This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Tomcat and the fly likes web.xml configuration question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "web.xml configuration question" Watch "web.xml configuration question" New topic

web.xml configuration question

Jazzy Sanchez
Ranch Hand

Joined: Apr 02, 2006
Posts: 35
Hi guys. I am using struts on apache tomcat. What I want is to set the default "index" page to a struts defined page instead to a specific file (e.g. index.jsp)

So inside the web.xml file, what should be the content of the line:

This DID NOT work:

Thank you so much in advance.
[ July 02, 2007: Message edited by: Jazzy Sanchez ]
Yogendra Joshi
Ranch Hand

Joined: Apr 04, 2006
Posts: 213
Hi Jazzy ,

You are missing the parent tag here...


It should be

try changing it and restart tomcat and check.

Cheers ,

Yogendra N Joshi.

Meri Zindagi Hain Tab Tak.. Jab Tak Tera Sahara.... Har Taraf Tu Hi Tu Hain SAI Tera Hi Hain Nazara.....
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308

To my best of knowledge , this tag should ideally contain only name of file.

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

So if you give URL as http://localhost:8080/context/jsp then automatically
http://localhost:8080/context/jsp/index.jsp would be rendered.

Rahul Bhattacharjee
LinkedIn - Blog
Jazzy Sanchez
Ranch Hand

Joined: Apr 02, 2006
Posts: 35
Yogenda, there's a parent tag. I just didn't include it in my message. That did not work though.

Now, how can i make a struts defined page as my application default page?

I am thinking to redirect my index.jsp to a struts defined page but it may be not good in terms of Search Engine Optimization.

Thanks in advance!
Renato Losio
Ranch Hand

Joined: Nov 23, 2005
Posts: 99
You can use a jsp:forward in the page but why do you need it? Don't use welcome-file-list at all- Just map the servlet directly. Probably I'm missing something here...


Renato Losio - -
Jazzy Sanchez
Ranch Hand

Joined: Apr 02, 2006
Posts: 35
That's what im trying to do Renato. Since i am using struts, i want every page of the application to be access via struts and no jsp pages will be access directly. Including the default page.
I agree. Here's the link:
subject: web.xml configuration question
It's not a secret anymore!