wink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b...@apache.org
Subject svn commit: r1005058 - /incubator/wink/trunk/wink-server/src/main/java/org/apache/wink/server/internal/servlet/AdminServlet.java
Date Wed, 06 Oct 2010 14:30:20 GMT
Author: bluk
Date: Wed Oct  6 14:30:20 2010
New Revision: 1005058

URL: http://svn.apache.org/viewvc?rev=1005058&view=rev
Log:
Fix AdminServlet to process query parameters correctly

See [WINK-316]

Thanks to Ruby Boyarski for reporting the issue
and the patch.

Modified:
    incubator/wink/trunk/wink-server/src/main/java/org/apache/wink/server/internal/servlet/AdminServlet.java

Modified: incubator/wink/trunk/wink-server/src/main/java/org/apache/wink/server/internal/servlet/AdminServlet.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-server/src/main/java/org/apache/wink/server/internal/servlet/AdminServlet.java?rev=1005058&r1=1005057&r2=1005058&view=diff
==============================================================================
--- incubator/wink/trunk/wink-server/src/main/java/org/apache/wink/server/internal/servlet/AdminServlet.java
(original)
+++ incubator/wink/trunk/wink-server/src/main/java/org/apache/wink/server/internal/servlet/AdminServlet.java
Wed Oct  6 14:30:20 2010
@@ -419,7 +419,7 @@ public class AdminServlet extends Abstra
             Marshaller marshaller = JAXBUtils.createMarshaller(resourceCtx);
             marshaller.marshal(jaxbObject, writer);
         } catch (JAXBException e) {
-            throw new ServletException(Messages.getMessage("adminServletFailMarshalObject",
//$NON-NLS-1$
+            throw new ServletException(Messages.getMessage("adminServletFailMarshalObject",
                                                            jaxbObject.getClass().getName()),
e);
 
         }
@@ -436,10 +436,6 @@ public class AdminServlet extends Abstra
      * @throws IOException
      */
     private void buildAdminHome(HttpServletResponse response) throws IOException {
-        // Set the response code before writing the content
-        // per the servlet specification.
-        response.setStatus(HttpStatus.BAD_REQUEST.getCode());
-        
         PrintWriter writer = response.getWriter();
         writer
             .write("<html>\r\n" + "<head>\r\n" //$NON-NLS-1$ //$NON-NLS-2$
@@ -466,6 +462,7 @@ public class AdminServlet extends Abstra
                 + "</form>\r\n" //$NON-NLS-1$
                 + "</body>\r\n" //$NON-NLS-1$
                 + "</html>"); //$NON-NLS-1$
+        response.setStatus(HttpStatus.BAD_REQUEST.getCode());
         writer.close();
         return;
     }
@@ -473,7 +470,7 @@ public class AdminServlet extends Abstra
     private void buildQueryParams(MethodMetadata methodMetadata, QueryParameters xmlQueryVariables)
{
         List<Injectable> formalParameters = methodMetadata.getFormalParameters();
         for (Injectable var : formalParameters) {
-            if (var.getParamType() == Injectable.ParamType.MATRIX) {
+            if (var.getParamType() == Injectable.ParamType.QUERY) {
                 Parameter param = resourcesObjectFactory.createParameter();
                 param.setValue(((BoundInjectable)var).getName());
                 xmlQueryVariables.getParameter().add(param);



Mime
View raw message