This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Tomcat and the fly likes Can we edit Tomcat default home page? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Can we edit Tomcat default home page?" Watch "Can we edit Tomcat default home page?" New topic
Author

Can we edit Tomcat default home page?

ravi kanth
Ranch Hand

Joined: Jun 04, 2008
Posts: 36
hi all,
can we edit tomcat default page (to place user defined applications )? if so can any body tell me how to do this..




thanks in advance.
rrk
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60785
    
  65

Why would you edit an existing page rather than create your own web application?

Or are you really asking how to make your own application the root application?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
ravi kanth
Ranch Hand

Joined: Jun 04, 2008
Posts: 36
thanks Bear Bibeault,

just i want add some links to default page that is to already existing links like Administration,Documentation etc.i want to add myownlinks tab.



thanks,
rrk
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41125
    
  45
You can co this. Just be aware that the ROOT web app is set up in a strange way by default. The index.jsp page isn't used, but instead there's a JSP/servlet mapped to index.jsp (which you can find in a jar file in WEB-INF/lib).


Ping & DNS - my free Android networking tools app
ravi kanth
Ranch Hand

Joined: Jun 04, 2008
Posts: 36
thnaks Ulf Dittmer ,

can you provide some more clarity on the post..





thanks,
rrk.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41125
    
  45
Which part is confusing you? Have you looked at the ROOT web app, its web.xml file, the index.jsp file and the contents of the jar file?
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1179

Originally posted by Ulf Dittmer:
Which part is confusing you? Have you looked at the ROOT web app, its web.xml file, the index.jsp file and the contents of the jar file?


In Tomcat 6.0.18 - which is the one I current have installed - there are no classes nor lib folder i WEB-INF. This means that changes to index.jsp will be made available automatically.

I will however give Ulf right, that in earlier versions of Tomcat it was as he described.


Regards, Rene Larsen
Dropbox Invite
Mathews P Srampikal
Ranch Hand

Joined: Nov 26, 2002
Posts: 211
Ravi,

I faced the same problem with tomcat earlier version and tried to change the index.jsp more than 10-15 times to see the changes.

So for your web application please follow the following steps.

1. create a new dir <test> under webapps
2. create WEB-INF dir under <test> dir
3. create web.xml (OR copy the web.xml from tomcat-docs\WEB-INF\web.xml) in newly created WEB-INF dir
4. create a index.jsp in <test> dir
5. start tomcat
6. http://localhost:8080/test
7. you will get index.jsp displayed.
8. you are done now....start exploring from here.

Thanks,
Mats.


Thanks,
Mathews
ravi kanth
Ranch Hand

Joined: Jun 04, 2008
Posts: 36
thnaks Ulf Dittmer ,

can you provide some more clarity on the post..





thanks,
rrk.
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1179

What is it that you want info about??

Which version of Tomcat do you have??
ravi kanth
Ranch Hand

Joined: Jun 04, 2008
Posts: 36
thanks Mathews ,

i have created structure like that,but i am not getting .
its status code it showing is 404.
ravi kanth
Ranch Hand

Joined: Jun 04, 2008
Posts: 36
i am using tomcat 5.0.28 version..
please explain me.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41125
    
  45
For Tomcat 5 what I wrote would apply, in other words, you'd alter the ROOT web app.
Mathews P Srampikal
Ranch Hand

Joined: Nov 26, 2002
Posts: 211
Ravi,

do you have a index.jsp in test dir.if not create one and test.

Thanks,
Mats.
Joel Sander
Ranch Hand

Joined: Jan 09, 2009
Posts: 38
Mathews P Srampikal wrote:Ravi,

I faced the same problem with tomcat earlier version and tried to change the index.jsp more than 10-15 times to see the changes.

So for your web application please follow the following steps.

1. create a new dir <test> under webapps
2. create WEB-INF dir under <test> dir
3. create web.xml (OR copy the web.xml from tomcat-docs\WEB-INF\web.xml) in newly created WEB-INF dir
4. create a index.jsp in <test> dir
5. start tomcat
6. http://localhost:8080/test
7. you will get index.jsp displayed.
8. you are done now....start exploring from here.

Thanks,
Mats.


I'm a newbie with tomcat and am facing the same (or similar) problem here using Tomcat 6.0.18. I followed all your steps with two exceptions. In step 3., my copy of tomcat does not have a tomcat-docs directory. However, there is a conf directory containing a web.xml file which I tried copying to the location you suggested. In step 6, I just typed 'http://localhost:8080/test' in as the url. All I get are 404 errors. I would like to have the user redirected to my existing index.jsp file.

Thanks!

Edit: Copying the web.xml file over caused every webpage (including my index.jsp) to return a 404 error.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can we edit Tomcat default home page?
 
Similar Threads
Context path question
error-code using jsp
Locating a file from servlet using a relative path
Tomcat 6 on Windows 7
administration and manager access