springMVC版本3.1.2-REALSE web容器:jetty java版本:1.7
问题描述: 下面这个bean没起作用...不知道错哪里
<bean class="org.springframework.web.servlet.view.UrlBasedViewResolver">
<property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
<property name="prefix" value="/WEB-INF/jsp/"/>
<property name="suffix" value=".jsp"/>
</bean>
public class StartControl implements Controller {
public ModelAndView handleRequest(HttpServletRequest request,
HttpServletResponse response) throws Exception {
System.out.println("controller is working");
return new ModelAndView("start");
//404错误 改成new ModelAndView("/WEB-INF/jsp/start.jsp");就没问题的...
}
}
分不多, 就20..希望大家帮忙看看问题在哪里...
springMVC
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"><property name="prefix" value="/WEB-INF/jsp/" />
<property name="suffix" value=".jsp" />
</bean>
试试这个。。把你的web.xml配置 贴上来看看