Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Tomcat web.xml and invalid url -pattern

807607Dec 19 2006 — edited Dec 30 2006
I am using an example found in an IBM tutorial about tomcat and jsp.
I have the following web.xml
<web-app>
	<!-- We give name contacts to our servlet -->
	<servlet>
		<servlet-name>contactsServlet</servlet-name>
		<servlet-class>com.roywmiller.contacts.model2.ContactsServlet</servlet-class>
	</servlet>
	<!-- ContactsServlet will be invoked when user provides url /index.html or any other ending in perfomr -->
	<servlet-mapping>
		<servlet-name>contactsServlet</servlet-name>
		<url-pattern>/index.html</url-pattern>
	</servlet-mapping>
	<servlet-mapping>
		<servlet-name>contactsServlet</servlet-name>
		<url-pattern>*.perform</url-pattern>
	</servlet-mapping>
	<!-- The following servlet comes with Tomcat -->
	<servlet>
		<servlet-name>jspAssign</servlet-name>
		<servlet-class>
			org.apache.jasper.servlet.JspServlet
		</servlet-class>	
		<init-param>
			<param-name>logVerbosityLevel</param-name>
			<param-value>WARNING</param-value>	
		</init-param>
		<init-param>			
			<param-name>fork</param-name>
			<param-value>false</param-value>
		</init-param>	
		<load-on-startup>3</load-on-startup>
	</servlet>
	
	<!--When there is a forward in a jsp the JspServlet is invoked -->
	<servlet-mapping>
		<servlet-name>jspAssign</servlet-name>
		<url-pattern>/*.jsp</url-pattern>
	</servlet-mapping>	
</web-app>		
		
When I am starting tomcat through eclipse I get the
<b>Invalid <url-pattern> /*.jsp in servlet mapping</b> exception
The syntax /*.jsp is not allowed in the web.xml?
When I remove slash I do not have this exception but I cannot go to my jsp page.
I have several actions and the first one my code goes in is an action that
returns return "/" + "contactList.jsp";

Please some help.

Thanking you in advance
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 27 2007
Added on Dec 19 2006
6 comments
1,066 views