Top > SAStrutsあれこれ > チュートリアルの「データベースを使ったサンプル」

Everything is expanded.Everything is shortened.
  1
  2
  3
 
 
 
    @ActionForm
    @Resource
    protected EmployeeForm employeeForm;
Everything is expanded.Everything is shortened.
  1
  2
  3
 
 
 
    @ActionForm
    @Resource
    protected EmployeeForm semployeeForm;

Everything is expanded.Everything is shortened.
  1
  2
  3
 
 
 
    @ActionForm
    @Resource(name = "semployeeForm")
    protected EmployeeForm semployeeForm;
Everything is expanded.Everything is shortened.
  1
  2
  3
  4
  5
 
 
 
 
 
    @Resource
    protected EmployeeService employeeService;
 
    @Resource
    protected DepartmentService departmentService;

Everything is expanded.Everything is shortened.
  1
  2
  3
  4
 
 
-
!
package tutorial.service;
import tutorial.entity.Employee;
public class EmployeeService extends AbstractService<Employee> {
}
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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
<%@page pageEncoding="UTF-8" %>
<html>
<head>
<title>Tutorial: Employee List</title>
<link rel="stylesheet" type="text/css" href="${f:url('/css/sa.css')}" />
 
</head>
<body>
<h1>Tutorial: Employee List</h1>
 
<table border="1">
<tr style="background-color:pink">
<th>Id</th><th>Name</th><th>JobType</th><th>Salary</th><th>Department</th><th>編集</th>
</tr>
<c:forEach var="e" varStatus="s" items="${empItems}">
<tr style="background-color:${s.index %2 == 0 ? 'white' : 'yellow'}">
<td align="right">${f:h(e.id)}</td>
<td>${f:h(e.name)}</td>
<td>${f:h(e.jobType)}</td>
<td align="right"><fmt:formatNumber value="${e.salary}" pattern="#,##0"/></td>
<td>${f:label(e.departmentId, deptItems, "id", "name")}</td>
<td><s:link href="edit/${f:u(e.id)}">編集</s:link></td>
</tr>
</c:forEach>
</table>
 
</body>
</html>

Everything is expanded.Everything is shortened.
  1
 
<td>${f:label(e.departmentId, deptItems, "id", "name")}</td>
Everything is expanded.Everything is shortened.
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 
 
 
 
-
|
|
|
|
|
!
    @Resource
    protected JdbcManager jdbcManager;
 
    @Execute(validator = false)
    public String index() {
        empItems = jdbcManager.from(Employee.class).orderBy("id")
                .getResultList();
        deptItems = jdbcManager.from(Department.class).orderBy("id")
                .getResultList();
        return "index.jsp";
    }
  0
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE components PUBLIC "-//SEASAR//DTD S2Container 2.4//EN"
	"http://www.seasar.org/dtd/components24.dtd">
<components>
 
	<include path="jdbc.dicon"/>
	<include path="s2jdbc-internal.dicon"/>
	<component name="jdbcManager" class="org.seasar.extension.jdbc.manager.JdbcManagerImpl">
		<property name="maxRows">0</property>
		<property name="fetchSize">0</property>
		<property name="queryTimeout">0</property>
		<property name="dialect">hsqlDialect</property>
	</component>
</components>

添付ファイル: filetutorial_db_er.jpg 750件 [詳細] fileemployee_hsqldb1.jpg 760件 [詳細]

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