• The difference between struts1 and struts2


    1) Both frameworks are MVC web frameworks, 2) Struts1 is an old-fashioned framework, which is widely used and has a good mass base. It has a small development risk and low cost. The core design idea of Struts2 is mainly derived from webwork, which is more elegant and easy to expand 3) Struts2 modifies and […]

  • Implementation of token authentication based on springboot and oauth2


    This article mainly introduces the implementation of token authentication based on springboot integration oauth2. The article introduces in detail the example code, which has certain reference learning value for everyone’s study or work, and friends in need can refer to it The difference between session and Token: Session is space for time, and token is […]

  • Java: put odd numbers on the left and even numbers on the right in one-dimensional array


    Algorithm idea Compare the first number, if it is odd, judge the second number; if the second number is even, judge the penultimate number is even, then judge the penultimate number is odd, then complete the exchange, and reduce the value judged next time. The efficiency of the algorithm is n package com.itheima.kuihuabaodian; import java.util.Scanner; […]

  • [email protected] How to use attribute injection


    This article mainly introduces [email protected] Attribute injection use method analysis, the article through the example code introduced in very detail, for everyone’s study or work has a certain reference learning value, need friends can refer to In projects using the spring framework, @ value is one of the frequently used annotations. Its function is to […]

  • Java operator


    Java operator 1、 Operator classification Operator priority Arithmetic operator one yuan ++,– binary +,-,*,/,% Assignment Operators = Extension operator +=,-=,*=,/= Relational operators >,=,<=,instanceof Logical operator &&,||,!,^ Bitwise Operators &,|,~,^,>>,<>> Conditional operator ?: String connector +   2、 Arithmetic operator (1) Unary operator A + +: the variable a is used first and then increased automatically. […]

  • Java data encapsulation tree structure code example


    This article mainly introduces the Java data encapsulation tree structure code example, the article through the example code introduction is very detailed, has the certain reference study value to everybody’s study or the work, needs the friend may refer to 1. Entity class @data public class PublishServiceType implements Comparable<PublishServiceType>{ /** * */ private static final […]

  • The initial use of Dao layer + service layer + action layer in spring


    1. Dao layer: (divided into interface and Implementation) package com.myget; public interface PersonDao { public void add(); } + package com.myget; import javax.annotation.Resource; import org.springframework.stereotype.Repository; @Repository (“persondao”) / / equivalent topublic class PersonDaoImplement implements PersonDao { public void add(){ System.out.println (the “add method of Dao layer”); }} 2. Service layer: (interface and Implementation) package com.myget; […]

  • Method of converting word / Excel / txt to PDF by Java


    introduction: Some time ago, the education system made by the company needs to record the situation and time of users’ learning courses in real time. Therefore, the same is true for some text document courseware besides video courses. The initial plan is to convert HTML files of office related types, and then display the corresponding […]

  • Kafka realizes no message loss and exact once processing


    In the introduction of many stream processing frameworks, Kafka is a reliable data source, and Kafka is recommended to be used as a data source. This is because compared with other message engine systems, Kafka provides a reliable data storage and backup mechanism. And through the concept of consumer displacement, consumers can easily return to […]

  • Solution to cross domain problem of spring cloud gateway request


    This article mainly introduces the spring cloud gateway request cross domain problem solution, the article through the example code introduction is very detailed, has the certain reference study value to everybody’s study or the work, needs the friend may refer to The code is as follows @Configuration public class CorsConfig implements GlobalFilter, Ordered { private […]

  • Introduction to quartz and demo


    What is quartz? Quartz is another open source project of OpenSymphony open source organization in the field of job scheduling. It is completely developed by Java and can be used to perform scheduled tasks. It is similar to java.util.Timer 。 However, compared with timer, quartz has added many functions: Persistent job – it is to […]

  • Explain the fuzzy query of data query module based on MVC


    Complete a simple MVC based data query module, which requires fuzzy query according to name. Index.jsp: <%@ page import=”student.TestBean” %> <%@ page import=”java.util.List” %> <%@ page import=”java.util.ArrayList” %> <%@ page language=”java” contentType=”text/html; charset=UTF-8″ pageEncoding=”UTF-8″%> <% List<TestBean> list = (List<TestBean>)request.getAttribute(“list”); if(list == null){ list = new ArrayList<TestBean>(); } %> <!doctype html> <html lang=”en”> <head> <meta charset=”UTF-8″> […]