You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Lachlan Hunt <la...@iinet.net.au> on 2004/06/03 04:35:09 UTC

Hiding Implementation using Tomcat 5

Hi,
   I'm in the process of rebuilding the website for the company I work 
for, with JSP using Tomcat 5.  Is there a way to hide the implementation 
from the URI, so that the extension does not need to be typed to get the 
resource.
eg.
If I have a file:
   /foo/bar.jsp
How can I set up the server, so that if I type in the URI
   http://www.example.com/foo/bar
I actually get bar.jsp delivered, rather than a 404 Not Found error.

   From what I've been able to find and read, it seems possible to do 
this using Apache HTTP Server content negotiation, so is it possible 
using Apache Tomcat 5?

-- 
Lachlan Hunt

lachlan.hunt@lachy.id.au
http://www.lachy.id.au/


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Hiding Implementation using Tomcat 5

Posted by Harry Mantheakis <ha...@mantheakis.freeserve.co.uk>.
Hello

You can register your JSPs (just like you can servlets) in the deployment
descriptor, and then map them to a URL pattern of your choice.

Have a look at this link:

http://edocs.bea.com/wls/docs70/webapp/components.html#145275

If you only register a JSP (but do not define a mapping for it) you can
invoke it using the ServletContext.getNamedDispatcher( String ) method where
'String' is the registered name of the JSP.

The getNamedDispatcher method is useful when you do not want clients to be
able to access JSPs directly - but only via 'controller' servlets which
process requests before invoking any JSPs.

Good luck.

Harry Mantheakis
London, UK


> Hi,
>  I'm in the process of rebuilding the website for the company I work
> for, with JSP using Tomcat 5.  Is there a way to hide the implementation
> from the URI, so that the extension does not need to be typed to get the
> resource.
> eg.
> If I have a file:
>  /foo/bar.jsp
> How can I set up the server, so that if I type in the URI
>  http://www.example.com/foo/bar
> I actually get bar.jsp delivered, rather than a 404 Not Found error.
> 
>  From what I've been able to find and read, it seems possible to do
> this using Apache HTTP Server content negotiation, so is it possible
> using Apache Tomcat 5?


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org