Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
后端镜像
java镜像
Springside4
提交
4fb1044b
S
Springside4
项目概览
后端镜像
/
java镜像
/
Springside4
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Springside4
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4fb1044b
编写于
10月 08, 2012
作者:
C
Calvin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add comments and fix url
上级
cb041981
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
8 addition
and
7 deletion
+8
-7
examples/showcase/src/main/webapp/WEB-INF/views/story/webservice.jsp
...owcase/src/main/webapp/WEB-INF/views/story/webservice.jsp
+2
-2
modules/core/src/main/java/org/springside/modules/persistence/DynamicSpecifications.java
...springside/modules/persistence/DynamicSpecifications.java
+4
-2
modules/core/src/main/java/org/springside/modules/web/Servlets.java
...re/src/main/java/org/springside/modules/web/Servlets.java
+1
-1
modules/test/src/test/resources/applicationContext-test.xml
modules/test/src/test/resources/applicationContext-test.xml
+1
-2
未找到文件。
examples/showcase/src/main/webapp/WEB-INF/views/story/webservice.jsp
浏览文件 @
4fb1044b
...
...
@@ -3,7 +3,7 @@
<c:set
var=
"ctx"
value=
"
${
pageContext
.
request
.
contextPath
}
"
/>
<html>
<head>
<title>
Restful
Service高级演示
</title>
<title>
Web
Service高级演示
</title>
<script>
$
(
document
).
ready
(
function
()
{
$
(
"
#webservice-tab
"
).
addClass
(
"
active
"
);
...
...
@@ -23,7 +23,7 @@
<h2>
2. 基于JAX-RS实现的Restful演示
</h2>
<ul>
<li>
服务端是基于CXF的JAX-WS演示, CXF自动生成的
<a
href=
"${ctx}/cxf/"
>
wadl文件列表
</a></li>
<li>
演示地址:
<a
href=
"${ctx}/cxf/rest/user/1.xml"
>
/cxf/rest/user/1.xml
</a>
与
<a
href=
"${ctx}/cxf/rest/user/1.
xml
"
>
/cxf/rest/user/1.json
</a></li>
<li>
演示地址:
<a
href=
"${ctx}/cxf/rest/user/1.xml"
>
/cxf/rest/user/1.xml
</a>
与
<a
href=
"${ctx}/cxf/rest/user/1.
json
"
>
/cxf/rest/user/1.json
</a></li>
</ul>
<h2>
3. SpringMVC Restful Service高级演示
</h2>
...
...
modules/core/src/main/java/org/springside/modules/persistence/DynamicSpecifications.java
浏览文件 @
4fb1044b
...
...
@@ -29,20 +29,21 @@ public class DynamicSpecifications {
List
<
Predicate
>
predicates
=
Lists
.
newArrayList
();
for
(
SearchFilter
filter
:
filters
)
{
// nested path translate
// nested path translate
, 如Task的名为"user.name"的filedName, 转换为Task.user.name属性
String
[]
names
=
StringUtils
.
split
(
filter
.
fieldName
,
"."
);
Path
expression
=
root
.
get
(
names
[
0
]);
for
(
int
i
=
1
;
i
<
names
.
length
;
i
++)
{
expression
=
expression
.
get
(
names
[
i
]);
}
// convert value
// convert value
from string to target type
Class
attributeClass
=
expression
.
getJavaType
();
if
(!
attributeClass
.
equals
(
String
.
class
)
&&
filter
.
value
instanceof
String
&&
conversionService
.
canConvert
(
String
.
class
,
attributeClass
))
{
filter
.
value
=
conversionService
.
convert
(
filter
.
value
,
attributeClass
);
}
// logic operator
switch
(
filter
.
operator
)
{
case
EQ:
predicates
.
add
(
builder
.
equal
(
expression
,
filter
.
value
));
...
...
@@ -65,6 +66,7 @@ public class DynamicSpecifications {
}
}
// 将所有条件用 and 联合起来
if
(
predicates
.
size
()
>
0
)
{
return
builder
.
and
(
predicates
.
toArray
(
new
Predicate
[
predicates
.
size
()]));
}
...
...
modules/core/src/main/java/org/springside/modules/web/Servlets.java
浏览文件 @
4fb1044b
...
...
@@ -161,7 +161,7 @@ public class Servlets {
}
/**
* 组合Parameters生成Query String的Parameter部分,并在paramter name上加上prefix.
* 组合Parameters生成Query String的Parameter部分,
并在paramter name上加上prefix.
*
* @see #getParametersStartingWith
*/
...
...
modules/test/src/test/resources/applicationContext-test.xml
浏览文件 @
4fb1044b
...
...
@@ -4,8 +4,7 @@
xsi:schemaLocation=
"http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd
"
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.1.xsd"
default-lazy-init=
"true"
>
<description>
Spring公共配置文件
</description>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录