spring mobile site preference管理

Spring Boot 整合——Spring Mobile用来识别请求设备类型的小工具 文章前面 关于版本 依赖 版本 springboot 2.0.8.RELEASE spring-mobile-starter 2.0.0.M2 关于项目 本内容也是我尝试整理工作中接触过各种工具在springboot中使用的方法。下面介绍的所有方法都已经提供了测试用例。因为每个例子涉及代码较多,所以文章中只贴出了部分代码。全部的代码在这里:https://gitee.com/daifyutils/springboot-samples。 Spring Mobile spring mob 阅读详情

http://static.springsource.org/spring-mobile/docs/1.0.0.M3/reference/html/device.html

参考2.4.2节,下面是我运行成功的配置:

    <annotation-driven>
        <argument-resolvers>
            <beans:bean class="org.springframework.mobile.device.site.SitePreferenceWebArgumentResolver" />
            <beans:bean class="org.springframework.mobile.device.DeviceWebArgumentResolver" />
            <beans:bean class="org.springframework.mobile.device.site.SitePreferenceWebArgumentResolver" />
        </argument-resolvers>    
    </annotation-driven>

    <interceptors>
    
        <!-- Detects the client's Device using WURFL -->
        <beans:bean class="org.springframework.mobile.device.DeviceResolverHandlerInterceptor">
            <beans:constructor-arg>
                <device:wurfl-device-resolver root-location="/WEB-INF/wurfl/wurfl-2.0.28.zip" patch-locations="/WEB-INF/wurfl/web_browsers_patch.xml" />
            </beans:constructor-arg>
        </beans:bean>
        
        <beans:bean class="org.springframework.mobile.device.site.SitePreferenceHandlerInterceptor" />
        
        <!-- Redirects the client to their preferred site if necessary.
             This particular configuration redirects clients preferring the mobile site to 'm.testdomain'.
             NOTE: for this redirect to work testdomain.com and m.testdomain.com must be added to your hosts file when running the app -->
        <!-- beans:bean class="org.springframework.mobile.device.switcher.SiteSwitcherHandlerInterceptor" factory-method="mDot">
            <beans:constructor-arg value="192.168.102.16" />
        </beans:bean-->
        
    </interceptors>

例子用的spring mobile 1.0 m3的例子wurfl-showcase


WURFL - J2EE获取客户端移动设备信息 NULL 博文链接:https://crazysky.iteye.com/blog/1179069 立即下载

相关推荐

泛微OAe9实战:如何从零搭建一个车辆预约系统(附完整代码)

本文详细介绍了如何利用泛微OA e9的建模引擎,从零开始构建一个企业级车辆预约管理系统。文章深入解析了核心数据模型设计、前后端双重预约冲突校验机制,并重点演示了如何配置自定义资源看板以实现车辆使用状态的可视化监控。该系统设计思路通用,可扩展至会议室、设备等各类共享资源的管理。

weixin_28363123的博客 142

Spring Mobile检测多种设备类型

spring mobile框架是一个很小的,用于获取设备信息,然后跳转到不同视图的框架。 集成方式 一、pring Moblie是什么? SpringMoblie是SpringMvc的一个扩展项目,它旨在简化移动web应用程序的开发。 开源地址为 https://github.com/spring-projects/spring-mobile 二、Spring Moblie可以...

Thinkingcao的专栏 1119

实测对比:Gromacs GPU版vsCPU版性能差异到底有多大?2023最新基准测试

本文通过2023年最新基准测试,详细对比了Gromacs GPU版与CPU版的性能差异。测试显示,GPU版本在计算速度上可提升54倍,同时显著降低内存需求和能耗成本。文章还提供了GPU版安装优化实践和硬件选购指南,为计算生物学研究提供关键参考。

weixin_29243063的博客 327

Spring Boot中优雅的判断请求来源设备并跳转对应的页面-Site preference

  在Spring Boot中优雅的判断请求来源设备并跳转对应的页面-Device detection这篇文章中已经对Spring Mobile有过简单的介绍,这里介绍的是另一种类似的方法:Site preference。 1.首先在pom.xml中引用以下依赖: <dependency> <groupId>org.springframework.mobile</groupId> <artifactId>spring-mobile-device</a

Qiwan的博客 1430

如何制作Mike21溢油模型围油栏文件

这段时间群友在做海洋环评的做了一个MIKE21的溢油模型,溢油模型其实也是ECOLAB模块的应用,而在海上发生溢油事件的时候,为防止溢油对海洋生态的破坏,经常使用的一种手段就是使用围油栏技术将溢油控制在一定范围并进行处理。今天小编就给大家说说在MIKE21里怎么实现围油栏文件的制作

zhuzhujiayoua的博客 1329

MT5策略如何设置回测结果才能最接近实盘

