The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages
> Java Help
|
Call Servlets
Discuss Call Servlets in the Java Help forum on Dev Shed. Call Servlets Java Help forum discussing all Java platforms - J2ME, J2SE and J2EE - as well as relevant standards, APIs and frameworks such as Swing, Servlets, JSPs, Applets, Struts, Spring, Hibernate, ANT, EJB, and other Java-related topics.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

April 10th, 2001, 10:59 PM
|
|
Junior Member
|
|
Join Date: Apr 2001
Posts: 0
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Hi, my name is Joubert. Iīm a brazilian student. I bought the book java servlet programming and I canīt find how can I call two or more servlets simultaneously when a single form is submitted from the client to the JavaWebServer??? I can do that or itīs impossible??? And if the same two servlets reside on two diferents webServers (Two different machines)???
These answers are very important for me. Thanks for your help.
Joubert.
|

April 19th, 2001, 08:17 PM
|
|
Registered User
|
|
Join Date: Jun 1999
Location: Columbia, SC
Posts: 5
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Joubert,
I am confused as to why you would want to post to 2 servlets. HTML will not allow this, you can only have one value for the 'action' attribute. However, I suppose you could have a gateway servlet that could call the 2 servlets and return the results. If you could elaborate on what you are trying to accomplish, I guess we could evaluate the problem better. But other than that I would suggest the gateway servlet, but If the reside on different servers you will have to use URLConnection class to call the remote servlet.
|

April 21st, 2001, 01:00 PM
|
|
Junior Member
|
|
Join Date: Apr 2001
Posts: 0
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Hi, Now I'm trying to make an application that will listen the port 80 and buffered the Url sent by client. After that, it's just duplicate the string buffered, changes the action atribute and send to one or more machines with different web Servers and different servlets, for example.
I hope this will work!!
Thanks for your help, Joubert
|

April 21st, 2001, 11:35 PM
|
|
Junior Member
|
|
Join Date: Feb 2001
Location: Cebu City, PH
Posts: 1
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Multiple Servlets
Joubert, using multiple servlets is not that difficult. Servlet chaining is a powerful aspect of Java, and you should be able to use the forward or include properties to pass parameters to multiple servlets, which can collaborate.
If you are doing this from an HTML form, it would be easier to package your web page under the auspices of .jsp, then utilize the <jsp:forward> and <jsp:include> tags to process the data from the form into the multiple servlets or beans you are utilizing. (The .jsp engine itself is a big servlet you can utilize to speak with another servlet.)
Hope this helps.
|

April 23rd, 2001, 02:45 AM
|
|
Junior Member
|
|
Join Date: Apr 2001
Location: chennai,india
Posts: 0
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
how to call servlets
hai joubert
using servlet chaing you can call one or more servlets simaltaniously.actually to call a servlet from html you should mention the servlet path at action
for examle
<form action="http://localhost:8080/sevlet/something>
when ever you submited than the header calls the sevlet which reside in your websever that in servlets directory in your webserver root.
this is normally calling an servlet
other wise you want to call a servlet from another is
using sendRedirect(" ") method in SevletResonese
okay
rao.java
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|