public class StrutsUtil extends Object
Modifier and Type | Field and Description |
---|---|
protected Map<String,Class> |
classes |
protected static Logger |
LOG |
protected OgnlTool |
ognl |
protected javax.servlet.http.HttpServletRequest |
request |
protected javax.servlet.http.HttpServletResponse |
response |
protected ValueStack |
stack |
Constructor and Description |
---|
StrutsUtil(ValueStack stack,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
Modifier and Type | Method and Description |
---|---|
Object |
bean(Object aName) |
String |
buildUrl(String url) |
Object |
findString(String name) |
Object |
findValue(String expression,
String className) |
String |
getContext() |
String |
getText(String text) |
String |
include(Object aName) |
String |
include(Object aName,
javax.servlet.http.HttpServletRequest aRequest,
javax.servlet.http.HttpServletResponse aResponse)
Deprecated.
the request and response are stored in this util class, please use include(string)
|
boolean |
isTrue(String expression) |
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
|
int |
toInt(long aLong) |
long |
toLong(int anInt) |
long |
toLong(String aLong) |
String |
toString(int anInt) |
String |
toString(long aLong) |
String |
translateVariables(String expression) |
String |
urlEncode(String s) |
protected static final Logger LOG
protected javax.servlet.http.HttpServletRequest request
protected javax.servlet.http.HttpServletResponse response
protected OgnlTool ognl
protected ValueStack stack
public StrutsUtil(ValueStack stack, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
public boolean isTrue(String expression)
public String include(Object aName, javax.servlet.http.HttpServletRequest aRequest, javax.servlet.http.HttpServletResponse aResponse) throws Exception
Exception
public Object findValue(String expression, String className) throws ClassNotFoundException
ClassNotFoundException
public String getContext()
public List makeSelectList(String selectedList, String list, String listKey, String listValue)
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 ListEntrypublic int toInt(long aLong)
public long toLong(int anInt)
public long toLong(String aLong)
public String toString(long aLong)
public String toString(int anInt)
Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.