Top > SAStrutsあれこれ > 「データベースを使ったサンプル」を軽く改造(2)

Everything is expanded.Everything is shortened.
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 
-
|
|
!
 
 
-
|
!
 
 
-
|
|
|
!
 
 
-
|
|
!
    @Execute(validator = false)
    public String edit_for_add() {
        deptItems = departmentService.findAll();
        return "edit_for_add.jsp";
    }
 
    @Execute(input = "backToEditForAdd")
    public String confirm_for_add() {
        return "confirm_for_add.jsp";
    }
 
    @Execute(input = "confirm_for_add.jsp")
    public String add() {
        Employee emp = Beans.createAndCopy(Employee.class, employeeForm).execute();
        employeeService.insert(emp);
        return index();
    }
 
    @Execute(validator = false)
    public String backToEditForAdd() {
        deptItems = departmentService.findAll();
        return "edit_for_add.jsp";
    }

Everything is expanded.Everything is shortened.
  1
  2
  3
  4
  5
  6
  7
  8
 
 
 
 
 
 
 
 
    @Required
    @IntegerType
    public String id;
 
    @Required
    @IntegerType
    public String version;
   

Everything is expanded.Everything is shortened.
  1
  2
  3
  4
  5
  6
  7
 
 
 
 
 
 
 
    @Required(target = "confirm,store")
    @IntegerType
    public String id;
 
    @Required(target = "confirm,store")
    @IntegerType
    public String version;
Everything is expanded.Everything is shortened.
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
<%@page pageEncoding="UTF-8"%>
<html>
<head>
<title>Employee Edit</title>
</head>
<body>
<html:errors/>
<s:form>
<table>
<tr>
<td>Name</td><td><html:text property="name"/></td>
</tr>
<tr>
<td>JobType</td>
<td>
<html:select property="jobType">
<html:option value="CLERT">CLERK</html:option>
<html:option value="SALESMAN">SALESMAN</html:option>
<html:option value="MANAGER">MANAGER</html:option>
<html:option value="ANALYST">ANALYST</html:option>
<html:option value="PRESIDENT">PRESIDENT</html:option>
</html:select>
</td>
</tr>
<tr>
<td>Salary</td><td><html:text property="salary"/></td>
</tr>
<tr>
<td>Department</td>
<td>
<html:select property="departmentId">
<html:option value=""></html:option>
<c:forEach var="d" items="${deptItems}">
<html:option value="${f:h(d.id)}">${f:h(d.name)}</html:option>
</c:forEach>
</html:select>
</td>
</tr>
</table>
<input type="submit" name="confirm_for_add" value="確認"/>
<input type="submit" name="index" value="戻る"/>
</s:form>
</body>
</html>
Everything is expanded.Everything is shortened.
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
<%@page pageEncoding="UTF-8"%>
<html>
<head>
<title>Employee Confirm</title>
</head>
<body>
<html:errors/>
<s:form>
<html:hidden property="name"/>
<html:hidden property="jobType"/>
<html:hidden property="salary"/>
<html:hidden property="departmentId"/>
<html:hidden property="version"/>
<table>
<tr>
<td>Name</td><td>${f:h(name)}</td>
</tr>
<tr>
<td>JobType</td><td>${f:h(jobType)}</td>
</tr>
<tr>
<td>Salary</td>
<td><fmt:formatNumber value="${f:number(salary, '####')}" pattern="#,###"/></td>
</tr>
<tr>
<td>Department</td><td>${f:h(departmentId)}</td>
</tr>
</table>
<input type="submit" name="add" value="追加"/>
<input type="submit" name="backToEdit" value="戻る"/>
</s:form>
</body>
</html>
Everything is expanded.Everything is shortened.
  1
  2
  3
 
 
 
<s:form>
    <input type="submit" name="edit_for_add" value="追加" />
</s:form>

添付ファイル: fileemployee_add4.jpg 208件 [詳細] fileemployee_add3.jpg 236件 [詳細] fileemployee_add2.jpg 217件 [詳細] fileemployee_add1.jpg 221件 [詳細]

リロード   新規 編集 凍結解除 差分 添付 複製 名前変更   ホーム 一覧 単語検索 最終更新 バックアップ リンク元   ヘルプ   最終更新のRSS
Last-modified: 2012-08-08 (水) 23:26:09 (2928d)