• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

web.xml configuration question

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic