com.itmusings.stm.ognl
Class HttpServletRequestAccessor

java.lang.Object
  extended by com.itmusings.stm.ognl.HttpServletRequestAccessor
All Implemented Interfaces:
ognl.PropertyAccessor

public class HttpServletRequestAccessor
extends java.lang.Object
implements ognl.PropertyAccessor

Author:
raja Exposes various attributes of the HttpServletRequest. If it has direct request properties such as requestURI,pathTranslated etc. then they are returned directly. If the property ends with "Cookie" it is assumed that the property is expected in a cookie. So cookies are examined to obtain the property value. if the property name ends with Header it is assumed to be a header property and hence the property is queried as such. For all other properties first they are examined to see if they have been set as parameters. If not they would be assumed to be request attributes.

Constructor Summary
HttpServletRequestAccessor()
           
 
Method Summary
protected  java.lang.Object getCookieProperty(javax.servlet.http.HttpServletRequest request, java.lang.String name)
           
protected  java.lang.Object getHeaderProperty(javax.servlet.http.HttpServletRequest request, java.lang.String name)
           
 java.lang.Object getProperty(java.util.Map context, java.lang.Object target, java.lang.Object name)
           
 java.lang.String getSourceAccessor(ognl.OgnlContext context, java.lang.Object target, java.lang.Object index)
           
 java.lang.String getSourceSetter(ognl.OgnlContext context, java.lang.Object target, java.lang.Object index)
           
 void setProperty(java.util.Map context, java.lang.Object target, java.lang.Object name, java.lang.Object value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpServletRequestAccessor

public HttpServletRequestAccessor()
Method Detail

getProperty

public java.lang.Object getProperty(java.util.Map context,
                                    java.lang.Object target,
                                    java.lang.Object name)
                             throws ognl.OgnlException
Specified by:
getProperty in interface ognl.PropertyAccessor
Throws:
ognl.OgnlException

setProperty

public void setProperty(java.util.Map context,
                        java.lang.Object target,
                        java.lang.Object name,
                        java.lang.Object value)
                 throws ognl.OgnlException
Specified by:
setProperty in interface ognl.PropertyAccessor
Throws:
ognl.OgnlException

getCookieProperty

protected java.lang.Object getCookieProperty(javax.servlet.http.HttpServletRequest request,
                                             java.lang.String name)

getHeaderProperty

protected java.lang.Object getHeaderProperty(javax.servlet.http.HttpServletRequest request,
                                             java.lang.String name)

getSourceAccessor

public java.lang.String getSourceAccessor(ognl.OgnlContext context,
                                          java.lang.Object target,
                                          java.lang.Object index)
Specified by:
getSourceAccessor in interface ognl.PropertyAccessor

getSourceSetter

public java.lang.String getSourceSetter(ognl.OgnlContext context,
                                        java.lang.Object target,
                                        java.lang.Object index)
Specified by:
getSourceSetter in interface ognl.PropertyAccessor


Copyright © 2011 ITMUSINGS. All Rights Reserved.