Apache Server configuration support - JSP root webapp displaying directory

This is Interesting: Free IT Magazines  
Home > Archive > Apache Server configuration support > October 2005 > JSP root webapp displaying directory





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author JSP root webapp displaying directory
NullBock

2005-10-24, 4:44 pm

Hi,

I'm putting together a JSP/Servlet webapp for shortening URLs--it can
be found at http://linkfrog.net. It works fine when the actual
directory is included with the URL, ie, http://linkfrog.net/linker.
But it needs to be accessed as a root webapp , which unfortunately
displays the directory instead. I'm using AJP13/mod_2k connections,
but I don't imagine the problem is there, since is does this whether I
use port 8080 or not (http://linkfrog.net:8080 doesn't work any
better).

I don't have a welcome-file, nor do I have a catch-all servlet mapping.
What I do have is a catch-all filter-mapping, thus:

<filter-mapping>
<filter-name>ControllerFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

The ControllerFilter then links to the required resource, be it local
or remote. Here are all the servlet filters that I use:

<servlet-mapping>
<servlet-name>MainPage</servlet-name>
<url-pattern>/start</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>ErrorPage</servlet-name>
<url-pattern>/error</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>SubmitLinkServlet</servlet-name>
<url-pattern>/submitLink</url-pattern>
</servlet-mapping>

The pertinent Host entry in my server.xml file looks like this:

<Host name="example.com" appBase="/usr/local/tomcat/webapps.other">
<Context path="" docBase="linker" debug="0"/>
</Host>

with the webapp being at "/usr/local/tomcat/webapps.other/linker."
I've tried setting appBase to the webapp sub-directory itself, w/o
success.

I've also played with different filter-mappings, like
<url-pattern>/</url-pattern> <url-pattern></url-pattern>. They don't
make any difference. Also, I cannot use a default servlet filter,
since I need access to various local resource (images, style sheets,
jsps and the like), plus any dynamically-created link mnemonics. Using
a default servlet mapping merely results in inifinite loops.

Any ideas?

Thanks,
Walter Gildersleeve
Freiburg, Germany

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com