aspose file tools*
The moose likes Struts and the fly likes Need help regarding  s:select tag list Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Need help regarding  s:select tag list" Watch "Need help regarding  s:select tag list" New topic
Author

Need help regarding s:select tag list

Venkata Sirish
Ranch Hand

Joined: Apr 09, 2007
Posts: 112
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
Marimuthu Madasamy
Ranch Hand

Joined: Jun 07, 2007
Posts: 72

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.


- Marimuthu Madasamy
 
jQuery in Action, 2nd edition
 
subject: Need help regarding s:select tag list