A good way to play spring bean

@Controller controller (injection service): used to label the control layer, equivalent to the action layer in struts; @Service service (injection dao): used to mark the service layer, mainly used for business logic processing; @repository (realizing Dao access): used to mark the data access layer, also can be said to mark the data access compo ...

Posted on Sat, 09 Nov 2019 08:17:36 -0500 by j1bird2k

Detailed explanation of Java reading resource file and sample code in Jar

This article mainly introduces the details of Java reading resource files and implementation code in jar. When developing Java projects, jar packages are often used. Here we talk about how to read them. You can refer to the following for your friends Detailed explanation of Java reading resource file and implementation code in Jar ...

Posted on Fri, 08 Nov 2019 11:00:55 -0500 by KrisCons

Single file upload and multi file upload of struts 2

File upload refers to uploading the local file to the specified directory of the server and using struts to upload the file. First, set the value of the enctype attribute of the form form form to multipart / form data. Single file upload The code of file upload page is as follows <body> <s:actionerror /&gt ...

Posted on Thu, 07 Nov 2019 13:43:07 -0500 by Keith Scott

In struts 2, the most common way to submit forms is to use request and response, as well as simple array, complex array and Map assignment.

I. ServletActionContext() obtains request and response The most commonly used method is the same as that in Servlet. The code is as follows:   1 HttpServletRequest request = ServletActionContext.getRequest(); 2 HttpServletResponse response = ServletActionContext.getResponse();   Note: the above methods need to be writt ...

Posted on Fri, 01 Nov 2019 03:03:33 -0400 by Shiki

Internationalization of struts 2

Internationalization: internationalization (I18n) The page can be switched between Chinese and English Step 1: create two new profiles first To switch the configuration of Chinese To switch English configuration _EN us.properties, which is the specification, must be written in this way, xx custo ...

Posted on Thu, 31 Oct 2019 14:47:55 -0400 by vicodin

Common Annotations and Custom Filter s for Spring

@ Configuration is usually used on configuration classes, telling spring that it is a configuration class (configuration classes are similar to configuration files, but the difference is that xml is represented in the form of classes; @ Service is used to annotate the service layer of business layer components. @ Controller is used to annotat ...

Posted on Sat, 05 Oct 2019 03:03:21 -0400 by shreej21

Custom Type Converter Processing Set Collection Based on Struts2

One view 1 input.jsp <%@ page contentType="text/html; charset=GBK" language="java" errorPage="" %> <%@taglib prefix="s" uri="/struts-tags"%> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns ...

Posted on Tue, 01 Oct 2019 08:59:52 -0400 by Ghulam Yaseen

Struts completes input verification manually based on validate method

One view 1registForm.jsp <%@ page contentType="text/html; charset=GBK" language="java" errorPage="" %> <%@taglib prefix="s" uri="/struts-tags"%> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html x ...

Posted on Tue, 01 Oct 2019 03:16:02 -0400 by kirkh34

The difference between the annotation @RequestParam and @PathVariable in spring MVC

The difference between the annotation @RequestParam and @PathVariable in spring MVC @ PathVariable binds URI template variable values @ PathVariable is used to obtain dynamic parameters in the request url @ PathVariable is used to map template ...

Posted on Wed, 18 Sep 2019 02:10:24 -0400 by gillypogi

How to upload files with Struts 1

1. Problems to be considered in traditional file uploading: _1. File encoding _2. File size _3. File Blocking 2. Using Struts to solve the above problems Struts upload package is used for file upload. 3. File upload Attributes of the form: enct ...

Posted on Fri, 16 Aug 2019 08:56:32 -0400 by spider.nick