You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Thomas Schweikle <tp...@vr-web.de> on 2007/09/20 00:01:16 UTC

changing the default application

Hi!

How can I change the default application from the tomcat
"ROOT/index.jsp" page to an application installed in
"$CATALINA_HOME/Catalina/localhost/app.xml"?

I found the default application in "web.xml" and changed it from

    <servlet-mapping>
        <servlet-name>default</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>

to

    <servlet-mapping>
        <servlet-name>default</servlet-name>
        <url-pattern>/tomcat</url-pattern>
    </servlet-mapping>

For the web application I defined (in
"$CATALINA_HOME/Cataline/localhost/app.xml"):

<Context
   path="/"
   docBase="/opt/app"
   debug="0"
   reloadable="false">
   <Logger
      className="org.apache.catalina.logger.FileLogger"
      prefix="mywebapp."
      suffix=".log"
      timestamp="true"/>
</Context>

but after restarting tomcat it seemd not to have any effect: calling
http://server:8080/tomcat did just not work and give back an error
404 - resource not available.

http://server:8080/ did work, but returned the tomcat default page.
My own webapp was not reachable at all.

Any idea what I am missing?

-- 
Thomas


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


RE: changing the default application

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: news [mailto:news@sea.gmane.org] On Behalf Of Thomas Schweikle
> Subject: changing the default application
> 
> How can I change the default application from the tomcat
> "ROOT/index.jsp" page to an application installed in
> "$CATALINA_HOME/Catalina/localhost/app.xml"?

Name your application ROOT - that's your only choice.  If you use a
<Context> element in conf/Catalina/[host]/ROOT.xml, store your app
outside of the <Host>'s appBase directory and use the docBase attribute
to point to it.

> I found the default application in "web.xml" and changed it from
>     <servlet-mapping>
>         <servlet-name>default</servlet-name>
>         <url-pattern>/</url-pattern>
>     </servlet-mapping>

You're confused.  That's the default _servlet_, not the default webapp.
That servlet is needed to deliver all static content.  Change it back to
the way you found it and leave it alone.

> For the web application I defined (in
> "$CATALINA_HOME/Cataline/localhost/app.xml"):
> <Context path="/"

The path attribute is not allowed in this instance; the file containing
the <Context> element must be named ROOT.xml for it to be treated as the
default webapp.

> Any idea what I am missing?

Lots - see the above.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

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


Re: changing the default application

Posted by Pid <p...@pidster.com>.
Thomas Schweikle wrote:
> Hi!
> 
> How can I change the default application from the tomcat
> "ROOT/index.jsp" page to an application installed in
> "$CATALINA_HOME/Catalina/localhost/app.xml"?
> 
> I found the default application in "web.xml" and changed it from
> 
>     <servlet-mapping>
>         <servlet-name>default</servlet-name>
>         <url-pattern>/</url-pattern>
>     </servlet-mapping>
> 
> to
> 
>     <servlet-mapping>
>         <servlet-name>default</servlet-name>
>         <url-pattern>/tomcat</url-pattern>
>     </servlet-mapping>

That's not going to help. You should probably put it back the way it
was.  That's the *default servlet* not the default application.

> For the web application I defined (in
> "$CATALINA_HOME/Cataline/localhost/app.xml"):
> 
> <Context
>    path="/"
>    docBase="/opt/app"
>    debug="0"
>    reloadable="false">
>    <Logger
>       className="org.apache.catalina.logger.FileLogger"
>       prefix="mywebapp."
>       suffix=".log"
>       timestamp="true"/>
> </Context>

That also is not going to work, mostly because you're changing the wrong
application.

> but after restarting tomcat it seemd not to have any effect: calling
> http://server:8080/tomcat did just not work and give back an error
> 404 - resource not available.

That's becau... see above.

> http://server:8080/ did work, but returned the tomcat default page.
> My own webapp was not reachable at all.
> 
> Any idea what I am missing?
> 

You've not stated which version of Tomcat you're using, and to hazard a
guess, you're missing some quality time spent in the company of the docs.

Reply with your server version and I'll talk you through it.

p





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