------------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.
background request, incredibly encoded format is problematic.Workaround: Specify the code format in the controller3. Operation database times the following errorWorkaround:The introduction of the following packages is possible.Commons-pool.jar, Commons-dbcp-1.2.2.jar and Commons-collections-3.2.jar three jar package added Classpath No problem pull, version must correspond, or else will report this error.4. The error is as follows.Workaround: Refer to the mybatis-spring package.7. Precautions1.
request parameter, the default request parameter is format
MediaTypes property: Based on the list of mappings for request parameter values and MIME types, which is the format in which contenttype is displayed, if the suffix in the request URL is:. JSON, the data is presented in Application/json format
Viewresolvers Property: Represents the Web Page view parser, because of the JSP technology used in our project, we use Internalresourceviewresolve to analyze the visual diagram.
); // when it returns, it becomes a portable processor. return This . Gethandlerexecutionchain (handler, request);}5. Follow-up of the acquisition program execution chain, This.gethandlerexecutionchain (handler,request) protectedhandlerexecutionchain Gethandlerexecutionchain (Object handler, HttpServletRequest request) {//ternary expression, is the processor execution chain on the strong turn, not on the acquisition based on the processor generated aHandlerexecutionchain chain = Handler
Integration IdeasPrepare Environment: Import jar Package (Spring MyBatis dbcp connection pool MySQL driver package log4j)Engineering Structure:---------------------------1. Integrate DAOMyBatis and Spring are integrated
applicationcontext-dao.xml Configuration:1. Data sources2.SqlSessionFactory3.mapper Scanning DeviceCreate PO and mapper (reverse engineer, no demo here)For the comprehensive query Mapper, the general situation will have associated queries, the proposed custom mapperItems
Record the process of building the framework1. Download the latest eclipseHttps://www.eclipse.org/downloads/download.php?file=/oomph/epp/neon/R/eclipse-inst-win64.exeThe installation will not be said. Just unzip the line. Decompression times wrong, "version 1.7.0_79 of the JVM is not suitable for this product. version:1.8 or greater is required ", which is not supported by the version. Download a jdk1.8 on the OK. jdk:http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151
, importing related jar filesConfigure Web. xmlConfiguration file (/resources) database.propertiesLog4j.propertiesMybatis-config.xmlConfigure TypealiasesSet Global lazy LoadApplicationcontext-mybatis.xmlSpringmvc-servlet.xmlApplicationcontext-mybatis.xmlData source related configurationTransaction managementConfigure SqlsessionfactorybeanConfigure MapperscannerconfigurerSpringmvc-servlet.xmlConfiguration Configure static file access via Configuring support file Uploads-multipartresolverConfiguri
; } PublicString GetPassword () {returnpassword; } Public voidSetPassword (String password) { This. Password =password; }}2. Defining the Processor method /* The return value of the object objects user type */ "/returnobjuser") @ResponseBody public Object Returnobjuser () { UserInfo u1=new UserInfo (" Mengliu " ,"123"); return U1; }3. Custom configuration XML file, Web.4. Access via web URLFour, a collection type that returns a value of object1.UserInfo w
Workflow Module---------------------------------------------------------------------------------------------------------- 1. Model Management: Web Online process designer, preview process XML, export XML, deployment process2. Process management: Import and export process resource file, view flowchart, reflect process model based on process instance, activate suspend3. Running Process: View process information, current task node, current flowchart, void suspend process, assign to-do person4. Hist
------------I do not have him, but the hand is ripe, humble and foolish, and eager to be hungry-------------Abstractcontroller implements a number of special features, such as inheriting the Webcontentgenerator cache control feature, and providing the optional session serialization access feature. And the Handlerequestinternal method is provided, so we should implement the Handlerequestinternal method in the specific controller class, not handlerequest.Simple to use:Package Cn.dawn.day04abstract
------------I do not have him, but the hand is ripe, humble and foolish, and eager to be hungry-------------Beannameurlhandlermapping and SimpleurlhandlermappingBeannameurlhandlermapping belongs to the SPRINGMVC default processor mapper, which is not worthy of thisBecause it has been configured in the SPRINGMVC configuration fileYou can also configure the beannameurlhandlermapping, but it is useless in your own XML configuration file: class=" Org.springframework.web.servlet.handler.BeanN
;class="Org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator">Must have consultant, no no no, the default automatic proxy does not have to implement parameters, he automatically matchesSingle test method:Package Cn.dawn.day17auto01;import Cn.dawn.day17atuo01.isomeservice;import org.junit.test;import Org.springframework.context.applicationcontext;import Org.springframework.context.support.ClassPathXmlApplicationContext;/** * Created by Dawn on 2018/3/3.*/ Public classtest201
"First" ; }3. You can also access this method if you want to add any level of content to the middle /* wildcard in front of a 0 or any multi-level path */ @RequestMapping ("/**/dofour") public String Dofour () throws Exception { return"First"; }4. What if the previous method must have only one level of directory in front of it? /* wildcards must precede and have only one level of directory */ @RequestMapping ("/*/dofive") public String dofive () throws Excepti
object, his Get/set method, there are new methods, the real theme of static enhancementPackage Cn.dawn.day08proxy;/** * Created by Dawn on 2018/3/6.*/ Public classProxysubject implements Subject {Subject Subject; Public voidrequest () {System. out. println ("before"); Subject.request (); System. out. println (" After"); } PublicSubject Getsubject () {returnsubject; } Public voidSetsubject (Subject Subject) { This. Subject =subject; }}Single test method:Package Cn.dawn.day08proxy
Question:SPRINGMVC automatically resolves incoming content, as long as the name of the object in the form corresponds to Pojo one by one, otherwise an error will be given.The JSP default appears to add the request header.If there is another way to pass the interface to the object. To add a request header.Content-type application/x-www-form-urlencoded(resolved) When building the SSM framework, the SPRINGMVC incoming object is not passed in, the flyer s
Maintaining Gmt_create and gmt_modified fields in SQLDatabase tables generally need to have gmt_create and gmt_modified two fields, but this two field does not need to be maintained in the application layer, even in the entity class, only in the SQL statement maintenance.When plugged in INSERT into money_account (user_id, balance,state,gmt_create) VALUES( #{userid,jdbctype=BIGINT}, #{balance,jdbctype= Integer}, #{state,jdbctype=integer}, Curren
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.