The problem is a combination of things. You have
import org.springframework.web.portlet.ModelAndView;
and
@RequestMapping(value="create",method=RequestMethod.GET)
public ModelAndView create(){
return new ModelAndView("create","user",new User());
}
The ModelAndView
from the portlet library is not a default recognized return type for the DispatcherServlet
stack. As such, it will be considered as a plain Object
and added to the model itself. Because your URI is .../create
, Spring will use that last path element to map to a view. So it will end up resolving your create.jsp
as a view but for the wrong reasons.
Change your ModelAndView
to
import org.springframework.web.servlet.ModelAndView;
I don't know why you have a portlet dependency, but get rid of it if you don't need it.
You're also missing
<mvc:annotation-driven />
from your servlet context.
You're <servlet>
is mapped to
<servlet-mapping>
<servlet-name>servlet_1</servlet-name>
<url-pattern>*.html</url-pattern>
</servlet-mapping>
so it's unclear to me what URL you're sending your request to, ../create.html
?