Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Need help regarding s:select tag list

Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is Venkat. Iam new to struts2 framework. Iam struck up with a small problem using <s:select> tag.

I have a page which contains a select tag . on page load i will populate its list values from server. Its a search form. when i perform the search the results are displayed in the same page.

In the action class, iam using the String member to get the selected value.

but after displaying the results in the same page, iam unable to get s:select tag list data....

how can i maintain the s:select list data,

To be specific, can i get the <s:select> tag list values in action class ....

please help me ASAP,

Thanks in Advance,
Ranch Hand
Posts: 72
Scala Monad Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On page load the list is available because it is in the request scope i guess. So when the page is displayed first, the select tag is populated with the list object in request scope. When you click for search results, it is a new request. So When you forward the results, you need to again make the list available in the request scope.
If you want to avoid making the list available for each request, you can use session scope for the list (make sure that the list in session doesnt contain stale data). This way when you load the page first time you make the list available for entire session. So the list now will be available in search results page.
All of the following truths are shameless lies. But what about this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic