am entering some values and submitting form . then after that how to get result in same page.... i mean request must go servlet and proceed some criteria and after that the processed results came to same jsp with out forward another page. if using redirect to same page the page will printing same as before but not getting results..
Also you can use JSTL tag import.
1) make you jsp form for search criteria. (page1)
2) build a jsp page for result (page2) and import the page1 inside page2 with jstl tag import.
TIP: In the form action of you page1 form call to page2.
Bear Bibeault wrote:The Ajax approach is far superior. In fact, I don't even see how using the JSTL import approach as described can possibly work.
I did that!!
I will try to explain my case:
I did a search.jsp, this had one field input for criteria search.
Then i did create a jsp for result. This result.jsp ask for parameters, is to say, i must to pass parameters from search.jsp o result.jsp.
search.jsp submit a value (parameter) . In the form action property call to result.jsp page and pass the parameter. In my result.jsp page i pass the parameter to a method than make a query. Then the result in showed in a html table in my result.jsp page.
In other words;
1)in the first block request the value (parameter) if the parameter is null then not display data, if the parameter is diferent to null build the query and disply the data below
2) in the second block include the page <c:import url="search.jsp"/>
3) in the third block of my result.jsp page show the data in a html table.
I hope you understand my explanation, sorry for my english grammar.
And Yes, you are right about Ajax, I am using AJAX and Jquery lately and it is so nice and pretty for do similar things.