RequestDispatcher in jsp -


I am trying to use RequestDispatcher's inclay method in my JSP page. The problem is that it is not giving the desired output.

Here's my code:

  & lt;% out.println ("end"); Out.println ("Start"); Request Dispairs RD = Request.GateQuestion Detector ("MyFile .Jsp"); Rd.include (request, response); & Gt%;  

and myfile.jsp:

  <% = "good"%>  

This output gives:

good end starts

But I hope the output should be: the end starts well.

Can someone please explain thanks

That's because you requested your request Response from the dispatch class is included in jsp, so this is being done by printing details of Calling JSP (i.e.) out.println .

By java docs,

If the resource is static, the method involved is included in the programmatic server-side if the resource is a web component, then the method The effect of this is to send request to the web component, execute the web component, and then include the results of the execution in response to the included servlet.

It can write the reaction body and give feedback.

It can not set the header or call any method, such as setCookie, which affects the top authors of the response

Hope this helps !


Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -