Revision: 3291
http://htmlunit.svn.sourceforge.net/htmlunit/?rev=3291&view=rev
Author: asashour
Date: 2008-09-01 14:50:42 +0000 (Mon, 01 Sep 2008)
Log Message:
-----------
DWR resources, remove .java from WEB-INF/classes
Removed Paths:
-------------
trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/address/AddressLookup.java
trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/asmg/Generator.java
trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/chat/JavaChat.java
trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/chat/JavascriptChat.java
trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/chat/Message.java
trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/cli/JettyLauncher.java
trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/clock/Clock.java
trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/filter/AuthenticationAjaxFilter.java
trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/filter/LoggingAjaxFilter.java
trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/filter/RandomSecurityAjaxFilter.java
trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/gidemo/Corporation.java
trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/gidemo/Corporations.java
trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/gidemo/Publisher.java
trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/gidemo/PublisherServletContextListener.java
trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/intro/Intro.java
trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/livehelp/LiveHelp.java
trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/people/People.java
trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/people/Person.java
trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/simpletext/Demo.java
Deleted: trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/address/AddressLookup.java
===================================================================
--- trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/address/AddressLookup.java 2008-09-01 14:35:37 UTC (rev 3290)
+++ trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/address/AddressLookup.java 2008-09-01 14:50:42 UTC (rev 3291)
@@ -1,89 +0,0 @@
-/*
- * Copyright 2005 Joe Walker
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.getahead.dwrdemo.address;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.directwebremoting.util.LocalUtil;
-
-/**
- * @author Joe Walker [joe at getahead dot ltd dot uk]
- */
-public class AddressLookup
-{
-
- private static final String LINE4 = "line4";
-
- private static final String LINE3 = "line3";
-
- private static final String LINE2 = "line2";
-
- /**
- * @param origpostcode the code to lookup
- * @return a map of postcode data
- */
- public Map fillAddress(String origpostcode)
- {
- Map reply = new HashMap();
- String postcode = LocalUtil.replace(origpostcode, " ", "");
-
- if (postcode.equalsIgnoreCase("LE167TR"))
- {
- reply.put(LINE2, "Church Lane");
- reply.put(LINE3, "Thorpe Langton");
- reply.put(LINE4, "MARKET HARBOROUGH");
- }
- else if (postcode.equalsIgnoreCase("NR147SL"))
- {
- reply.put(LINE2, "Rectory Lane");
- reply.put(LINE3, "Poringland");
- reply.put(LINE4, "NORWICH");
- }
- else if (postcode.equalsIgnoreCase("B927TT"))
- {
- reply.put(LINE2, "Olton Mere");
- reply.put(LINE3, "Warwick Road");
- reply.put(LINE4, "SOLIHULL");
- }
- else if (postcode.equalsIgnoreCase("E178YT"))
- {
- reply.put(LINE2, "");
- reply.put(LINE3, "PO Box 43108 ");
- reply.put(LINE4, "LONDON");
- }
- else if (postcode.equalsIgnoreCase("SN48QS"))
- {
- reply.put(LINE2, "Binknoll");
- reply.put(LINE3, "Wootton Bassett");
- reply.put(LINE4, "SWINDON");
- }
- else if (postcode.equalsIgnoreCase("NN57HT"))
- {
- reply.put(LINE2, "Heathville");
- reply.put(LINE3, "");
- reply.put(LINE4, "NORTHAMPTON");
- }
- else
- {
- reply.put(LINE2, "Postcode not found");
- reply.put(LINE3, "");
- reply.put(LINE4, "");
- }
-
- return reply;
- }
-}
Deleted: trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/asmg/Generator.java
===================================================================
--- trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/asmg/Generator.java 2008-09-01 14:35:37 UTC (rev 3290)
+++ trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/asmg/Generator.java 2008-09-01 14:50:42 UTC (rev 3291)
@@ -1,82 +0,0 @@
-/*
- * Copyright 2005 Joe Walker
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.getahead.dwrdemo.asmg;
-
-import java.util.StringTokenizer;
-
-import org.directwebremoting.Security;
-
-/**
- * Generate an anti-spam mailto link from an email address.
- * The output link looks something like this (where $1 is the username part of
- * the address and $2 is the hostname part:
- * <pre>
- * Contact us using:
- * <script type="text/javascript">
- * var a = $1 + "@" + $2;
- * document.write("<a href='mail" + "to:" + a + "'>" + a + "</a>");
- * </script>
- * <noscript>[$1 at $2]</noscript>
- * </pre>
- * @author Joe Walker [joe at getahead dot ltd dot uk]
- */
-public class Generator
-{
- /**
- * Generate an anti-spam mailto link from an email address
- * @param name The person to contact
- * @param email The address to generate a link from
- * @return The HTML snippet
- */
- public String generateAntiSpamMailto(String name, String email)
- {
- StringTokenizer st = new StringTokenizer(email, "@");
- if (Security.containsXssRiskyCharacters(email) || st.countTokens() != 2)
- {
- throw new IllegalArgumentException("Invalid email address: " + email);
- }
-
- String before = st.nextToken();
- String after = st.nextToken();
-
- StringBuffer buffer = new StringBuffer();
-
- buffer.append("Contact ");
- buffer.append(Security.replaceXmlCharacters(name));
- buffer.append(" using: <span id=\"asmgLink\"></span>\n");
- buffer.append("<script type='text/javascript'>\n");
-
- buffer.append("var before = '");
- buffer.append(before);
- buffer.append("';\n");
-
- buffer.append("var after = '");
- buffer.append(after);
- buffer.append("';\n");
-
- buffer.append("var link = \"<a href='mail\" + \"to:\" + before + '@' + after + \"'>\" + before + '@' + after + \"</a>\";\n");
-
- buffer.append("document.getElementById(\"asmgLink\").innerHTML = link;\n");
- buffer.append("</script>\n");
- buffer.append("<noscript>[");
- buffer.append(before);
- buffer.append(" at ");
- buffer.append(after);
- buffer.append("]</noscript>\n");
-
- return buffer.toString();
- }
-}
Deleted: trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/chat/JavaChat.java
===================================================================
--- trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/chat/JavaChat.java 2008-09-01 14:35:37 UTC (rev 3290)
+++ trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/chat/JavaChat.java 2008-09-01 14:50:42 UTC (rev 3291)
@@ -1,56 +0,0 @@
-package org.getahead.dwrdemo.chat;
-
-import java.util.Collection;
-import java.util.LinkedList;
-
-import org.directwebremoting.WebContext;
-import org.directwebremoting.WebContextFactory;
-import org.directwebremoting.proxy.dwr.Util;
-import org.directwebremoting.util.Logger;
-
-/**
- * @author Joe Walker [joe at getahead dot ltd dot uk]
- */
-public class JavaChat
-{
- /**
- * @param text The new message text to add
- */
- public void addMessage(String text)
- {
- // Make sure we have a list of the list 10 messages
- if (text != null && text.trim().length() > 0)
- {
- messages.addFirst(new Message(text));
- while (messages.size() > 10)
- {
- messages.removeLast();
- }
- }
-
- WebContext wctx = WebContextFactory.get();
- String currentPage = wctx.getCurrentPage();
-
- // Clear the input box in the browser that kicked off this page only
- Util utilThis = new Util(wctx.getScriptSession());
- utilThis.setValue("text", "");
-
- // For all the browsers on the current page:
- Collection sessions = wctx.getScriptSessionsByPage(currentPage);
- Util utilAll = new Util(sessions);
-
- // Clear the list and add in the new set of messages
- utilAll.removeAllOptions("chatlog");
- utilAll.addOptions("chatlog", messages, "text");
- }
-
- /**
- * The current set of messages
- */
- private LinkedList messages = new LinkedList();
-
- /**
- * The log stream
- */
- protected static final Logger log = Logger.getLogger(JavaChat.class);
-}
Deleted: trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/chat/JavascriptChat.java
===================================================================
--- trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/chat/JavascriptChat.java 2008-09-01 14:35:37 UTC (rev 3290)
+++ trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/chat/JavascriptChat.java 2008-09-01 14:50:42 UTC (rev 3291)
@@ -1,58 +0,0 @@
-package org.getahead.dwrdemo.chat;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.LinkedList;
-
-import org.directwebremoting.ScriptBuffer;
-import org.directwebremoting.ScriptSession;
-import org.directwebremoting.WebContext;
-import org.directwebremoting.WebContextFactory;
-import org.directwebremoting.util.Logger;
-
-/**
- * @author Joe Walker [joe at getahead dot ltd dot uk]
- */
-public class JavascriptChat
-{
- /**
- * @param text The new message text to add
- */
- public void addMessage(String text)
- {
- if (text != null && text.trim().length() > 0)
- {
- messages.addFirst(new Message(text));
- while (messages.size() > 10)
- {
- messages.removeLast();
- }
- }
-
- WebContext wctx = WebContextFactory.get();
- String currentPage = wctx.getCurrentPage();
-
- ScriptBuffer script = new ScriptBuffer();
- script.appendScript("receiveMessages(")
- .appendData(messages)
- .appendScript(");");
-
- // Loop over all the users on the current page
- Collection pages = wctx.getScriptSessionsByPage(currentPage);
- for (Iterator it = pages.iterator(); it.hasNext();)
- {
- ScriptSession otherSession = (ScriptSession) it.next();
- otherSession.addScript(script);
- }
- }
-
- /**
- * The current set of messages
- */
- private LinkedList messages = new LinkedList();
-
- /**
- * The log stream
- */
- protected static final Logger log = Logger.getLogger(JavascriptChat.class);
-}
Deleted: trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/chat/Message.java
===================================================================
--- trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/chat/Message.java 2008-09-01 14:35:37 UTC (rev 3290)
+++ trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/chat/Message.java 2008-09-01 14:50:42 UTC (rev 3291)
@@ -1,47 +0,0 @@
-package org.getahead.dwrdemo.chat;
-
-/**
- * A POJO that represents a typed message
- * @author Joe Walker [joe at getahead dot ltd dot uk]
- */
-public class Message
-{
- /**
- * @param newtext the new message text
- */
- public Message(String newtext)
- {
- text = newtext;
-
- if (text.length() > 256)
- {
- text = text.substring(0, 256);
- }
- }
-
- /**
- * @return the message id
- */
- public long getId()
- {
- return id;
- }
-
- /**
- * @return the message itself
- */
- public String getText()
- {
- return text;
- }
-
- /**
- * When the message was created
- */
- private long id = System.currentTimeMillis();
-
- /**
- * The text of the message
- */
- private String text;
-}
Deleted: trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/cli/JettyLauncher.java
===================================================================
--- trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/cli/JettyLauncher.java 2008-09-01 14:35:37 UTC (rev 3290)
+++ trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/cli/JettyLauncher.java 2008-09-01 14:50:42 UTC (rev 3291)
@@ -1,31 +0,0 @@
-package org.getahead.dwrdemo.cli;
-
-import org.mortbay.jetty.Server;
-import org.mortbay.jetty.nio.SelectChannelConnector;
-import org.mortbay.jetty.webapp.WebAppContext;
-
-/**
- * Launch Jetty embedded.
- */
-public class JettyLauncher
-{
- /**
- * Sets up and runs server.
- * @param args The command line arguments
- * @throws Exception Don't care because top level
- */
- public static void main(String[] args) throws Exception
- {
- Server server = new Server();
-
- SelectChannelConnector connector = new SelectChannelConnector();
- connector.setPort(8080);
- server.addConnector(connector);
- server.setStopAtShutdown(true);
-
- server.addHandler(new WebAppContext("web","/dwr"));
-
- server.start();
- server.join();
- }
-}
Deleted: trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/clock/Clock.java
===================================================================
--- trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/clock/Clock.java 2008-09-01 14:35:37 UTC (rev 3290)
+++ trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/clock/Clock.java 2008-09-01 14:50:42 UTC (rev 3291)
@@ -1,101 +0,0 @@
-/*
- * Copyright 2005 Joe Walker
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.getahead.dwrdemo.clock;
-
-import java.util.Collection;
-import java.util.Date;
-
-import javax.servlet.ServletContext;
-
-import org.directwebremoting.ServerContext;
-import org.directwebremoting.ServerContextFactory;
-import org.directwebremoting.WebContextFactory;
-import org.directwebremoting.proxy.dwr.Util;
-import org.directwebremoting.util.Logger;
-
-/**
- * @author Joe Walker [joe at getahead dot ltd dot uk]
- */
-public class Clock implements Runnable
-{
- /**
- *
- */
- public Clock()
- {
- ServletContext servletContext = WebContextFactory.get().getServletContext();
- sctx = ServerContextFactory.get(servletContext);
- }
-
- /**
- *
- */
- public synchronized void toggle()
- {
- active = !active;
-
- if (active)
- {
- new Thread(this).start();
- }
- }
-
- /* (non-Javadoc)
- * @see java.lang.Runnable#run()
- */
- public void run()
- {
- try
- {
- log.debug("CLOCK: Starting server-side thread");
-
- while (active)
- {
- Collection sessions = sctx.getScriptSessionsByPage("/dwr/clock/index.html");
- Util pages = new Util(sessions);
- pages.setValue("clockDisplay", new Date().toString());
-
- log.debug("Sent message");
- Thread.sleep(1000);
- }
-
- Collection sessions = sctx.getScriptSessionsByPage("/dwr/clock/index.html");
- Util pages = new Util(sessions);
- pages.setValue("clockDisplay", "");
-
- log.debug("CLOCK: Stopping server-side thread");
- }
- catch (InterruptedException ex)
- {
- ex.printStackTrace();
- }
- }
-
- /**
- * Our key to get hold of ServerContexts
- */
- private ServerContext sctx;
-
- /**
- * Are we updating the clocks on all the pages?
- */
- private transient boolean active = false;
-
- /**
- * The log stream
- */
- private static final Logger log = Logger.getLogger(Clock.class);
-}
Deleted: trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/filter/AuthenticationAjaxFilter.java
===================================================================
--- trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/filter/AuthenticationAjaxFilter.java 2008-09-01 14:35:37 UTC (rev 3290)
+++ trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/filter/AuthenticationAjaxFilter.java 2008-09-01 14:50:42 UTC (rev 3291)
@@ -1,82 +0,0 @@
-package org.getahead.dwrdemo.filter;
-
-import java.lang.reflect.Method;
-
-import javax.servlet.http.HttpSession;
-
-import org.directwebremoting.AjaxFilter;
-import org.directwebremoting.AjaxFilterChain;
-import org.directwebremoting.WebContextFactory;
-
-/**
- * Manages the current Authentication state.
- * @author Joe Walker [joe at getahead dot ltd dot uk]
- */
-public class AuthenticationAjaxFilter implements AjaxFilter
-{
- /* (non-Javadoc)
- * @see org.directwebremoting.AjaxFilter#doFilter(java.lang.Object, java.lang.reflect.Method, java.lang.Object[], org.directwebremoting.AjaxFilterChain)
- */
- public Object doFilter(Object object, Method method, Object[] params, AjaxFilterChain chain) throws Exception
- {
- // We allow anyone to authenticate
- if (authenticateName.equals(method.getName()))
- {
- return chain.doFilter(object, method, params);
- }
-
- Object user = getUser();
- if (user != null)
- {
- return chain.doFilter(object, method, params);
- }
-
- throw new SecurityException("Not authenticated");
- }
-
- /**
- * @return Returns the authenticateName.
- */
- public String getAuthenticateName()
- {
- return authenticateName;
- }
-
- /**
- * @param authenticateName The authenticateName to set.
- */
- public void setAuthenticateName(String authenticateName)
- {
- this.authenticateName = authenticateName;
- }
-
- /**
- * What is the name of the authenticate method?
- */
- private String authenticateName = "authenticate";
-
- /**
- * Accessor for the current user
- * @param user The current user
- */
- public static void setUser(Object user)
- {
- HttpSession session = WebContextFactory.get().getSession(true);
- session.setAttribute(USER, user);
- }
-
- /**
- * Accessor for the current user
- * @return The current user
- */
- public static Object getUser()
- {
- HttpSession session = WebContextFactory.get().getSession(true);
- return session.getAttribute(USER);
- }
-
- /**
- * The session key
- */
- private static final String USER = "org.directwebremoting.filter.AuthenticationAjaxFilter.USER";
-}
Deleted: trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/filter/LoggingAjaxFilter.java
===================================================================
--- trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/filter/LoggingAjaxFilter.java 2008-09-01 14:35:37 UTC (rev 3290)
+++ trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/filter/LoggingAjaxFilter.java 2008-09-01 14:50:42 UTC (rev 3291)
@@ -1,46 +0,0 @@
-/*
- * Copyright 2005 Joe Walker
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.getahead.dwrdemo.filter;
-
-import java.lang.reflect.Method;
-
-import org.directwebremoting.AjaxFilter;
-import org.directwebremoting.AjaxFilterChain;
-import org.directwebremoting.util.Logger;
-
-
-/**
- * An example filter that does some logging of Ajax calls
- * @author Joe Walker [joe at getahead dot ltd dot uk]
- */
-public class LoggingAjaxFilter implements AjaxFilter
-{
- /* (non-Javadoc)
- * @see uk.ltd.getahead.dwr.AjaxFilter#doFilter(java.lang.Object, java.lang.reflect.Method, java.lang.Object[], uk.ltd.getahead.dwr.AjaxFilterChain)
- */
- public Object doFilter(Object obj, Method method, Object[] params, AjaxFilterChain chain) throws Exception
- {
- log.debug("About to execute: " + method.getName() + "() on " + obj);
- Object reply = chain.doFilter(obj, method, params);
- log.debug("Executed: " + method.getName() + "() giving " + reply);
- return reply;
- }
-
- /**
- * The log stream
- */
- private static final Logger log = Logger.getLogger(LoggingAjaxFilter.class);
-}
Deleted: trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/filter/RandomSecurityAjaxFilter.java
===================================================================
--- trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/filter/RandomSecurityAjaxFilter.java 2008-09-01 14:35:37 UTC (rev 3290)
+++ trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/filter/RandomSecurityAjaxFilter.java 2008-09-01 14:50:42 UTC (rev 3291)
@@ -1,46 +0,0 @@
-/*
- * Copyright 2005 Joe Walker
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.getahead.dwrdemo.filter;
-
-import java.lang.reflect.Method;
-
-import org.directwebremoting.AjaxFilter;
-import org.directwebremoting.AjaxFilterChain;
-
-
-/**
- * An example filter that uses a fairly random event to define it's security
- * policy: If the current system time (in milliseconds) is even then the call
- * is allowed, otherwise it is denied.
- * @author Joe Walker [joe at getahead dot ltd dot uk]
- */
-public class RandomSecurityAjaxFilter implements AjaxFilter
-{
- /* (non-Javadoc)
- * @see uk.ltd.getahead.dwr.AjaxFilter#doFilter(java.lang.Object, java.lang.reflect.Method, java.lang.Object[], uk.ltd.getahead.dwr.AjaxFilterChain)
- */
- public Object doFilter(Object obj, Method method, Object[] params, AjaxFilterChain chain) throws Exception
- {
- if (System.currentTimeMillis() % 2 == 1)
- {
- return chain.doFilter(obj, method, params);
- }
- else
- {
- throw new SecurityException("Wrong time. Try again later");
- }
- }
-}
Deleted: trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/gidemo/Corporation.java
===================================================================
--- trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/gidemo/Corporation.java 2008-09-01 14:35:37 UTC (rev 3290)
+++ trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/gidemo/Corporation.java 2008-09-01 14:50:42 UTC (rev 3291)
@@ -1,154 +0,0 @@
-/*
- * Copyright 2005 Joe Walker
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.getahead.dwrdemo.gidemo;
-
-import java.math.BigDecimal;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.Random;
-
-/**
- * An object representing the stock price of a corporation.
- * @author Joe Walker [joe at getahead dot ltd dot uk]
- */
-public class Corporation
-{
- /**
- * @param jsxid
- * @param name
- * @param last
- * @param change
- */
- public Corporation(String jsxid, String name)
- {
- this.jsxid = jsxid;
- this.name = name;
-
- float temp = random.nextFloat() * 100.0F;
- last = new BigDecimal(Math.round(temp * 100.0F) / 100.0F);
- last = last.setScale(2, BigDecimal.ROUND_UP);
- time = new Date();
- change = new BigDecimal(0.0F);
- change = change.setScale(2, BigDecimal.ROUND_UP);
- max = last;
- min = last;
- }
-
- private String jsxid;
-
- private String name;
-
- private BigDecimal last;
-
- private Date time;
-
- private BigDecimal change;
-
- private BigDecimal max;
-
- private BigDecimal min;
-
- private Random random = new Random();
-
- /**
- * @return the jsxid
- */
- public String getJsxid()
- {
- return jsxid;
- }
-
- /**
- * @return the name
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * @return the last
- */
- public BigDecimal getLast()
- {
- return last;
- }
-
- /**
- * @return the time
- */
- public String getTime()
- {
- return FORMAT.format(time);
- }
-
- /**
- * @return the change
- */
- public BigDecimal getChange()
- {
- return change;
- }
-
- /**
- * @return the max
- */
- public BigDecimal getMax()
- {
- return max;
- }
-
- /**
- * @return the min
- */
- public BigDecimal getMin()
- {
- return min;
- }
-
- /**
- * Alter the stock price
- */
- public void change()
- {
- float newChange = (random.nextFloat() * 4) - 2;
- newChange = Math.round(newChange * 100.0F) / 100.0F;
-
- if (last.floatValue() + newChange < 9)
- {
- newChange = -newChange;
- }
-
- change = new BigDecimal(newChange);
- change = change.setScale(2, BigDecimal.ROUND_UP);
-
- last = last.add(change);
-
- if (last.compareTo(max) > 0)
- {
- max = last;
- }
-
- if (last.compareTo(min) < 0)
- {
- min = last;
- }
-
- time = new Date();
- }
-
- private static final SimpleDateFormat FORMAT = new SimpleDateFormat("hh:MM:ss");
-}
Deleted: trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/gidemo/Corporations.java
===================================================================
--- trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/gidemo/Corporations.java 2008-09-01 14:35:37 UTC (rev 3290)
+++ trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/gidemo/Corporations.java 2008-09-01 14:50:42 UTC (rev 3291)
@@ -1,64 +0,0 @@
-/*
- * Copyright 2005 Joe Walker
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.getahead.dwrdemo.gidemo;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Random;
-
-/**
- * A manager for a set of corporations
- * @author Joe Walker [joe at getahead dot ltd dot uk]
- */
-public class Corporations
-{
- /**
- * Create a set of random corporations
- */
- public Corporations()
- {
- corporations.add(new Corporation("AAPL", "Apple"));
- corporations.add(new Corporation("AMZN", "Amazon"));
- corporations.add(new Corporation("EBAY", "EBay"));
- corporations.add(new Corporation("GOOG", "Google"));
- corporations.add(new Corporation("IBM", "IBM"));
- corporations.add(new Corporation("MSFT", "Microsoft"));
- corporations.add(new Corporation("TIBX", "TIBCO"));
- corporations.add(new Corporation("YHOO", "Yahoo"));
- }
-
- /**
- * @return A randomly changed corporation
- */
- public Corporation getNextChangedCorporation()
- {
- // Who's is gonna be
- Corporation corporation = (Corporation) corporations.get(random.nextInt(corporations.size()));
- corporation.change();
-
- return corporation;
- }
-
- /**
- * Used to generate random data
- */
- private Random random = new Random();
-
- /**
- * The corporations that we manage
- */
- private List corporations = new ArrayList();
-}
Deleted: trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/gidemo/Publisher.java
===================================================================
--- trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/gidemo/Publisher.java 2008-09-01 14:35:37 UTC (rev 3290)
+++ trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/gidemo/Publisher.java 2008-09-01 14:50:42 UTC (rev 3291)
@@ -1,103 +0,0 @@
-package org.getahead.dwrdemo.gidemo;
-
-import java.util.Collection;
-import java.util.Random;
-
-import javax.servlet.ServletContext;
-
-import org.directwebremoting.ServerContext;
-import org.directwebremoting.ServerContextFactory;
-import org.directwebremoting.WebContext;
-import org.directwebremoting.WebContextFactory;
-import org.directwebremoting.proxy.ScriptProxy;
-import org.directwebremoting.util.Logger;
-
-/**
- * A generator of random objects to push to GI
- * @author Joe Walker [joe at getahead dot ltd dot uk]
- */
-public class Publisher implements Runnable
-{
- /**
- * Create a new publish thread and start it
- */
- public Publisher()
- {
- WebContext webContext = WebContextFactory.get();
- ServletContext servletContext = webContext.getServletContext();
-
- serverContext = ServerContextFactory.get(servletContext);
-
- // A bit nasty: the call to serverContext.getScriptSessionsByPage()
- // below could fail because the system might need to read web.xml which
- // means it needs a ServletContext, which is only available using
- // WebContext, which in turn requires a DWR thread. We can cache the
- // results simply by calling this in a DWR thread, as we are now.
- webContext.getScriptSessionsByPage("");
-
- synchronized (Publisher.class)
- {
- if (worker == null)
- {
- worker = new Thread(this, "Publisher");
- worker.start();
- }
- }
- }
-
- /* (non-Javadoc)
- * @see java.lang.Runnable#run()
- */
- public void run()
- {
- try
- {
- log.info("Starting Publisher thread");
-
- while (!Thread.currentThread().isInterrupted())
- {
- Collection sessions = serverContext.getScriptSessionsByPage("/dwr/gi/index.html");
- ScriptProxy proxy = new ScriptProxy(sessions);
-
- Corporation corp = corporations.getNextChangedCorporation();
- proxy.addFunctionCall("OpenAjax.publish", "gidemo", "corporation", corp);
-
- int timeToSleep = random.nextInt(2500);
- Thread.sleep(timeToSleep);
- }
- }
- catch (InterruptedException ex)
- {
- // Ignore, we expect this
- }
- finally
- {
- log.info("Stopping Publisher thread");
- }
- }
-
- /**
- * The thread that does the work
- */
- protected static Thread worker;
-
- /**
- * The set of corporations that we manage
- */
- private Corporations corporations = new Corporations();
-
- /**
- * We use DWRs ServerContext to find users of a given page
- */
- private ServerContext serverContext;
-
- /**
- * Used to generate random data
- */
- private Random random = new Random();
-
- /**
- * The log stream
- */
- private static final Logger log = Logger.getLogger(Publisher.class);
-}
Deleted: trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/gidemo/PublisherServletContextListener.java
===================================================================
--- trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/gidemo/PublisherServletContextListener.java 2008-09-01 14:35:37 UTC (rev 3290)
+++ trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/gidemo/PublisherServletContextListener.java 2008-09-01 14:50:42 UTC (rev 3291)
@@ -1,47 +0,0 @@
-/*
- * Copyright 2005 Joe Walker
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.getahead.dwrdemo.gidemo;
-
-import javax.servlet.ServletContextEvent;
-import javax.servlet.ServletContextListener;
-
-/**
- * Allow a Publisher to gracefully shutdown
- * @author Joe Walker [joe at getahead dot ltd dot uk]
- */
-public class PublisherServletContextListener implements ServletContextListener
-{
- /* (non-Javadoc)
- * @see javax.servlet.ServletContextListener#contextInitialized(javax.servlet.ServletContextEvent)
- */
- public void contextInitialized(ServletContextEvent sce)
- {
- }
-
- /* (non-Javadoc)
- * @see javax.servlet.ServletContextListener#contextDestroyed(javax.servlet.ServletContextEvent)
- */
- public void contextDestroyed(ServletContextEvent sce)
- {
- synchronized (Publisher.class)
- {
- if (Publisher.worker != null)
- {
- Publisher.worker.interrupt();
- }
- }
- }
-}
Deleted: trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/intro/Intro.java
===================================================================
--- trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/intro/Intro.java 2008-09-01 14:35:37 UTC (rev 3290)
+++ trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/intro/Intro.java 2008-09-01 14:50:42 UTC (rev 3291)
@@ -1,41 +0,0 @@
-/*
- * Copyright 2005 Joe Walker
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.getahead.dwrdemo.intro;
-
-import java.io.IOException;
-
-import javax.servlet.ServletException;
-
-import org.directwebremoting.WebContext;
-import org.directwebremoting.WebContextFactory;
-
-/**
- * Used by the default webapp landing page to check basic functionallity
- * @author Joe Walker [joe at getahead dot ltd dot uk]
- */
-public class Intro
-{
- /**
- * A simple test that the DWr is working. Used by the front page.
- * @return The text of the insert.html page
- * @throws IOException From {@link WebContext#forwardToString(String)}
- * @throws ServletException From {@link WebContext#forwardToString(String)}
- */
- public String getInsert() throws ServletException, IOException
- {
- return WebContextFactory.get().forwardToString("/insert.html");
- }
-}
Deleted: trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/livehelp/LiveHelp.java
===================================================================
--- trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/livehelp/LiveHelp.java 2008-09-01 14:35:37 UTC (rev 3290)
+++ trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/livehelp/LiveHelp.java 2008-09-01 14:50:42 UTC (rev 3291)
@@ -1,96 +0,0 @@
-/*
- * Copyright 2005 Joe Walker
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.getahead.dwrdemo.livehelp;
-
-import java.util.Collection;
-
-import org.directwebremoting.Security;
-import org.directwebremoting.WebContext;
-import org.directwebremoting.WebContextFactory;
-import org.directwebremoting.proxy.dwr.Util;
-import org.directwebremoting.util.Logger;
-
-/**
- * A simple shared input form that several users can share
- * @author Joe Walker [joe at getahead dot ltd dot uk]
- */
-public class LiveHelp
-{
- /**
- * Something has changed
- * @param id The id of the field that changed
- * @param value The new value
- */
- public void notifyTyping(String id, String value)
- {
- Util utilAll = new Util(getUsersToAffect());
-
- utilAll.setValue(id, Security.replaceXmlCharacters(value));
- }
-
- /**
- * The user has tabbed in
- * @param id The id of the field that changed
- */
- public void notifyFocus(String id)
- {
- Util utilAll = new Util(getUsersToAffect());
-
- utilAll.addClassName(id, "disabled");
- String addr = WebContextFactory.get().getHttpServletRequest().getRemoteAddr();
- utilAll.setValue(id + "Tip", addr);
-
- //utilAll.addScript("$('" + id + "').disabled = true;");
- }
-
- /**
- * The user has tabbed out
- * @param id The id of the field that changed
- */
- public void notifyBlur(String id)
- {
- Util utilAll = new Util(getUsersToAffect());
-
- utilAll.removeClassName(id, "disabled");
- utilAll.setValue(id + "Tip", "");
-
- //utilAll.addScript("$('" + id + "').disabled = false;");
- }
-
- /**
- * @return The collection of people to affect
- */
- private Collection getUsersToAffect()
- {
- WebContext wctx = WebContextFactory.get();
- String currentPage = wctx.getCurrentPage();
-
- // For all the browsers on the current page:
- Collection sessions = wctx.getScriptSessionsByPage(currentPage);
-
- // But not the current user!
- sessions.remove(wctx.getScriptSession());
-
- log.debug("Affecting " + sessions.size() + " users");
-
- return sessions;
- }
-
- /**
- * The log stream
- */
- private static final Logger log = Logger.getLogger(LiveHelp.class);
-}
Deleted: trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/people/People.java
===================================================================
--- trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/people/People.java 2008-09-01 14:35:37 UTC (rev 3290)
+++ trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/people/People.java 2008-09-01 14:50:42 UTC (rev 3291)
@@ -1,170 +0,0 @@
-/*
- * Copyright 2005 Joe Walker
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.getahead.dwrdemo.people;
-
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Random;
-import java.util.Set;
-
-import org.directwebremoting.util.Logger;
-
-/**
- * A container for a set of people
- * @author Joe Walker [joe at getahead dot ltd dot uk]
- */
-public class People
-{
- /**
- * Pre-populate with random people
- */
- public People()
- {
- log.debug("Generating a new set of random people");
- for (int i = 0; i < 5; i++)
- {
- people.add(getRandomPerson());
- }
- }
-
- /**
- * Accessor for the current list of people
- * @return the current list of people
- */
- public Set getAllPeople()
- {
- return people;
- }
-
- /**
- * Insert a person into the set of people
- * @param person The person to add or update
- */
- public void setPerson(Person person)
- {
- log.debug("Adding person: " + person);
- if (person.getId() == -1)
- {
- person.setId(getNextId());
- }
-
- people.remove(person);
- people.add(person);
- }
-
- /**
- * Delete a person from the set of people
- * @param person The person to delete
- */
- public void deletePerson(Person person)
- {
- log.debug("Removing person: " + person);
- people.remove(person);
- debug();
- }
-
- /**
- * the current list of people
- */
- private Set people = new HashSet();
-
- /**
- * Create a random person
- * @return a random person
- */
- private Person getRandomPerson()
- {
- Person person = new Person();
- person.setId(getNextId());
-
- String firstname = FIRSTNAMES[random.nextInt(FIRSTNAMES.length)];
- String surname = SURNAMES[random.nextInt(SURNAMES.length)];
- person.setName(firstname + " " + surname);
-
- String housenum = (random.nextInt(99) + 1) + " ";
- String road1 = ROADS1[random.nextInt(ROADS1.length)];
- String road2 = ROADS2[random.nextInt(ROADS2.length)];
- String town = TOWNS[random.nextInt(TOWNS.length)];
- String address = housenum + road1 + " " + road2 + ", " + town;
- person.setAddress(address);
-
- float salary = Math.round(10 + 90 * random.nextFloat()) * 1000;
- person.setSalary(salary);
-
- return person;
- }
-
- /**
- * List the current people so we know what is going on
- */
- protected void debug()
- {
- for (Iterator it = people.iterator(); it.hasNext();)
- {
- Person person = (Person) it.next();
- log.debug(person.toString());
- }
- }
-
- /**
- * Get the next unique ID in a thread safe way
- * @return a unique id
- */
- private static synchronized int getNextId()
- {
- return nextId++;
- }
-
- /**
- * The next ID, to get around serialization issues
- */
- private static int nextId = 1;
-
- private Random random = new Random();
-
- private static final String[] FIRSTNAMES =
- {
- "Fred", "Jim", "Shiela", "Jack", "Betty", "Jacob", "Martha", "Kelly",
- "Luke", "Matt", "Gemma", "Joe", "Ben", "Jessie", "Leanne", "Becky",
- };
-
- private static final String[] SURNAMES =
- {
- "Sutcliffe", "MacDonald", "Duckworth", "Smith", "Wisner", "Iversen",
- "Nield", "Turton", "Trelfer", "Wilson", "Johnson", "Cowan", "Daniels",
- };
-
- private static final String[] ROADS1 =
- {
- "Green", "Red", "Yellow", "Brown", "Blue", "Black", "White",
- };
-
- private static final String[] ROADS2 =
- {
- "Close", "Drive", "Street", "Avenue", "Crescent", "Road", "Place",
- };
-
- private static final String[] TOWNS =
- {
- "Birmingham", "Kettering", "Paris", "San Francisco", "New York",
- "San Mateo", "Barcelona",
- };
-
- /**
- * The log stream
- */
- private static final Logger log = Logger.getLogger(People.class);
-}
Deleted: trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/people/Person.java
===================================================================
--- trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/people/Person.java 2008-09-01 14:35:37 UTC (rev 3290)
+++ trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/people/Person.java 2008-09-01 14:50:42 UTC (rev 3291)
@@ -1,139 +0,0 @@
-/*
- * Copyright 2005 Joe Walker
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.getahead.dwrdemo.people;
-
-import org.directwebremoting.Security;
-
-/**
- * @author Joe Walker [joe at getahead dot ltd dot uk]
- */
-public class Person
-{
- /**
- * @return the address
- */
- public String getAddress()
- {
- return address;
- }
-
- /**
- * @param address the address to set
- */
- public void setAddress(String address)
- {
- this.address = Security.escapeHtml(address);
- }
-
- /**
- * @return the id
- */
- public int getId()
- {
- return id;
- }
-
- /**
- * @param id the id to set
- */
- public void setId(int id)
- {
- this.id = id;
- }
-
- /**
- * @return the name
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * @param name the name to set
- */
- public void setName(String name)
- {
- this.name = Security.escapeHtml(name);
- }
-
- /**
- * @return the salary
- */
- public float getSalary()
- {
- return salary;
- }
-
- /**
- * @param salary the salary to set
- */
- public void setSalary(float salary)
- {
- this.salary = salary;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#equals(java.lang.Object)
- */
- public boolean equals(Object obj)
- {
- if (obj == null)
- {
- return false;
- }
-
- if (obj == this)
- {
- return true;
- }
-
- if (!this.getClass().equals(obj.getClass()))
- {
- return false;
- }
-
- Person that = (Person) obj;
-
- if (this.id != that.id)
- {
- return false;
- }
-
- return true;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#hashCode()
- */
- public int hashCode()
- {
- return 5924 + id;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- public String toString()
- {
- return "Person[id=" + id + ",name=" + name + "]";
- }
-
- private String name;
- private String address;
- private float salary;
- private int id;
-}
Deleted: trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/simpletext/Demo.java
===================================================================
--- trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/simpletext/Demo.java 2008-09-01 14:35:37 UTC (rev 3290)
+++ trunk/htmlunit/src/test/resources/DWR/2.0.5/WEB-INF/classes/org/getahead/dwrdemo/simpletext/Demo.java 2008-09-01 14:50:42 UTC (rev 3291)
@@ -1,52 +0,0 @@
-/*
- * Copyright 2005 Joe Walker
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.getahead.dwrdemo.simpletext;
-
-import java.io.IOException;
-
-import javax.servlet.ServletException;
-
-import org.directwebremoting.WebContext;
-import org.directwebremoting.WebContextFactory;
-
-/**
- * Some simple text demos
- * @author Joe Walker [joe at getahead dot ltd dot uk]
- */
-public class Demo
-{
- /**
- * Return a server side string to display on the client in real time
- * @param name The name of person to say hello to
- * @return A demo string
- */
- public String sayHello(String name)
- {
- return "Hello, " + name;
- }
-
- /**
- * Fetch a resource using forwardToString()
- * @return a demo HTML page
- * @throws ServletException If the servlet engine breaks
- * @throws IOException If the servlet engine breaks
- */
- public String getInclude() throws ServletException, IOException
- {
- WebContext wctx = WebContextFactory.get();
- return wctx.forwardToString("/simpletext/forward.html");
- }
-}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|