tag:blogger.com,1999:blog-3237724005744642470.post9122791831225577628..comments2020-09-27T17:41:07.221+01:00Comments on Captain Debug's Blog: Accessing Path Variables in Spring MVCRoger Hugheshttp://www.blogger.com/profile/07042290171112551665[email protected]Blogger1125tag:blogger.com,1999:blog-3237724005744642470.post-16941069436611004922011-07-14T09:36:10.988+01:002011-07-14T09:36:10.988+01:00Nice post! A neat little extra is that if you add...Nice post!<br /><br />A neat little extra is that if you add the @RequestMapping to the class, rather than the method, you can still access path variables.<br /><br />e.g.<br /><br />@RequestMapping(&quot;/help/{myVariable}&quot;)<br />class MyClass {<br /><br /> public String displayHelpDetail(@PathVariable(&quot;myVariable&quot;) myVariable) { ... }<br /><br />}Adam Perryhttps://www.blogger.com/profile/16839632259862699051[email protected]