org.apache.beehive.netui.databinding.datagrid.runtime.util
Class JspUtil

Object
  extended by JspUtil

public final class JspUtil
extends Object

Utility class used for operations related to JSPs.


Method Summary
static String createURL(String href, String action, String location, String scope, Map params, JspContext jspContext)
           Utility method used by data grid related classes to create URLs.
static Locale getLocale(JspContext jspContext)
          Get the Locale from the JspContext
static PageContext getPageContext(JspContext jspContext)
          Attempt to convert a JspContext into a PageContext.
static HttpServletRequest getRequest(JspContext jspContext)
          Attempt to obtain a HttpServletRequest from a JspContext.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getRequest

public static HttpServletRequest getRequest(JspContext jspContext)
Attempt to obtain a HttpServletRequest from a JspContext.

Parameters:
jspContext - the jsp context
Returns:
the HttpServletRequest
Throws:
IllegalStateException - if the JspContext is unable to provide a HttpServletRequest

getPageContext

public static PageContext getPageContext(JspContext jspContext)
Attempt to convert a JspContext into a PageContext.

Parameters:
jspContext - the jsp context
Returns:
the page context
Throws:
IllegalStateException - if the JspContext can't be converted into a PageContext

createURL

public static String createURL(String href,
                               String action,
                               String location,
                               String scope,
                               Map params,
                               JspContext jspContext)
                        throws URISyntaxException

Utility method used by data grid related classes to create URLs. If both an action name and href are provided, the action name will be used to construct the URL string.

Parameters:
href - the href
action - the action
location - the intra page location
scope - the scope into which to create the URL
params - a map of parameters to attach to the URL
jspContext - the jsp context
Returns:
a URL represented as a string. This URL will be correctly encoded by calling HttpServletResponse.encodeURL(String)
Throws:
URISyntaxException

getLocale

public static Locale getLocale(JspContext jspContext)
Get the Locale from the JspContext

Parameters:
jspContext - the jsp context
Returns:
the current locale