Don Brown wrote:
I believe it is technically possible to do this, but not at all
intuitive right now. This is probably my number one improvement
request for the REST plugin.
You should be able change the wildcard mapper to one that recognizes
named wildcards then use them in your namespace annotation like this:
@Namespace("/book/{bookId}")
Don
Yeah, I use this feature heavily to support URIs matching Mike's
requirement.
in struts.xml
<bean type="com.opensymphony.xwork2.util.PatternMatcher"
name="namedVariablePatternMatcher"
class="com.opensymphony.xwork2.util.NamedVariablePatternMatcher"/>
in *actions.*.ChapterContoller.java
@Namespace("/book/{bookId}")
public class ChapterController implements ModelDriven<Chapter> {
private void setBookId(Long id) {...}
private void setId(Long id) { ..}
private Chapter getModel() {...}
public HttpHeaders show() {
model = bookService.lookupChapter(bookid, id);
if (model != null) {
return new DefaultHttpHeaders("show");
} else {
return new DefaultHttpHeaders("error");
}
}
public HttpHeaders index() {...}
}
and
in *actions.BookContoller.java
@Namespace("/")
public class BookController implements ModelDriven<Book> { }
regards,
Jeromy Evans
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]