How to forward the parameters from one page to another jsp page?

前端 未结 1 1483
春和景丽
春和景丽 2020-12-19 15:48

Am New to jsp I had to forward the name from one file to another. After a lot of dig I found the below code to be worked but it wasn\'t work. I have three jsp files like one

1条回答
  •  生来不讨喜
    2020-12-19 16:22

    Consider the code below on how you can pass parameters between jsp pages. You can use the to forward a request using this code:

    
      
    
    

    This will forward the response to newjsp1.jsp with a parameter par1 and its value is 111.

    Now in newjsp1.jsp you can read this parameter using:

    
      out.append(request.getParameter("par1"));
    
    

    You can also share attributes between pages using the session implicit Object... Possibilities are limitless...

    Maybe you would like to check these pages out:

    1. http://www.tutorialspoint.com/jsp/jsp_implicit_objects.htm
    2. http://www.apl.jhu.edu/~hall/java/Servlet-Tutorial/

    0 讨论(0)
提交回复
热议问题