Web application directory structure

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Web application directory structure

Joe Becknell
I'm new to Tomcat and having a problem I thought someone could help me with.
I have an application with servlet installed under webapps. I can run the
servlet without problems. The servlet creates a page that gets sent to the
browser with some links to some (HTML and XML) data files on it. When I
click on one of the links, I get a 404 (resource not available) error, even
though the file exists under my web application location. My setup is
(basically, I'm not at work, so I can't remember it exactly):
 
webapps\testapp\index.html
webapps\testapp\WEB-INF\web.xml
webapps\testapp\WEB-INF\classes\servlet.class
webapps\testapp\WEB-INF\src\servlet.java
webapps\testapp\data\test1.html
 
in my server.xml config file I have:
 
<Context path="/testapp" docBase="testapp" debug="0" reloadable="true">
 
although I don't think I need this since my app is located under the webapps
directory. Navigating to:
 
http://localhost:8080/testapp/index.html works fine, but navigating to
 
http://localhost:8080/testapp/data/test1.html gives me the 404 error. I was
under the imression that I could place files anywhere under the application
root (docBase) directory. Am I missing something here. Configuration
oversight?
 
Thanks for any information.
Joe.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: Web application directory structure

David Smith-2
You're right in that it should work.  I can only guess the most likely
reason this might fail is your web.xml configuration.  Look for servlet
mappings that might catch the data/test1.html url.  Your log files
should have more information.  Also check to be sure the tomcat service
has read privilege on the file and it's directory.

--David

Joe Becknell wrote:

>I'm new to Tomcat and having a problem I thought someone could help me with.
>I have an application with servlet installed under webapps. I can run the
>servlet without problems. The servlet creates a page that gets sent to the
>browser with some links to some (HTML and XML) data files on it. When I
>click on one of the links, I get a 404 (resource not available) error, even
>though the file exists under my web application location. My setup is
>(basically, I'm not at work, so I can't remember it exactly):
>
>webapps\testapp\index.html
>webapps\testapp\WEB-INF\web.xml
>webapps\testapp\WEB-INF\classes\servlet.class
>webapps\testapp\WEB-INF\src\servlet.java
>webapps\testapp\data\test1.html
>
>in my server.xml config file I have:
>
><Context path="/testapp" docBase="testapp" debug="0" reloadable="true">
>
>although I don't think I need this since my app is located under the webapps
>directory. Navigating to:
>
>http://localhost:8080/testapp/index.html works fine, but navigating to
>
>http://localhost:8080/testapp/data/test1.html gives me the 404 error. I was
>under the imression that I could place files anywhere under the application
>root (docBase) directory. Am I missing something here. Configuration
>oversight?
>
>Thanks for any information.
>Joe.
>
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: Web application directory structure

Brian Stephens
In reply to this post by Joe Becknell
Are you using the autoDeploy or deployOnStartup feature (usually in the
Host configuration in server.xml)?  If you manually specify a Context
and use one of the automatic deployment features, you're likely to have
issues with your application; at least I did.  Try setting both of those
parameters to false, manually exploding your .war file, then restarting
Tomcat.

-----Original Message-----
From: David Smith [mailto:[hidden email]]
Sent: Wednesday, July 27, 2005 6:55 AM
To: Tomcat Users List
Subject: Re: Web application directory structure

You're right in that it should work.  I can only guess the most likely
reason this might fail is your web.xml configuration.  Look for servlet
mappings that might catch the data/test1.html url.  Your log files
should have more information.  Also check to be sure the tomcat service
has read privilege on the file and it's directory.

--David

Joe Becknell wrote:

>I'm new to Tomcat and having a problem I thought someone could help me
with.
>I have an application with servlet installed under webapps. I can run
>the servlet without problems. The servlet creates a page that gets sent

>to the browser with some links to some (HTML and XML) data files on it.

>When I click on one of the links, I get a 404 (resource not available)
>error, even though the file exists under my web application location.
>My setup is (basically, I'm not at work, so I can't remember it
exactly):

>
>webapps\testapp\index.html
>webapps\testapp\WEB-INF\web.xml
>webapps\testapp\WEB-INF\classes\servlet.class
>webapps\testapp\WEB-INF\src\servlet.java
>webapps\testapp\data\test1.html
>
>in my server.xml config file I have:
>
><Context path="/testapp" docBase="testapp" debug="0" reloadable="true">
>
>although I don't think I need this since my app is located under the
>webapps directory. Navigating to:
>
>http://localhost:8080/testapp/index.html works fine, but navigating to
>
>http://localhost:8080/testapp/data/test1.html gives me the 404 error. I

>was under the imression that I could place files anywhere under the
>application root (docBase) directory. Am I missing something here.
>Configuration oversight?
>
>Thanks for any information.
>Joe.
>
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Web application directory structure

Joe Becknell
In reply to this post by David Smith-2
Thanks. I found out my problem. I wasn't going after
the path with the correct case. I wasn't aware that
Tomcat, by default, is case sensitive. Doohh!

--- David Smith <[hidden email]> wrote:

> You're right in that it should work.  I can only
> guess the most likely
> reason this might fail is your web.xml
> configuration.  Look for servlet
> mappings that might catch the data/test1.html url.
> Your log files
> should have more information.  Also check to be sure
> the tomcat service
> has read privilege on the file and it's directory.
>
> --David
>
> Joe Becknell wrote:
>
> >I'm new to Tomcat and having a problem I thought
> someone could help me with.
> >I have an application with servlet installed under
> webapps. I can run the
> >servlet without problems. The servlet creates a
> page that gets sent to the
> >browser with some links to some (HTML and XML) data
> files on it. When I
> >click on one of the links, I get a 404 (resource
> not available) error, even
> >though the file exists under my web application
> location. My setup is
> >(basically, I'm not at work, so I can't remember it
> exactly):
> >
> >webapps\testapp\index.html
> >webapps\testapp\WEB-INF\web.xml
> >webapps\testapp\WEB-INF\classes\servlet.class
> >webapps\testapp\WEB-INF\src\servlet.java
> >webapps\testapp\data\test1.html
> >
> >in my server.xml config file I have:
> >
> ><Context path="/testapp" docBase="testapp"
> debug="0" reloadable="true">
> >
> >although I don't think I need this since my app is
> located under the webapps
> >directory. Navigating to:
> >
> >http://localhost:8080/testapp/index.html works
> fine, but navigating to
> >
> >http://localhost:8080/testapp/data/test1.html gives
> me the 404 error. I was
> >under the imression that I could place files
> anywhere under the application
> >root (docBase) directory. Am I missing something
> here. Configuration
> >oversight?
> >
> >Thanks for any information.
> >Joe.
> >
> >
> >
> >  
> >
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [hidden email]
> For additional commands, e-mail:
> [hidden email]
>
>


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]