First, Please suggest me if my question heading is not correct.
Moving on to question: Say I am having below components:
search.jsp
- A JSP Page with a Form to Submit Data
Search.java
- A controller Servlet having both get()
and post()
defined separately so that it can acts as a dispatcher for path /search.jsp
searchResults.jspf
- A Fragment with some JSTL code to show up the Search Results
What I want here is for every POST request the controller servlet has to do its calculation, set results as Request Attributes and than - forward the request to the view search.jsp
that should include the Fragment after its own codes.
So that, I can have a View Defined in such a way as:
search.jsp
+
searchResults.jspf
on a single page.
Problem is, I can either do Forward or Include with the dispatcher as I don't know how can i Include a fragment while forwarding to a JSP into it.
Let me know if I need to post some code if necessary, or need any corrections.