Receive values with action

Source: Internet
Author: User

Class: Accounting for 143

1. Previously used is the value of Requestgetparameter received, now with the action to accept, he will help you change the type of acceptance, relatively easy to operate.

2. The method is to inherit the Actionsupport () method first.

3. Add a method to the entity

Public String Add () {
System.out.println ("name" +name);
System.out.println ("Age" +age);
return SUCCESS;
}

Write specific actions and jump addresses in struts.

Struts>
<constant name= "Struts.devmode" value= "true"/>
<package name= "user" extends= "struts-default" namespace= "/user" >

<action name= "user" class= "com.bjsxt.struts2.user.action.UserAction" >
<result>/user_add_success.jsp</result>
</action>
</package>
</struts>

Summary: The feeling of learning is very interesting, but they do not so hard, now try to change their attitude, refueling!!!

Receive values with action

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.