aspose file tools*
The moose likes Servlets and the fly likes help.... Servlet Chaining Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "help.... Servlet Chaining" Watch "help.... Servlet Chaining" New topic
Author

help.... Servlet Chaining

Aru Ven
Ranch Hand

Joined: Sep 28, 2000
Posts: 199
Hi All,
I am a new learner. Please help.
I have a servlet which has to call another servlet either when a button is clicked or when clicked on a link.
I have a input item, whose value is to be passed to the servlet being called. Here is my code

What exactly happening is
when ckicked on the url the second servlet is started but the parameter when displayed in all cases shows only "val".
But when is button is clicked.
?varname=whatever value i have entered for the name
gets appended to the current URL but the second servlet is not displayed.
I have coded both servlets as doGet.
Please Help
Thx in advance.
Aruna
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
I think your HTML form is very strange. Typically a HTML form starts with a tag something like <FORM METHOD='POST' ACTION='/servlets/whatever'>, then has a series of <INPUT> tags, then finally a </FORM> tag at th ened to finish it.
You seem to have some input elements outside the form, and a form start with no end. Does this work at all?


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
Aru Ven
Ranch Hand

Joined: Sep 28, 2000
Posts: 199
Frank,
I have just given the lines which I think I'm wrong.
sorry it was a mistake due to cut & paste.

And my prog has all the reqd tags.
Aruna
[This message has been edited by Aru Ven (edited December 01, 2000).]
Aru Ven
Ranch Hand

Joined: Sep 28, 2000
Posts: 199
CAN ANYONE HELP ME.......???
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
Your problem may be that you say that I have coded both servlets as doGet, but your form is submitting a POST request. Try changing the form method to GET and see if it works.
Rayudu addagarla
Ranch Hand

Joined: Aug 17, 2000
Posts: 39
hi,
i think for sevlet chaining you need to administer the
javawebserver admin.bat in bin directory. in that servlet
alias will be there.u have to give the same name for both servlets in the alias field and "servlet1,servlet2" in the
next field. then if you invoke the first one it will redirect to other.
if that is not what you want i am sorry....
rayudu


Good luck for Certfication.
Monty Ireland
Ranch Hand

Joined: Oct 03, 2000
Posts: 161
I have a quick question...
How do you code servlet1 to call servlet2 directly...?
Monty

Multi Platform Database Developer & DBA on E.S.T.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12806
    
    5
As I understand it, servlet chaining is not really part of the official Servlet API, but was an early kludge. You are supposed to use a RequestDispatcher object to accomplish things like having one servlet call another.
That said - the original poster's problem just looks like a matter of getting the HTML form right.
Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: help.... Servlet Chaining