Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Feb 2012
    Posts
    22
    Thanks
    14
    Thanked 0 Times in 0 Posts

    jsp forward question

    Hi

    I want to forward the post request of my form to the servlet LoginServlet exactly as if I make action="LoginServlet" in my form. My form is in LoginForm.jsp and this is my approach :

    Content of LoginForm.jsp
    Code:
    <%  
    if (request.getMethod().equals("POST"))  
    {  
    // ...  Some checks
    <jsp:forward page="/LoginServlet"/>  
    }  
    %>
    <form action="LoginForm.jsp">  
    <input type="text" name="username">  
    <input type="password" name="userpass">  
    <input type="submit" value="submit">  
    </form>
    So I don't know about the slash in the <jsp:forward page="/LoginServlet"/> if it is mandatory or useless. After that, the LoginServlet servlet should be able to capture the post data with doPost and doGet procedures.

    Regards

  • #2
    Senior Coder ckeyrouz's Avatar
    Join Date
    Jun 2009
    Location
    Montreal, Canada
    Posts
    1,044
    Thanks
    5
    Thanked 179 Times in 179 Posts
    If it is a servlet it should be configured in your web.xml file.

    Check how the path is configured in the web.xml and type it here.
    Software and cathedrals are much the same - first we build them, then we pray.

  • #3
    New to the CF scene
    Join Date
    Mar 2012
    Location
    Pakistan
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi friends,
    I know that the jsp is used to develop the website in the java language. I know that the main aim of the jsp is to provide the security in your website. I know that session is the main key tools of the JSP page.
    JSP forword is used in website to forword the request into the server. Servlet is also used in this java programming .
    Thanks .


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •