Spring4新特性——注解、脚本、任务、MVC等其他特性改进

java脚本引擎Groovy实战 ​互联网时代随着业务的飞速发展,不仅产品迭代、更新的速度越来越快,个性化需求也是越来越多。如何快速的满足各种业务的个性化需求是我们要重点思考的问题。我们开发的系统如何才能做到热部署就能适应各种规则变化呢?实现业务和规则的解耦。 好了,Java的ScriptEngine脚本引擎给了我们一个选择,它支持代码动态执行,代码修改后不需要重启JVM进程,就可以使用解析或编译方式执行,非常方便,在一些动态业务规则、热更新、热修复等场景中会非常方便。 阅读详情

Spring4新特性——泛型限定式依赖注入

Spring4新特性——核心容器的其他改进

Spring4新特性——Web开发的增强

Spring4新特性——集成Bean Validation 1.1(JSR-349)到SpringMVC 

Spring4新特性——Groovy Bean定义DSL

Spring4新特性——更好的Java泛型操作API 

Spring4新特性——JSR310日期API的支持

Spring4新特性——注解、脚本、任务、MVC等其他特性改进 

 

一、注解方面的改进

spring4对注解API和ApplicationContext获取注解Bean做了一点改进。

获取注解的注解,如@Service是被@Compent注解的注解,可以通过如下方式获取@Componet注解实例:

Java代码   收藏代码
  1. Annotation service = AnnotationUtils.findAnnotation(ABService.class, org.springframework.stereotype.Service.class);  
  2. Annotation component = AnnotationUtils.getAnnotation(service, org.springframework.stereotype.Component.class);  

 

获取重复注解:

比如在使用hibernate validation时,我们想在一个方法上加相同的注解多个,需要使用如下方式:

Java代码   收藏代码
  1. @Length.List(  
  2.         value = {  
  3.                 @Length(min = 1, max = 2, groups = A.class),  
  4.                 @Length(min = 3, max = 4, groups = B.class)  
  5.         }  
  6. )  
  7. public void test() {  

可以通过如下方式获取@Length:

Java代码   收藏代码
  1. Method method = ClassUtils.getMethod(AnnotationUtilsTest.class, "test");  
  2. Set<Length> set = AnnotationUtils.getRepeatableAnnotation(method, Length.List.class, Length.class);  

 

当然,如果你使用Java8,那么本身就支持重复注解,比如spring的任务调度注解,

Java代码   收藏代码
  1. @Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE})  
  2. @Retention(RetentionPolicy.RUNTIME)  
  3. @Documented  
  4. @Repeatable(Schedules.class)  
  5. public @interface Scheduled {   
Java代码   收藏代码
  1. @Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE})  
  2. @Retention(RetentionPolicy.RUNTIME)  
  3. @Documented  
  4. public @interface Schedules {  
  5.   
  6.     Scheduled[] value();  
  7.   
  8. }  

 

这样的话,我们可以直接同时注解相同的多个注解:

Java代码   收藏代码
  1. @Scheduled(cron = "123")  
  2. @Scheduled(cron = "234")  
  3. public void test     

但是获取的时候还是需要使用如下方式:

Java代码   收藏代码
  1. AnnotationUtils.getRepeatableAnnotation(ClassUtils.getMethod(TimeTest.class, "test"), Schedules.class, Scheduled.class)  

 

ApplicationContext和BeanFactory提供了直接通过注解获取Bean的方法:

Java代码   收藏代码
  1. @Test  
  2. public void test() {  
  3.     AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();  
  4.     ctx.register(GenericConfig.class);  
  5.     ctx.refresh();  
  6.   
  7.     Map<String, Object> beans = ctx.getBeansWithAnnotation(org.springframework.stereotype.Service.class);  
  8.     System.out.println(beans);  
  9. }  

这样可以实现一些特殊功能。

 

另外和提供了一个AnnotatedElementUtils用于简化java.lang.reflect.AnnotatedElement的操作,具体请参考其javadoc。   

 

二、脚本的支持 

spring4也提供了类似于javax.script的简单封装,用于支持一些脚本语言,核心接口是:

Java代码   收藏代码
  1. public interface ScriptEvaluator {  
  2.     Object evaluate(ScriptSource script) throws ScriptCompilationException;  
  3.     Object evaluate(ScriptSource script, Map<String, Object> arguments) throws ScriptCompilationException;  
  4. }  

 

