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.
Questions tagged [url-pattern]
379 questions
2
votes
1 answer
Servlet URL pattern to match all URL
I'm current using Spring MVC to do a project. I having problem using the url-pattern to direct my jsp page. Everytime I create a new jsp page, I have to hardcode the jsp name into the web.xml.
web.xml

Khee
- 39
- 1
- 7
2
votes
2 answers
Django urlpattern with infinite number of parameters
Is it possible to define Django urlpattern, which would get any number of same type parameters and pass them to a view?
Lets say I want to create a page which gets a list of numbers from url and sums them. So these would be valid…

niekas
- 8,187
- 7
- 40
- 58
2
votes
2 answers
How to restrict web server written in golang to allow a particular address instead of a pattern?
When I use
http.HandleFunc("/", serveRest) //serveRest is the method to handle request
http.ListenAndServe("localhost:4000", nil)
It will accept all request starting with "/". How do I restrict it to serve only "localhost:4000" instead of every…

Shailesh
- 367
- 1
- 5
- 15
2
votes
2 answers
Error in servlet url pattern matching implementation
I'm implementing the Servlet URL pattern matching follow the Servlet Specification. My matching method:
public static boolean match(String pattern, String str, boolean isCaseSensitive) {
char[] patArr = pattern.toCharArray();
char[]…

Barcelona
- 2,122
- 4
- 21
- 42
2
votes
0 answers
UriTemplate matching with optional trailing slash
I'm using the Spring Web UriTemplate for some URL matching. In the following example, the second assert fails because of the mismatched slash at the end of the URL:
UriTemplate uriTemplate = new UriTemplate("/myservice/{version}/stuff");
String…

metacubed
- 7,031
- 6
- 36
- 65
2
votes
1 answer
Django URL pattern to include a #
I'm having issues getting a URL pattern to work.
The URL is in the format of the following:
/API#access_token=&expires_in=
I can't change the #access_token=&expires_in= part unfortunately, as this is outside of my control, and I…

Stewart Polley
- 224
- 1
- 2
- 9
2
votes
1 answer
Django URLconf: How to use captured params in include's RedirectView?
I have a parent URLconf:
from django.conf.urls import include, patterns, url
urlpatterns = patterns('',
(r'^main/(?P[^/]+)/(?P[^/]+)/(?P[^/]+)/', include('foo')),
)
And a child URLconf (included in the parent) that includes a…

jawns317
- 1,726
- 2
- 17
- 26
2
votes
4 answers
url-pattern /* serves jsp files and static assets as seperate requests
I have a simple servlet which renders different content based on different geo locations
for example:
example.com/us
example.com/de
example.com/uk
example.com/..
so actually the servlet should supports all geo locations as url-pattern. So thats why…

tokhi
- 21,044
- 23
- 95
- 105
2
votes
2 answers
What is the difference between these url mapping patterns?
What is the difference between these url mappings ?
/servlet
and
/servlet/*
and
/*
and
*.do

user3590092
- 37
- 5
2
votes
2 answers
Difference between servlet url-pattern / and /*
What is the difference between:
dispatcher
/
And:
dispatcher
…

ruslanys
- 1,183
- 2
- 13
- 25
2
votes
2 answers
Spring MVC url pattern - keeps appending the controller
I have a Spring MVC app.
This is the web.xml

madhairsilence
- 3,787
- 2
- 35
- 76
2
votes
1 answer
WebFilter urlPatterns ignored
I have read numerous examples though I seem to have an 'exact' copy of them, so I cannot figure out why my filter will execute when I navigate to /login instead of /restricted/*.
I have tried both annotations (as in the example below) and XML to…

Menno
- 12,175
- 14
- 56
- 88
2
votes
3 answers
Image not displayed on JSP page
I have a simple JSP page that has one image that is part of the JSP page but that image is not displayed when I view the webpage. I can view the webpage but it does not include the image.
I have my img folder located in several places because I…

user1701556
- 47
- 2
- 2
- 8
2
votes
1 answer
Prefix URL-Mapping in JSF causing FileNotFound-Error
I´m a JSF-Beginner and try to build a small JSF2 webapplication with Spring and Hibernate. My Server of Choice is the JBOSS 7.1 AS.
I´ve encountered an odd Error while trying to map a servlet with a Prefix URL-Pattern. This is the part of the…

Xecu
- 101
- 1
- 5
2
votes
0 answers
Relative prefix for django urlpatterns?
I tried doing something like
urlpatterns = patterns('.persons.views',
)
in my urls.py file with the directories looking like
main folder
\profile
\person
urls.py <- this is the file
urls.py
but I got the error "relative imports…

Derek
- 11,980
- 26
- 103
- 162