tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randy Layman <randy.lay...@aswethink.com>
Subject RE: [Repost] Re: Context problem (I think)
Date Thu, 24 Jan 2002 13:42:12 GMT
 
    Your problem is the implementation of the original servlet, it is trying
to do a Servlet forward (i.e. using the RequestDispatcher to call forward),
which requires the destination to be in the SAME webapp (which is why you
are getting /ROOT/myApp).  You need to either implement the servlet yourself
or you need to live with the fact that myApp must be a sub-folder of the
context holding the servlet.  Those are the only choices that I see you
having.  Virtual Directories in IIS won't help since the forward call is
internal to Tomcat and the JSP and Servlet specs are pretty clear on how web
apps have to work (and forwarding between them would violate those rules).
 
    Randy
 

-----Original Message-----
From: Marcelo Demestri [mailto:kausario@hotmail.com]
Sent: Thursday, January 24, 2002 2:18 PM
To: Tomcat Users List
Subject: [Repost] Re: Context problem (I think)


    Still I could not solve the problem.
    Please, some suggestion?
    Thanks to all!

            Marcelo
---------------------------------------------------------------------------
    Thanks Dan!
    But I would like not to have to modify the servlet since it's
third-party┬┤s servlet.
    Do you have some solution configuring only the side TC?
    How I do the corresponding thing to "virtual directories" of IIS in TC?
    The only thing that I want to obtain is that TC understands "/myapp"
like a context that it has docBase that I define (i.e.
docBase="c:/Project/myapp").
    Then, when the servlet ask for http://localhost:8080/myapp/some.jsp
<http://localhost:8080/myapp/some.jsp> 
(this string is generated by it), TC knows where to find the information (in
this case, the jsp page in "c:/Project/myapp/some.jsp").
    Thanks again for new suggestions.

            Marcelo

----- Original Message -----
From: "Dan Miller" < dcmill2@hotmail.com <mailto:dcmill2@hotmail.com> >
To: "Tomcat Users List" < tomcat-user@jakarta.apache.org
<mailto:tomcat-user@jakarta.apache.org> >
Sent: Tuesday, January 22, 2002 6:32 PM
Subject: Re: Context problem (I think)
>
> I would recommend trying something like this, assuming that I have
> understood your question.  First, get the ServletContext that you are
trying
> to access and the forward/include onward.
>
> Example:
>
getServletContext().getContext("/myapp/").getRequestDispatcher("/myapp/myarc
> h.jsp").forward(request, response);
>
> Dan
>
> ----- Original Message -----
> From: "Marcelo Demestri" < kausario@hotmail.com
<mailto:kausario@hotmail.com> >
> To: "Tomcat Users List" < tomcat-user@jakarta.apache.org
<mailto:tomcat-user@jakarta.apache.org> >
> Sent: Tuesday, January 22, 2002 8:51 PM
> Subject: Context problem (I think)
>
>
> > Hi everybody!
> > I have a little question for you:
> >
> > I have a servlet that responds requests like
> > http://localhost:8080/servlet/myservlet?param1=value1
<http://localhost:8080/servlet/myservlet?param1=value1&param2=value2>
&param2=value2
> > With those parameters he knows what application must deploy. He generate
a
> > path like this: "/myapp/myarch.jsp"
> > But instead of looking for it within "/myapp", apparently it looks for
> > within "/ROOT/myapp"
> > I want to move my jsp pages outside the "webapps" folder.
> > I try with context:
> >
> > i.e. <Context path="/myapp" docBase="c:/Project/myapp" debug="0"
> > reloadable="true"/>
> >
> > But when my servlet generate the string "/myapp/myarch.jsp", he always
> look
> > into "/ROOT/myapp" instead of  "c:/Project/myapp/".  He doesn't
recognize
> > the "/myapp" like a web application (a context).
> > The stranger of all this is that in JRun+IIS (with virtual directories
> > created in < home > of IIS) my servlet works, that is to say, it finds
the
> > jsp's! And I read Craig in a previous mail say VirtualDirectory
> > (IIS)=Context (TC)
> >
> > Some idea, explanation or suggestion?
> > Very many thanks to all...
> >
> >
> > Marcelo



Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message