how to call Http Servlets from other Http Servlets
Bhasker Reddy
Ranch Hand
Joined: Jun 13, 2000
Posts: 176
posted
0
I am trying to call a Http Servlet from another Http Servlet. But the page is not displayed. I am clicking a link on the displayed webpage(from a servlet), this link is supposed to take me to another Servlet. can we call a servlet my just clicking a href link(like an html page), how do you call a servlet from a servlet and pass parameters, i will appreciate if someone can help me thanks
To have a servlet call a servlet (or jsp or html page).
This will call the servlet "servletname" passing all parms passed to this servlet
Anonymous
Ranch Hand
Joined: Nov 22, 2008
Posts: 18944
posted
0
If what you're trying to do is have your first servlet generate html containing a hyperlink to a second servlet, then have the first servlet generate something like this:
And don't forget to urlEncode the address if you want to maintain session. [This message has been edited by Miftah Khan (edited September 20, 2001).]
Bhasker Reddy
Ranch Hand
Joined: Jun 13, 2000
Posts: 176
posted
0
what do you mean by urlencode., how do you maintain sessions
Anonymous
Ranch Hand
Joined: Nov 22, 2008
Posts: 18944
posted
0
what do you mean by urlencode
Steve's response shows an example of how to urlEncode a web address.