DIGIT-ARC read-only archive · snapshot: July 23, 2026

Java

4 posts · originally from https://geek.digit.in/community/threads/java.84121/

H
hariharan Original post #1
Apr 1, 2008 at 5:35 PM
I have a JSP page in which i have one drop down box and two list boxes. now based on the selections I query a database and display the search results in the next page. In this new page i have a back button which on clicking leads back to the search page. I need the values selected for previous search query in the drop down box and list boxes( with multiple selection ) to remain as selected.

How to go about this.... any suggestions...??
Faun
Faun #2
Apr 1, 2008 at 6:42 PM
use session and pass on values using attributes
Garbage
Garbage #3
Apr 1, 2008 at 7:00 PM
use session and pass on values using attributes
TRUE !!

Just add code like...

if (session.getAttribute("search1")==null)
{
// display blank form
}
else
{
%>
Search : <input type=text name="search1" value="<%= session.getAttribute("search1")%>" >
<%
}

It's sample !!! Forgive errors please.. ;)
D
Apr 2, 2008 at 11:30 AM
use session based java beans