org.directwebremoting.dwrp
Class ParseUtil

java.lang.Object
  extended by org.directwebremoting.dwrp.ParseUtil

public class ParseUtil
extends java.lang.Object

Utilities to parse GET and POST requests from the DWR javascript section.

Author:
Joe Walker [joe at getahead dot ltd dot uk]

Constructor Summary
ParseUtil()
           
 
Method Summary
static java.util.Map parseGet(HttpServletRequest req)
          Parse an HTTP GET request to fill out the scriptName, methodName and paramList properties.
static java.util.Map parsePost(HttpServletRequest req)
          Parse an HTTP POST request to fill out the scriptName, methodName and paramList properties.
static java.lang.String[] splitInbound(java.lang.String data)
          The javascript outbound marshaller prefixes the toString value with a colon and the original type information.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParseUtil

public ParseUtil()
Method Detail

parsePost

public static java.util.Map parsePost(HttpServletRequest req)
                               throws ServerException
Parse an HTTP POST request to fill out the scriptName, methodName and paramList properties. This method should not fail unless it will not be possible to return any sort of error to the user. Failure cases should be handled by the checkParams() method.

Parameters:
req - The original browser's request
Returns:
The equivalent of HttpServletRequest.getParameterMap() for now
Throws:
ServerException - If reading from the request body stream fails

parseGet

public static java.util.Map parseGet(HttpServletRequest req)
                              throws ServerException
Parse an HTTP GET request to fill out the scriptName, methodName and paramList properties. This method should not fail unless it will not be possible to return any sort of error to the user. Failure cases should be handled by the checkParams() method.

Parameters:
req - The original browser's request
Returns:
Simply HttpRequest.getParameterMap() for now
Throws:
ServerException - If the parsing fails

splitInbound

public static java.lang.String[] splitInbound(java.lang.String data)
The javascript outbound marshaller prefixes the toString value with a colon and the original type information. This undoes that.

Parameters:
data - The string to be split up
Returns:
A string array containing the split data