RE: Storing data in session scope

2005-06-22 Thread Pilgrim, Peter
> -Original Message- > From: Adam Hardy [mailto:[EMAIL PROTECTED] > Sent: 22 June 2005 11:54 > To: Struts Users Mailing List > Subject: Re: Storing data in session scope > > > On 22/06/05 08:54 Pilgrim, Peter wrote: > >> What data do I need to store???.

Re: Storing data in session scope

2005-06-22 Thread Adam Hardy
On 22/06/05 08:54 Pilgrim, Peter wrote: What data do I need to store???. Data that it has to be updated if the user goes to a module which update that data but in database. So If the user updates the data, it has to be updated automatically in the application scope. This is different kettle o

RE: Storing data in session scope

2005-06-22 Thread Pilgrim, Peter
> -Original Message- > From: Rafael Taboada [mailto:[EMAIL PROTECTED] ==== > I am suprise that no body mention a ServletFilter as also another possibility. > > I really appreciate ur help, thanks to everybody for ur reply. > In my web.xml file I have: > > /index.jsp > > So when

Re: Storing data in session scope

2005-06-21 Thread Michael Jouravlev
On 6/21/05, Rafael Taboada <[EMAIL PROTECTED]> wrote: > 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

Re: Storing data in session scope

2005-06-21 Thread Frank W. Zammetti
Do you truly need this information everywhere in the app? If not you might be able to quite easily get away with just reading it in every time you need it. Create a helper class with a single method that returns some Map or something (or a custom bean, whatever is appropriate) and use this cl

Re: Storing data in session scope

2005-06-21 Thread Wendy Smoak
From: "Frank W. Zammetti" <[EMAIL PROTECTED]> > The only complication in such situations to be aware of is when you > might need to periodically refresh the data, i.e., maybe the database > could possibly be updated throughout the day, but not frequently enough > to hit it every time through. What

Re: Storing data in session scope

2005-06-21 Thread Rafael Taboada
I really appreciate ur help, thanks to everybody for ur reply. In my web.xml file I have: /index.jsp So when the user write the URL http://localhost:8084/SanCristobal... It calls the index.jsp file. This file has a frameset (I didn't use tiles). So, My doubt is how to store some data in app

Re: Storing data in session scope

2005-06-21 Thread Ross Gibb
Hi, To get stuff in the application scope at startup we extended org.apache.struts.action.Plugin and overrode the init method put what we want in the application scope. We then load the plugin in struts-config.xml. The plugin gets loaded when struts starts. Since no one else mentioned this

RE: Storing data in session scope

2005-06-21 Thread Abdullah Jibaly
ok, maybe I'll get it right today: event.getServletContext().setAttribute("tax", "1.23"); -Original Message- From: Abdullah Jibaly Sent: Tuesday, June 21, 2005 4:05 PM To: Struts Users Mailing List Subject: RE: Storing data in session scope It sh

Re: Storing data in session scope

2005-06-21 Thread Wendy Smoak
From: "Aleksandar Matijaca" <[EMAIL PROTECTED]> > Wendy, can you please give me the complete class name of that Listener > object? Is it referenced in the web.xml?? HttpSessionListener and ServletContextListener are interfaces that you implement. They require a Servlet 2.3 or better container (T

RE: Storing data in session scope

2005-06-21 Thread Abdullah Jibaly
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:

Re: Storing data in session scope

2005-06-21 Thread Frank W. Zammetti
If an example of a ContextListener would be helpful, and perhaps even something that will do the trick for you, depending on the requirements, take a look at the code I just checked in to CVS for JavaWebParts: http://sourceforge.net/projects/javawebparts/ It is available in HEAD. I added a Co

RE: Storing data in session scope

2005-06-21 Thread Abdullah Jibaly
in web.xml: com.acme.web.listener.StartupListener StartupListener.java: public class StartupListener implements ServletContextListener { public void contextInitialized(ServletContextEvent event) { context.setAttribute("tax", "1.23"); } } in your jsp: ${applicationS

Re: Storing data in session scope

2005-06-21 Thread Frank W. Zammetti
You beat me to punch Wendy, I was just in the middle of tying almost the same reply :) The only complication in such situations to be aware of is when you might need to periodically refresh the data, i.e., maybe the database could possibly be updated throughout the day, but not frequently enou

Re: Storing data in session scope

2005-06-21 Thread Aleksandar Matijaca
Wendy, can you please give me the complete class name of that Listener object? Is it referenced in the web.xml?? Thanks, Alex. On 6/21/05, Wendy Smoak <[EMAIL PROTECTED]> wrote: > > From: "Rafael Taboada" <[EMAIL PROTECTED]> > > > I need to store some objects in session scope in order to use

Re: Storing data in session scope

2005-06-21 Thread Aleksandar Matijaca
What I would do is, create an index.html, and inside of that index.html, do redirect to a struts action... For example: Then, in your struts, the action mapped through firstAction.do can load up the session with your TAX info... Another way would be to create a Filter class, which will get ca

Re: Storing data in session scope

2005-06-21 Thread Wendy Smoak
From: "Rafael Taboada" <[EMAIL PROTECTED]> > I need to store some objects in session scope in order to use > around the application. If you need to use them across the entire webapp, then application/context scope might be more appropriate. But either way, what I do is have a Listener that is no