Tomcat - Help

Hi all,

I am using Tomcat 5.0.28 web server for my Application

i need to modify ( add a Line ) the Page displaying while Accessing

http://<ServerName>:<portNum> ( ie the Tomcat index Page ).

For that i changed the $CATALINA_HOME/webapps/ROOT/index.jsp file.

then i restarted Tomcat.

But the Change didnot happen to the page.

then i removed all the Content of the same file and restarted the Tomcat, getting same page i viewed before.

is the file is auto generated at run time?

How can i add some lines to this (index.jsp) page ?

Pls help.

Thanks.

Ganesh

[646 byte] By [GaneshNarayana] at [2007-10-2 11:43:53]
# 1

Define a welcome-file in your web.xml

Here's how you do it

<welcome-file-list>

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

</welcome-file-list>

It should be the last element in your web.xml

Also, is your war file deployed as ROOT.war?

cheers,

ram.

Madathil_Prasada at 2007-7-13 5:41:52 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

Sir,

I have the application, say mis( mis.war ). this have a Index file and entry in web.xml as u mentioned. But for accessing this i have to type

http://hostname:port/mis

: and working fine .

While accessing http://hostname:port

we can view the Default page of tomcat. What i want is to add some Lines to this file( you can see the File path Mentioned in the Page itself , index.jsp ). i added some lines and not reflecting in result.

ROOT dir of tomcat/ webapps is a default dir with Tomcat.

Now i found that the Code of index.jsp is autogenerated from catalina-root.jar situated at

webapps\ROOT\WEB-INF\lib

how can i modify the Jar file.?

i unzipped the jar file, modified code, again zipped and tried. not working...

Thanks,

Ganesh

GaneshNarayana at 2007-7-13 5:41:52 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

Hmmm...that should work. Did you delete the exploded directory called ROOT from webapps when you restarted with your changes ?

If you just require the default index.html of root page, you can create your own web application, have the default index page with your changes as the index page for the war and put it as ROOT.war :)

ram.

Madathil_Prasada at 2007-7-13 5:41:52 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
Hi,Statement(s)ROOT is a default Dir of Tom cat With out any war file.Steps1 . Delete ROOT dir.2 . Create a new War (ROOT.war) with index.jspdeploy the war in tomcat and try.Correct?
GaneshNarayana at 2007-7-13 5:41:53 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
Hi sir,it is Working Fine...Thankyou,Ganesh
GaneshNarayana at 2007-7-13 5:41:53 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 6
You are welsome.By the way, ROOT dir is also created out of ROOT.warAlso that shows how you specify your web app as the root - just name it as ROOT.war ;)ram.
Madathil_Prasada at 2007-7-13 5:41:53 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...