JSP forward tag

Discussions

Web tier: servlets, JSP, Web frameworks: JSP forward tag

  1. JSP forward tag (2 messages)

    when i am trying to send a parameter from one jsp page to another jsp page, it is not picking up the passed value
    What is wrong with my code:

    1) 1.jsp
    <html>
    <body>
     

    <jsp:forward page="2.jsp" >
    <jsp:param name="yyy" value="xxx" />
    </jsp:forward>

    </body>
    </html>

    2) 2.jsp

    <html>

    <body>

    <%
    out.println("<b>Employee</b>"+ request.getParameter("yyy"));

     %>

    </body>
    </html>

    it is displaying the output as "Employeenull". Pl. let me know

    Threaded Messages (2)

  2. JSP forward tag[ Go to top ]

    hi
    your code is right but make sure that you server supports JSP1.1..b'coz i think <jsp:forward> tag along with params is JSP1.1 standard..so if you server doesn't support JSP1.1 then u go for JSP1.0 and change the program.so use
    <% response.sendRedirect("xx.jsp?name="hell" & value="yes"); %>
    otherwise you can do this also
    <jsp:forward page="xx.jsp?UID=0 & key="99"" />
    ok i prefer the first one
    i hope this should work for..all the best
    hey bytheway which server do u use to run your JSPs
    bye
    ram
  3. JSP forward tag[ Go to top ]

    Hi Rawat,
    your code is correct. but if you are using JSWDK 1.0.1, this won't work. with WebLogic 5.0.1 or JRun 3.0 this code will work.

    if you are using JSWDK, use the <jsp:forward .. > tag according to JSP 1.0 specification.

    just check if it works.
    thanx.