tags:

views:

14

answers:

1

My application has internationalization and the language code is in the first part of every path like "/en/dosomething" and "/de/dosomething"

How do i make a single access rule for the "dosomething" resource instead of 2 and still check for "en" and "de"?

A: 

If you are using Spring 3 then you can set your path match to something like this:

@Controller
@RequestMapping("/{language:.*}/dosomething")
public class doSomething {
...

   public void get(@PathVariable String language) {
      ...
   }
}
Gandalf