You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Michael Gesundheit <mi...@rocketmail.com> on 2012/03/15 16:40:02 UTC

Document base/ Document root

Hi,
I have a problem which assume has to do with my document base.My environmet is Jboss.I keep getting the 404 page always saying the the page:"AppName/whatever" is not found.AppName is my servlet context.
I'm unable to determine my document base.Question: Is the a way in which I can find what does the internal TomCat sees asĀ document base?Or is there a way to force TomCat to use a specific directory as the doc root?
Any advice will be appreciated.
Thanks,-MichaelĀ 

Re: Document base/ Document root

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

Michael,

On 3/15/12 11:40 AM, Michael Gesundheit wrote:
> I have a problem which assume has to do with my document base.My 
> environmet is Jboss.I keep getting the 404 page always saying the
> the page:"AppName/whatever" is not found.AppName is my servlet
> context.

So you are getting 404 errors? What resource are you trying to access?
Is it static or dynamic? If dynamic, is it properly mapped in
WEB-INF/web.xml?

Do you have a web server in front of JBoss? If so, what does the
configuration look like?

> I'm unable to determine my document base.Question: Is the a way in 
> which I can find what does the internal TomCat sees as document 
> base?Or is there a way to force TomCat to use a specific directory
> as the doc root?

You might be confused by what web servers (like httpd) typically call
a DocumentRoot. In Tomcat, there are two relevant directories that
could be what you are talking about:

1. appBase - this is an attribute of <Host> that specifies where
   webapps are "usually" placed on the file system. In a default
   configuration, webapps placed there (in a directory or as a WAR
   file) are automatically deployed on startup.

2. docBase - this is an attribute of <Context> that may only be
   specified when you are placing a context.xml file (named
   appname.xml) into Tomcat's conf/ directory structure. The docbase
   points to the directory or WAR file that contains the webapp.
   This is the closest thing to DocumentRoot you can get in Tomcat.

If you are talking about docBase, then there's no reason you should be
setting it to anything at all: everything is auto-detected if you
deploy your webapp in any standard way.

As long as your URI looks like this:

/context/resource

then you ought to be able to find 'resource' here:

/path/to/webapp/resource

Note that the 'context' is part of the URI but doesn't get added to
your webapp's docBase (since the context prefix and the docBase are
usually the same).

Hope that helps,
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk9iMA8ACgkQ9CaO5/Lv0PCFxACZASl5jVVcVCgC8Qh2HfChvqtS
nIwAn2Q8ZCV65g23DLLC2j8KwFGoZ9xc
=LXAk
-----END PGP SIGNATURE-----

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


Re: Document base/ Document root

Posted by Pid * <pi...@pidster.com>.
On 15 Mar 2012, at 15:40, Michael Gesundheit <mi...@rocketmail.com> wrote:

> Hi,
> I have a problem which assume has to do with my document base.My environmet is Jboss.I keep getting the 404 page always saying the the page:"AppName/whatever" is not found.AppName is my servlet context.
> I'm unable to determine my document base.Question: Is the a way in which I can find what does the internal TomCat sees as document base?Or is there a way to force TomCat to use a specific directory as the doc root?
> Any advice will be appreciated.
> Thanks,-Michael


Probably a JBoss config problem, no?


p

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