#83 task增加description属性,目录重构

This commit is contained in:
Calvin
2012-08-30 23:44:50 +08:00
parent 8ec177735c
commit cd4f6cab2c
10 changed files with 57 additions and 25 deletions
@@ -0,0 +1,31 @@
package org.springside.examples.quickstart.web.account;
import org.apache.shiro.web.filter.authc.FormAuthenticationFilter;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
/**
* LoginController负责打开登录页面(GET请求)和登录出错页面(POST请求),
* 真正登录的POST请求由Filter完成,
*
* @author calvin
*/
@Controller
public class LoginController {
@RequestMapping(value = "/login", method = RequestMethod.GET)
public String login() {
return "account/login";
}
@RequestMapping(value = "/login", method = RequestMethod.POST)
public String fail(@RequestParam(FormAuthenticationFilter.DEFAULT_USERNAME_PARAM) String userName, Model model) {
model.addAttribute(FormAuthenticationFilter.DEFAULT_USERNAME_PARAM, userName);
return "account/login";
}
}
@@ -1,4 +1,4 @@
package org.springside.examples.quickstart.web;
package org.springside.examples.quickstart.web.task;
import java.util.List;
@@ -45,13 +45,13 @@ public class TaskController {
List<Task> tasks = taskService.getUserTask(userId);
model.addAttribute("tasks", tasks);
return "taskList";
return "task/taskList";
}
@RequestMapping(value = "create")
public String createForm(Model model) {
model.addAttribute("task", new Task());
return "taskForm";
return "task/taskForm";
}
@RequestMapping(value = "save")
@@ -67,7 +67,7 @@ public class TaskController {
@RequestMapping(value = "update/{id}")
public String updateForm(@PathVariable("id") Long id, Model model) {
model.addAttribute("task", taskService.getTask(id));
return "taskForm";
return "task/taskForm";
}
@RequestMapping(value = "save/{id}")
@@ -84,8 +84,7 @@
<beans profile="development">
<context:property-placeholder ignore-resource-not-found="true"
location="classpath*:/application.properties,
classpath*:/application.development.properties,
classpath*:/application.development-local.properties" />
classpath*:/application.development.properties" />
<!-- DBCP连接池 -->
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
@@ -4,7 +4,8 @@ drop table if exists ss_user;
create table ss_task (
id bigint generated by default as identity,
title varchar(255) not null,
title varchar(128) not null,
description varchar(255),
user_id bigint,
primary key (id)
);
@@ -22,11 +22,17 @@
<fieldset>
<legend><small>管理任务</small></legend>
<div class="control-group">
<label for="title" class="control-label">任务名称:</label>
<label for="task.title" class="control-label">任务名称:</label>
<div class="controls">
<input type="text" id="task.title" name="title" size="50" value="${task.title}" class="required" minlength="3"/>
</div>
</div>
<div class="control-group">
<label for="task.description" class="control-label">任务描述:</label>
<div class="controls">
<textarea id="task.description" name="description">${task.description}</textarea>
</div>
</div>
<div class="form-actions">
<input id="submit_btn" class="btn btn-primary" type="submit" value="提交"/>&nbsp;
<input id="cancel_btn" class="btn" type="button" value="返回" onclick="history.back()"/>
@@ -12,7 +12,7 @@
</c:if>
<table id="contentTable" class="table table-striped table-bordered table-condensed">
<thead><tr><th>任务标题</th><th>管理</th></tr></thead>
<thead><tr><th>任务</th><th>管理</th></tr></thead>
<tbody>
<c:forEach items="${tasks}" var="task">
<tr>
@@ -1,6 +1,7 @@
insert into SS_TASK (ID,TITLE,USER_ID) values(1, 'Study PlayFramework 2.0',1);
insert into SS_TASK (ID,TITLE,USER_ID) values(2, 'Study Grails 2.0',1);
insert into SS_TASK (ID,TITLE,USER_ID) values(3, 'Try SpringFuse',1);
insert into SS_TASK (ID,TITLE,USER_ID) values(4, 'Try Spring Roo',1);
insert into SS_TASK (ID,TITLE,USER_ID) values(5, 'Release SprignSide 4.0',1);
insert into SS_USER (ID,LOGIN_NAME,NAME,PASSWORD,SALT) values(1,'user','Calvin','2488aa0c31c624687bd9928e0a5d29e7d1ed520b','6d65d24122c30500');
insert into SS_TASK (ID, TITLE, DESCRIPTION, USER_ID) values(1, 'Study PlayFramework 2.0','http://www.playframework.org/', 1);
insert into SS_TASK (ID, TITLE, DESCRIPTION, USER_ID) values(2, 'Study Grails 2.0','http://www.grails.org/', 1);
insert into SS_TASK (ID, TITLE, DESCRIPTION, USER_ID) values(3, 'Try SpringFuse','http://www.springfuse.com/', 1);
insert into SS_TASK (ID, TITLE, DESCRIPTION, USER_ID) values(4, 'Try Spring Roo','http://www.springsource.org/spring-roo', 1);
insert into SS_TASK (ID, TITLE, DESCRIPTION, USER_ID) values(5, 'Release SpringSide 4.0','As soon as posibble', 1);
insert into SS_USER (ID, LOGIN_NAME, NAME, PASSWORD, SALT) values(1,'user','Calvin','2488aa0c31c624687bd9928e0a5d29e7d1ed520b','6d65d24122c30500');
+2 -6
View File
@@ -495,19 +495,15 @@
<artifactId>maven-antrun-plugin</artifactId>
<configuration>
<target>
<property file="src/main/resources/application.development-local.properties" />
<property file="src/main/resources/application.development.properties" />
<property file="src/main/resources/application.properties" />
<property name="sql.type" value="h2" />
<sql driver="${jdbc.driver}" url="${jdbc.url}" userid="${jdbc.username}" password="${jdbc.password}" onerror="continue">
<classpath refid="maven.test.classpath" />
<transaction src="src/main/resources/sql/${sql.type}/schema.sql"/>
<transaction src="src/main/resources/sql/h2/schema.sql"/>
<transaction src="src/test/resources/data/import-data.sql"/>
</sql>
<sql driver="${quartz.jdbc.driver}" url="${quartz.jdbc.url}" userid="${quartz.jdbc.username}" password="${quartz.jdbc.password}"
src="src/main/resources/sql/${sql.type}/quartz.sql" onerror="continue">
src="src/main/resources/sql/h2/quartz.sql" onerror="continue">
<classpath refid="maven.test.classpath" />
</sql>
</target>
@@ -106,8 +106,7 @@
<beans profile="development">
<context:property-placeholder ignore-resource-not-found="true"
location="classpath*:/application.properties,
classpath*:/application.development.properties,
classpath*:/application.development-local.properties" />
classpath*:/application.development.properties" />
<!-- DBCP连接池 -->
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
@@ -130,8 +129,7 @@
<!-- unit test环境 -->
<beans profile="test">
<context:property-placeholder ignore-resource-not-found="true"
location="classpath*:/application.properties,
classpath*:/application.test.properties" />
location="classpath*:/application.properties" />
<!-- 嵌入式内存中数据库 -->
<jdbc:embedded-database id="dataSource" type="H2">