Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java Open Source > Apache Tomcat
|
Apache Tomcat General discussion of the Apache Tomcat servlet container. For discussions specific to the Professional Apache Tomcat book, please see the book discussion forum for that book.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Apache Tomcat section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 17th, 2008, 10:50 AM
Registered User
 
Join Date: May 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to deepakkotla
Default url mapping for jsp in tomcat

To access my jsp's in tomcat, url is http://locatlhost:port/appName/jsp/home.jsp
but i don't want to see appName/jsp in the above url without changing the name of the folder(jsp in appName.war) in war file.

Is there anyway i can specify in the web.xml saying all request starts with http://localhost:port/ to redirect / refer to jsp.
ie
if i type http://locatlhost:port/ it should call internally http://locatlhost:port/appName/jsp/home.jsp

Thanks in advance.

Deepak Kotla :)

Kotla V L Deepak
 
Old March 20th, 2008, 07:58 AM
Friend of Wrox
 
Join Date: Mar 2007
Posts: 373
Thanks: 0
Thanked 1 Time in 1 Post
Default

You can write a servlet which gets called for one sort of requests [like yourdomain/app/somename] and forward those requests to desired targets [like domain/app/jsp/xyz.jsp].

If you are talking just about home page then you can configure it in your web.xml's <welcome-file-list> tag. You can also create servlet mapping for a jsp page like
<servlet>
   <servlet-name></servlet-name>
   <jsp-file></jsp-file>
</servelt>

and the mapping using <servlet-mapping>


- Rakesh





Similar Threads
Thread Thread Starter Forum Replies Last Post
Tomcat URL mapping question colinexl Apache Tomcat 1 October 17th, 2007 10:20 PM
url mapping and regular expressions rudgr BOOK: Professional ASP.NET 2.0 and Special Edition; ISBN: 978-0-7645-7610-2; ISBN: 978-0-470-04178-9 3 February 4th, 2006 08:46 AM
How to remove URL rewriting using tomcat config or mintnovate Apache Tomcat 0 November 13th, 2005 01:01 AM
jsp in tomcat damo Apache Tomcat 1 February 15th, 2005 01:32 PM
url mapping for jsp in tomcat rams279 Apache Tomcat 1 July 16th, 2004 06:10 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.