url-mapping

Yii2 Url Mapping Suffix

邮差的信 提交于 2019-12-10 11:18:32
问题 i have some simular Url Mapping in Yii2: 'urlManager' => [ 'enablePrettyUrl' => true, 'showScriptName' => false, 'rules' => [ ['pattern'=>'pages','route'=>'pages/index', 'suffix'=>'/'], ['pattern'=>'pages/<id:\d+>','route'=>'pages/single', 'suffix'=>'.html'], ]] So, urls: domain.com/pages/ - works fine domain.com/pages - E404 domain.com/pages/321.html - works fine domain.com/pages/321 - E404 If i remove suffix parameter from config array, then: domain.com/pages/ - E404 domain.com/pages -

Spring MVC - No mapping found for HTTP request with URI [duplicate]

非 Y 不嫁゛ 提交于 2019-12-08 04:09:28
问题 This question already has answers here : Why does Spring MVC respond with a 404 and report “No mapping found for HTTP request with URI […] in DispatcherServlet”? (7 answers) Closed 2 years ago . I'm aware that there are loads of questions on the topic but none of the solutions i found here worked for me. I'm using Spring with Jetty 6 so i don't have a web.xml file. The mapping for the spring dispatcher servlet is set to "/" in jetty's config dispatcher: <bean class="org.mortbay.jetty.servlet

Spring application not mapping in Tomcat

一笑奈何 提交于 2019-12-07 21:18:22
问题 I'm convinced I have something setup wrong somewhere but I can't figure out where as I have tried following multiple tutorials and solution (viralpatel.net, stackoverlow question, another stackoverflow question) but I cannot deploy a simple HelloWorld Spring MVC to tomcat. I have tried multiple tutorials on multiple machines (windows 7 and os x 10.7), and I end up with the same issue. The main tutorial I was following was the mykong Spring 3 MVC hello World example , I even tried to download

Spring MVC multiple url mapping to the same controller method

我的未来我决定 提交于 2019-12-07 12:41:54
问题 Let's say we have 3 url-patterns for a servlet named dispatcher in web.xml: <servlet-mapping> <servlet-name>dispatcher</servlet-name> <url-pattern>/aaa/*</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>dispatcher</servlet-name> <url-pattern>/bbb/*</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>dispatcher</servlet-name> <url-pattern>/ccc/*</url-pattern> </servlet-mapping> and a controller method: @RequestMapping(value = "/xxx", method = RequestMethod.POST)

Spring MVC - No mapping found for HTTP request with URI [duplicate]

喜你入骨 提交于 2019-12-07 12:33:28
This question already has answers here : Why does Spring MVC respond with a 404 and report “No mapping found for HTTP request with URI […] in DispatcherServlet”? (7 answers) Closed 2 years ago . I'm aware that there are loads of questions on the topic but none of the solutions i found here worked for me. I'm using Spring with Jetty 6 so i don't have a web.xml file. The mapping for the spring dispatcher servlet is set to "/" in jetty's config dispatcher: <bean class="org.mortbay.jetty.servlet.ServletHolder"> <property name="name" value="spring" /> <property name="servlet"> <bean class="org

How to detect Fragment identifiers in Url Mappings?

爷,独闯天下 提交于 2019-12-07 11:55:17
问题 In a Grails project I'm trying to map a Url based on whether or not a Fragment Identifier is present in the Url. The Fragment Identifiers are important because a Flash library SWFAddress uses them to communicate to a Flash application present in the web page. I simply need to determine whether a fragment is present or not in the Request url. Should I look into HttpServletRequest to do this? What's the best way in Grails to route a url based on whether a Fragment Identifier is present in a Url

Spring Controller's URL request mapping not working as expected

自作多情 提交于 2019-12-06 03:22:00
问题 I have created a mapping in web.xml something like this: <servlet> <servlet-name>dispatcher</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>dispatcher</servlet-name> <url-pattern>/about/*</url-pattern> </servlet-mapping> In my controller I have something like this: import org.springframework.stereotype.Controller; @Controller public class MyController{

Spring MVC multiple url mapping to the same controller method

孤者浪人 提交于 2019-12-05 21:29:24
Let's say we have 3 url-patterns for a servlet named dispatcher in web.xml: <servlet-mapping> <servlet-name>dispatcher</servlet-name> <url-pattern>/aaa/*</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>dispatcher</servlet-name> <url-pattern>/bbb/*</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>dispatcher</servlet-name> <url-pattern>/ccc/*</url-pattern> </servlet-mapping> and a controller method: @RequestMapping(value = "/xxx", method = RequestMethod.POST) public String foo() {} Since the path value in @RequestMapping does not contain servlet path, when users

How to detect Fragment identifiers in Url Mappings?

时光毁灭记忆、已成空白 提交于 2019-12-05 18:29:15
In a Grails project I'm trying to map a Url based on whether or not a Fragment Identifier is present in the Url. The Fragment Identifiers are important because a Flash library SWFAddress uses them to communicate to a Flash application present in the web page. I simply need to determine whether a fragment is present or not in the Request url. Should I look into HttpServletRequest to do this? What's the best way in Grails to route a url based on whether a Fragment Identifier is present in a Url? [I asked this same question at the Grails forum .] A fragment identifier is not part of a URL, it is

RESTful grails application: DRYing up UrlMapping

风流意气都作罢 提交于 2019-12-04 21:33:50
问题 Let's say we have a grails web application exposing several resources. tags urls users The application has a classical web-interface which the users interact with and some administration. We want to expose the resources from the application to clients via a RESTful API and we don't want that part of the app to clutter up the controllers and code we already have. So we came up with the following: If the web interface offers host/app_path/url/[list|show|create] we want the REST API to be at