- 浏览: 371788 次
- 性别:
- 来自: 北京
文章分类
最新评论
-
lgh1992314:
scugxl 写道这个java.ext.dirs属于加载的JR ...
classpath 和 java.ext.dirs 的区别 -
Oneforher:
java -Djava.ext.dirs 加载Lib后,%JA ...
classpath 和 java.ext.dirs 的区别 -
cxw1128:
java -Djava.ext.dirs=/home/ice/ ...
classpath 和 java.ext.dirs 的区别 -
suosuo230:
同感,纠结了一天了,才发现,比你们晚发现2-4年
com.ibm.icu.text.SimpleDateFormat 的陷阱 -
scugxl:
这个java.ext.dirs属于加载的JRE/LIB/EXT ...
classpath 和 java.ext.dirs 的区别
SPRING-REST和CXF-REST实现过程中的系列问题
- 博客分类:
- Java
1、mybatis 数字用$,字符用#
2、cxf 关于JSONProvider 返回单个对象数组的问题。
app-rest.xml配置
javabean代码
相关源代码参见截图:
备注:
a.arrayKeys和serializeAsArray组合使用,serializeAsArray=true表示arrayKeys中提到的属性值都以数组形式返回,解决单条数据不以数组形式返回的问题。
b.arrayKeys是值需要以数组形式返回的属性名字。如上是comment而不是commentList。
4、cxf关于数字类型的字符串自动被去掉引号的问题。
具体原因参见:org.codehaus.jettison.mapped.DefaultConverter和org.codehaus.jettison.mapped.SimpleConverter
方法1:SimpleConverter的实现去重写DefaultConverter。
方法2:修改配置使其默认用SimpleConverter即可。具体怎么配置目前还不知道。
5、spring mvc rest空对象也被返回的问题。
6、spring mvc rest支持jsonp的问题。
重写MappingJacksonJsonpView 类
7、cxf rest 支持jsonp的问题。
参见:http://cxf.apache.org/docs/jax-rs-data-bindings.html#JAX-RSDataBindings-JSONWithPadding%28JSONP%29
One option for supporting "JSON With Padding" (JSONP) is to extend the default JSONProvider and override its writeTo method as follows:
Similar approach can work when Jackson is used.
Alternatively, a custom servlet filter can be used to support JSONP. Please read the Supporting JSONP blog post for more information.
Starting from CXF 2.3.4 and 2.4.0, JSONP can be supported with the help of CXF in/out interceptors:
JsonpInInterceptor checks if a JSONP callback query parameter is available (default is _jsonp) and if yes then it saves its value on the current exchange for out interceptors to know if they have to write the paddings or not. The name of the expected callback parameter can be customized. JsonpPreStreamInterceptor and JsonpPostStreamInterceptor ensure the actual JSON stream is 'padded' properly. JsonpPreStreamInterceptor will also set Content-Type to "application/x+javascript" by default but this can be changed:
8、关于ThreadLocal与线程池的问题。
Web服务器使用线程池,所以会有重用线程的问题,而ThreadLocal是根据线程ID来区分的。
http://blog.csdn.net/comliu/article/details/3186778
http://hi.baidu.com/sqxxr/item/e9946b34427c5ec02e8ec294
9、安装tomcat支持apr
http://blog.163.com/chhj_292/blog/static/12229472008101434124476/
2、cxf 关于JSONProvider 返回单个对象数组的问题。
app-rest.xml配置
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:util="http://www.springframework.org/schema/util" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxrs="http://cxf.apache.org/jaxrs" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd"> <import resource="classpath:META-INF/cxf/cxf.xml" /> <import resource="classpath:META-INF/cxf/cxf-servlet.xml" /> <import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml" /> <util:list id="jsonKeys"> <value>app</value> <value>comment</value> </util:list> <util:list id="jsonTypes"> <value>application/json</value> <value>application/jettison</value> </util:list> <bean id="jsonProvider" class="org.apache.cxf.jaxrs.provider.JSONProvider"> <property name="arrayKeys" ref="jsonKeys" /> <property name="serializeAsArray" value="true" /> <property name="produceMediaTypes" ref="jsonTypes" /> <property name="consumeMediaTypes" ref="jsonTypes" /> </bean> <jaxrs:server id="commonsService" address="/"> <jaxrs:extensionMappings> <entry key="json" value="application/json" /> <entry key="xml" value="application/xml" /> </jaxrs:extensionMappings> <jaxrs:serviceBeans> <ref bean="commentsServiceImpl" /> <ref bean="userServiceImpl" /> <ref bean="postServiceImpl" /> <ref bean="contentRestImpl" /> <ref bean="collectListRestImpl" /> <ref bean="downloadListRestImpl" /> <ref bean="rankServiceRestImpl" /> <ref bean="appAddImpl" /> <ref bean="appPush" /> </jaxrs:serviceBeans> <jaxrs:providers> <ref bean="jsonProvider" /> </jaxrs:providers> </jaxrs:server> </beans>
javabean代码
import java.io.Serializable; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import sgh.comment.base.model.Comments; //评论列表 @XmlAccessorType(XmlAccessType.FIELD) public class CommentsResult implements Serializable { private static final long serialVersionUID = -6304211106650057160L; /** * 总条数 */ public Integer totalCount; /** * 总页数 */ public Integer totalPage; /** * APP评论 */ @XmlElement(name="comment") public List<Comments> commentList; }
相关源代码参见截图:
备注:
a.arrayKeys和serializeAsArray组合使用,serializeAsArray=true表示arrayKeys中提到的属性值都以数组形式返回,解决单条数据不以数组形式返回的问题。
b.arrayKeys是值需要以数组形式返回的属性名字。如上是comment而不是commentList。
4、cxf关于数字类型的字符串自动被去掉引号的问题。
具体原因参见:org.codehaus.jettison.mapped.DefaultConverter和org.codehaus.jettison.mapped.SimpleConverter
方法1:SimpleConverter的实现去重写DefaultConverter。
方法2:修改配置使其默认用SimpleConverter即可。具体怎么配置目前还不知道。
5、spring mvc rest空对象也被返回的问题。
<property name="defaultViews"> <list> <!-- for application/json --> <bean class="org.springframework.web.servlet.view.json.MappingJacksonJsonView"> <!-- 重新设置 objectMapper --> <property name="objectMapper"> <bean class="org.codehaus.jackson.map.ObjectMapper"> <!-- 设置objectMapper的serializationConfig的serializationInclusion属性,以忽略null对象 ,也可在vo上注解@JsonWriteNullProperties(false)--> <property name="serializationConfig.serializationInclusion"> <value type="org.codehaus.jackson.map.annotate.JsonSerialize.Inclusion">NON_NULL</value> </property> </bean> </property> </bean> <!-- for application/jsonp --> <bean class="org.springframework.web.servlet.view.jsonp.MappingJacksonJsonpView"> <!-- 重新设置 objectMapper --> <property name="objectMapper"> <bean class="org.codehaus.jackson.map.ObjectMapper"> <!-- 设置objectMapper的serializationConfig的serializationInclusion属性,以忽略null对象 ,也可在vo上注解@JsonWriteNullProperties(false)--> <property name="serializationConfig.serializationInclusion"> <value type="org.codehaus.jackson.map.annotate.JsonSerialize.Inclusion">NON_NULL</value> </property> </bean> </property> </bean> <!-- for application/xml --> <!-- <bean class="org.springframework.web.servlet.view.xml.MarshallingView"> <property name="marshaller" ref="castorMarshaller" /> </bean> --> </list> </property>
6、spring mvc rest支持jsonp的问题。
<!-- 设置为true以忽略对Accept Header的支持,默认false --> <property name="ignoreAcceptHeader" value="false" /> <!-- 设置为true以开启对扩展名支持,默认true --> <property name="favorPathExtension" value="true" /> <!-- 用于开启 /userinfo/123?format=json的支持,默认false --> <property name="favorParameter" value="true" /> <!-- 在没有扩展名和参数时即: "/user/1" 时的默认展现形式 --> <property name="defaultContentType" value="application/xml" /> <property name="mediaTypes"> <map> <entry key="xml" value="application/xml" /> <entry key="json" value="application/json" /> <entry key="jsonp" value="application/javascript"/> </map> </property>
重写MappingJacksonJsonpView 类
package org.springframework.web.servlet.view.jsonp; import org.springframework.web.servlet.view.json.MappingJacksonJsonView; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.Map; public class MappingJacksonJsonpView extends MappingJacksonJsonView { /** * Default content type. Overridable as bean property. */ public static final String DEFAULT_CONTENT_TYPE = "application/javascript"; @Override public String getContentType() { return DEFAULT_CONTENT_TYPE; } /** * Prepares the view given the specified model, merging it with static * attributes and a RequestContext attribute, if necessary. Delegates to * renderMergedOutputModel for the actual rendering. * * @see #renderMergedOutputModel */ @Override public void render(Map<String, ?> model, HttpServletRequest request, HttpServletResponse response) throws Exception { if ("GET".equals(request.getMethod().toUpperCase())) { @SuppressWarnings("unchecked") Map<String, String[]> params = request.getParameterMap(); if (params.containsKey("callback")) { response.getOutputStream().write(new String(params.get("callback")[0] + "(").getBytes()); super.render(model, request, response); response.getOutputStream().write(new String(");").getBytes()); response.setContentType("application/javascript"); } else { super.render(model, request, response); } } else { super.render(model, request, response); } } }
7、cxf rest 支持jsonp的问题。
参见:http://cxf.apache.org/docs/jax-rs-data-bindings.html#JAX-RSDataBindings-JSONWithPadding%28JSONP%29
One option for supporting "JSON With Padding" (JSONP) is to extend the default JSONProvider and override its writeTo method as follows:
@Produces("application/javascript") class JsonpProvider extends JSONProvider { @Override public void writeTo(Object obj, Class<?> cls, Type genericType, Annotation[] anns, MediaType m, MultivaluedMap<String, Object> headers, OutputStream os) throws IOException { String prefix = getContext().getHttpServletRequest().getParameter("_jsonp"); boolean hasPrefix = !isEmpty(prefix); if(hasPrefix) { os.write(prefix.getBytes(HttpUtils.getSetEncoding(m, headers, "UTF-8"))); os.write('('); } super.writeTo(obj, cls, genericType, anns, m, headers, os); if(hasPrefix) { os.write(')'); } } }
Similar approach can work when Jackson is used.
Alternatively, a custom servlet filter can be used to support JSONP. Please read the Supporting JSONP blog post for more information.
Starting from CXF 2.3.4 and 2.4.0, JSONP can be supported with the help of CXF in/out interceptors:
<jaxrs:server id="bookJsonp" address="/jsonp"> <jaxrs:serviceBeans> <ref bean="serviceBean" /> </jaxrs:serviceBeans> <jaxrs:inInterceptors> <bean class="org.apache.cxf.jaxrs.provider.jsonp.JsonpInInterceptor"/> </jaxrs:inInterceptors> <jaxrs:outInterceptors> <bean class="org.apache.cxf.jaxrs.provider.jsonp.JsonpPreStreamInterceptor"/> <bean class="org.apache.cxf.jaxrs.provider.jsonp.JsonpPostStreamInterceptor"/> </jaxrs:outInterceptors> </jaxrs:server>
JsonpInInterceptor checks if a JSONP callback query parameter is available (default is _jsonp) and if yes then it saves its value on the current exchange for out interceptors to know if they have to write the paddings or not. The name of the expected callback parameter can be customized. JsonpPreStreamInterceptor and JsonpPostStreamInterceptor ensure the actual JSON stream is 'padded' properly. JsonpPreStreamInterceptor will also set Content-Type to "application/x+javascript" by default but this can be changed:
<jaxrs:server id="bookJsonp" address="/jsonp"> <jaxrs:serviceBeans> <ref bean="serviceBean" /> </jaxrs:serviceBeans> <jaxrs:inInterceptors> <bean class="org.apache.cxf.jaxrs.provider.jsonp.JsonpInInterceptor"> <property name="callbackParam" value="myjsonp"/> </bean> </jaxrs:inInterceptors> <jaxrs:outInterceptors> <bean class="org.apache.cxf.jaxrs.provider.jsonp.JsonpPreStreamInterceptor"> <property name="mediaType" value="text/x+javascript"/> </bean> <bean class="org.apache.cxf.jaxrs.provider.jsonp.JsonpPostStreamInterceptor"> <!-- default is ');' --> <property name="paddingEnd" value=")"/> </bean> </jaxrs:outInterceptors> </jaxrs:server>
8、关于ThreadLocal与线程池的问题。
Web服务器使用线程池,所以会有重用线程的问题,而ThreadLocal是根据线程ID来区分的。
http://blog.csdn.net/comliu/article/details/3186778
http://hi.baidu.com/sqxxr/item/e9946b34427c5ec02e8ec294
9、安装tomcat支持apr
cd /usr/local/apache-tomcat-6.0.18/bin/tomcat-native-1.1.14-src/jni/native/ ./configure --prefix=/usr/local/apr ./configure --with-apr=/usr/local/apr make make install
http://blog.163.com/chhj_292/blog/static/12229472008101434124476/
评论
2 楼
fengfujie
2013-08-07
cxf rest 支持jsonp的问题。我按照你这个方式返回的数据是这样的怎么回事
callback(<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ats><city_list><city><adcode>100000</adcode><citycode></citycode><enable>1</enable><latitude>39.915085</latitude><longitude>116.3683244</longitude><name_en>The People's Republic of China</name_en><name_zh>中华人民共和国</name_zh><pinyin>ZhongHuaRenMinGongHeGuo</pinyin><short_code>ZHRMGHG</short_code></city><city><adcode>110000</adcode><citycode>010</citycode><enable>1</enable><latitude>39.904989</latitude><longitude>116.405285</longitude><name_en>Beijing City</name_en><name_zh>北京市</name_zh><pinyin>BeiJingShi</pinyin><short_code>BJ</short_code></city><city><adcode>110101</adcode><citycode>010</citycode><enable>1</enable><latitude>39.917544</latitude><longitude>116.418757</longitude><name_en>Dongcheng District</name_en><name_zh>东城区</name_zh><pinyin>DongChengQu</pinyin><short_code>DC</short_code></city><city><adcode>110102</adcode><citycode>010</citycode><enable>1</enable><latitude>39.915309</latitude><longitude>116.366794</longitude><name_en>Xicheng District</name_en><name_zh>西城区</name_zh><pinyin>XiChengQu</pinyin><short_code>XC</short_code></city><city><adcode>110105</adcode><citycode>010</citycode><enable>1</enable><latitude>39.921489</latitude><longitude>116.486409</longitude><name_en>Chaoyang District</name_en><name_zh>朝阳区</name_zh><pinyin>ChaoYangQu</pinyin><short_code>CY</short_code></city><city><adcode>110106</adcode><citycode>010</citycode><enable>1</enable><latitude>39.860337</latitude><longitude>116.312765</longitude><name_en>Fengtai District</name_en><name_zh>丰台区</name_zh><pinyin>FengTaiQu</pinyin><short_code>FS</short_code></city><city><adcode>110107</adcode><citycode>010</citycode><enable>1</enable><latitude>39.926085</latitude><longitude>116.186736</longitude><name_en>Shijingshan District</name_en><name_zh>石景山区</name_zh><pinyin>ShiJingShanQu</pinyin><short_code>SJS</short_code></city><city><adcode>110108</adcode><citycode>010</citycode><enable>1</enable><latitude>39.956074</latitude><longitude>116.310316</longitude><name_en>Haidian District</name_en><name_zh>海淀区</name_zh><pinyin>HaiDianQu</pinyin><short_code>HD</short_code></city><city><adcode>110109</adcode><citycode>010</citycode><enable>1</enable><latitude>39.937183</latitude><longitude>116.105381</longitude><name_en>Mentougou District</name_en><name_zh>门头沟区</name_zh><pinyin>MenTouGouQu</pinyin><short_code>MTG</short_code></city><city><adcode>110111</adcode><citycode>010</citycode><enable>1</enable><latitude>39.735535</latitude><longitude>116.139157</longitude><name_en>Fangshan District</name_en><name_zh>房山区</name_zh><pinyin>FangShanQu</pinyin><short_code>FS</short_code></city><city><adcode>110112</adcode><citycode>010</citycode><enable>1</enable><latitude>39.902486</latitude><longitude>116.658603</longitude><name_en>Tongzhou District</name_en><name_zh>通州区</name_zh><pinyin>TongZhouQu</pinyin><short_code>TZ</short_code></city><city><adcode>110113</adcode><citycode>010</citycode><enable>1</enable><latitude>40.128936</latitude><longitude>116.653525</longitude><name_en>Shunyi District</name_en><name_zh>顺义区</name_zh><pinyin>ShunYiQu</pinyin><short_code>SY</short_code></city><city><adcode>110114</adcode><citycode>010</citycode><enable>1</enable><latitude>40.218085</latitude><longitude>116.235906</longitude><name_en>Changping District</name_en><name_zh>昌平区</name_zh><pinyin>ChangPingQu</pinyin><short_code>CP</short_code></city><city><adcode>110115</adcode><citycode>010</citycode><enable>1</enable><latitude>39.755477</latitude><longitude>116.337733</longitude><name_en>Daxing District</name_en><name_zh>大兴区</name_zh><pinyin>DaXingQu</pinyin><short_code>DX</short_code></city><city><adcode>110116</adcode><citycode>010</citycode><enable>1</enable><latitude>40.324272</latitude><longitude>116.637122</longitude><name_en>Huairou District</name_en><name_zh>怀柔区</name_zh><pinyin>HuaiRouQu</pinyin><short_code>HR</short_code></city><city><adcode>110117</adcode><citycode>010</citycode><enable>1</enable><latitude>40.144783</latitude><longitude>117.112335</longitude><name_en>Pinggu District</name_en><name_zh>平谷区</name_zh><pinyin>PingGuQu</pinyin><short_code>PG</short_code></city><city><adcode>110228</adcode><citycode>010</citycode><enable>1</enable><latitude>40.377362</latitude><longitude>116.843352</longitude><name_en>Miyun County</name_en><name_zh>密云县</name_zh><pinyin>MiYunXian</pinyin><short_code>MY</short_code></city><city><adcode>110229</adcode><citycode>010</citycode><enable>1</enable><latitude>40.465325</latitude><longitude>115.985006</longitude><name_en>Yanqing County</name_en><name_zh>延庆县</name_zh><pinyin>YanQingXian</pinyin><short_code>YQ</short_code></city><city><adcode>120000</adcode><citycode>022</citycode><enable>1</enable><latitude>39.125596</latitude><longitude>117.190182</longitude><name_en>Tianjin City</name_en><name_zh>天津市</name_zh><pinyin>TianJinShi</pinyin><short_code>TJ</short_code></city><city><adcode>120101</adcode><citycode>022</citycode><enable>1</enable><latitude>39.118327</latitude><longitude>117.195907</longitude><name_en>Heping District</name_en><name_zh>和平区</name_zh><pinyin>HePingQu</pinyin><short_code>HP</short_code></city></city_list><code>1</code><message>Successful.</message><result>true</result><timestamp>1375858376</timestamp><total>3223</total><version>2.0 - 2.0.3218.1805</version></ats>)
callback(<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ats><city_list><city><adcode>100000</adcode><citycode></citycode><enable>1</enable><latitude>39.915085</latitude><longitude>116.3683244</longitude><name_en>The People's Republic of China</name_en><name_zh>中华人民共和国</name_zh><pinyin>ZhongHuaRenMinGongHeGuo</pinyin><short_code>ZHRMGHG</short_code></city><city><adcode>110000</adcode><citycode>010</citycode><enable>1</enable><latitude>39.904989</latitude><longitude>116.405285</longitude><name_en>Beijing City</name_en><name_zh>北京市</name_zh><pinyin>BeiJingShi</pinyin><short_code>BJ</short_code></city><city><adcode>110101</adcode><citycode>010</citycode><enable>1</enable><latitude>39.917544</latitude><longitude>116.418757</longitude><name_en>Dongcheng District</name_en><name_zh>东城区</name_zh><pinyin>DongChengQu</pinyin><short_code>DC</short_code></city><city><adcode>110102</adcode><citycode>010</citycode><enable>1</enable><latitude>39.915309</latitude><longitude>116.366794</longitude><name_en>Xicheng District</name_en><name_zh>西城区</name_zh><pinyin>XiChengQu</pinyin><short_code>XC</short_code></city><city><adcode>110105</adcode><citycode>010</citycode><enable>1</enable><latitude>39.921489</latitude><longitude>116.486409</longitude><name_en>Chaoyang District</name_en><name_zh>朝阳区</name_zh><pinyin>ChaoYangQu</pinyin><short_code>CY</short_code></city><city><adcode>110106</adcode><citycode>010</citycode><enable>1</enable><latitude>39.860337</latitude><longitude>116.312765</longitude><name_en>Fengtai District</name_en><name_zh>丰台区</name_zh><pinyin>FengTaiQu</pinyin><short_code>FS</short_code></city><city><adcode>110107</adcode><citycode>010</citycode><enable>1</enable><latitude>39.926085</latitude><longitude>116.186736</longitude><name_en>Shijingshan District</name_en><name_zh>石景山区</name_zh><pinyin>ShiJingShanQu</pinyin><short_code>SJS</short_code></city><city><adcode>110108</adcode><citycode>010</citycode><enable>1</enable><latitude>39.956074</latitude><longitude>116.310316</longitude><name_en>Haidian District</name_en><name_zh>海淀区</name_zh><pinyin>HaiDianQu</pinyin><short_code>HD</short_code></city><city><adcode>110109</adcode><citycode>010</citycode><enable>1</enable><latitude>39.937183</latitude><longitude>116.105381</longitude><name_en>Mentougou District</name_en><name_zh>门头沟区</name_zh><pinyin>MenTouGouQu</pinyin><short_code>MTG</short_code></city><city><adcode>110111</adcode><citycode>010</citycode><enable>1</enable><latitude>39.735535</latitude><longitude>116.139157</longitude><name_en>Fangshan District</name_en><name_zh>房山区</name_zh><pinyin>FangShanQu</pinyin><short_code>FS</short_code></city><city><adcode>110112</adcode><citycode>010</citycode><enable>1</enable><latitude>39.902486</latitude><longitude>116.658603</longitude><name_en>Tongzhou District</name_en><name_zh>通州区</name_zh><pinyin>TongZhouQu</pinyin><short_code>TZ</short_code></city><city><adcode>110113</adcode><citycode>010</citycode><enable>1</enable><latitude>40.128936</latitude><longitude>116.653525</longitude><name_en>Shunyi District</name_en><name_zh>顺义区</name_zh><pinyin>ShunYiQu</pinyin><short_code>SY</short_code></city><city><adcode>110114</adcode><citycode>010</citycode><enable>1</enable><latitude>40.218085</latitude><longitude>116.235906</longitude><name_en>Changping District</name_en><name_zh>昌平区</name_zh><pinyin>ChangPingQu</pinyin><short_code>CP</short_code></city><city><adcode>110115</adcode><citycode>010</citycode><enable>1</enable><latitude>39.755477</latitude><longitude>116.337733</longitude><name_en>Daxing District</name_en><name_zh>大兴区</name_zh><pinyin>DaXingQu</pinyin><short_code>DX</short_code></city><city><adcode>110116</adcode><citycode>010</citycode><enable>1</enable><latitude>40.324272</latitude><longitude>116.637122</longitude><name_en>Huairou District</name_en><name_zh>怀柔区</name_zh><pinyin>HuaiRouQu</pinyin><short_code>HR</short_code></city><city><adcode>110117</adcode><citycode>010</citycode><enable>1</enable><latitude>40.144783</latitude><longitude>117.112335</longitude><name_en>Pinggu District</name_en><name_zh>平谷区</name_zh><pinyin>PingGuQu</pinyin><short_code>PG</short_code></city><city><adcode>110228</adcode><citycode>010</citycode><enable>1</enable><latitude>40.377362</latitude><longitude>116.843352</longitude><name_en>Miyun County</name_en><name_zh>密云县</name_zh><pinyin>MiYunXian</pinyin><short_code>MY</short_code></city><city><adcode>110229</adcode><citycode>010</citycode><enable>1</enable><latitude>40.465325</latitude><longitude>115.985006</longitude><name_en>Yanqing County</name_en><name_zh>延庆县</name_zh><pinyin>YanQingXian</pinyin><short_code>YQ</short_code></city><city><adcode>120000</adcode><citycode>022</citycode><enable>1</enable><latitude>39.125596</latitude><longitude>117.190182</longitude><name_en>Tianjin City</name_en><name_zh>天津市</name_zh><pinyin>TianJinShi</pinyin><short_code>TJ</short_code></city><city><adcode>120101</adcode><citycode>022</citycode><enable>1</enable><latitude>39.118327</latitude><longitude>117.195907</longitude><name_en>Heping District</name_en><name_zh>和平区</name_zh><pinyin>HePingQu</pinyin><short_code>HP</short_code></city></city_list><code>1</code><message>Successful.</message><result>true</result><timestamp>1375858376</timestamp><total>3223</total><version>2.0 - 2.0.3218.1805</version></ats>)
1 楼
苹果超人
2013-07-21
请问一下cxf-extension-jaxrsbinding.xml在哪个jar包中,我一直缺这个文件。
发表评论
-
classpath 和 java.ext.dirs 的区别
2012-10-29 10:36 23952先说说我的遭遇: 以下是我到运行脚本 java -cp l ... -
InputStream与String,Byte之间互转
2012-06-28 21:10 1210itStream outStream = nenputSt ... -
java操作redis
2012-05-11 16:26 26790转自:http://jzkangta.iteye. ... -
不用安装oracle客户端也可以用plsql连接远程oracle
2012-05-08 14:22 1920每次问人家,plsql 可不可以直接远程连接服务器,他们 ... -
solr no such core
2012-02-28 17:36 1503前几天配置solr3.5嵌入式的时候,老实报“no such ... -
JAVA获取文件的MD5码,比较两个文件是否相同
2012-02-21 16:41 8692System.out.println(DigestUtil ... -
java.security.AccessControlException: access denied 解决办法
2011-12-26 15:45 5394用eclipse启动tomcat时报如下错误: java. ... -
HttpClient在使用中有两个超时时间 区别
2011-11-11 16:30 7009HttpClient在使用中有两个 ... -
cvs version的管理
2011-09-14 10:14 1062我们的项目在某一阶段 ... -
Windows下使用Jconsole远程监控Linux系统中java服务器资源占用情况
2011-08-18 22:43 13761、首先需要停止正在运行的服务:resin-XXX stop ... -
Linux部署java项目注意事项
2011-07-28 11:48 19791、java命令引入jar时可以-cp参数,但时-cp不能用通 ... -
统计图表ChartDirector在Servlet和Struts2中的应用
2011-04-29 16:52 26551、公共配置 a.把ChartDirector.jar放到\ ... -
remoting服务例子
2011-04-12 11:21 18131、remoting-servlet.xml <?x ... -
com.ibm.icu.text.SimpleDateFormat 的陷阱
2011-04-11 11:16 5844在项目中经常用到SimpleDateFormat,从未出过错! ... -
写文件 faster and faster
2011-03-30 11:48 1415import java.io.BufferedWriter ... -
Spring 3.0 注解注入详解
2010-10-26 17:42 5338一、各种注解方式 1.@Aut ... -
Java 信号量 Semaphore
2010-09-16 16:58 1954操作系统的信号量是个很重要的概念,在进程控制方面都有应用。Ja ... -
Hello ServiceLoader
2010-09-16 16:36 3013ServiceLoader 类 Java SE 6 平 ... -
JAVA集合归总
2010-06-21 13:59 908集合类说明及区别 Collec ... -
Tomcat多个Context的配置
2010-04-22 15:37 11955Tomcat中给server.xml加入<Context ...
相关推荐
SPRING-MVC-MQ-CXF-REST_Demo
CXF整合spring实现REST接口开发
这是一个基于maven构建的java项目,整合了Apache CXF框架,实现restful风格的service
spring-cxf-rest-example 带有spring cxf和集成测试的rest接口示例 使用全新安装 tomcat7 运行:运行
Spring启动骆驼cxf休息示例
Spring CXF Restful 实例
这个是cxf+spring发布webservice和restservice的服务端项目
使用了cxf 同时实现了 RESTful WebService --项目启动后访问地址 http://localhost:8080/springMVC/services/rest/equipQuery/getUserById/1?_type=json 本人没有一一列明 xml json 以及post get请求 大家可以在...
Spring+CXF+Maven+REST方式搭建WebService服务端demo测试用例
弹簧-CXF-WS 一些使用spring和cxf生成webservice Rest和Soap的例子
自己在网上找了很多cxf实现rest风格的文章也不少,但是都讲的不全面,也没有lib包,所以自己参考网上零散的文章,搞了大半天才成功的。现在把源码发上来,java代码只有12K,主要是lib里面的全部jar包(spring、cxf等...
Apache CXF配置REST服务,集成到Spring当中。
CXF spring 提供rest服务输出xml或json等格式数据
发布CXF+Spring整合的REST的服务接口完整实例,其中包括数据库连接池,json数据格式传递数据,HttpURLConne的get和post方式调用接口,以及获取访问者ip地址工具类等众多的技术实例。
Hello World Rest 使用 Apache Cxf 和 Spring Framework
Apache CXF is an open source services framework. CXF helps you build and develop services using frontend programming APIs, like JAX-WS and JAX-RS. These services can speak a variety of protocols such ...
绝对可运行,里面有客户端和服务端还有对应的操作文档,导入eclipse或者MyEclipse十分钟内就搞定,虽然贵点但是绝对物有所值.
将 Apache CXF 和 JAX-RS 用于 REST-ful Web 服务的简单示例。 只是一个闲逛的地方,用于对 Kuali Rice 团队进行一些培训和讨论。 运行项目 您可以从命令行(如果安装了 Maven)或从 IDE 启动应用程序。 要使用 ...
使用cxf、spring构建的rest风格webservice,其他相关技术springmvc、mybatis、druid等。代码中使用的数据库为sybase,请根据实际环境更改,需修改pom中引用的数据库驱动,依照entity类的属性建对应表,并修改config....
Spring Boot 整合 Mybatis 实现RESTful API ,具体可以查看博客: http://blog.csdn.net/yaozhiqi1905658804/article/details/70820892