Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

I cannot get rest plugin to hit my setters

 
Brendan Gibson
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to use Restful URL's like

"/Books/12345"

I can get

"/books/12345"

working, but have been unable to change the Action URL to be able to use one with an initial capital letter.

I have tried

public class BooksController

@Action("/Books")
public HttpHeaders show() {
...
}

public void setId(String id) {
this.id = id;
}

which hits show(), but not setId() if my URL is "/Books/12345", however it still works if my URL is "/books/12345"

How do I get a changed path (from the convention) to hit my setter method?
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What version? (I don't know what the Convention plugin does to URLs during request processing--is there a compelling reason to have upper-case URLs?)
 
Brendan Gibson
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The compelling reason that I am doing this is because the functionality exists (using apache) - I want to port it to using Struts, and we want to respect old bookmarks by using the same URL naming scheme.

I am trying to use version 2.1.2

Perhaps there is another way to read the id. In an interceptor perhaps?
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The issue isn't the id, it's the prefix: did you check the plugin source?
 
Brendan Gibson
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good idea! I'll play with it
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic