Code Bye

Controller请求不到,No mapping found for HTTP request

No mapping found for HTTP request with URI [ ] in DispatcherServlet with name “”springMvc””

web.xml:

<servlet>
		<description>spring mvc servlet</description>
		<servlet-name>springMvc</servlet-name>
		<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
		<init-param>
			<description>spring mvc 配置文件</description>
			<param-name>contextConfigLocation</param-name>
			<param-value>classpath:spring-mvc.xml</param-value>
		</init-param>
		<load-on-startup>1</load-on-startup>
	</servlet>
	<servlet-mapping>
		<servlet-name>springMvc</servlet-name>
		<url-pattern>*.do</url-pattern>
	</servlet-mapping>
	<servlet>
		<servlet-name>druidStatView</servlet-name>
		<servlet-class>com.alibaba.druid.support.http.StatViewServlet</servlet-class>
	</servlet>
	<servlet-mapping>
		<servlet-name>springMvc</servlet-name>
		<url-pattern>*.action</url-pattern>
	</servlet-mapping>
	<!-- update begin Author:liuht Date:20131228 -->
	<!-- restUrl风格配置 -->
	<servlet>
		<servlet-name>restSpringMvc</servlet-name>
		<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
		<init-param>
			<description>spring mvc 配置文件</description>
			<param-name>contextConfigLocation</param-name>
			<param-value>classpath:spring-mvc.xml</param-value>
		</init-param>
	</servlet>
/**   
 * @Title: Controller
 * @Description: 员工管理   
 *
 */
@Controller
@RequestMapping("/personController")
public class PersonController extends BaseController {
	/**
	 * Logger for this class
	 */
	private static final Logger logger = Logger.getLogger(PersonController.class);

	@Autowired
	private PersonServiceI personService;
	@Autowired
	private SystemService systemService;
	private String message;

路径:personController.do?person

	@RequestMapping(params = "person")
	public ModelAndView person(HttpServletRequest request) {
		return new ModelAndView("com/buss/person/personList");
	}

我的新建按钮总是出现,No mapping found for HTTP request with URI [ ] in DispatcherServlet with name “”springMvc””问题。


10分
错了吧
personController/person 

15分
1.既然用了springmvc  struts的东西就抛弃吧  .do .action什么的就别强求了 看着也难看
2,personController.do?person
改这里@RequestMapping(“/personController.do“)
改这里 personController.do/person

10分
你在web.xml里配置的url-pattern 为 *.do 和*.action,controller里的配置的路径都没有.do和.action ,应该是请求不到

10分
怎么配置了2个啊。

15分
@RequestMapping(“/personController”)
public class PersonController extends BaseController

@RequestMapping(“/person.do”)
public ModelAndView person(HttpServletRequest request) {
    return new ModelAndView(“com/buss/person/personList”);
}

访问的ACTION  就是:/personController/person.do  

你自己试试!


CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明Controller请求不到,No mapping found for HTTP request