1, network programming/website programming: Knocking on a website that others can access
Access: In the Address bar, you can access the address.
If the server is placed on a public network, then others can access it through an IP address.
So we can first set up our site locally, others can come to visit.
2, the basic realization: through Tomcat to the page request to our program to deal with
(1) Request: via the Address bar input
(2) Response: The data/page to be returned
3, configuration file. (mainly understanding, because the possibility of modification is very small)
Basic Concept section:
The pom file specifies all the jar packages required by MAVEN to load
Jar Package: Plugins
The Spring MVC framework stipulates that some jar packages need to be imported.
Basic framework:
(1) Web. XML: This document specifies the basic framework configuration (at first it is not necessary to move at all)
One is the listener: for example, to do some logic when the program starts, this XML will be configured
One is the filter: Filter the user limit rights.
(2) Classpath is resource this folder
Application.properties: Database Configuration (the first place that may need to be changed)
MyBatis: This thing can convert data from a database into Java objects
Applicationcontext-mybatis: Most of them do not need to be modified, because most of them are fixed values.
The only thing to note is the scanning of the MyBatis file, if the directory of the configuration file has been modified, then it needs to be changed.
Process: Scans the configuration file and translates it into code logic for implementation.
Applicationcontext-schedule: Timed tasks, such as daily xx time to run a certain logic, can be configured here (the logic is temporarily completely useless, so there is no need to modify)
ApplicationContext: Basic Configuration
Freemarkerconfiger: Template engine, Management says where the pages we return are stored
! Focus, Scan @service
Automatic generation configuration of generatorconfig:mybaits files (ignore, do not tube)
LOG4J: Log configuration file
SPRING-MVC: Basic configuration of the framework
! Focus Scan @controller
4, configuring Tomcat to eclipse
Discussion group Chat record
Server accidentally shut down how to see
Window->show View->other->server
5, error after project import
(1) without Maven, all jar packages are missing
Configure Maven
Windows->preferences->maven->installations->add Adding a local Maven plugin
If the eclipse version is not proven to be too low, you have to re-download the latest version
(2) Project right-click->maven->update Project
6, Import process
(1) Import Project
(2) Configuring MAVEN
(3) Configuring Tomcat
(4) Update Project
7, how to make a simple access request processing.
(1) Controller This package
Mapping via @requestmapping ("request Address")
The simplest example: TestController
(2) Login process
1) Find the page
2) Fill in the Log in information
3) When the login button is pressed, the login information is sent to the new URL (that is, the new request address to find the corresponding method)
4) method to do database judgment matching user information.
5) @ResponseBody means that it is not a return page, but a return message
6) parameter name to match according to the front end name
(3) Entity class Package Basic Property configuration
(4) Service Package
At first it can be understood
controller-"service-" Mapper interface-"XML implementation
Web-related knowledge