接着上一篇 ,在springmvc.xml配置文件中配置

<!-- 视图解析器(框架) -->  
<!-- 在这里将传来的success变成/jsp/success.jsp-->
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/jsp/"/> <property name="suffix" value=".jsp"/> </bean>



在对应的action中修改为
public class HelloAction implements Controller {

@Override
public ModelAndView handleRequest(HttpServletRequest arg0,
HttpServletResponse arg1) throws Exception {
ModelAndView modelAndView = new ModelAndView();
modelAndView.addObject("message", "这是我第一个springmvc应用程序");
modelAndView.setViewName("success");//这里个本是/jsp/success.jsp的
return modelAndView;
}

}