File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to share variables in Struts tiles?

 
Jeppe Sommer
Ranch Hand
Posts: 270
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In a jsp class called Init.jsp I define some variables that has to be used by all the jsp pages. An example is:

java.util.Locale ressources = ( java.util.Locale ) init.get("ressources");

At the moment I got an error because the other jsp pages don�t know the variables defined in the init.

cannot resolve symbol ressources

How can I solve the problem?

 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Set the variables to a scope (request, session, application).
 
Jeppe Sommer
Ranch Hand
Posts: 270
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Will you give an example, please?

Her is some piece of my Init.jsp file:


Is that a good way to initialize the parameters, which all the other jsp pages (tiles) are going to use?
[ June 19, 2005: Message edited by: Jeppe Fjord ]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic