LGTM

On Thu, Apr 1, 2010 at 5:46 PM, <[email protected]> wrote:

> Reviewers: Ray Ryan,
>
> Description:
> Move the enum config to the proper place in web.xml
> Thanks Ben!
>
> Patch by: amitmanjhi
> Review by: rjrjr (TBR)
>
>
> Please review this at http://gwt-code-reviews.appspot.com/303801/show
>
> Affected files:
>  M
> bikeshed/src/com/google/gwt/sample/expenses/server/ExpensesDataServlet.java
>  D bikeshed/war/WEB-INF/classes/servlet.properties
>  M bikeshed/war/WEB-INF/web.xml
>
>
> Index:
> bikeshed/src/com/google/gwt/sample/expenses/server/ExpensesDataServlet.java
> ===================================================================
> ---
> bikeshed/src/com/google/gwt/sample/expenses/server/ExpensesDataServlet.java
> (revision 7849)
> +++
> bikeshed/src/com/google/gwt/sample/expenses/server/ExpensesDataServlet.java
> (working copy)
> @@ -30,7 +30,6 @@
>
>  import java.io.BufferedInputStream;
>  import java.io.IOException;
> -import java.io.InputStream;
>  import java.io.PrintWriter;
>  import java.lang.reflect.InvocationTargetException;
>  import java.lang.reflect.Method;
> @@ -40,7 +39,6 @@
>  import java.util.Iterator;
>  import java.util.List;
>  import java.util.Map;
> -import java.util.Properties;
>  import java.util.Set;
>
>  import javax.servlet.http.HttpServlet;
> @@ -52,7 +50,6 @@
>  */
>  public class ExpensesDataServlet extends HttpServlet {
>
> -  private static final String PROPERTY_FILENAME = "servlet.properties";
>   // TODO: Remove this hack
>   private static final Set<String> PROPERTY_SET = new HashSet<String>();
>   static {
> @@ -76,15 +73,10 @@
>
> sync(topLevelJsonObject.getString(RequestDataManager.CONTENT_TOKEN),
>             writer);
>       } else {
> -        InputStream is =
> this.getClass().getClassLoader().getResourceAsStream(PROPERTY_FILENAME);
> -        if (is == null) {
> -          throw new IllegalArgumentException("unable to find
> servlet.properties");
> -        }
> -        Properties properties = new Properties();
> -        properties.load(is);
>         operation = getOperationFromName(
>             operationName,
> -            (Class<RequestDefinition>)
> Class.forName(properties.getProperty("servlet.serveroperation")));
> +            (Class<RequestDefinition>)
> Class.forName(getServletContext().getInitParameter(
> +                "servlet.serverOperation")));
>         Class<?> domainClass =
> Class.forName(operation.getDomainClassName());
>         Method domainMethod = domainClass.getMethod(
>             operation.getDomainMethodName(),
> operation.getParameterTypes());
> Index: bikeshed/war/WEB-INF/classes/servlet.properties
> ===================================================================
> --- bikeshed/war/WEB-INF/classes/servlet.properties     (revision 7849)
> +++ bikeshed/war/WEB-INF/classes/servlet.properties     (working copy)
> @@ -1 +0,0 @@
>
> -servlet.serveroperation=com.google.gwt.sample.expenses.shared.ExpenseRequestFactory$ServerSideOperation
> Index: bikeshed/war/WEB-INF/web.xml
> ===================================================================
> --- bikeshed/war/WEB-INF/web.xml        (revision 7849)
> +++ bikeshed/war/WEB-INF/web.xml        (working copy)
> @@ -56,4 +56,9 @@
>     </auth-constraint>
>   </security-constraint>
>
> +  <context-param>
> +    <param-name>servlet.serverOperation</param-name>
> +
>  
> <param-value>com.google.gwt.sample.expenses.shared.ExpenseRequestFactory$ServerSideOperation</param-value>
> +  </context-param>
> +
>  </web-app>
>
>
>

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

To unsubscribe, reply using "remove me" as the subject.

Reply via email to