In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
First of all, when integrating this framework, think about what the general steps are. After there is a step first, it will not be confused later, so that it will be clearer during the integration.
Then we integrate it step by step.
1 create a Web project.
2 import the jar package of Mybatis3, Spring4, SpringMVC4, connection database (the database I use is mysql).
The bag I use:
Spring-websocket-4.2.0.RELEASE.jar
(3) create configuration files for Mybatis3, Spring4, SpringMVC4 and connecting to the database.
4 configure web.xml
12 7 8 9 10 contextConfigLocation11 12 / WEB-INF/classes/applicationContext.xml 13 14 15 16 17 18 19 20 log4jConfigLocation21 / WEB-INF/log4j.xml22 23 24 25 log4jRefreshInterval26 6000027 28 29 30 31 webAppRootKey32 ssm.root33 34 35 36 37 default38 / static/*39 40 41 42 43 44 mvc45 org.springframework.web.servlet.DispatcherServlet46 48 49 contextConfigLocation50 / WEB-INF/classes/mvc-servlet.xml51 52 53 54 mvc55 / 56 57 58 59 60 61 encodingFilter62 org.springframework.web.filter.CharacterEncodingFilter63 64 encoding65 UTF-866 67 68 69 forceEncoding70 true71 72 73 74 encodingFilter75 / * 76 77 78 79 80 loginFilter81 com.cy.ssm.filter.LoginFilter82 83 84 loginFilter85 / * 86 87 88 89 Org.springframework.web.context.ContextLoaderListener90 91 92 93 org.springframework.web.util.Log4jConfigListener94 95 96 97 index.jsp98 99
5 datasource.properties connection to the database
1 jdbc.driver=com.mysql.jdbc.Driver2 jdbc.url=jdbc:mysql://localhost:3306/mybatis?useUnicode=true&characterEncoding=UTF-83 jdbc.username=root4 jdbc.password=root
6 mybatis.cfg.xml Fil
7 mvc-servlet.xml
12 10 11 12 13 14 15 16 17 18 19 20 21 22 23 26 27 28 29 30 31
8 applicationContext.xml
1 2 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 classpath:datasource.properties28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 57 58 59 60 61 62 63 65 67 69 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
9 configuration files are almost ready, and then write a test.
LoginController .java
1 package com.cy.ssm.controller; 2 3 4 import javax.annotation.Resource; 5 import javax.servlet.http.HttpServletRequest; 6 7 import org.apache.log4j.Logger; 8 import org.springframework.stereotype.Controller; 9 import org.springframework.web.bind.annotation.RequestMapping;10 import org.springframework.web.servlet.ModelAndView;11 12 import com.cy.ssm.beans.UserBean;13 import com.cy.ssm.service.ILoginService;14 15 16 17 @ Controller18 public class LoginController {19 private Logger log = Logger.getLogger (this.getClass ()) 20 21 @ Resource22 private ILoginService loginServiceImpl;23 24 @ RequestMapping ("/ login") 25 public ModelAndView login (HttpServletRequest req,UserBean user) {26 log.info (user); 27 28 ModelAndView mv = new ModelAndView (); 29 UserBean u=loginServiceImpl.Login (user.getUsername (), user.getPassword ()) 30 31 if (u! = null) {32 33 req.getSession (). SetAttribute ("user", u); 34 mv.addObject ("password", u.getPassword ()); 35 System.out.println (u.getPassword ()); 36} 37 mv.setViewName ("index"); 38 return mv 39} 40 41 42 43}
Jsp page
Login.jsp
1 2 3 4 5 6
Index.jsp
${password}
Test:
Click submit
That's about it as a whole!
1. Use Alibaba Druid connection pool (efficient, powerful and scalable database connection pool, monitor database access performance, support Common-Logging, Log4j and JdkLog, monitor database access)
two。 Provide high concurrency JMS message processing mechanism
3. All functional modularization, all module service, all service atomization, provide an extensible service model, so that the program runs stably and never downtime.
4. Provides Wink Rest and Webservice services, so it can be deployed as an independent service platform
Framework integration:
Springmvc + Mybatis + Shiro (permission) + REST (Service) + WebService (Service) + JMS (message) + Lucene (search engine) + Quartz (scheduled scheduling) + Bootstrap Html5 (support for PC, IOS, Android)
Introduction to the framework:
Project Maven construction, real large-scale Internet architecture, to achieve high concurrency, big data processing, the whole project uses customized service ideas, to provide modular, service-oriented, atomized solution, the functional modules will be split, can be shared to all projects. The architecture adopts distributed deployment architecture, and all modules are split, so that the project is absolutely decoupled and stability trumps everything.
Continuous integration:
1. My to-do workflow service (providing Webservice services)
two。 My to-do workflow integrates JMS message services (supports high concurrency and can support thousands of system integration)
3. My tasks provide Rest services, complete daily work management, and dynamically generate my tasks, cycle tasks, scheduled mail reminders to complete tasks, etc., through the scheduled scheduling platform.
4. File upload, multithreaded download service, sending mail, short message service, department information service, product information service, information release service, my subscription service, my task service, public link, my collection service, etc.
System module:
1. User Management:
User information management (add, delete, modify, user authorization, user column management, query, etc.)
User group management (add, delete, modify, user group column authorization, column authorization, query, user group personnel add query, etc.)
User role management (add, delete, modify, user role authorization, user role column information query settings, etc.)
two。 Article Management:
Column management: query infinite pole column tree, create infinite pole column tree classification (navigation column, picture list column, article list column, article content column, etc.), delete, modify column information.
Article management: create, delete, modify articles, multi-dimensional article queries, including published, unpublished, all articles, etc. Article rich text editor, article multi-file upload, article status control and so on.
3. System Settings:
Data dictionary management: support Chinese and English information, support unlimited level classification configuration, dynamic control whether available, etc.
Department information management: support unlimited level department information in Chinese and English to add, delete, modify operation, department list, tree heart query and so on.
Log management: system log list query, online viewing, online download, etc.
Route management: integrate Baidu map API, provide line query management function
Druid Monitor (monitoring): integrate Alibaba connection pool, provide online connection pool monitoring program, including: data source, SQL monitoring, URL monitoring, Session monitoring, Spring monitoring, etc.
Website information management: operate the website content through the system configuration file, including mail server configuration, company basic information configuration and so on.
4. Integrated REST service, which can be used as an independent service platform (provides a large number of examples and testing platforms, including: file uploads and downloads, email messages, departments, products, public connections, my favorites, my tasks, information release, etc.)
5. Integrated Quartz scheduling, which can be used as a timing scheduling platform (dynamically configure scheduling classes, scheduling time, so that programs automatically perform certain services)
6. Lucene search engine, which can index documents and support document content search, keyword search, highlighted keywords, etc., so that the information can be extracted and queried in milliseconds.
7. User setting functions: including modifying user information, changing passwords, sending messages, modifying personal pictures, viewing roles, viewing user groups, administrators modifying roles, users, user groups, and so on.
8. Integrate Webservice platform, including jaxws service, CXF framework, configure double encryption authority authentication. Make service integration more secure.
9. Bootstrap html5 provides two sets of foreground environments, including CMS and e-commerce sites, to make your development more concise.
Technical points:
1. Springmvc + Mybatis integration, SpringSecurity permission control, Spring AOP transaction processing.
2. Wink Rest service, Webservice service: jaxws, CXF, etc.
3. IO stream uploads and downloads files and operates with multiple threads
4. Send mail, configure mail server, send mail based on html, plain text format
5. MD5 encryption (login password verification, encryption, etc.), unified Session, Cookie management, unified CAPTCHA verification, etc.
6. Unified configuration of database connection pool
7. Quartz scheduled task integration (directly through configuration)
8. Httpclient cracked the CAPTCHA and logged in to Unicom's recharge platform.
9. Chinese characters, English split, can be used as document keyword search and so on.
10. Base64 image processing, which supports PC,Android,IOS
11. Service Socket, Client Socket communication technology (GPRS data acquisition has been done and used in the project)
twelve。 Provides a large number of tool classes that can be used directly
13. Maven project building, you can directly do the architecture, you can improve your learning ability and make you a true architect.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.