File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to insert static variable with struts tags

 
Shankar Narayana
Ranch Hand
Posts: 134
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Is there any way I can use the struts tag library to put the value of a static variable in the jsp.

for ex:


I want to put the value of REQUEST_TYPE in the jsp, how?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33716
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Shankar,
There are two ways of doing this, both a bit messy:

1) Use a partial scriptlet:
<bean efine id="staticField" value="<%= new String(ReqSessConstants.REQUEST_TYPE) %>" />
<bean:write name="staticField" />

2) Wrap the constant in a getter method of a bean.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic