Hi,

Whenever we do respose.sendRedirect() it will be a new request altogather
for the server. We will not be able to fetch the request parameters which we
post to the target. I would like to give an example.

<form name="test" action="/myhost/cash/sample.jsp" metho
d="post" target="secpopup" >
    <input type="hidden" name="param1" value="122123">
    <input type="submit"
</form>

If I submit this form from /myhost/sim/sample2.jsp I am able to access the
/myhost/cash/sample.jsp and able to access the request parameters.

But if I post the following form
<form name="test" action="/myhost/cash/sample.event" metho
d="post" target="secpopup" >
    <input type="hidden" name="param1" value="122123">
    <input type="submit"
</form>

It goes to servlet of /myhost/sim application tries to access
/myhost/sim/myhost/cash/sample.event which does not exist. I had already
used the workaround/solution you described in your previous mail, but I
think there may be another solution to it.

I am not very sure whether JSP engine interacts in the same way as my
servlet does.

Thanks,
-ShriKant



>From: satya vennapusala <[EMAIL PROTECTED]>
>Reply-To: "A mailing list for discussion about Sun Microsystem's Java
>         Servlet API Technology." <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: Re: Multi web-application navigation
>Date: Fri, 12 Oct 2001 17:00:46 +0530
>
>Hi ,
>
>     Servlet container will recognize automatically the web application
>and forwards the request to appropriate web application. but once the
>request is made and it is  in to a context ( web application ) to make
>it to forward to another web application, it is the job of servlet
>author to tell the container about the servletcontext of that web
>appliaction.so the job involves in specifing the context of other web
>application, but not extra request. still if u dont want to specify the
>context on ur own, using response.redirect(/myhost/sim/..) will work.
>
>   and u said jsp engine recognizes request for a jsp which is on another
>jsp engine. could u pls
>tell me how is it possible with out using response.redirect().
>
>pls correct me, if i am wrong.
>
>Thanx in advance.
>Satya.V
>
>-----Original Message-----
>From: shrikant vashishtha [mailto:[EMAIL PROTECTED]]
>Sent: Friday, October 12, 2001 4:07 PM
>To: [EMAIL PROTECTED]
>Subject: Re: Multi web-application navigation
>
>
>Hi,
>
>I am doing the same at present within the servlet but it will cause
>another
>request to the servlet of /myhost/sim application which I want to avoid.
>Is
>it possible to trap it beforehand, before entering into servlet. Can't
>it be
>handled on the servlet engine level where engine will recognise the
>servlet
>context with respect to request and forward to the appropriate
>web-application servlet.
>
>I was talking about how JSP engines handles this kind of situations,not
>how
>do we forward the request in JSPs. In JSPs if you post a request to
>another
>application-JSP it recognize the request and forward to that JSP engine.
>
>Please advice
>Many Thanks
>-Shrikant
>
> >From: satya vennapusala <[EMAIL PROTECTED]>
> >Reply-To: "A mailing list for discussion about Sun Microsystem's Java
> >         Servlet API Technology." <[EMAIL PROTECTED]>
> >To: [EMAIL PROTECTED]
> >Subject: Re: Multi web-application navigation
> >Date: Fri, 12 Oct 2001 13:13:01 +0530
> >
> >In case of servlets
> >
> >       get the servlet context(sc =
> >ServletContext.getContext(/myhost/sim/index.html)) of other web
> >application and there by get the Request
> >dispatcher(sc.getRequestDispacher(relativeUrl to /myhost/sim) ) and
> >forward.
> >
> >I think in case of JSPs
> >
> >     response.sendRedirect(with obsolute url) will work
> >
> >Regards
> >Satya.v
> >
> >-----Original Message-----
> >From: shrikant vashishtha [mailto:[EMAIL PROTECTED]]
> >Sent: Thursday, October 11, 2001 7:52 PM
> >To: [EMAIL PROTECTED]
> >Subject: Multi web-application navigation
> >
> >
> >Hi,
> >
> >I am working in a project which does use the Front-Controller J2EE
> >pattern
> >for controlling the navigation. It works with a servlet which accept
> >virtual
> >links for navigation. So instead of calling /myhost/cash/sample.jsp we
> >call
> >/myhost/cash/sample.event. When the servlet receives request to
> >/myhost/cash/sample.event, it can choose to display content from an
>HTML
> >page, a JSP page, or even a servlet. We have multiple web application
> >which
> >deploy this servlet for navigation.
> >
> >Now the problem comes when I want to navigate from one web-application
> >to
> >another web-application. For example I want to navigate from
> >/myhost/cash
> >application to /myhost/sim/ posting a /myhost/sim/sample1.event. The
> >request
> >goes to servlet of the same servlet context ie. of /myhost/cash and the
> >request URI it gets becomes /myhost/cas/myhost/sim/sample1.event which
> >does
> >not exist in the system and I get an exception.
> >
> >I have worked on a work-around which extracts the web-application id
> >from
> >request.getRequestURI() as /myhost/sim, gets the servlet context of
>this
> >web-applicaion and forward it using the request dispatcher of
> >/myhost/sim
> >application.
> >
> >But the question arise how does JSP engine works. If I want to navigate
> >from
> >one web-application JSP to another web-application JSP, it does allow
>me
> >to
> >do it.
> >
> >Is there any methodology by which it can be assured that it is invoking
> >the
> >right servlet of right web-application. So if I fire
> >/myhost/sim/sample1.jsp
> >from /myhost/cash web-application, it should get the servlet of
> >/myhost/sim
> >not of /myhost/cash.
> >
> >Many Thanks,
> >-ShriKant
> >
> >
> >_________________________________________________________________
> >Get your FREE download of MSN Explorer at
> >http://explorer.msn.com/intl.asp
> >
> >_______________________________________________________________________
>_
> >___
> >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
> >
>
>
>_________________________________________________________________
>Get your FREE download of MSN Explorer at
>http://explorer.msn.com/intl.asp
>
>________________________________________________________________________
>___
>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
>


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp

___________________________________________________________________________
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

Reply via email to