A full stack Java Web project based on the SSM framework technology (deployed to directly experience)

Source: Internet
Author: User
Tags string back

Overview This project is based on the SSM Framework Technology Java Web Project, is a full stack project, involving front-end, back-end, plug-in, on-line deployment, and other sections, the project all the code is self-coding, each step, the parts have clear comments, do not worry about code confusion, can be easy, simple, Complete learning with confidence (and no versioning configuration required). I will try my best to answer any questions after downloading. This project: Kuaib is a fast and versatile editing system that makes every effort to integrate all functions of writing, finding, alignment, modification, file downloading, uploading, duplicate checking, etc. into a single page operation integrated operating system. --In addition, this project has been deployed: http://yws233.cn:8080/kuaib/with direct access to the experience--。 Detailed code Download: http://www.demodashi.com/demo/12947.html

Note: As soon as the project is downloaded directly, it is guaranteed to run as long as it is compliant with the deployment environment and has been deployed on-line to run tests (without Maven and other versioning). In addition, due to the large number of project code, the file structure and details are described here, it is only affixed to the Login control layer (Logincontroller) as an example. After downloading any questions can contact me (email: [Email protected]), or directly click on the http://yws233.cn:8080/kuaib/(project deployment URL to experience) to see the system features detailed description.

In addition, since the project cost the author about half a year of time, painstaking efforts, is purely original, copyright is completely owned by the author, only for personal learning and communication use, such as for other business, sharing, advice and other activities, please be sure to contact the author.

First, the code implementation process

1. Technical description of the project

Front End: HTML5 + CSS3 + JS + jQuery + ajax + Fastjson + xhediter + pdf.js

Back end: Springmvc + Spring + Mybatis + poixmldocument + simhash

Database: MySQL + Redis (late cache)

Server: Tomcat9.02 + Aliyun + jdk1.8

File processing: POI + pdfbox + JDOM + itextpdf

Development environment: ubuntu16.04 + IDEA17.2

2. Configuration Files Section

    1. MySQL Database configuration-----> Database.properties

    2. log4j configuration file-----------> Log4j.properties

    3. Mybatis----------------------> Mybatis-config.xml

    4. SPRINGMVC configuration file-----> Springmvc-servlet.xml

    5. Spring configuration file------------> Applicationcontext-mybatis.xml

3. Core control Layer

Basecontroller (Basic filter layer)

Logincontroller (Login control layer)

Usercontroller (Home control layer)

For example, paste the login layer code:

