com.opensymphony.webwork.util
Class WebWorkUtil
java.lang.Object
com.opensymphony.webwork.util.WebWorkUtil
- Direct Known Subclasses:
- VelocityWebWorkUtil
public class WebWorkUtil
- extends Object
WebWork base utility class, for use in Velocity and Freemarker templates
- Version:
- $Revision: 1995 $
- Author:
- Rickard ?????berg (rickard@dreambean.com), Cameron Braid
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
protected static final org.apache.commons.logging.Log log
request
protected HttpServletRequest request
response
protected HttpServletResponse response
classes
protected Map classes
ognl
protected OgnlTool ognl
stack
protected OgnlValueStack stack
WebWorkUtil
public WebWorkUtil(OgnlValueStack stack,
HttpServletRequest request,
HttpServletResponse response)
bean
public Object bean(Object aName)
throws Exception
- Throws:
Exception
isTrue
public boolean isTrue(String expression)
findString
public Object findString(String name)
include
public String include(Object aName)
throws Exception
- Throws:
Exception
include
public String include(Object aName,
HttpServletRequest aRequest,
HttpServletResponse aResponse)
throws Exception
- Deprecated. the request and response are stored in this util class, please use include(string)
- Throws:
Exception
textToHtml
public String textToHtml(String s)
urlEncode
public String urlEncode(String s)
buildUrl
public String buildUrl(String url)
findValue
public Object findValue(String expression,
String className)
throws ClassNotFoundException
- Throws:
ClassNotFoundException
getText
public String getText(String text)
getContext
public String getContext()
makeSelectList
public List makeSelectList(String selectedList,
String list,
String listKey,
String listValue)
- the selectedList objects are matched to the list.listValue
listKey and listValue are optional, and if not provided, the list item is used
- Parameters:
selectedList
- the name of the action property
that contains the list of selected items
or single item if its not an array or listlist
- the name of the action property
that contains the list of selectable itemslistKey
- an ognl expression that is exaluated relative to the list item
to use as the key of the ListEntrylistValue
- an ognl expression that is exaluated relative to the list item
to use as the value of the ListEntry
- Returns:
- a List of ListEntry
htmlEncode
public String htmlEncode(Object obj)
toInt
public int toInt(long aLong)
toLong
public long toLong(int anInt)
toLong
public long toLong(String aLong)
toString
public String toString(long aLong)
toString
public String toString(int anInt)