ragtan
asked on
Reloading the jsp page
Hello,
I have a problem in my code. Let me explain the scenario.
I have a search button in a search.jsp page. when I click the search button I will be posting it to the controller /usr/search. When I come back to the user search page. I need to display the search criteria entered by the user. there are 10 search criteria text boxes. with username. last name etc
So how do I cache the search criteria?
To cache the criteria information
I took the approach of setting up a session variables in another jsp page when the user clicks the search button. here is the code of the two pages
This is the another page where i'm setting the session variables
<%
session.setAttribute("user name_crite ria", request.getParameter("user names"));
session.setAttribute("user _last_name _criteria" , request.getParameter("user _last_name s"));
session.setAttribute("user _first_nam e_criteria ", request.getParameter("user _first_nam es"));
session.setAttribute("user _status_cr iteria", request.getParameter("user _status")) ;
request.setAttribute("sear ch_criteri a_flag", "true");
%>
Here is the javascript code where i'm submitting the pages
function searchUsers() {
forward(document.userSearc hForm,"/se curity/use r/search_c riteria.js p","/user/ user_searc h.jsp","/u ser/user_s earch.jsp" );
forward(document.userSearc hForm,"/se curity/usr /search"," /user/user _search.js p","/user/ user_searc h.jsp");
}
forward is a javascript function which is used to submit a post to the pages which is passed as a parameters
the problem with this approach is sometimes it submits only the second one. sometime both the submits
How do I solve this problem.?Someone help me out solving this problem
I have a problem in my code. Let me explain the scenario.
I have a search button in a search.jsp page. when I click the search button I will be posting it to the controller /usr/search. When I come back to the user search page. I need to display the search criteria entered by the user. there are 10 search criteria text boxes. with username. last name etc
So how do I cache the search criteria?
To cache the criteria information
I took the approach of setting up a session variables in another jsp page when the user clicks the search button. here is the code of the two pages
This is the another page where i'm setting the session variables
<%
session.setAttribute("user
session.setAttribute("user
session.setAttribute("user
session.setAttribute("user
request.setAttribute("sear
%>
Here is the javascript code where i'm submitting the pages
function searchUsers() {
forward(document.userSearc
forward(document.userSearc
}
forward is a javascript function which is used to submit a post to the pages which is passed as a parameters
the problem with this approach is sometimes it submits only the second one. sometime both the submits
How do I solve this problem.?Someone help me out solving this problem
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
<form action="/user/user_search.
...
...
</form>
Or, maybe u have your reason ?