• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

does global forward work for this case ?

 
Artemesia Lakener
Ranch Hand
Posts: 162
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A simple question -- I have an /index.jsp which serves as the beginning page for my application. I don't like to use "index.jsp" in the URL, instead I like to use something like "/myapplication" in the URL and it should automatically "forward" to this index.jsp.

I checked "global forward" but I don't know how I can use it for this case. I also checked "action" in the "action-mapping", this seems suits me. Can I simply do

<action-mapping>
<action path="/myapplication" forward="/index.jsp"/>

?
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If index.jsp is the starting point for your application and it doesn't require any processing prior to being displayed, you don't really need to define a forward for it at all. Just include the following in your web.xml file:

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

If you do this, when you specify the server name and context root (e.g. myserver.com/myApplication ) the web container will automatically call index.jsp.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic