Questions tagged [url-pattern]

The URL-pattern element of servlet-mapping or filter-mapping associates a filter or servlet with a set of URLs. When using this tag on implementation heavy questions - tag the code language the implementation is written in.

379 questions
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
12
votes
1 answer

Error: /login.xhtml Not Found in ExternalContext as a Resource

I'm using JBoss 7.1 with JSF 2.1/Prime Faces and keep running into the error listed in the title. I've tried many of the suggestions made here and all end up with the same error. File structure is: WEB-INF faces login.xhtml I have the…
Chris K.
  • 692
  • 3
  • 8
  • 14
11
votes
5 answers

Basic Spring MVC config: PageNotFound using InternalResourceViewResolver

I'm trying to get a first Spring 3 MVC setup running. My app is running on tomcat, with in the server context of "grapevine" For the purposes of testing, I'm trying to get requests from http://localhost:8080/grapevine/test to render the contents of…
Marty Pitt
  • 28,822
  • 36
  • 122
  • 195
11
votes
1 answer

how to exclude a url in filtermapping

web.xml SessionCheckFilter filter.SessionCheckFilter SessionCheckFilter
galao
  • 1,281
  • 8
  • 26
  • 50
10
votes
2 answers

Servlet @WebServlet urlPatterns

This is a quick question but I couldn't find a quick answer. Now I have a servlet BaseServlet, when user request any of the url below: host host/ host/BaseServlet It should always refer to the same servlet and redirect to the homepage. When I…
kakacii
  • 728
  • 3
  • 10
  • 24
10
votes
2 answers

Wildcard path for servlet?

Having an @WebServlet(urlPatterns = "/myServlet/"). If the user goes to myapp/myServlet/other, I still want my servlet to catch. So to say, wildcard anything on after the servlet path. How could I do this?
membersound
  • 81,582
  • 193
  • 585
  • 1,120
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
9
votes
1 answer

/faces/index.xhtml Not Found in ExternalContext as a Resource in Glassfish

I am getting this error while launching application. com.sun.faces.context.FacesFileNotFoundException: /faces/index.xhtml Not Found in ExternalContext as a Resource This is the context of web.xml:
user2634009
  • 279
  • 1
  • 4
  • 11
9
votes
1 answer

Catch-all (wildcard) servlet url-pattern overrides file extension patterns

I would like to achieve the following: /webapp-context/Page-1 -> Handled by my custom "ContentServlet" /webapp-context/Another-Page -> Handled by my custom "ContentServlet" /webapp-context/Page-with-long-title -> Handled by my…
Reto Höhener
  • 5,419
  • 4
  • 39
  • 79
8
votes
1 answer

Wiremock not matching regex

I'm using wiremock to mock certain requests and their respective response, but I'm trying to add a regex. Unfortunately, this just throws an exception stating that the request was not matched. { "request" : { "method": "GET", …
masha.knezevic
  • 121
  • 1
  • 1
  • 8
8
votes
1 answer

Pagination with URL path or the query parameters

I am working on writing a blog and came across two different alternatives on the internet for making pagination. I couldn't decide which to use. Url types are like ; blog/page/2 blog/?page=2 Does one of these have an advantage over the other?
safaer
  • 191
  • 1
  • 2
  • 11
8
votes
2 answers

Servlet URL pattern to match a URL that ends with a slash ("/")

I'd like to specify a Servlet URL pattern to match a URL that ends with a slash ("/") and only a slash. I understand that the pattern /example/path/* will match a URL of http://example.com/example/path/ and that this appears to work.…
Jon Cram
  • 16,609
  • 24
  • 76
  • 107
8
votes
1 answer

Servlet filter url mapping

How can a filter be mapped to the root of a URL? I'm using Tomcat 7.0.2 and deploying an application as ROOT.war. The welcome page is sign_in.xhtml. I would like to run a filter whenever the client sends a request for the root of the site (i.e.…
J. Andrew Laughlin
  • 1,926
  • 3
  • 21
  • 33
8
votes
4 answers

Django1.4: Generic way to set language links in template to work with i18n_patterns?

I started to play with new i18n_patterns in Django 1.4. Basically, i want to have language links for each of my supported languages on all of my templates headers. I have implemented my header as a separate template that is being included in other…
7
votes
2 answers

Modifing urlpatterns at runtime in Django

I'm developping a Django application that requires to load dynamic modules (at runtime). Now I'm able to upload (from client browser to server) "plugins" and register the plugin model in the database, etc. But I need a way to handle the urlpatterns…
user1302007
  • 101
  • 1
  • 5
1
2
3
25 26