Hello All/Mohamed,
I'm really sorry if my question is not clear.
What you are saying is exactly correct if both servlets are running in the same
webserver. If they are running in different webserver. I can't use "Forward"
method.
I must use some other option. I tried this way first "Redirected" the request
Servlet2:Port2 from Servlet1:Port1. And in Servlet2:Port2 again i redirected to
Servlet1:Port1 from Servlet2:Port2 after adding the "name:value" in the URL.
Now the problem is how to handle one of the webserver is down while "Redirecting"
from/to the Servlet. Basically i would like to know whether that servlet is running
or not.
Regards
G S Sundaram
Mohamed Salman wrote:
> Use setAttribute("keytobeset","Value"); in the servlet2
> and get it as getAttribute("keytobeset") in servlet1.
>
> Steps
> 1. Servlet1 (do whatever req)
> 2. Forward req to servlet2
> 3. setAttribute
> 4. Forward req to servlet1
> 5. getAttriubute()
>
> hope I am right??
> Salman
>
> G S Sundar wrote:
>
> > Hello Cristopher,
> > I'm not very much clear, if i make a call from Servlet1 to Servlet2 using
> > "Response.sendRedirect(String urlString)". Int this case how do i return my
> > first object to Servlet1 from Servlet2. Because i want to return an object
> > there is clue to return object via request/response.
> > So, how do i do this? can you explain me little more in this regard. If you
> > have any code example it will be more help full to me.
> >
> > Regards
> > G S Sundaram
> >
> > "Christopher K. St. John" wrote:
> >
> > > Sam Newman wrote:
> > > >
> > > > Once you have your serialized object, simply store it in a
> > > > file which both your servlets can access
> > > >
> > >
> > > That would require something like file locks, so it
> > > might not be such a good idea. If you absolutely
> > > can't use a database, then you might consider making
> > > an http call from the first servlet to the second,
> > > and send the information in the body of the request.
> > > That keeps it all servlets-based, and finesses you
> > > around (some of) the potential synchronization issues.
> > >
> > > --
> > > Christopher St. John [EMAIL PROTECTED]
> > > DistribuTopia http://www.distributopia.com
> > >
> > > ___________________________________________________________________________
> > > To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> > > of the message "signoff SERVLET-INTEREST".
> > >
> > > Archives: http://archives.java.sun.com/archives/servlet-interest.html
> > > Resources: http://java.sun.com/products/servlet/external-resources.html
> > > LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
> >
> > ___________________________________________________________________________
> > To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> > of the message "signoff SERVLET-INTEREST".
> >
> > Archives: http://archives.java.sun.com/archives/servlet-interest.html
> > Resources: http://java.sun.com/products/servlet/external-resources.html
> > LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html