Questions tagged [servlet-mapping]
74 questions
52
votes
2 answers
What is the significance of url-pattern in web.xml and how to configure servlet?
I have manually configured web.xml for my application. Now, I'm facing issues while running my application. I'm trying to access my servlet from my jsp page. But, it is throwing error as page not found.
The servlets are placed under below folder…

gkumar
- 521
- 1
- 4
- 4
44
votes
2 answers
java.lang.IllegalArgumentException: Invalid in servlet mapping
MM
16
votes
1 answer
Why FacesServlet cannot have a url-pattern of /*.?
This is my web.xml :
Faces Servlet
/*
When I navigate to:
http://localhost:8080/LearningRoot/index.xhtml
I can see the page just fine, however when I…

Koray Tugay
- 22,894
- 45
- 188
- 319
13
votes
2 answers
Why should url-pattern in servlet mapping start with forward slash(/)
I was reading Head First JSP and Servlets book. I was going through the mapping of servlet. And my doubt here is
test
…

Avinash Reddy
- 2,204
- 3
- 25
- 44
10
votes
3 answers
How to use .jsf extension in URLs?
I'm developing a JSF 2 web application. For prestige purpouses I would like that every URL ends with .jsf extension. Now it ends with .xhtml. If I change it directly to .jsf in web browser address bar, then a HTTP 500 error is shown.
How can I set…

Tomas
- 111
- 1
- 1
- 7
8
votes
2 answers
Could not resolve view with name 'htmlviews/index.html' in servlet with name 'dispatcher' using javaconfig
I get such exception:
javax.servlet.ServletException: Could not resolve view with name 'htmlviews/index.html' in servlet with name…

Edgar
- 1,120
- 4
- 28
- 53
7
votes
1 answer
java.lang.IllegalArgumentException: Servlet mapping specifies an unknown servlet name GCMBroadcast
I'm trying to incorporate GCM(Google cloud messaging) in my android app. For this, I have been following this tutorial. Comments below it report success, so definitely the problem is on my side and not the tutorial.
Info-
I'm running latest Eclipse…

Akash Agarwal
- 2,326
- 1
- 27
- 57
3
votes
1 answer
Any way of mapping java servlet using simple regex?
I need to map /Test to a servlet Test.java and also /anything/Test to the same servlet. I read that /*/Test won't work in web.xml as it doesn't accept regex.
Is there any alternate way of doing it using filters ? I can't use Tuckey URL filter due to…

Sanchit Saxena
- 161
- 9
3
votes
2 answers
JSF render template to text/plain
I've got a (working) JSF app. Now i want a document that is not a page resource (let's say a plain text document) to be expanded using the JSF expression language (as i need state from my beans and this seems "natural"). But it seems i don't get…

mtraut
- 4,720
- 3
- 24
- 33
3
votes
2 answers
java.lang.IllegalArgumentException: Servlet mapping specifies an unknown servlet name
When I try run my project I get error
Caused by: java.lang.IllegalArgumentException: Servlet mapping specifies an unknown servlet name dispatcher
at org.apache.catalina.core.StandardContext.addServletMapping(StandardContext.java:3156)
at…

Narkan
- 31
- 1
- 1
- 2
2
votes
1 answer
Spring Boot does not serve a static resource
Spring Boot does not serve a static resource if there is a method in the controller with a suitable path template.
I am currently reading the book "Spring Boot in Action" (2015). There is an example project in the second chapter.
The project has the…

Yaroslav Tarasenko
- 31
- 5
2
votes
1 answer
How to include JSPs into others that have servlet mapping to change the URL?
I have a main file (main.jsp) which includes multiple other JSPs.
I've added some servlet mapping to main.jsp to change the url from:
folder/appname/main.jsp
to:
appname/
Here is my web.xml:
Main
…

Xander
- 991
- 1
- 13
- 32
2
votes
3 answers
Weblogic 12.2.1.0.0 disable default base URI pattern value (resources)
Pre-requsitions:
WebLogic Server Version: 12.2.1.0.0
Common Java web-application deployed
Started using Jersey client library
Issue:
Right after that /resources/ URI has been mapped/handled by (embedded) WebLogic JAX-RS/Jersey servlet handler.
WL…

Taraskin
- 561
- 9
- 15
2
votes
3 answers
IllegalArgumentException: The servlets named [Hello] and [com.crunchify.jsp.servlet.HelloCrunchify] are both mapped to the url-pattern
I have created a dynamic web project in eclipse as mentioned in this doc: sampledoc
When I run the program in server, I get this error in the console:
Caused by: java.lang.IllegalArgumentException: The servlets named [Hello] and…

Sweet
- 187
- 3
- 15
2
votes
2 answers
java.lang.IllegalArgumentException: Invalid SolrServlet1 in servlet mapping
I have created a JSP page and from this page i will invoke a servlet and process something and redirect back to same JSP.
But when i deploy only JSP all is fine. But when i include my servlet in a project tomcat 8 fails to start and it throws below…

AVINASH
- 108
- 1
- 12