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
3
votes
1 answer

Django urlpatterns frustrating problem with trailing slashes

All of the examples I can find of urlpatterns for django sites have a separate entry for incoming urls that have no leading slash, or the root folder. Then they handle subfolders on each individual line. I don't understand why a simple /? regular…
sansjoe
  • 262
  • 3
  • 14
3
votes
1 answer

java.lang.IllegalArgumentException: Invalid MyServlet in servlet mapping

I am trying to learn J2EE by myself. Started with Servlets .. So I have downloaded an eclipse for J2ee ., first couple of days tomcat runs very well... but nowadays , it's not running, infact it's giving errors , i.e Server Tomcat v8.0 Server at…
Archana Sarang
  • 101
  • 1
  • 9
3
votes
3 answers

url pattern for html file in web.xml

we know how to set url pattern for servlet but I am unable to set url pattern for html in web.xml, can u help me to find solution, I googled but, can't able to get it, please find below for my problem.
Selva
  • 546
  • 5
  • 12
  • 34
3
votes
2 answers

Servlet path "/" returns that servlet content for any request pattern

When I map servlet with path as like: Home1Servlet com.project.servlets.Home1Servlet Home1Servlet
nullptr
  • 3,320
  • 7
  • 35
  • 68
3
votes
3 answers

web.xml URL pattern matching question for Tomcat

I'd like to use this kind of a pattern for my Java web app: /*/test.html and then parse the URL in the servlet to get what the value of the star is, and use that value to query a different table in the database. However…
Murat Ayfer
  • 3,894
  • 6
  • 29
  • 26
3
votes
1 answer

How do I get the requests for a servlet implementing CometProcessor interface to pass through a filter

I have a servlet implementing CometProcessor and I am trying to get the requests coming to this servlet to pass through a filter. Specifying the servlet in web.xml under does not make the requests to the servlet to pass through the filter. I also…
user2020498
  • 135
  • 1
  • 8
3
votes
3 answers

What difference does putting a 'forward slash' at the end, make to a url?

What is the difference between the 2 URL's : http://localhost:8084/D_Nappster/NewServlet/ and http://localhost:8084/D_Nappster/NewServlet The first URL gets me a 404 response,while the second one works as expected. From web.xml…
saplingPro
  • 20,769
  • 53
  • 137
  • 195
3
votes
1 answer

Servlet url pattern with wildcard in the middle

I'm working on an HttpServlet and trying to define a url-pattern with a wildcard, but not finding much documentation. The path I want to capture is "resource/{id}/action" I've tried my annotation as: @WebServlet("/resource/*/action") but this…
Nathan
  • 1,396
  • 3
  • 18
  • 32
3
votes
3 answers

Redirection in Django URLs

How do I redirect all URLs starting from a particular pattern to another? Description: I want to be able to redirect as follows: /pattern1/step1/ to /pattern2/step1/ /pattern1/step2/ to /pattern2/step2/ /pattern1/continue/ to…
Alagappan Ramu
  • 2,270
  • 7
  • 27
  • 37
3
votes
2 answers

Using regular expressions for filter-mapping

I know I cannot use regular expressions for the url-pattern of a filter-mapping, but I wanted to know if it is possible somehow to map the filter using something like /foo/.+/*
DanC
  • 8,595
  • 9
  • 42
  • 64
2
votes
1 answer

Servlet URL patterns on Google App Engine

I'm trying to do some simple work with url-pattern that works well on localhost but fails when the application is deployed on the GAE server. What I want to do is next: One servlet to serve all requests This servlet will forward some requests to…
Marto
  • 21
  • 1
  • 3
2
votes
2 answers

url-pattern Servlet Tomcat 7.0

I'm studying JSP/Servlet by myself. And I'm facing a problem that I'm able to solve. I'm creating a simple form that will request a servlet. The problem is when I change the url-pattern in the web.xml to a url that I want, the Tomcat give me an…
Camus
  • 827
  • 2
  • 20
  • 36
2
votes
1 answer

How can I match deep link URL patterns in the Android well-known assetlinks.json file?

I have an Android app which needs to handle deep links, and I have installed a /.well-known/assetlinks.json file as documented. I am hoping I can use the assetlinks.json file to specify a more complex URL matching pattern than the…
Ben
  • 1,881
  • 17
  • 20
2
votes
1 answer

Django URL Pattern Syntax - raw string

What is the difference between: path('index/', views... And path(r'^index/$', views... I use the first example but I see everyone using the raw string syntax in examples I look up. Are there any differences between the way Django handles the two…
2
votes
1 answer

Why django can't recognize 2 path convertors from each other?

I have a django application and I have 2 url paths that are only different in the last part which is the path convertors: path('questions/', views.QuestionDetailView.as_view(), name='question_detail'), path('questions/',…
Yasaman Shokri
  • 145
  • 1
  • 1
  • 11