url-mapping

Grails urlmapping using id and name

心已入冬 提交于 2019-12-23 15:37:38
问题 hey all, i have a question about urlmapping in grails. I'm trying to make seo friendly url's using a page name and id. I got the follwing in my URLMapping: class UrlMappings { static mappings = { "/$id/$name"{ controller = "page" action = "view" } "500"(view:'/error') "/"(controller:"index") } } Witch is working, but.... the id won't clear in the urlbar, so the first time i click a link all goes well: http://localhost:8080/SuurdGasControl/2/Gasmetingen But for the next page it shows: http:/

I can't start tomcat 7 server on linux openshift - Failed to start end point associated with ProtocolHandler [“http-nio-12345”]

。_饼干妹妹 提交于 2019-12-23 06:08:49
问题 I've checked out this question which is very similar to mine, however the difference is I'm using a port > 1024 (i.e. I'm using port 12345) which is what the answerer said to do. I'm trying to run a Tomcat instance on an Openshift server.. Any help is appreciated! Thanks! My execution script is as follows: nohup java -Xms384m -Xmx412m -jar target/*.war --server.port=12345 Note the "-jar" is this right? I am deploying a .war file not a .jar? I think.. Sorry, a little new to this. The important

Grails UrlMappings with URL-pattern ending with “/”

*爱你&永不变心* 提交于 2019-12-22 10:34:53
问题 I have the following UrlMapping in my Grails UrlMappings class: "/$something/" { controller = "controllerName" action = "actionName" constraints { } } Requests to both "/foobar/" and "/foobar" gets routed to the correct controller and action. However, URL:s created using g:link does not end with slash ("/") as expected. The GSP code ... <g:link controller="controllerName" action="actionName" params="[something: 'foobar']">...</g:link> ... generates the HTML output ... <a href="/foobar">...</a

Launching a grails-app through Intelli-J with root set to localhost:8080/ instead of localhost:8080/app, or modifying createLink?

穿精又带淫゛_ 提交于 2019-12-21 21:53:48
问题 Is there a way to launch an application through Intelli-J so that it makes localhost:8080/ the root of the application? The problem I'm having is that AJAX urls that work locally don't work in production, and createLink(action:"ajaxUpdate") seems to create references to /app/ajaxUpdate , which works locally but not in production. Is there a way to fix createLink to work in both locations? I thought perhaps I could just use UrlMappings to make all the ajax calls pretty and just refer to

How to create custom url in Yii [duplicate]

坚强是说给别人听的谎言 提交于 2019-12-21 06:22:20
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: How to make user profile link like facebook for my web page How do i manage custom url for user profile like www.exampl.com/brito insted of www.exampl.com/user/profile/id/22 www.exampl.com/jhon insted of www.exampl.com/user/profile/id/31 www.exampl.com/piter insted of www.exampl.com/user/profile/id/66 I have done below code in my config/main.php file, now its works for this 3 static users only. how can i change

How to create custom url in Yii [duplicate]

倖福魔咒の 提交于 2019-12-21 06:21:39
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: How to make user profile link like facebook for my web page How do i manage custom url for user profile like www.exampl.com/brito insted of www.exampl.com/user/profile/id/22 www.exampl.com/jhon insted of www.exampl.com/user/profile/id/31 www.exampl.com/piter insted of www.exampl.com/user/profile/id/66 I have done below code in my config/main.php file, now its works for this 3 static users only. how can i change

How to specify url mappings in ASP.NET 4.0 when parameters are involved?

冷暖自知 提交于 2019-12-20 04:39:07
问题 The problem I have a web site with some articles inside. Articles are accessed using a database writing results on a single page. When a certain article is to be accessed, I need the article-id and I only need to get to the page: http://www.mysite/Articles.aspx?a={article-id} . This is nice but not really friendly and not scalable. What I want to do is to redirect every url in the form: http://www.mysite/articles/{article-id} to the page http://www.mysite/Articles.aspx?a={article-id} . I know

Adding UrlMapping constraints to a VERB-mapped url?

家住魔仙堡 提交于 2019-12-14 03:21:48
问题 Is it possible to add constraints to HTTP verb-matched Url Mappings? Here's my current definition: "/a/$param1/b" { controller = "a" action = [GET: 'method1', POST: 'method2' ] } 回答1: Sure, this seems to work: "/rest/$controller/$id?"(parseRequest:true) { action = [GET: "show", POST: "update", PUT:"save", DELETE:"delete"] constraints { id(matches:/[0-9]+/) } } 来源: https://stackoverflow.com/questions/5356916/adding-urlmapping-constraints-to-a-verb-mapped-url

Grails “loses” custom URL mapping when following any links on the page

冷暖自知 提交于 2019-12-13 12:19:49
问题 I have an application where users can browse maps in two ways (like thumbnails and in a list) /map/browse /map/list Now, I would like to restrict these views to just show maps of a specific user, for example through /user/3/browse /user/3/list So I created the mapping: "/user/$userId/browse" { controller = "map" action = "browse" } "/user/$userId/list" { controller = "map" action = "list" } Now, I can go to /user/3/browse , but as soon as I click on a pagination link or change the pagination

Does Grails Filter `actionExclude` work with method-based routing?

♀尐吖头ヾ 提交于 2019-12-13 06:48:51
问题 I have a method-based route like: name base: "/" { controller="api" action=[GET: "welcome", POST: "post"] } And I'd like to apply a filter to handle authorization, e.g. class RequestFilters { def filters = { authorizeRequest(controller: 'api', actionExclude: 'welcome') { before = { log.debug("Applying authorization filter.") } } } } But when I apply this in practice, the filter runs on all requests (even GET requests, which should use the welcome method and thus should not trigger this filter