I have the following mapping:
@RequestMapping(value = \"/{first}/**/{last}\", method = RequestMethod.GET)
public String test(@PathVariable(\"first\") String firs
It could be done by writing a custom path matcher and configuring Spring to use it. For example, such a solution is documented here: http://java.dzone.com/articles/spring-3-webmvc-optional-path
The link provides a custom path matcher and shows how to configure spring to use it. That should solve your need if you don't mind writing a custom component.
Also, this is a duplicate of With Spring 3.0, can I make an optional path variable?