Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

web.xml configuration question

 
Jazzy Sanchez
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jazzy ,

You are missing the parent tag here...

<welcome-file-list></welcome-file-list>..

It should be

try changing it and restart tomcat and check.

Cheers ,

Yogendra N Joshi.
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<welcome-file>/jsp/index.jsp</welcome-file>

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.
 
Jazzy Sanchez
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Jazzy Sanchez
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic