You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by satya mahapatra <sa...@yahoo.com> on 2008/12/27 15:24:52 UTC

HTTP Status 404

Hi,

I have created sample web application using MyEclipse6.5. There is just one
welcome page is there. When I am giving the Context path I am expecting the
welcome page should be displayed. The entry in the web.xml file is as
follows.

<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>


The web.xml file is inside \WebRoot\WEB-INF\web.xml. According to this I
have modified the context.xml inside Tomcat 6.0\conf as below.

<WatchedResource>/WebRoot/WEB-INF/web.xml</WatchedResource>

But still its not able to pick the web.xml and thats why showing 404 error.
Any idea where else I need to change?

But when I removed the WebRoot folder and only kept the WEB-INF folder
directly inside the context path then its working fine.

Is there any way to customize the directory structure of the web application
and please let me know where i am going wrong.

Thanks,
Satya
-- 
View this message in context: http://www.nabble.com/HTTP-Status-404-tp21184492p21184492.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


Re: HTTP Status 404

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Satya,

satya mahapatra wrote:
> The web.xml file is inside \WebRoot\WEB-INF\web.xml. According to this I
> have modified the context.xml inside Tomcat 6.0\conf as below.
> 
> <WatchedResource>/WebRoot/WEB-INF/web.xml</WatchedResource>

AFAICT, <WatchedResource> expects resources to be relative to the
application's root, so you really want this:

<WatchedResource>WEB-INF/web.xml</WatchedResource>

...if your application's name is "WebRoot".

Note that web.xml is "watched" by default, and you don't need this extra
setting. Also note that you shouldn't be changing conf/context.xml. If
you want to customize your own application's deployment, then use a
context.xml file in the META-INF directory of your web application
instead of modifying the server-wide config file.

> But still its not able to pick the web.xml and thats why showing 404 error.
> Any idea where else I need to change?
> 
> But when I removed the WebRoot folder and only kept the WEB-INF folder
> directly inside the context path then its working fine.

I suspect that you have your application "deployed" within the ROOT app
and thus not properly deployed. Does your directory structure look like
this:

ROOT
  - WebRoot
     - WEB-INF
        - web.xml

??

If that's the case, your application is improperly deployed. Either
deploy "WebRoot" at the same level as the ROOT directory (to deploy your
application as "WebRoot"), or move everything from WebRoot up to ROOT
(to deploy your application as the root application).

> Is there any way to customize the directory structure of the web application
> and please let me know where i am going wrong.

There is only one acceptable directory structure for a web application
and that is to have WEB-INF at the top-level of the application's
deployment directory (or WAR file).

If you are still having problems, please give more detail about where
your files are,

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAklr3ogACgkQ9CaO5/Lv0PAIQwCff/AnAlsTKJq/mBwpg6pyalaR
AUoAn235r5fDHnrt02WB/RkV9BhN2/bc
=xBKM
-----END PGP SIGNATURE-----

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