摘要:在MT5回测中,选择"每笔分笔报价"模式最接近实盘交易,因其使用真实Tick数据模拟价格波动、点差和滑点。关键设置包括:下载高质量历史数据、合理设定点差和滑点、使用正常回测速度。该模式能准确测试挂单、止盈止损等策略,虽然速度较慢但结果最可靠,避免其他模式造成的失真,是评估交易策略表现的最佳选择。(149字)

weixin_38915451的博客 1877

SpringBoot配置参数解析器(WebArgumentResolver)

##SpingBoot下的WebArgumentResolver 参数解析器 需要集成类型WebArgumentResolver 并在@Configuration配置类型中配置参数解析器 import javax.servlet.http.HttpServletRequest; import org.springframework.core.MethodParameter; import or...

zhangningkid的博客 2238

海上风电经柔性直流送出系统的阻抗建模与稳定性分析

摘要 本文针对海上风电经柔性直流送出系统的稳定性问题,提出了一种基于阻抗建模的分析方法。研究建立了直驱永磁同步发电机(PMSG)的序阻抗解析模型和模块化多电平换流器(MMC)的交流侧小信号阻抗模型,通过Matlab/Simulink平台实现了完整的仿真验证系统。采用谐波线性化原理和端口阻抗分析法,揭示了风电机组与柔直换流器之间的阻抗匹配特性对系统稳定性的影响规律。研究结果表明,控制参数设置会显著改变系统阻抗特性,进而影响稳定裕度。文中提出的阻抗建模方法为分析海上风电柔直送出系统的宽频振荡问题提供了有效工具,

huanghm88的专栏 232

能够检测多种设备类型的Spring Mobile

Spring Moblie是什么?       SpringMoblie是SpringMvc的一个扩展项目,它旨在简化移动web应用程序的开发。 开源地址为 https://github.com/spring-projects/spring-mobile Spring Moblie可以做什么?          它可以检测到访问当前服务器程序的请求是通过什么设备发起的(PC, 平板,

zh_coder 5648

生成模型实战 | 基于Transformer生成音乐

本文介绍了基于Transformer架构的音乐生成方法,将音乐视为一系列事件序列进行处理。与将音乐表示为多维图像的MuseGAN不同,该方法使用类似GPT的仅解码器模型,基于先前事件预测下一个音乐事件。模型使用MIDI格式的钢琴音乐数据,通过分词处理将音符转换为note-on、note-off、time-shift和velocity四种事件类型,共388个独特词元,映射为索引序列后输入网络。训练完成后,可通过调整温度参数控制生成音乐的新颖性,从而创作出风格类似训练数据且连贯逼真的音乐作品。

盼小辉丶的博客 5811

自动化Google Chrome的强大工具:chromedriver下载、安装、简单使用

本文介绍了 ChromeDriver 的基本概念和安装配置方法,重点讲解了如何通过 Selenium 实现 Chrome 浏览器的自动化测试。内容涵盖了 ChromeDriver 下载、版本匹配、依赖引入和简单的自动化测试脚本示例,帮助读者快速上手并避免常见问题。

曾经“等你生日那天”都遥远得像未来,如今却可欢愉的挥手说“下个十年见” 88万+

spring mobile简单试用

spring mobile 是spring新推出的一个用于支持移动浏览的小框架,用起来很简单,和spring mvc结合也很方便。 首先建立一个spring mvc的工程 然后,在pom.xml中添加spring mobile的支持 [html] view plaincopy dependency>  

记事本 1710

SAE ARP 4761A内容详解

SAE ARP 4761A主要为民用航空系统及设备的安全评估提供指南,帮助制造商和设计者满足FAA的FAR 25.1309等适航标准的要求。该文档旨在为航空器和航空系统设计中涉及的安全评估流程提供一个结构化的框架,并结合一系列工具和方法,如故障树分析(FTA)、依赖图分析(DD)、马尔可夫分析(MA)等,来系统地评估潜在的安全隐患。这一标准不仅适用于大型航空器的设计和评估,还可以应用于各种类型的飞行系统,如无人驾驶飞行器(UAV)和新型的电动垂直起降飞机(eVTOL)。

qq_41854911的博客 3147

SpringBoot 配置文件 application.properties

转:http://www.qiyadeng.com/post/spring-boot-application-properties#########COMMON SPRING BOOT PROPERTIES######========CORE PROPERTIES===========#SPRING CONFIG (ConfigFileApplicationListener)spring.conf...

weixin_30810239的博客 60

IDEA的使用指南

IDEA基于java的使用手册,可以最快速的上手,在使用中不断的丰富自己的使用技巧.

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

spring cloud ,spring boot application.properties 配置属性列表

#横幅 banner.charset = UTF-8#横幅文件编码。 banner.location = classpath:banner.txt#横幅文件位置。 banner.image.location = classpath:banner.gif#横幅图像文件位置(也可以使用jpg / png)。 banner.image.width =#以字符形式显示横幅图像的宽度(默认值为76) ba...

zl386119974的专栏 722

华为的C语言编程规范.pdf

