Note that there are some explanatory texts on larger screens.

plurals
  1. PODispatching requests from a servlet to jsp
    primarykey
    data
    text
    <p>I have a jsp page which display some records in a table and each record has a link called update next to it. When update is clicked , the jsp page will call a servlet which gets some information from the url , such as the record ownername , record title , etc. (When the link is clicked , these information are attached to url).</p> <p>The servlet which is called by the jsp page , will then dispatch its request and response to another jsp page , it will display "OK". (This is just a simple program which i have setup)</p> <p>My problem is, the sevlet cannot dispatch to the other jsp page. </p> <p>Here is what i have done :</p> <p>This is the First Jsp page which will display the records (Works perfectly)</p> <pre><code>&lt;body&gt; &lt;table border="10"&gt; &lt;th&gt;Project Owner&lt;/th&gt;&lt;th&gt;Project Supervisor &lt;/th&gt; &lt;th&gt;Project Title&lt;/th&gt; &lt;th&gt;Project Description&lt;/th&gt; &lt;th&gt;Start-Date&lt;/th&gt; &lt;th&gt;End-Date&lt;/th&gt; &lt;th&gt;Approval Status&lt;/th&gt; &lt;c:forEach items="${nominationList}" var="Iter"&gt; &lt;tr&gt; &lt;td&gt;${Iter.projectOwner}&lt;/td&gt; &lt;td&gt;${Iter.projectSupervisor}&lt;/td&gt; &lt;td&gt;${Iter.projectTitle}&lt;/td&gt; &lt;td&gt;${Iter.projectDescription}&lt;/td&gt; &lt;td&gt;${Iter.startDate}&lt;/td&gt; &lt;td&gt;${Iter.endDate}&lt;/td&gt; &lt;td&gt;${Iter.acceptStatus}&lt;/td&gt; &lt;td&gt;&lt;a href="${pageContext.request.contextPath}/ProjectApproval/${Iter.projectOwner}"&gt;Update&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt; //Above is the link to update each record &lt;/c:forEach&gt; &lt;/table&gt; &lt;/body&gt; </code></pre> <p>This is the servlet code which it will call</p> <pre><code> RequestDispatcher updateDispatcher=request.getRequestDispatcher("testing.jsp"); updateDispatcher.forward(request, response); </code></pre> <p>//this servlet dispatches to the other jsp page</p> <p>I found that if i remove the extra things in the url to update (In first jsp page code) , it works but the problem is i need those extra things to implement something else in the future.</p> <p>Thank you for your time.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload