Announcement Announcement Module
Collapse
No announcement yet.
@RequestMapping - unexpected pattern matching Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • @RequestMapping - unexpected pattern matching

    Hi all,

    Using annotations I've mapped following URL.

    Code:
    @RequestMapping("/signup")
    public String signUp(@Valid User user) {
    }
    In config I've mapped a view-controller as follows.

    Code:
    <mvc:view-controller path="/signup.jsp" view-name="underconstruction" />
    The issue is requests to URL /signup.jsp are getting mapped to /signup.

    Using debugged I narrowed it down to org.springframework.web.servlet.mvc.condition.Patt ernsRequestCondition which tries to match /signup using /signup.*.

    Code:
    private String getMatchingPattern(String pattern, String lookupPath) {
    .
    .
    if (this.useSuffixPatternMatch) {
    	boolean hasSuffix = pattern.indexOf('.') != -1;
    	if (!hasSuffix && this.pathMatcher.match(pattern + ".*", lookupPath)) {
    		return pattern + ".*";
    	}
    }
    .
    .
    }
    After some Google I found following relevant resources.

    http://stackoverflow.com/questions/9...ar-expressions
    http://forum.springsource.org/showthread.php?120192
    http://static.springsource.org/sprin...erMapping.html

    Based on this I tried following config.

    Code:
    <bean id="handlerMapping" class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping">
    	<property name="useSuffixPatternMatch" value="false"/>
    </bean>
    But it didn't work.

    I'll keep trying. Meanwhile, any suggestions?

    Thanks,
    Santosh.
Working...
X