tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Todd Gamber" <tgam...@texturemedia.com>
Subject RE: Tomcat 5.5 redirect vs. forward behavior with welcome-file-list
Date Mon, 12 Feb 2007 22:38:47 GMT
Hassan,

I couldn't seem to get
request.getAttribute("javax.servlet.forward.servlet_path") to work in my
situation (it returns null, maybe because its being called from a custom
tag?), but Stefan's suggestion of request.getServletPath() accomplishes just
what I need. 

Thank you for your response, and to Stefan as well,
Todd

-----Original Message-----
From: Hassan Schroeder [mailto:hassan.schroeder@gmail.com] 
Sent: Monday, February 12, 2007 2:52 PM
To: Tomcat Users List
Subject: Re: Tomcat 5.5 redirect vs. forward behavior with welcome-file-list

On 2/12/07, Todd Gamber <tgamber@texturemedia.com> wrote:

> I realize that populating content based on what's in the URL bar is not
the
> best design, but I can't seem to find another way to definitively get the
> name of the actual JSP being requested.

TSSIYF -- The Servlet Spec is your friend :-)

SRV.8.4.2 Forwarded Request Parameters
   Except for servlets obtained by using the getNamedDispatcher
  method, a servlet that has been invoked by another servlet using
  the forward method of RequestDispatcher has access to the path
  of the original request.

  The following request attributes must be set:
    javax.servlet.forward.request_uri
    javax.servlet.forward.context_path
    javax.servlet.forward.servlet_path
    javax.servlet.forward.path_info
    javax.servlet.forward.query_string

HTH!
-- 
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org




---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message