比如我们使用groovy脚本的话,可以这样:

Java代码   收藏代码
  1. @Test  
  2. public void test() throws ExecutionException, InterruptedException {  
  3.     ScriptEvaluator scriptEvaluator = new GroovyScriptEvaluator();  
  4.   
  5.     //ResourceScriptSource 外部的  
  6.     ScriptSource source = new StaticScriptSource("i+j");  
  7.     Map<String, Object> args = new HashMap<>();  
  8.     args.put("i", 1);  
  9.     args.put("j", 2);  
  10.     System.out.println(scriptEvaluator.evaluate(source, args));  
  11. }  

没什么很特别的地方。另外还提供了BeanShell(BshScriptEvaluator)和javax.script(StandardScriptEvaluator)的简单封装。

 

三、Future增强

提供了一个ListenableFuture,其是jdk的Future的封装,用来支持回调(成功/失败),其借鉴了com.google.common.util.concurrent.ListenableFuture。

Java代码   收藏代码
  1. @Test  
  2. public void test() throws Exception {  
  3.     ListenableFutureTask<String> task = new ListenableFutureTask<String>(new Callable() {  
  4.         @Override  
  5.         public Object call() throws Exception {  
  6.             Thread.sleep(10 * 1000L);  
  7.             System.out.println("=======task execute");  
  8.             return "hello";  
  9.         }  
  10.     });  
  11.   
  12.     task.addCallback(new ListenableFutureCallback<String>() {  
  13.         @Override  
  14.         public void onSuccess(String result) {  
  15.             System.out.println("===success callback 1");  
  16.         }  
  17.   
  18.         @Override  
  19.         public void onFailure(Throwable t) {  
  20.         }  
  21.     });  
  22.   
  23.     task.addCallback(new ListenableFutureCallback<String>() {  
  24.         @Override  
  25.         public void onSuccess(String result) {  
  26.             System.out.println("===success callback 2");  
  27.         }  
  28.   
  29.         @Override  
  30.         public void onFailure(Throwable t) {  
  31.         }  
  32.     });  
  33.   
  34.     ExecutorService executorService = Executors.newSingleThreadExecutor();  
  35.     executorService.submit(task);  
  36.     String result = task.get();  
  37.     System.out.println(result);  
  38.   
  39. }  

可以通过addCallback添加一些回调,当执行成功/失败时会自动调用。

 

四、MvcUriComponentsBuilder

MvcUriComponentsBuilder类似于ServletUriComponentsBuilder,但是可以直接从控制器获取URI信息,如下所示:

假设我们的控制器是:

Java代码   收藏代码
  1. @Controller  
  2. @RequestMapping("/user")  
  3. public class UserController {  
  4.   
  5.     @RequestMapping("/{id}")  
  6.     public String view(@PathVariable("id") Long id) {  
  7.         return "view";  
  8.     }  
  9.   
  10.     @RequestMapping("/{id}")  
  11.     public A getUser(@PathVariable("id") Long id) {  
  12.         return new A();  
  13.     }  
  14.   
  15. }  

注:如果在真实mvc环境,存在两个@RequestMapping("/{id}")是错误的。当前只是为了测试。

 

我们可以通过如下方式得到

Java代码   收藏代码
  1. //需要静态导入 import static org.springframework.web.servlet.mvc.method.annotation.MvcUriComponentsBuilder.*;  
  2. @Test  
  3. public void test() {  
  4.     MockHttpServletRequest req = new MockHttpServletRequest();  
  5.     RequestContextHolder.setRequestAttributes(new ServletRequestAttributes(req));  
  6.   
  7.     //MvcUriComponentsBuilder类似于ServletUriComponentsBuilder,但是直接从控制器获取  
  8.     //类级别的  
  9.     System.out.println(  
  10.             fromController(UserController.class).build().toString()  
  11.     );  
  12.   
  13.     //方法级别的  
  14.     System.out.println(  
  15.             fromMethodName(UserController.class, "view", 1L).build().toString()  
  16.     );  
  17.   
  18.     //通过Mock方法调用得到  
  19.     System.out.println(  
  20.             fromMethodCall(on(UserController.class).getUser(2L)).build()  
  21.     );  
  22. }  

注意:当前MvcUriComponentsBuilder实现有问题,只有JDK环境支持,大家可以复制一份,然后修改:

