views:

110

answers:

0

My controller's action looks like:

@RequestMapping(value = "/tp/{userid}")
    public ModelAndView TestParams(@PathVariable("userid") String userId)  {

        ModelAndView mv = new ModelAndView("testparams");

        mv.addObject("userid", userId);


        return mv;
    }

My Jsp simply is suppose to output the {userid} value in the querystring.

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
  <head><title>Simple jsp page</title></head>
  <body> User id is: ${userid} Place your content here</body>
</html>

My springmvc2-servlet.xml has:

<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver" p:prefix="/WEB-INF/jsp/"
        p:suffix=".jsp" p:order="2"/>

So when I try the Url:

http://localhost:8080/tp/234

I get the error:

HTTP Status 404 - /WEB-INF/jsp/tp/234.jsp

Having that setting to append /web-inf/ and .jsp is causing this issue. Can I still have that and grab values from the url using @PathVariable?