/** Login Control layer * */package Cn.kuaib.controller;import javax.annotation.resource;import Javax.servlet.http.httpservletrequest;import Javax.servlet.http.httpsession;import com.mysql.jdbc.StringUtils; Import Org.apache.log4j.logger;import Org.springframework.stereotype.controller;import Org.springframework.web.bind.annotation.requestmapping;import Org.springframework.web.bind.annotation.requestmethod;import Org.springframework.web.bind.annotation.requestparam;import Cn.kuaib.pojo.user;import Cn.kuaib.service.userservice;import Cn.kuaib.tools.constants;import Org.springframework.web.bind.annotation.responsebody;import Java.text.simpledateformat;import java.util.Date;@ Controllerpublic class Logincontroller {private Logger Logger = Logger.getlogger (logincontroller.class); @ Resourceprivate userservice userservice; @RequestMapping (value= "/login.html") public String login () {Logger.debug (" Logincontroller welcome kuaib================== ");//randomly display the login page text return" login ";} @RequestMapping (value= "/dologin.html", Method=requestmethod.post) public string Dologin (@RequestParam string usercode, @RequestParam string UserPassword, HttpServletRequest request,httpsession session) throws Exception{logger.debug ("dologin============================        ========"); Call the service method and make the user match with the username = Userservice.login (usercode,userpassword); String loginpic = Request.getparameter ("picconfirm"); Gets the validation value of Boolean confirm = Loginpic.equals ("Validation succeeded!"); Logger.info ("##### #piccccccccccccccccccc:" + loginpic); Logger.info ("##### #piccccccccccccccccccc:" + confirm); if ( Null! = user) {if (User.getusercode ()! = "" && user.getusercode ()! = null&& User.getuserpassword ()! = null && User.getuserpassword ()! = "" && loginpic.equals ("Verify succeeded!"))                {//Login succeeded//put into session session.setattribute (Constants.user_session, USER);                Put password, file upload using Session.setattribute (constants.user_pass,user); Return "redirect:/sys/main.htML "; Enter the interceptor to verify the}}else{//page jump (login.jsp) with the prompt message--forward Request.setattribute ("error", "* Username or password is incorrect"); return "Login"; return "Login";} /* * User Registration * */@RequestMapping (value = "adduser.html", method = requestmethod.post) public String adduser (user user, H Ttpsession session) {try {if (userservice.addreg (user) = = true) {Session.setattribute ("regtrue", "registered successfully! "); Place registration Successful prompt return "redirect:/login.html";}} catch (Exception e) {e.printstacktrace ();} return "register";} /** asynchronously determines if the registered user has the same name as */@RequestMapping (value = "/usercodeexist.html") @ResponseBody//asynchronous processing results are written directly to the HTTP Responsebody public Object usercodeisexist (@RequestParam String usercode) {logger.info ("///////////*****************////////////into async judgment        ");/*hashmap<string, string> resultmap = new hashmap<string, string> (); */string Cjson = null; Logger.debug ("Usercodeisexit usercode=====================" +usercode); if (Stringutils.isnullorempty (UserCode)) {/ *resultmap.put ("Usercode", "exist"); *//If the user already exists logger. info ("//////************************ enters null:"); return "Nullcode";}                else {try {User user = Userservice.registeruser (usercode); if (null! = user) {Cjson = "exist";//the user is not empty then already exists                    }else {//Registered user length cannot be longer than ten int len = Usercode.length ();                        if (len >=) {Cjson = "toolen";//the user enters a length of more than 10 to prompt}else { Cjson = "Noexist"; User is empty, you can register}}} catch (Exception e) {e.printstacktrace ()}} /*logger.info (">>>>>>>>>>>>>>>>>>>>>>> >>>>> "+ jsonarray.tojsonstring (Resultmap)); return jsonarray.tojsonstring (Resultmap); */logger.info ("//////************************cjson:" + Cjson); return Cjson;} /** asynchronously determines whether a user mailbox exists */@RequestMapping (value = "/userpwdexist.html") @ResponseBody public String userpasswordexist (@Req Uestparam String Email) {Logger.info ("Enter the mailbox async judgment >>&Gt;>>>>>>>>>>>>>>>>>>>>>>>> ");        String Ejson = null;        if (stringutils.isnullorempty (email)) {return "nullpwd";            }else {User user = Userservice.backpassword (email);            if (null! = user) {Ejson = "existpwd";            }else {Ejson = "noexistpwd";        }} logger.info ("//////************************cjson:" + Ejson);    return Ejson;    }/** Jump to retrieve Password page */@RequestMapping (value = "back.html") public String back () {return "Forget"; }/** Recover Password * */@RequestMapping (value = "backpassword.html", method = requestmethod.post) public String backpass (@    Requestparam String Email, HttpSession session) {User user = Userservice.backpassword (email);        if (user! = null) {Session.setattribute (Constants.password,user.getuserpassword ());        return "Backpwd"; } session.setattribute (Constants.sys_message, "* YourThe mailbox does not exist, please register First "); return" Forget ";} /** Jump to login page */@RequestMapping (value = "backlogin.html") public String Backlogin () {return "login";}    @RequestMapping (value = "register.html") public String Skipregister () {return "register"; } @RequestMapping (value= "/sys/main.html") public String Main (HttpSession session) {SimpleDateFormat df = new    SimpleDateFormat ("Yyyy-mm-dd");//Set Date format Session.setattribute (Constants.data_now,df.format (new Date ())); return "main";}}

DAO layer, service layer, etc.

4. Front-end Section

PDF and Xhediter are plugins and can be read on the website.

JSP and LIB Package

Second, the code implementation process

1. After the whole project has been downloaded, unzip and import idea:

2. Database and SSM configuration file (Modify your own username and password)

3. Core control Layer

4. Front-end Web tier

Third, the demonstration effect

1. Login Page

2. homepage (each zone file upload display)

3. Switching system

4. Registration page

5. Password Retrieval

Code Download: http://www.demodashi.com/demo/12947.html Note: This copyright belongs to the author, published by the demo master, refused to reprint, reprint needs the author authorization

A full stack Java Web project based on SSM framework technology (deployed to experience directly)

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.