Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

session and s:select

 
John Eric Hamacher
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello:

I have a JSP page which is tabbed pane. Most of these panes submit a form and then forwards back to the same JSP. The consequence of this setup is that any given pane can have several points of entry.

I have many dropdowns and I need iterable things to populate them. I am having trouble being able to pick collections off the value stack because these collections must be stored at the session level. I know that the session is evil or something but this being the real world I have to use it. I cannot expose the collections in my Actions because so many of them lead to one place. So how do I use a <s:select list="???"> to use the session . . . or how do I put the collections on the value stack in such a way it mimics a session?

Hope this makes sense.

Thanks in advance.
 
Tom Rispoli
Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe the syntax to use OGNL to get values from the session is list="#session.mySessionAttributeName".

I'm not a fan of using the session to store data that is relevant throught the user's session. I wouldn't say its evil, I just find that its more suceptible to introducing hard to diagnose bugs when users start using unexpected browser controls. Be careful to try to clean up the session data as best you can to try to limit these problems.
 
Nishan Patel
Ranch Hand
Posts: 689
Eclipse IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi..

Why you use session for list. If your jsp submit that jsp then call Action set your list value in Action then you not need to store your list in session.
you can directly use that list in your jsp.

When your Action is called your all Action variable push in to OGNL stack and you directly use this variable.After setting your list yo use

<s:select list="list" />


Thanks,
Nishan Patel.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic