struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Abdullah Jibaly" <>
Subject RE: Storing data in session scope
Date Tue, 21 Jun 2005 21:04:38 GMT
It should be getServletContext().setAttribute("tax", "1.23");

-----Original Message-----
From: Abdullah Jibaly 
Sent: Tuesday, June 21, 2005 4:00 PM
To: 'Struts Users Mailing List'; 'Rafael Taboada'
Subject: RE: Storing data in session scope

in web.xml:


public class StartupListener implements ServletContextListener {

    public void contextInitialized(ServletContextEvent event) {
		context.setAttribute("tax", "1.23");

in your jsp:



-----Original Message-----
From: Rafael Taboada []
Sent: Tuesday, June 21, 2005 3:38 PM
To: Struts List
Subject: Storing data in session scope

Hi folks. I need to store some objects in session scope in order to use 
around the application. What is the best way to do that?
 I need to have TAX value in any place of the application. I thought about 
creating an Action class y call a method which it get TAX data from database 
and then put the value in session scope.
 But when I call for first time index.jsp, it has to call that method... How 
can I do that?. Is it an appropiate way?
 I don't know how to call a method inside an action class from a jsp.
 Thanks in advance

Rafael Taboada
Software Engineer

Cell : +511-97753290

"No creo en el destino pues no me gusta tener la idea de controlar mi vida"

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message