org.hopto.pentaj.jexin.util
Class WebUtils

java.lang.Object
  extended by org.hopto.pentaj.jexin.util.WebUtils

public class WebUtils
extends java.lang.Object

Static helper methods for the MVC layer.

Author:
jmcclure

Constructor Summary
WebUtils()
           
 
Method Summary
static javax.servlet.http.HttpSession getExistingSession(javax.servlet.http.HttpServletRequest request)
          Gets the session from the request.
static java.lang.String getRequiredParameter(javax.servlet.http.HttpServletRequest request, java.lang.String paramName)
          Gets the parameter from the request.
static java.lang.String[] getRequiredParameterValues(javax.servlet.http.HttpServletRequest request, java.lang.String paramName)
          Gets the parameter values from the request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebUtils

public WebUtils()
Method Detail

getExistingSession

public static javax.servlet.http.HttpSession getExistingSession(javax.servlet.http.HttpServletRequest request)
Gets the session from the request. If the session does not exist a RuntimeException is logged and thrown.

Parameters:
request -
Returns:
The HttpSession

getRequiredParameter

public static java.lang.String getRequiredParameter(javax.servlet.http.HttpServletRequest request,
                                                    java.lang.String paramName)
Gets the parameter from the request. If the parameter does not exist a RuntimeException is logged and thrown.

Parameters:
request - The request to get the parameter from
paramName - The name of the parameter
Returns:
The parameter value

getRequiredParameterValues

public static java.lang.String[] getRequiredParameterValues(javax.servlet.http.HttpServletRequest request,
                                                            java.lang.String paramName)
Gets the parameter values from the request. If the parameter does not exist a RuntimeException is logged and thrown. Use this method instead of getRequiredParameter(HttpServletRequest, String) if there may be multiple values.

Parameters:
request - The request to get the parameter from
paramName - The name of the parameter
Returns:
The parameter values