Home > Common Problem > body text

What does action mean in jsp

anonymity
Release: 2019-05-28 15:45:59
Original
7086 people have browsed it

The Action class is the bridge between user requests and business logic. Each Action acts as a business agent for the customer. When the RequestProcessor class preprocesses a request, after creating an instance of Action, it calls its own processActionPerform() method, which calls execute() of the Action class.

What does action mean in jsp

Complete action

<action path="/aFullAction" 
type="somePackage.someActionClass">  
name="someForm" 
input="someJSP.jsp" 
<forward name="successful" path="someJSP.jsp"/>  
<forward name="failed" path="someOtherJSP.jsp"/>  
</action>
Copy after login

First, the ActionServlet of Struts receives a request, and then based on the configuration of struts-config.xml Locate the corresponding mapping;

Next, if the scope of the form is request or it is difficult to find the form in the defined scope, create a new form instance;

Get the form After the instance, call its reset () method, and then put the parameters in the form into the form. If the validate attribute is not false, call the validate() method;

If validate() returns non-empty ActionErrors, It will be transferred to the URI specified by the input attribute. If empty ActionErrors is returned, then the execute() method of the Action is executed and the target URI is determined based on the returned ActionForward.

The effect of this is: execute() will only be executed after validate() succeeds; the input attribute specifies a URI.

The above is the detailed content of What does action mean in jsp. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
jsp
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!