I have two jsp pages. result.jsp, x.jsp. x.jsp is a menu view page which has some links through which we can filter our result.jsp. I want to merge these 2 pages. how to do it?
Asked
Active
Viewed 5,531 times
2
-
1merge means? (1) Do you want to have the content of both of them in a single jsp OR (2) Do you want that they remain separate jsp but when they are rendered on the browser they should be rendered as a single page? which one is it or is it something else? – Prakash K Sep 25 '12 at 13:17
-
right now i have two separate working jsps. so wen i hit search they both gotta be rendered on single page – Bala Sep 25 '12 at 13:25
1 Answers
3
You can either use
- static include
<%@include file="x.jsp" %>
(included at compile time) - or dynamic include
<jsp:include page="x.jsp" />
(included while rendering the output)
inside your results.jsp
or the other way round i.e. including results.jsp
in x.jsp
.
For more info:
- Include another JSP file
- Difference between the two includes
<%@include %>
is a directive and<js:include />
is a standard-action.
Hope this helps.
-
Thank u very much praksah. i tried then already but non of them are working for me. it just blanks off the page with just header n footer – Bala Sep 25 '12 at 13:45
-
What errors do you get in the console? Any stack-trace? or does the jsp page actually gets called, have you checked? – Prakash K Sep 26 '12 at 05:00