华为技术有限公司内部技术规范。本规范制定了编写C语言程序的基本原则、规则和建议。从代码的清晰、简洁、可测试、安全、程序效率、可移植各个方面对C语言编程作出了具体指导。

什么是Spring Boot

什么是Spring Boot什么是Spring BootSpring Boot的优缺点快速入门编写第一个Spring Boot的应用Spring Boot的核心关闭自动配置更多配置详解LOGGINGAOPIDENTITY (ContextIdApplicationContextInitializer)ADMIN (SpringApplicationAdminJmxAutoConfiguration...

不一样的花朵的博客 1086

文档:亲测可用解决vnc灰屏,黑屏,鼠标大黑叉情况

主要解决vnc-viewer灰屏,黑屏,鼠标大黑叉等现象,详细见文档。

Springboot全局配置文件

Springboot全局配置文件、作用、示例

记录和分享属于我的“IT”时光。 2425

Spring Mobile 集成springmvc的使用

spring mobile框架是一个很小的,用于获取设备信息,然后跳转到不同视图的框架。集成方式<filter> <filter-name>sitePreferenceRequestFilter</filter-name> <filter-class>org.springframework.mobile.device.site.SitePreferenceReques

风景美如画的博客 2353

spring-mobile 获取device 的两种方法

     第一种:传HttpServletRequest 获取 @GetMapping("/test")public void home2(HttpServletRequest request){     LiteDeviceResolver deviceResolver = new LiteDeviceResolver(); Device device = deviceResolver.reso...

phpfzh的博客 2519

SpringBoot四大神器之Starter

序 SpringBoot的starter主要用来简化依赖用的。本文主要分两部分,一部分是列出一些starter的依赖,另一部分是教你自己写一个starter。 部分starters的依赖 Starter(Group ID: org.springframework.boot) 传递依赖于 spring-boot-starter-log4j2 ■ org.apache.logging....

Demo__的博客 1309

Request Filter

Request Filters You can ask Catalina to check the IP address, or host name, on every incoming request directed to the surrounding Engine, Host, or Context element. The remote address or nam

技术何 791

Spring Boot中优雅的判断请求来源设备并跳转对应的页面-Device aware view

  在Spring Boot中优雅的判断请求来源设备并跳转对应的页面-Device detection和Spring Boot中优雅的判断请求来源设备并跳转对应的页面-Site preference这两篇文章中已经对Spring Mobile有过简单的介绍,这里介绍的是Spring Mobile的第三种方法也是最优雅的一种方法:Device aware view(设备自动感知视图)。 1.首先在pom.xml中引用以下依赖: <dependency> <groupId>org.sp

Qiwan的博客 1028

低版本的51degrees.mobi 1.2.0.5 用UserAgent获取手机硬件型号,并升级最新的WURFL硬件包...

如题,首先从51degrees.mobi的codeplex下载1.2.0.5版本的库。 为什么要下载1.2.0.5这个版本了,答案很简单,因为1版本的库实现了WURFL接口,并采用WURFL的硬件包,所以,能准确的获取到硬件的型号。2版本的库已经不能获取硬件型号了,只有付费版的才行。 当我们下回1.2.0.5版本的库时,里面的WURFL硬件包是旧版的,我们可以去WURFL的官方网站下...

angou6476的博客 187

SpringBoot配置项大全

SpringBoot启动时不需要额外配置,它会提供一些默认的配置,比如启动端口默认是8080。有时候这些默认配置并不是适合项目的,这时候就需要在配置文件中添加配置。下面配置项是从SpringBoot官方文档复制下来的,版本是1.5.9.RELEASE。原文档链接https://docs.spring.io/spring-boot/docs/1.5.9.RELEASE/reference/htm...

成长是一辈子的事 3654

Windows定时任务底层机制与生产级避坑指南

Windows定时任务远不止GUI配置那么简单,其本质是基于会话隔离、权限上下文和COM+宿主环境的系统级调度机制。理解Session 0隔离、NT AUTHORITY\SYSTEM账户权限模型及schtasks命令行底层行为,是保障无人值守任务稳定运行的关键。该机制直接影响数据库备份、日志清理、Python脚本执行等典型运维场景的可靠性,尤其在无用户登录、网络共享访问、高权限操作等生产环境中极易暴露设计缺陷。本文结合真实故障案例,解析触发器资源感知逻辑、脚本执行环境适配要点及事件查看器深度调试方法,为运维

weixin_33971977的博客 384

mybatis绑定错误

如果出现: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found) 一般的原因是Mapper interface和xml文件的定义对应不上,需要检查包名,namespace,函数名称等能否对应上,需要比较细致的对比,我经常就是写错了一两个字母搞的很长时间找不到错误

softwarehe的专栏 16万+
上一篇: swfupload缩略图流程
下一篇: jquery在eclipse工程中错误显示的解决
softwarehe
博客等级 码龄26年 66粉丝 165原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值