• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Need help regarding s:select tag list

 
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
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,
Venkat
 
Ranch Hand
Posts: 72
Scala Monad Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic