We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

Struts storing data into session , Struts 1.2.9

NiksStruts
NiksStruts asked
on
Medium Priority
829 Views
Last Modified: 2013-11-24
Hi Experts,

I have requirement like....there a drop down box which shows tables records...when user press add to list button ...the selected record will add to table grid which reside below in same page...
the records in grid stored temporary...when user select other record and press add to list button ..that record will also come to the table ...the total they become 2 records but they are temporary...if user moves to other page then those record will be lost....how can i achieve this in my strtus 1.2.9 framwork????  

Thanks in advance
Comment
Watch Question

You need to store this data in a HttpSession. Remember how to get the session:

HttpSession session = request.getSession();

then  you add your attributes, in this case your query objects, they can be stored in a String or in another object.

session.setAttribute("name", "value");

remember setAttribute receives a String name and an object for the value.

when you want to display again your querys, just get the attribute from the session object:

String q = (String)session.getAttribute("name");

Good luck

 

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.