hgbdelphi
asked on
in struts how can i set/get application value?
hi,experts now i hava a struts page like this
,how can i get the application value???
thanks!
public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
//in servlet i can do this get the application "application" value,but when i use struts,how can i get the application value???
//getServletContext().setA ttribute(" applicatio n","testva lue"); //can get application value in servlet,but not get value in it.
}
,how can i get the application value???
thanks!
public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
//in servlet i can do this get the application "application" value,but when i use struts,how can i get the application value???
//getServletContext().setA
}
struts comes with a class TagUtils wich have your function. (or you can study the source if you need a diffrent implementation)
look at: http://struts.apache.org/api/index.html
the classname is org.apache.struts.taglib.t iles.util. TagUtils
look at: http://struts.apache.org/api/index.html
the classname is org.apache.struts.taglib.t
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thank for your help,
hi,sbockelman ,your code can help me ,thank!
hi,sbockelman ,your code can help me ,thank!
ASKER
request.getSession().setAt
but how can i set application in Sturts 's action??
thanks very much!