JavaEE

The use of multi-threading, the application scenarios of synchronization locks, the status of threads

1. [The class inherits the] Thread class, [overrides the run() method,] calls start(), which is not suitable for resource sharing. public class ThreadDemo1 extends Thread{ //Add a constructor to easily distinguish new threads public ThreadDemo1 (String name) { super (name); } @Override public void run() { System.out.println(Thread.currentThread().getName()+i); } public static void main(String[] args) throws InterruptedException …

The use of multi-threading, the application scenarios of synchronization locks, the status of threads Read More »

The use of jqPaginator paging plugin

first step The premise of using the jqPaginator paging plugin needs to import the following two cssstyles and twojs <link rel="stylesheet" href="css/bootstrap.min.css"> <link rel="stylesheet" href="css/jqPaginator.css"> <script type="text/javascript" src="js/jquery-3.3.1.js"></script> <script type="text/javascript" src="js/jqPaginator.js"></script> Notice: jquery-3.3.1.jsThe import order of the files should come first jqPaginator.js, because the code jqPaginator.jswill be called in there .jQuery No matter in the …

The use of jqPaginator paging plugin Read More »

JavaEE learning session technology, cookie explanation and case remember the last visit time

Conversational Technology Session: A session contains multiple requests and responses. One session: The browser sends a request to the server resource for the first time, and the session is established until one party disconnects Function: Share data between multiple requests within the scope of a session Ways: Client-side session technology: Cookie Server-side session technology: Session …

JavaEE learning session technology, cookie explanation and case remember the last visit time Read More »

Spring boot logback log printing details

By saving system logs to a log file with the help of logback. If spring boot adds the spring-boot-starter-web dependency, which includes spring-boot-starter-logging, then logback is used by default to record logs. [Create a new logback configuration file logback- spring.xml] under the project’s resources[] <?xml version="1.0" encoding="UTF-8"?> <configuration scan="true" scanPeriod="60 seconds" debug="false"> <contextName>cacacai</contextName> <springProperty scope="context" …

Spring boot logback log printing details Read More »

ServletContext object of JavaEE

ServletContext object: 1. Concept: represents the entire web application and can communicate with the program’s container (server) 2. Obtain: 1. Get the request through the request object .getServletContext ( ); 2. Get this .getServletContext () through HttpServlet ; code example @WebServlet("/servletContextDemo1") public class ServletContextDemo1 extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, …

ServletContext object of JavaEE Read More »

JavaEE project – create + add servlet

Development environment configuration JDK1.8 MyEclipse2017 Create a [web project] According to the actual personal computer environment configuration project selection, JavaEE version, Java version, whether you need [Maven] to support the running environment, this myeclips will have its own running environment, or you can configure it manually, and then other default configurations Project file structure src: …

JavaEE project – create + add servlet Read More »