• 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

Aliasing in tomcat for a jsp

 
Ranch Hand
Posts: 220
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 VI Editor Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 VI Editor Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic