Home >Common Problem >What does action mean in jsp

What does action mean in jsp

anonymity
anonymityOriginal
2019-05-28 15:45:597134browse

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>

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!

Statement:
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