近日,Roy Clarkson发布了Spring Mobile和Spring Android。


Spring Mobile


Spring Mobile 是 Spring MVC 的扩展,用来简化手机上的Web应用开发。



interceptor 定义的示例:
<interceptors>       <!-- On pre-handle, detect the device that originated the web request -->       <beans:bean class="org.springframework.mobile.device.mvc.DeviceResolvingHandlerInterceptor" />   </interceptors>  <interceptors>    <!-- On pre-handle, detect the device that originated the web request -->    <beans:bean class="org.springframework.mobile.device.mvc.DeviceResolvingHandlerInterceptor" /></interceptors>


如果该设备不是移动设备,JSP模板也能有内容的呈现:


Please try again<c:if test="${!currentDevice.mobile}"> or <a href="<c:url value="/signup" />">sign up</a></c:if>  Please try again<c:if test="${!currentDevice.mobile}"> or <a href="<c:url value="/signup" />">sign up</a></c:if> 


如果该设备是一个移动设备,基于Tiles的页面布局将会改变:

Java代码
<definition name="page" templateExpression="/WEB-INF/layouts/${currentDevice.mobile ? 'mobile/' : 'standard/'}page.jsp" />  <definition name="page" templateExpression="/WEB-INF/layouts/${currentDevice.mobile ? 'mobile/' : 'standard/'}page.jsp" />  


Spring Android


Spring Android 是 Spring 框架的扩展,用于简化 Android 本地应用程序的开发。



针对Andriod的客户端,出现了不同的挑战。需要通过REST,与HTTPS服务器上的数据进行交流,因为数据是用户特定的,我们需要知道用户登录是不是使用了基本认证,而且我们也需要将用户名跟密码存储在设备上,所以我们选择了OAuth(查看更多关于OAuth的介绍)http://www.williamlong.info/archives/2185.html。


点击查看更多详情:http://blog.springsource.com/2010/11/19/spring-into-mobile-application-development/

更多相关文章

  1. android adb工具使用
  2. android自动化测试工具简介
  3. android常用命令
  4. Android(安卓)发布可穿戴设备 SDK 的开发者预览版
  5. Android设备和PC设备有线USB连接双向通信预研报告
  6. Android(安卓)获取设备唯一号 unknown
  7. 终于找到一个类似wince 远程桌面控制android设备的软件——Andro
  8. Android干坏事——禁止设备休眠
  9. Android(安卓)蓝牙开发(九)A2DP基本功能

随机推荐

  1. android网络编程——使用Android中的网络
  2. Android(安卓)动态改变app图标
  3. Android(安卓)代码混淆
  4. android 加载图片轻松避免OOM(out of mem
  5. Android(安卓)AsyncChannel源码分析
  6. Android(安卓)IO
  7. Android(安卓)开发者(Android(安卓)Develo
  8. Android中使用Dialog风格弹出框的Activit
  9. Android(安卓)TextView设置个别字体样式
  10. Android联机开发Python