Note that there are some explanatory texts on larger screens.

plurals
  1. POredirecting jsp page from servlet
    primarykey
    data
    text
    <p>Here i want to call jsp page from the servlet using RequestDispatcher,the problem is calling the java code in the jsp code is fine and the problem is the html code is not working </p> <p>Here is the code:</p> <p>RedirectServlet.java:</p> <pre><code> protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { System.out.println("calling doPost() "); response.setHeader("Pragma", "No-cache"); response.setHeader("Cache-Control","no-store"); //HTTP 1.1 response.setDateHeader("Expires", 0); response.setHeader("Cache-Control", "no-cache"); response.setContentType("text/html;charset=WINDOWS-1256"); String action=request.getParameter("action"); System.out.println(action); if(action.equals("reports")){ System.out.println("inside reports"); //Getting values from Reports_arb.jsp String Fromdate=request.getParameter("FD"); String Todate=request.getParameter("TD"); String status=request.getParameter("actionid"); String usercode=request.getParameter("usercode"); //placing given values in a session request.setAttribute("FD", Fromdate); request.setAttribute("TD", Todate); request.setAttribute("actionid", status); request.setAttribute("usercode", usercode); //Redirecting to showReport_arb.jsp //response.sendRedirect("showReport_arb.jsp"); ServletContext sc = getServletContext(); sc.getRequestDispatcher("/showReport_arb.jsp").forward(request, response); } </code></pre> <p>showReportt_arb.jsp:</p> <pre><code> &lt;HTML dir="rtl"&gt; &lt;HEAD&gt; &lt;%@ page language="java" import="java.sql.*" contentType="text/html; charset=WINDOWS-1256" pageEncoding="WINDOWS-1256" isThreadSafe="true" autoFlush="true" import ="com.iton.eoffice.WorkflowManagement.*,com.iton.eoffice.contentmanager.*,com.iton.eoffice.authentica tion.*,com.iton.eoffice.*" import ="java.sql.*,java.util.GregorianCalendar,java.util.Calendar,java.util.Vector,java.text.DateFormat,jav a.text.SimpleDateFormat" %&gt; &lt;% response.setHeader("Pragma", "No-cache"); response.setHeader("Cache-Control","no-store"); //HTTP 1.1 response.setDateHeader("Expires", 0); response.setHeader("Cache-Control", "no-cache"); %&gt; ... ... &lt;script language="JavaScript"&gt; function formatTable(oTable) { var rows=document.all(oTable).rows; for(var i=1;i&lt;rows.length;i++) { if(i%2==0) { for(var j=0;j&lt;rows[i].cells.length;j++) { rows[i].cells[j].style.backgroundColor = "#FFFFFF"; rows[i].cells[j].style.borderTop="1 solid #FFFFFF"; rows[i].cells[j].style.borderBottom="1 solid #FFFFFF"; rows[i].cells[j].style.color = "#000000"; } } ... ... &lt;/script&gt; .... &lt;% ... System.out.println("From Date is"+FD); out.println("welcome to showreports_arb.jsp"); String dtArray[]=FD.split("-"); FD=dtArray[1]+"-"+dtArray[0]+"-"+dtArray[2];.... ..... %&gt; ..... ..... ...... &lt;TABLE align="center"&gt; &lt;TR&gt; &lt;TD class="set"&gt;&lt;input type="button" class="SETARB" value="ØÈÇÚÉ ÇáÊÞÑíÑ" style="width:80px" onclick="printPage()"&gt;&lt;/TD&gt; &lt;TD class="set"&gt;&lt;input type="button" class="SETARB" value="ÎÑæÌ" style="width:80px" onclick="closePage()"&gt;&lt;/TD&gt; &lt;/TR&gt; &lt;/TABLE&gt; &lt;TABLE width="100%" style="border:0px solid #BFBDBA;text-align:center;" align="center"&gt; ...... ... .. &lt;/html&gt; </code></pre> <p>in the above logic java code is displaying in the server console but the html code was not displayed.Please help me to resolve this issue</p>
    singulars
    1. This table or related slice is empty.
    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