method.getParameterCount() (Java 8才支持)

到

method.getParameterTypes().length

 

五、Socket支持

提供了获取Socket TCP/UDP可用端口的工具,如

SocketUtils.findAvailableTcpPort()

SocketUtils.findAvailableTcpPort(min, max) 

SocketUtils.findAvailableUdpPort()

非常简单,就不用特别说明了。

 

示例代码请参考:spring4-others

 

到此,spring4新特性就介绍完了,此处没有介绍websocket,后续有时间考虑写一个websocket完整系列,对于spring4除了websocket,其他方面并没有特别吸引人的功能。


转载地址:http://jinnianshilongnian.iteye.com/blog/1995111

groovy常用Script groovy一般程序的script,适合Groovy初学者 立即下载

相关推荐

Groovy Script 入门

Groovy Script 入门 Groovy 脚本入门

Java的Groovy执行器内存泄露(MetaSpace)问题分析与解决办法

内存泄漏

qq_34898847的博客 5508

频偏估计技术:从原理到5G应用的实战解析

本文深入解析了5G通信中的频偏问题及其核心技术。频偏如同调不准的旋钮,会导致信号失真与载波间干扰。文章详细拆解了整数倍与小数倍频偏估计两大核心方法,重点剖析了基于循环前缀和基于同步信号块的算法原理与优劣,并结合eMBB、mMTC、URLLC三大5G应用场景,提供了实战算法选择策略与参数调优避坑指南。

weixin_29218963的博客 265

Groovy基础以及语法

Groovy基础以及部分语法.

OGtwelve的博客 2825

Sourcetree与Gitee的搭配使用

初次将gitee与sourcetree联合起来使用,还是遇到了不少问题,其中最让人烦恼的就是在我修改了一下用户名之后,便无法在Sourcetree直接推送到gitee,很是让人郁闷。本文处理Sourcetree与gitee搭配使用过程中的问题:Sourcetree身份验证失败,无法推送;Sourcetree推送时,无法显示要推送的分支;Sourcetree远端上面有感叹号。

年少时的棉花糖 4435

一文读懂AI大模型时代的RAG技术

RAG(Retrieval-Augmented Generation,检索增强生成) 是一种结合检索技术与生成模型的技术架构,旨在通过动态引入外部知识库增强大语言模型(LLM)的生成能力。其核心思想是通过检索系统从外部数据源(如企业知识库、实时文档等)获取相关信息,并将检索结果作为上下文输入生成模型,以提高生成答案的准确性、时效性和专业性

awei0916的专栏 2120

浅谈spring4泛型依赖注入

本文简单分析了Spring 4.0的新特性泛型依赖注入。本文以我自己编写的代码为例子,详细论述了泛型依赖注入的两种实现方式,同时讨论了泛型依赖注入的优点,部分原理,以及各种实现的优缺点。

新手程序猿的学习日记 1万+

AD2S1210与DSP28335 SPI通信中的GPIO配置陷阱与解决

本文深入剖析了AD2S1210与DSP28335进行SPI通信时,因GPIO输入限定配置不当导致数据整体右移的典型问题。文章指出,错误地将MISO引脚配置为带采样周期的同步模式是根本原因,并提供了将输入选择限制正确设置为异步模式的解决方案。同时,总结了不同应用场景下GPIO输入限定的配置原则,为高速同步通信的稳定实现提供了关键指导。

weixin_29163857的博客 147

Spring4新特性——Web开发的增强

Spring4新特性——泛型限定式依赖注入 Spring4新特性——核心容器的其他改进 Spring4新特性——Web开发的增强 Spring4新特性——集成Bean Validation 1.1(JSR-349)到SpringMVC  Spring4新特性——Groovy Bean定义DSL Spring4新特性——更好的Java泛型操作API  Spring

一个迷茫的小码农 1444

Qt Creator菜单栏消失的终极修复指南:从快捷键冲突到设置恢复

本文详细解析了Qt Creator菜单栏消失的常见原因及修复方法,包括快捷键冲突排查、配置文件重置和界面模式切换等解决方案。特别针对Qt开发者遇到的菜单栏显示问题,提供了从简单快捷键操作到深度配置修改的全方位指南,帮助用户快速恢复Qt Creator的正常使用。

weixin_27240351的博客 338

