2

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?

Bala
  • 539
  • 1
  • 5
  • 8
  • 1
    merge 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 Answers1

3

You can either use

  1. static include <%@include file="x.jsp" %> (included at compile time)
  2. 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:

  1. Include another JSP file
  2. Difference between the two includes
  3. <%@include %> is a directive and <js:include /> is a standard-action.

Hope this helps.

Community
  • 1
  • 1
Prakash K
  • 11,669
  • 6
  • 51
  • 109
  • 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