Package org.apache.struts2.util
Class StrutsUtil
java.lang.Object
org.apache.struts2.util.StrutsUtil
Struts base utility class, for use in Velocity and Freemarker templates
- 
Field SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionStrutsUtil(ValueStack stack, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) 
- 
Method SummaryModifier and TypeMethodDescriptionfindString(String name) booleanmakeSelectList(String selectedList, String list, String listKey, String listValue) the selectedList objects are matched to the list.listValueinttoInt(long aLong) longtoLong(int anInt) longtoString(int anInt) toString(long aLong) toStringSafe(Object obj) translateVariables(String expression) 
- 
Field Details- 
LOGprotected static final org.apache.logging.log4j.Logger LOG
- 
requestprotected jakarta.servlet.http.HttpServletRequest request
- 
responseprotected jakarta.servlet.http.HttpServletResponse response
- 
classes
- 
stack
 
- 
- 
Constructor Details- 
StrutsUtilpublic StrutsUtil(ValueStack stack, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) 
 
- 
- 
Method Details- 
bean- Throws:
- Exception
 
- 
isTrue
- 
findString
- 
include- Throws:
- Exception
 
- 
urlEncode
- 
buildUrl
- 
findValue- Throws:
- ClassNotFoundException
 
- 
findValue
- 
getText
- 
getContext
- 
translateVariables
- 
makeSelectListpublic List<ListEntry> makeSelectList(String selectedList, String list, String listKey, String listValue) the selectedList objects are matched to the list.listValuelistKey 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 list
- list- the name of the action property that contains the list of selectable items
- listKey- an ognl expression that is exaluated relative to the list item to use as the key of the ListEntry
- listValue- an ognl expression that is exaluated relative to the list item to use as the value of the ListEntry
- Returns:
- a List of ListEntry
 
- 
toIntpublic int toInt(long aLong) 
- 
toLongpublic long toLong(int anInt) 
- 
toLong
- 
toString
- 
toString
- 
toStringSafe
 
-