connecting servlet with jsp

Discussion in 'Java' started by soni29, Jul 25, 2003.

  1. soni29

    soni29 Guest

    hi,
    i have a jsp page with a form on it and wish to submit the data to a
    servlet, in the form's action property do i have to specify the
    servlet class as http://localhost:8080/myApps/servlet/Test or is there
    anyway without having to map the entire ip address into it. Without
    having to map would help as this way i can easily move it to another
    ip without having to change the code.

    Thank you.
    soni29, Jul 25, 2003
    #1
    1. Advertising

  2. soni29

    Andy Flowers Guest

    As long as the JSP page is in the same application then submit it back as
    "/servlet/Test", the rest of the path is known by the browser.

    "soni29" <> wrote in message
    news:...
    > hi,
    > i have a jsp page with a form on it and wish to submit the data to a
    > servlet, in the form's action property do i have to specify the
    > servlet class as http://localhost:8080/myApps/servlet/Test or is there
    > anyway without having to map the entire ip address into it. Without
    > having to map would help as this way i can easily move it to another
    > ip without having to change the code.
    >
    > Thank you.
    Andy Flowers, Jul 25, 2003
    #2
    1. Advertising

  3. soni29

    Wendy S Guest

    "soni29" <> wrote
    > i have a jsp page with a form on it and wish to submit the data to a
    > servlet, in the form's action property do i have to specify the
    > servlet class as http://localhost:8080/myApps/servlet/Test or is there
    > anyway without having to map the entire ip address into it. Without
    > having to map would help as this way i can easily move it to another
    > ip without having to change the code.


    You can use relative paths for the form's action element. In this case you
    can probably use <form action="/myApps/servlet/Test" >. No guarantees, I'm
    not sure how the port number will be handled as I don't use it.

    --
    Wendy in Chandler, AZ
    Wendy S, Jul 25, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. circuit_breaker
    Replies:
    2
    Views:
    1,993
    Jack Jia
    Apr 4, 2004
  2. Drew
    Replies:
    1
    Views:
    792
    Rhino
    Feb 17, 2005
  3. Replies:
    0
    Views:
    4,347
  4. javadev
    Replies:
    5
    Views:
    12,892
    javadev
    Nov 16, 2006
  5. Replies:
    4
    Views:
    777
Loading...

Share This Page