Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / October 2005

Tip: Looking for answers? Try searching our database.

Tomcat JSP displaying file list

Thread view: 
subscriptions@easypeas.net - 14 Oct 2005 10:37 GMT
Hi,

I'm putting together a JSP/Servlet webapp for shortening URLs.  It
works fine if I install it as a sub-directory of my domain for instance
"example.com/linker."  But I need it to be the root webapp for my
domain; when I do this, however, I get a directory listing instead.   I
get the listing whether or not I go through connectors, thus
"example.com:8080" also shows the listing, but
"example.com:8080/linker" does not.

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>

I'm linking from Apache to Tomcat 5.5 via ajp13/mod_jk2.  The 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."

Any ideas?

Thanks,
Walter Gildersleeve
Freiburg, Germany

Here are links to the actual on-line application:
http://linkfrog.net (should work, doesn't though)
http://linkfrog.net:8080 (doesn't work either)
http://linkfrog.net/linker (works)
http://linkfrog.net:8080/linker (also works)
subscriptions@easypeas.net - 14 Oct 2005 10:41 GMT
It just occurred to me how off-topic this post is.  Sorry in advance,
and it won't happen again!  Now I'm off to find a Tomcat group to post
this to.
subscriptions@easypeas.net - 19 Oct 2005 12:19 GMT
Well, it's working, though I'm not quite sure why.  I added autoDeploy
and deployOnStartup attributes; maybe that was the problem.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.