Data encapsulation of struts 2
The struts 2 framework is a web framework, and provides the function of data subpackage
Data encapsulation property driven encapsulation
set method provided by property driven encapsulation (not commonly used)
Let's take an example to explain:
Let's start with a simple user form submission page
Key jsp code:
<form action ...
Posted by Daniel Exe on Sat, 30 Nov 2019 19:23:40 -0800
File download of java struts 2
1. In practical application development, file download function is also very common.
2. The simplest way to download files is through hyperlink:
<body>
<a href="download/s.txt">Courseware</a><br/>
<a href="download/t.jpg">Beauty</a><br/>
<a href="download/jstl-1.2.jar">jstl</ ...
Posted by mattyj10 on Sun, 03 Nov 2019 02:51:01 -0800
Form form submission under struts 2, action needs to add project name to solve the problem
Form form submission under struts 2, action needs to add project name to solve the problem
This is a test form for me to test whether struts 2 works normally.
index.jsp:
<form action="/loginManage" method="post">
<input type="text" name="username">
<input type="password" ...
Posted by cetaces on Thu, 31 Oct 2019 22:52:54 -0700
Struts 2: Action get form submission data
Action get form submission data
In the previous web stage, submit the form to the servlet, and use the method in the request object to obtain, getParameter and getParameterMap.
Submit the form to action, but action does not have a request object and cannot use the request object directly.
There are ...
Posted by tomsasse on Fri, 18 Oct 2019 09:41:14 -0700
Strts06 - Interceptor, File Processing
struts Initial Knowledge 6-Interceptor
1. Interceptor use
1.1 Custom Interceptor
Method:
1. Create common classes, inherit AbstractIntercepter, and implement abstract methods
2.struts.xml configuration interceptor:
2.1 Declare Interceptor
2.2 ...
Posted by squimmy on Thu, 05 Sep 2019 01:36:30 -0700
Structs2 structs. XML configuration
<struts>
<package name="action" namespace="/action" extends="struts-default">
<action name="LoginAction" class="action.LoginAction" method="execute">
<result name="teacher">/teacher.jsp</result>
<result name="student">/student.jsp</result>
<resul ...
Posted by edwinlcy on Thu, 05 Sep 2019 01:21:41 -0700
Struts 2 table dynamic details to the background.
Recently, we trained new people and finally practiced using Struts 2 framework, but we met the problem that the background of the screen List object can not be transmitted. Looked on the Internet for a circle and did not find the corresponding solution. Finally, I found one, which I can read after writing down.
Note: There are tens of millions ...
Posted by jfgreco915 on Tue, 27 Aug 2019 07:44:57 -0700
Strts2 picture upload
Strts2 picture upload
Three upload schemes
1. Disadvantage of uploading to tomcat server: the storage location of uploaded pictures is too coupled with tomcat server, which is not commonly used.
2. Establishing binary fields in database tables and storing pictures in database. Disadvantage: directly ...
Posted by Tohou on Wed, 31 Jul 2019 04:26:56 -0700
Picture upload for Struts
File upload based on previous blog
Website: https://blog.csdn.net/weixin_45174537/article/details/97618636
File upload:Three upload schemes1. Upload to tomcat server The location where the uploaded pictures are stored is too coupled with the tomcat server
2. Upload to a specified file directory, add a m ...
Posted by mduran on Tue, 30 Jul 2019 11:58:05 -0700
Loading and Configuration of web.xml Files
First, web.xml file is the core configuration file of the project. Many configuration information is configurated, loaded and initialized through this file.
1. The loading order of the web.xml file is independent of its order in the web.xml file; the loading order is: ServletContext (context-param) - ...
Posted by PAZII on Tue, 30 Jul 2019 01:03:25 -0700