bug Way

1, java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/applicationContext.xml]
in time to build the framework of SSM reported above error, the error suggesting no applicationContext.xml, first check this configuration is not present , under normal circumstances,
we will create a resource own folder. The configuration file into it. So start tomcat when you need to tell us launcher configuration file where
the web.xml file, we add a listener, so we'll tell the container in which the listener accessories, as follows:

<!-- 注册ServletContext监听器,创建容器对象,并且将ApplicationContext对象放到Application域中 -->
<listener>
  <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
 
<!-- 指定spring核心配置文件 -->
<context-param>
  <param-name>contextConfigLocation</param-name>
  <param-value>classpath:applicationContext.xml</param-value>
</context-param>

2, for maven project, if you change some configuration files, it is best to refresh the project.

3, is start tomcat log message Chinese garbage problem:
find logging.properties conf folder modify the configuration file in tomcat
java.util.logging.ConsoleHandler.encoding = GBK

4, when using JSTL and EL expressions, if you experience $ {} does not recognize this, some of RFC reported a similar fault, it's time to pay attention to the following points, if your web.xml you need is a version = 2.3 modify the web.xml configuration file or join isELIgnored = "false" in the jsp page, if this does not work, then it is my problem arise, jstl import dependency error

<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>修改为
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

// Remember to import jsp in, both wanted, but not the same function

5、  Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter 'cand_name' not found. Available parameters are [0, startTime, endTime, param3, param1, param2]

On this issue, several similar error occurred because every mistake is different, the conclusion on the causes of individuals appear this:
In short, there is reason for general reasons for this parameter is not properly passed, can not find the cause parameter.
1, if the field is a parameter which pass over, rather than the fields in the database, where the two stepped pit
2, for each parameter to bind in the interface, or will not find the parameter
3, for packaging object types have good binding, and object attributes must be incorporated in this document in the object. attribute embodiment
4, the time for determining the type of treatment (oracle database) to_date (# {startTime}, 'yyyy-mm -dd ') instead TO_DATE {# (' the startTime ',' YYYY-mm-dd ')}
. 5, greater than or equal to, less error if special characters, to see because of the problem is not escape.

Published 33 original articles · won praise 37 · views 4389

Guess you like

Origin blog.csdn.net/weixin_42142899/article/details/103307342