File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes How to share variables in Struts tiles? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to share variables in Struts tiles?" Watch "How to share variables in Struts tiles?" New topic
Author

How to share variables in Struts tiles?

Jeppe Sommer
Ranch Hand

Joined: Jan 07, 2004
Posts: 270
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

Joined: Feb 05, 2003
Posts: 4727

Set the variables to a scope (request, session, application).


A good workman is known by his tools.
Jeppe Sommer
Ranch Hand

Joined: Jan 07, 2004
Posts: 270
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
 
subject: How to share variables in Struts tiles?