• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

Getting the arraylist through session

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello frnds...

I am putting the array values in session....but when i getting the array in jsp i am getting only last value......not the full array.

code is as follows:



jsp page where i am getting the session.....

 
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Don't use scriplet in jsp, rather JSTL will be the right way.
The below would be helpful.

ses.setAttribute("AttNameA",AttNameA); //Assuming that you have the at
ses.setAttribute("AttValueA",AttValueA);



As you already have the attributes set into session you can go with JSTL directly.
<c:forEach var="nameA" items="${AttNameA}">
<c: out value="${nameA}"/>
</c:forEach>

 
Bartender
Posts: 1845
10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is also an issue with your code.
The session attribute is set from the methd: "writeDocumentToOutput" .
This method is called recursively.
Every time you call the method it is setting the session attributes, and overrides the previous value it had.

That explains why you only get the "last" value.
This class looks like it was written for an app, and is being adapted for the web.

What is it you are trying to accomplish in the display?
 
A berm makes a great wind break. And we all like to break wind once in a while. Like this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic