#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2000
    Location
    toronto, ontario, canada
    Posts
    10
    Rep Power
    0

    linking to a servlet from a html link


    I am new at writing java servlets.

    How can I link to a java servlet using html links?
    Will the following work?

    <a href="<host>:<port>/<class_name>?sessionid=23"> MY LINK </a>

    Thanks in advance
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2001
    Posts
    0
    Rep Power
    0
    use this
    form action = "<host>:<port>/servlet/name_of_servlet"
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2001
    Posts
    36
    Rep Power
    14

    Lightbulb


    Hi,

    it's not always host>:<port>/servlet/name_of_servlet

    U can change mapping of Ur servlets, so U don't need to specify "servlet" folder

    Ciao
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2000
    Location
    toronto, ontario, canada
    Posts
    10
    Rep Power
    0
    I want to run a servlet when a html link in clicked.

    By html link I mean:

    <a href="...something"> Link leading to my servlet </a>


    I know how to run a servlet from a form element.
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2001
    Posts
    68
    Rep Power
    14
    depending on where your document root is....

    i just call <A HREF='/servlets/servletname'>

    if its in a package, then the /servlets/com.cma.servletname...

    it all depends on where you start from when you call /servlets

IMN logo majestic logo threadwatch logo seochat tools logo