1. Project use technology: The MAVEN project uses the Spring mvc+spring +mybatis+tomcat to build a project.2. Error message:Error Configuring application Listener of Class Org.springframework.web.context.ContextLoaderListenerJava.lang.ClassNotFoundException:org.springframework.web.context.ContextLoaderListener3. Solution Ideas:(1) From the error message we can see that the project was launched when the Contextloaderlistener was not found.(2) Then we must first think that we have the spring packa
Classpath:applicationcontext-*.xml:localhost:8080/beyongmedical/system/webserver_adminlogin-->Filter configuration issues in the SSM Framework Web. XML
Use IDEA to configure Maven to build the development framework ssm and mavenssm1. Configure the Maven environment 1. Download Maven
Download link http://maven.apache.org/download.cgi
2. Download and decompress the package and create a local repository folder.
3. Open the decompression file and configure the local repository path
4. Configure Maven Environment Variables
5. Check whether maven is correctly configured in cmd.
Enter the mvn-v comman
SSM + PageHelper, ssmpagehelper
Maven is used in the project.
1 introduce the jar package
First, introduce the jar package of PageHelper.
If maven is used, you only need to introduce the plug-in pom. xml as follows:
artifactId>pagehelper
Be sure to note: the version number cannot be too low. When is used at the beginning, the error 500 is reported and the page is not correct.2. Configure in sqlMapConfig. xml:
) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M01/8C/CF/wKiom1h4mcWxh7SpAACc0dLT8Us684.png "style=" float : none; "title=" 1.png "alt=" Wkiom1h4mcwxh7spaacc0dlt8us684.png "/>650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M01/8C/CB/wKioL1h4mcagG8qCAACnGTx9wMk536.png "style=" float : none; "title=" 2.png "alt=" Wkiol1h4mcagg8qcaacngtx9wmk536.png "/>Clicking Run as->maven Install will download a lot of jar packages and the last build succeeds.650) this.width=650; "src=" Http://s5.51
Integration steps
Create a Web project
Import all the jar packages required for consolidation
Write the required configuration files for each layer
1) MyBatis Global configuration file2) Spring Management MyBatis configuration file3) Manage Service4) Management Services5) SPRINGMVC's core configuration file6) Web. xml file
Introducing Resource Files
Connection Database Information Profile Db.properties
Log file Log4j.properties
MYBATIS,SPRIN
Compiler: Idea 2016Frame: SSMProblem:On this anomaly, I found a lot of problem solving on the network, but I never solved it until I began to analyze each of the exception prompts myself.Found the result maps already contains this sentence.Repeat? My mapper and Pojo are automatically generated by reverse engineering.Found userinfo this mapper, found that there are really two result, go to the database (Oracle 12c) A look, sure enough, under my system account has a userinfo table,In C # #admin (t
This article is a reference to the SSM framework-Detailed Integration tutorial (spring+springmvc+mybatis) ModifiedFirst, the environment1. Myeclipse20162. MysqlIi. Concrete Steps1. Integrating Spring and MyBatis 1. Import the required packages (the required packages are available in the download link)2. Create a jdbc.properties fileDriver=com.mysql.jdbc.driverurl=jdbc:mysql://localhost:3306/testusername=rootpassword=123initialsize= 0maxactive=20
1. Error2. Solution: - 3.123Xmlns= "Http://java.sun.com/xml/ns/javaee"4Xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance"5Xsi:schemalocation= "Http://java.sun.com/xml/ns/javaee6http//java.sun.com/xml/ns/javaee/web-app_3_0.xsd ">78 9Ten One A - -class>org.springframework.web.context.contextloaderlistenerclass> the - - - + -class>org.springframework.web.context.request.requestcontextlistenerclass> + A at - - -class>org.springframework.web.servlet.dispatcherservletclass> - - in
MetronicClient-side validation: JQuery Validation Plugin.Rich Text: CkecitorFile Management: CkfinderDynamic tab: JerichotabData table: Jqgriddialog box: JQuery jboxTree structure controls: JQuery ZtreeOther components: Bootstrap 4 metronic3. SupportServer middleware: Tomcat 6, 7, Jboss 7, WebLogic 10, WebSphere 8Database support: Currently only support MySQL database, but not limited to the database, the next version of the upgrade multi-data source switching and database read and write separa
= "Exception"/> rollback- for= "Exception"/> rollback- for= "Exception"/> pointcut= "Execution (* cn.itcast.scm.service.impl.*.* (..))"/> class= "Org.mybatis.spring.SqlSessionTemplate" > Package= "*"/>- Package= "Cn.itcast" > expression= "Org.springframework.stereotype.Controller"/> Configure the converter, for the interface class under the package (including the sub-package) set in Basepackage, if the full class name of the interface class is consistent in the Mapper.xml file and the defined n
= ". jsp" /> + Bean> A the The following is a full annotated configuration of Spring + MyBatis - + - Tx:annotation-drivenTransaction-manager= "Txmanager" /> $ $ Registration Transaction Management - - BeanID= "Txmanager" - class= "Org.springframework.jdbc.datasource.DataSourceTransactionManager"> the Propertyname= "DataSource"ref= "DataSource" /> - Bean>Wuyi the defining DBCP Data Sources - - BeanID= "DataSource"class= "Org.apache.commons.dbcp.BasicDa
-filtertype= "Annotation"expression= "Org.springframework.stereotype.Controller"/> Context:component-scan> View Parser Configuration - Beanclass= "Org.springframework.web.servlet.view.InternalResourceViewResolver"> Propertyname= "prefix"value= "/web-inf/views/"> Property> Propertyname= "suffix"value= ". jsp"> Property> Bean> Two standard configurations - give Tomcat a request that SPRINGMVC cannot process - Mvc:default-servlet-handler/> can support SPRINGM
">SELECT* FROM book WHERE bookname like'%${value}%'Select>--> can prevent SQL injectionSelectId="Likeselect"Parametertype="string"Resulttype=" Book">SELECT* FROM book WHERE bookname like'%'#{value}'%'Select>--> SelectId="Likeselect"Parametertype="string"Resulttype=" Book">SELECT"MySQL"/> from book WHERE bookname like Concat ('%', #{bookname},'%') Select> Three ways, the first is not to prevent SQL injection (to finish the log consolidation from the console can see the SQL statement), I like
------------I do not have him, but the hand is ripe, humble and foolish, and eager to be hungry-------------Getmapper function, get to the interface, directly through the point of call method, so as not to directly hand-hit way to write the wrong method name, (strong type of way)Example:Ibookdao mapper = Session.getmapper (Ibookdao. Class); ListThe tool class, the main thing is to get sqlsession object, the wordingPackage Cn.dawn.util;import Org.apache.ibatis.io.resources;import org.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.