50分求助 springmvc 页面跳转问题
新开发的小项目,第一次用springmvc 没用几天,遇到不少问题,现在这个问题实在自己解决不了,该看的帖子都看了,有些理解有些不理解,但都尝试过了,可就是无法实现页面跳转,以下是代码,请大神找出问题:
controller代码,同一controller之间调转
@Controller
@RequestMapping("/tbasCorp")
public class TbasCorpController {
@Resource(name="tbasCorpMgr")
private TbasCorpBulletinboardMgr tbasCorpMgr;
@RequestMapping("getTbasCorpByCode")
public String getTbasCorpByCode(String corpcode) {
System.out.println(corpcode);
TbasCorpBulletinboard tbasCorp = tbasCorpMgr.getTbasCorpByCode(corpcode);
return "redirect:/tbasCorp/initForHistory";
}
@RequestMapping("/initForHistory")
public String initForHistoryForData(String corpcode) {
System.out.println(corpcode);
Map<String, List> dataMap = tbasCorpMgr.initForHistory(corpcode);
dataMap.get("dislist");
dataMap.get("corplist");
dataMap.get("sitelist");
return "/enterpriseInfo";
}
}
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="WebApp_ID" version="2.5">
<display-name>json_test</display-name>
<welcome-file-list>
<welcome-file>/login.jsp</welcome-file>
</welcome-file-list>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:config/spring/spring-*.xml</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>*.css</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>*.gif</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>*.jpg</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>*.js</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>*.png</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>springMVC</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:config/spring/spring-mvc.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>springMVC</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>