url-pattern

REST API DESIGN - Getting a resource through REST with different parameters but same url pattern

折月煮酒 提交于 2019-11-27 17:04:44
I have a question related to REST url design. I found some relevant posts here: Different RESTful representations of the same resource and here: RESTful url to GET resource by different fields but the responses are not quite clear on what the best practices are and why. Here's an example. I have REST urls for representing "users" resource. I can GET a user with an id or with an email address but the URL representation remains the same for both. Going through a lot of blogs and books I see that people have been doing this in many different ways. For example read this practice in a book and

Spring: Difference of /** and /* with regards to paths

廉价感情. 提交于 2019-11-27 16:44:46
What's the difference between two asterisks instead of one asterisk when we refer to paths? Earlier I was debugging my Spring 3 project. I was trying to add a .swf using <spring:url var="flashy" value="/resources/images/flash.swf"/> With my web.xml's ResourceServlet looking like <servlet-name>Resource Servlet </servlet-name> <url-pattern>/resources/*</url-pattern> But unfortunately I was getting this error: WARN org.springframework.js.resources.ResourceServlet - An attempt to access a protected resource at /images/flash.swf was disallowed. I found it really strange since all my images in the

Basic Spring MVC config: PageNotFound using InternalResourceViewResolver

被刻印的时光 ゝ 提交于 2019-11-27 14:00:15
问题 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 WEB-INF/jsp/noSuchInvitation.jsp When I try this, I'm getting a 404 , and the logs suggest that my jsp isn't present: WARN org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/grapevine/WEB-INF/jsp

REST API DESIGN - Getting a resource through REST with different parameters but same url pattern

佐手、 提交于 2019-11-26 18:49:30
问题 I have a question related to REST url design. I found some relevant posts here: Different RESTful representations of the same resource and here: RESTful url to GET resource by different fields but the responses are not quite clear on what the best practices are and why. Here's an example. I have REST urls for representing "users" resource. I can GET a user with an id or with an email address but the URL representation remains the same for both. Going through a lot of blogs and books I see

Spring: Difference of /** and /* with regards to paths

谁都会走 提交于 2019-11-26 18:44:41
问题 What's the difference between two asterisks instead of one asterisk when we refer to paths? Earlier I was debugging my Spring 3 project. I was trying to add a .swf using <spring:url var="flashy" value="/resources/images/flash.swf"/> With my web.xml's ResourceServlet looking like <servlet-name>Resource Servlet </servlet-name> <url-pattern>/resources/*</url-pattern> But unfortunately I was getting this error: WARN org.springframework.js.resources.ResourceServlet - An attempt to access a

What is the significance of url-pattern in web.xml and how to configure servlet?

廉价感情. 提交于 2019-11-26 10:26:58
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 location <application folder>/WEB-INF/classes/<package> So, what should be the entries for servlets in url-pattern and servlet-mapping . So that, servlet can be accessible through URL. url-pattern is used in web.xml to map your servlet to specific URL. Please see below xml code, similar code you may find in your web.xml configuration file. <servlet>

What is the significance of url-pattern in web.xml and how to configure servlet?

好久不见. 提交于 2019-11-26 05:50:07
问题 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 location <application folder>/WEB-INF/classes/<package> So, what should be the entries for servlets in url-pattern and servlet-mapping . So that, servlet can be accessible through URL. 回答1: url-pattern is used in web.xml to map your servlet to

Sometimes I see JSF URL is *.jsf, sometimes *.xhtml and sometimes /faces/*. Why?

冷暖自知 提交于 2019-11-25 21:53:28
问题 Been try to learn JSF, and sometimes I see the URL is *.jsf and sometimes is *.xhtml or /faces/* . Can someone fill my knowledge, please? When I create a JSF using Facelet, the file extension is .xhtml , so where does .jsf URL extension come from? 回答1: The .jsf extension is where the FacesServlet is during the JSF 1.2 period often mapped on in the web.xml . <servlet-mapping> <servlet-name>facesServlet</servlet-name> <url-pattern>*.jsf</url-pattern> </servlet-mapping> The .xhtml extension is

Difference between / and /* in servlet mapping url pattern

微笑、不失礼 提交于 2019-11-25 21:48:51
问题 The familiar code: <servlet-mapping> <servlet-name>main</servlet-name> <url-pattern>/*</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>main</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> My understanding is that /* maps to http://host:port/context/* . How about / ? It sure doesn\'t map to http://host:port/context root only. In fact, it will accept http://host:port/context/hello , but reject http://host:port/context/hello.jsp . Can anyone explain how is http:/