1

I am using Eclipse and Tomcat 7, on servlet I just add @WebServlet("className") so that I do not have to use or to put web.xml but when I try to start server (or tomcat) on console window and error occured saying

Starting Servlet Engine: Apache Tomcat/7.0.12 java.lang.IllegalArgumentException: Invalid <url-pattern> FirstHello in servlet mapping at org.apache.catalina.core.StandardContext.addServletMapping(StandardContext.java:3133) at org.apache.catalina.core.StandardContext.addServletMapping(StandardContext.java:3108) ... 

At first I did not put web.xml on project, then when the error shows I try to put web.xml but does not have servlet mapping

<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"> </web-app> 

but still same error messge show on Console window of eclipse.

Anyone who could help me to see any error(s) that I am doing?

Thanks..

1 Answer 1

1

It's an illegal URL mapping pattern. Change FirstHello to /FirstHello

Sign up to request clarification or add additional context in comments.

1 Comment

I missed that part. Thank you sir.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.