• Post Reply Bookmark Topic Watch Topic
  • New Topic

Aliasing in tomcat for a jsp  RSS feed

 
Ranch Hand
Posts: 220
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
i am runnnig a webappliction on tomcat4.1 . i have the URL like

http://inteserver.intranet.citi.com/app/public/jsp/index.jsp


and unless i type all this, am not getting the home page.
so is there a way,where in i can cut short and make an alias for this,which helps me redirect to homepage without describing all this?


Thanks
Raj
 
Ranch Hand
Posts: 820
IntelliJ IDE Tomcat Server VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have something like the following in your web.xml file?



This should enable you to
navigate to http://inteserver.intranet.citi.com/yourServlet/ and see your application.

The way I have it, the servlet forwards to my index.jsp with a line like:

pageForward( "/index.jsp", req, res);


[ January 25, 2005: Message edited by: Tim McGuire ]
[ January 25, 2005: Message edited by: Tim McGuire ]
 
Rajendar Goud
Ranch Hand
Posts: 220
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim,
iam making use of tag
<welcome-file-list>
<welcome-file>
public/jsp/index.jsp
</welcome-file>
</welcome-file-list>
from the web.xml

and the servlet mapping is
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>

how can i implement what you had suggested?
 
Tim McGuire
Ranch Hand
Posts: 820
IntelliJ IDE Tomcat Server VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So you have a servlet called action and that servlet should have a service method in there, So, add code to handle default behavior with a pageforward():


disclaimer:
I inherited parts of the above code and so learned to use it that way,
but there might be a better way to do it.
 
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make your app the 'default' webapp and add index.jsp to your welcome-file-list if it isn't already.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!