OA Project---Notes

Source: Internet
Author: User

---------in useradd.jsp
Post add
<s:select name= "Roleids" multiple= "true" size= "ten" list= "#roleList" listkey= "id" listvalue= "name" ></S: Select> Ctrl-click to select or deselect

Department add
<s:select name= "DepartmentID" list= "#departmentList" listkey= "id" listvalue= "name" headerkey= "" headervalue= " Please select the Department ></s:select>

---------in Useraction
Post add
Private long[] Roleids; Generate get, set method, accept data from foreground
list<role> rolelist = Roleservice.getbyids (roleids);
Model.setroles (New hashset<role> (rolelist));
Userservice.save (model);

Department add
Private Long DepartmentID; Generate get, set method, accept data from foreground
Department Department = Departmentservice.getbyid (DepartmentID);
Model.setdepartment (department);
Userservice.save (model);

Modify and add page save.jsp---------
<s:form action= "Useraction_%{id = = null? ' Add ': ' Edit ' >
<s:hidden name= "id" ></s:hidden>

<s:radio name= "Gender" list= "%{{' male ', ' Woman '}" ></s:radio>

If Judgment------------
<s:if test= "#parent! = null" >
<s:a action= "departmentaction_list?parentid=%{#parent. parent.id}" > Return to the top level </s:a>
</s:if>
------------------------------------------------------------------------
Actioncontext.getcontext (). Put ("key", value);//Put in a value stack map
Actioncontext.getcontext (). Getvaluestack (). push (role); Put it on top of the stack, find the stack and find the map.
-------------------------------------------------------------------------
Template:
Many-to-one:
<many-to-one name= "" class= "" column= "" ></many-to-one>
Pair of more:
<set name= "" >
<key column= "" ></key>
<one-to-many class= ""/>
</set>
Many-to-many:
<set name= "" table= "" >
<key column= "" ></key>
<many-to-many class= "" column= "" ></many-to-many>
</set>
----------------------------------------------------------------------------
Number of requests Address bar
Forwarding 1 unchanged
REDIRECT 2 variable
----------------------------------------------------------------------------
Action Method name return value page

List () listlist.jsp
Remove Delete () toList
Add Page Addui () adduiaddui.jsp
Added Add () toList
Modify Page Editui () edituieditui.jsp
Modify edit () toList

Result configuration for ToList:
<result name= "toList" type= "Redirectaction" >roleAction_list</result>

OA Project---Notes

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.