Simulink中Simscape—Fluids模块(原Simhydraulics)学习记录

学习来源:http://cn.mathworks.com/help/physmod/hydro/getting-started-with-simhydraulics.html 主要学习内容如下图: 详细内容: 1、组件来源 SIMULINK浏览器中的模块:Simscape_Foundation 和 Simscape_Fluids。 2、Simscape下包括多个子

1万+

Spring4新特性——核心容器的其他改进

2019独角兽企业重金招聘Python工程师标准>>> ...

weixin_34358092的博客 287

UDF学习(二)基础数据类型与常见宏

thread_loop_c (t,d) 必须与begin_c_loop (c,t)同时使用,但begin_c_loop (c,t)不一定与thread_loop_c (t,d)同时使用。同理thread_loop_f(t,d)必须与begin_f_loop (c,t)同时使用,但begin_f_loop (c,t)不一定与thread_loop_f(t,d)同时使用。begin_c_loop (c,t) 在计算域内对网格单元进行循环。c_face_loop (c,t)遍历网格单元上的所有网格面。

weixin_44386973的博客 857

Spring4新特性注解、脚本、任务、MVC等其他特性改

环境支持,大家可以复制一份,然后修。注解的注解,可以通过如下方式获取。没什么很特别的地方。,那么本身就支持重复注解,比如。非常简单,就不用特别说明了。这样可以实现一些特殊功能。的封装,用来支持回调(成功。,但是可以直接从控制器获取。我们可以通过如下方式得到。添加一些回调,当执行成功。提供了直接通过注解获取。可以通过如下方式获取。

2301_78064339的博客 190

三种方法教你下载大模型到本地,总有一种适合你

本文主要介绍了下载大模型到本地的三种解决方案,希望能对同学们有所帮助。 文章目录 1. 场景/问题描述 2. 方案一:使用git 3. 方案二:镜像站 4. 方案三:高速下载工具(变体及自定义代码) 4.1 aria2 4.2 自定义代码

weixin_43178406的博客 17万+

jdk-8u144-linux-x64.tar.gz.

该资源为搭建Linux系统Java环境用,资源的后缀为tar.gz格式的压缩包

【手撕 Spring】Spring 的新特性

Spring 3.1是Spring框架的一个版本,引入了一些新的特性和改进。以下是Spring 3.1的一些主要特性: 1. 缓存抽象层:Spring 3.1引入了一个新的缓存抽象层,使得开发者可以更方便地使用缓存来提高应用程序的性能。它提供了对不同缓存提供商(如Ehcache、Redis等)的支持,并且可以通过注解或XML配置来管理缓存。 2. Spring MVC的改进:Spring 3.1对Spring MVC进行了一些改进,提供了更好的RESTful支持和更灵活的请求映射。它还引入了一些新

激流丶的博客 5528

深度学习工具包 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 MVC 4常用的那些注解

Spring从2.5版本开始在编程中引入注解,用户可以使用@RequestMapping, @RequestParam, @ModelAttribute等等这样类似的注解。到目前为止,Spring的版本虽然发生了很大的变化,但注解的特性却是一直延续下来,并不断扩展,让广大的开发人员的双手变的更轻松起来,这都离不开Annotation的强大作用,今天我们就一起来看看Spring MVC 4中常用

小尘 1万+

Devexpress16.2.6破解工具

Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具

android 蓝牙通讯demo

android 下蓝牙通讯demo,实现了发现蓝牙,使能蓝牙,通过蓝牙发送消息。

Spring 各版本新特性

Spring各版本新特性 1.Spring3.1新特性 http://blog.youkuaiyun.com/en_joker/article/details/78538904?locationNum=5&fps=1 (1)功能升级: 添加了引入环境profile功能 SpringMVC:https://www.cnblogs.com/strugglion/p/7091021.html Sp

u012160163的专栏 1万+

Spring4Mvc纯注解启动,无web.xml

基于Spring4新特性,尝试了一下纯注解启动Mvc 主要类如下图: RootConfig: /** * RootConfig * @author zoe * */ @Configuration @ComponentScan(basePackages={"com.spittr...

746
上一篇: Spring4新特性——JSR310日期时间API的支持
下一篇: springMVC使用HandlerMethodArgumentResolver 自定义解析器实现请求参数绑定方法参数
VagueCoder
博客等级 码龄13年 4粉丝 8原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值