Struts2 的Result Annotation配置

一、qt下载与安装 qt与qtcreator 的区别与联系 1、QT Creator只是一个集成的编译器,用于将源代码编译成可执行程序。 QT 是跨平台C++图形用户界面应用程序开发框架,可以简单理解成是一个开发包。 2、Qt是完全面向对象的,很容易扩展,并且允许真正地组件编程。 QT Creator 跨平台的 Qt IDE,Qt Creator 是 Qt 被 Nokia 收购后推出的一款新的轻量级集 ... 阅读详情

虽然struts2推出的时间不短了,由于对struts的厌烦,所以一直对其不怎么感冒,也懒得去关心他。可是最近有个内部用的新项目,本来想用JSF做,但由于JSF页面组件的控制非常麻烦,而且和SPRING ACEGI接合上一直找不到最好的方案,再加上同事的强烈要求下,最后还是决定用struts2了。。。(其实我想用的JSF啊 555。。。)

在google上找了些资料看看,struts2和1.X版本完全是两回事。。。(为什么不干脆改个名呢),看了整个struts2的框架感觉非常的棒!Action也没有像1.X那样必须要继承那个org.apache.struts.action.*下的东西了。可以完全的使用自己独立的bean。而且还有了Annotation的配置,这样就不用去配那个冗长的struts-config.xml了。

不过在配Result Annotation的过程中。。。被网上一些不负责的网友所误导。。把actionPackages写成了actionPackage结果导致浪费了不少的时间。。最后还是在struts2的官方文档里看到才改对的。。哎也不能怪别人,只怪自己的太懒了。。。看来一切还是要靠自己动手啊。

具体请参看strtus2的doc

Apache Struts 2 Documentation > Home > Guides > Core Developers Guide > Annotations > Result Annotation

Python爬虫实战:高德地图POI信息爬取(餐馆/加油站等),附选址分析技巧 高德API配置AMAP_KEY = "你的高德API Key" # 替换成自己的Key# 爬取参数CITY = "成都" # 城市DISTRICTS = ["锦江区"] # 区域,可添加多个(比如["锦江区", "武侯区"])KEYWORDS_LIST = ["川菜馆", "加油站"] # 要爬取的POI类型TYPES = {"川菜馆": "050101", # 餐饮服务→中餐→川菜馆(高德POI分类编码)"加油站": "110100" # 交通设施→加油站。 阅读详情

相关推荐

别再踩坑了!CAPL脚本里局部变量和全局变量的那些“怪事”(附CANoe实测代码)

本文深度解析CAPL脚本中局部变量和全局变量的特殊机制,揭示其与通用编程语言的差异。通过实测代码展示静态局部变量的默认行为和全局变量的节点隔离特性,并提供高效避坑指南,帮助汽车网络测试工程师避免常见陷阱。

weixin_30225755的博客 293

struts2的配置二——annotation的配置

Struts2引入annotation的目的:减少XML配置文件的数量,将相关的配置信息通过annotation嫁接到action中。 对于单个action的配置,用annotation可以很方便的开发与维护,但对于全局配置来说,用XML更清晰. 1.namespace的配置 @Namespace(“”)标注:配置action的URL路径。在类级上注解。 @Action(“”):actio

zrxJuly 496

统信UOS/麒麟Kylin OS下利用pyenv实现Python多版本开发环境搭建指南

本文详细介绍了在统信UOS和麒麟Kylin OS国产操作系统下使用pyenv搭建Python多版本开发环境的完整指南。从系统环境准备、pyenv定制安装到Python版本编译实战,提供了针对国产CPU架构的特殊优化方案和常见问题解决方法,帮助开发者高效管理不同Python版本需求。

sea99的博客 1051

struts2的result-type详解

序:真心谢谢文章的作者,我收获很多,在此作为我学习的记录。 Struts2默认提供的result-type 在struts2-core.jar/struts-default.xml中,我们可以找到关于result-type的一些配置信息,从中可以看出struts2组件默认为我们提供了这  些result-type

TechBirds在路上 825

RK3308B开发板WiFi+蓝牙一体模组RTL8821CS驱动移植保姆级教程(含DTS配置与避坑点)

本文提供RK3308B开发板RTL8821CS WiFi+蓝牙模组驱动移植的完整教程,涵盖SDK环境配置、DTS设备树设置、内核编译优化及功能验证全流程。重点解析引脚复用冲突、电源管理等关键配置,并给出常见错误解决方案,帮助开发者快速实现双模通信功能。

weixin_42531163的博客 398

PyMySQLSaver实战:构建高可靠性的LangGraph状态管理

本文详细介绍了如何使用PyMySQLSaver构建高可靠性的LangGraph状态管理系统。通过检查点机制和MySQL持久化技术,开发者可以确保AI应用在崩溃后从最近状态恢复,支持长时间运行任务和多轮交互。文章包含核心架构解析、生产环境部署指南及实战案例,帮助开发者掌握状态管理的核心技术。

weixin_29310605的博客 494

Struts2中result-type详解(三)

在struts2框架中,当action处理完之后,就应该向用户返回结果信息,该任务被分为两部分:结果类型和结果本身。 结果类型提供了返回给用户信息类型的实现细节。结果类型通常在Struts2中就已预定义好了(见下表),或者是由插件提供,开发人员也可以自定义结果类型。默认配置的结果类型是dispatcher,该结果类型使用JSP来向用户显示结果。当定义了结果类型之后,该结果类型可以在不同的action中重复使用。

Developer of XingKong22star 915

【日常小结】项目Modbus RTU 协议

Modbus RTU(远程终端) 协议 一、前言 最近因为码跺宽度测量项目推广升级,更换了摄像头(换成了基恩士摄像头)和光栅(换成了施莱格05LCM系列光栅),导致原来的程序用不了了,然而这个软件升级的任务落到了我身上,作为机械非科班出身的我要学习TCP和Modbus RTU通信协议,也算是自我突破了。本文只对Modbus/RTU/HEX 进行简单的小结。 二、Modbus Modbus是一种串行通信协议,是Modicon公司(现在的施耐德电气Schneider Electric)于1979年为使用可编程逻

weixin_39681471的博客 831

struts2零配置-注解

一、配置web.xml    struts2  org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter    actionPackages  com.test.action        struts2  /*    二、加入注解  @Namespace(value="/test

hjtk009的专栏 517

多孔材料吸附性质模拟程序RASPA的离线和在线安装方法

RASPA-2.0是今年美国西北大学教授Randall Q. Snurr等人开发的针对于MC,MD,分子力学优化等用途的程序,相比于之前开发的MUSIC软件,RASPA的功能更加齐全,操作更加简便,可以在MC的吸附过程中考虑骨架的柔性,也可以想MUSIC一样先制作积分格点(music中的map)。 A、离线安装(centos为例): (1)、安装之前要检查一下是否装了automake,

youyno的博客 1万+

零基础速成simulink代码生成——stateflow基础3

此专栏面向嵌入式工程没有matlab开发经验的人,可以快速学习和实践这门技术。MDB技术,越来越成熟和普遍,从手写代码转到基于模型开发已经是大势,不仅减少开发周期,还增加代码的复用性。汽车领域、医疗和算法建模广泛使用。

不断debug,优化中…… 1711

13、零配置Struts2开发

Convention 插件 从 Struts 2.1 开始, Struts 可以使用 Convention 插件来支持零配置: Convention 插件完全抛弃配置信息, 不仅不需要使用 struts.xml 文件进行配置, 甚至不需要使用 Annotation 进行配置. 而是完全根据约定来自动配置. 安装 Conversion 插件: 复制 struts-2.2.1\lib\...

G18612483166的专栏 210

知识图谱-KGE-语义匹配-双线性模型-2018:SimplE

【paper】 SimplE Embedding for Link Prediction in Knowledge Graphs 【简介】 本文是加拿大英属哥伦比亚大学的两位学者发表在 NIPS 2018 上的工作,文章提出了 SimplE(Simple Embedding)。这篇和前面一篇差不多,也是对 1927 年的 CP 进行改进(简化),传统CP为实体分配的两个向量是独立训练的,SimplE利用关系的逆在三元组打分函数中加上了一个对称项,使得每个实体的两个向量依赖学习,并且 SimplE 的复杂度随

u013250861的博客 958

struts2 零配置

从struts2.1开始,struts2不再推荐使用Codebehind作为零配置插件,而是改为使用Convention插件来支持零配置,和Codebehind相比,Convention插件更彻底,该插件完全抛弃配置信息,不仅不需要是使用struts.xml文件进行配置,甚至不需要使用Annotation进行配置,而是由struts2根据约定自动配置。 如何使用Convention

笑看人生的专栏 566

深度学习工具包 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")

蓝牙模块HM-10手册

蓝牙模块HM-10手册,该手册对蓝牙模块HM-10进行了详细的介绍和使用方法以及一些AT指令。

cost733天气分型软件Linux源码编译安装实战指南

天气分型是气候诊断与极端事件归因研究中的常用技术,通过将高维气象格点数据归类为若干典型环流型,为天气气候分析提供降维工具。在工程实践中,基于Fortran开发的cost733命令行工具因支持k-means、PCA聚类等多种分型算法而被广泛使用。但其源码编译依赖NetCDF生态链,从zlib、HDF5到netcdf-c与netcdf-fortran,任何一环版本或顺序失误都会导致编译失败。围绕环境配置、依赖构建、Makefile调整到最小测试,系统梳理了在CentOS7上安装cost733的完整流程与常见报错

weixin_33863087的博客 263

迈瑞BS系列全自动生化分析仪LIS协议接口手册(内含HL7和ASTM)

迈瑞BS系列全自动生化分析仪LIS协议接口手册,内含HL7和ASTM)

Struts2零配置开发(注解Annotation的使用)一

以前使用Struts2的时候参数都是在struts.xml里面配置的,现在转入了一个新的项目中,发现这个项目struts.xml中只定义了几个常量,并没有大量的action、interceptor的配置信息,项目显得非常整洁,但是同时也看的云里雾里。今天花了一小会看了一个Struts2 Convention Plugin的官方文档,才大致了解了一二,这里简单叙述一下。      具体的阐述请

hmy1106的专栏 709

STRUTS2 Convention零配置

从struts2.1开始,struts2不再推荐使用Codebehind作为零配置插件,而是改为使用Convention插件来支持零配置,和Codebehind相比,Convention插件更彻底,该插件完全抛弃配置信息,不仅不需要是使用struts.xml文件进行配置,甚至不需要使用Annotation进行配置,而是由struts2根据约定自动配置。 如何使用Convention 1. 将str...

﹎仰望↗星空℡ 138

Struts2 Result-type(封装Action层到View层的跳转逻辑)

在struts2-core.jar/struts-default.xml中,我们可以找到关于result-type的一些配置信息,从中可以看出struts2组件默认为我们提供了这 些result-type ...

scheme2008的专栏 128

Struts2 零配置----详解

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

weixin_34240657的博客 85

struts2 annotation

从struts2.1开始,struts2不再推荐使用Codebehind作为零配置插件,而是改为使用Convention插件来支持零配置,和Codebehind相比,Convention插件更彻底,该插件完全抛弃配置信息,不仅不需要是使用struts.xml文件进行配置,甚至不需要使用Annotation进行配置,而是由struts2根据约定自动配置。 如何使用Convention 1.

sanshou的专栏 504

struts2注解

一、配置web.xml struts2 org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter actionPackages com.test.action struts2 /* 二、加入注解 @Namespace(value="/tes

lizhibin3944的专栏 513

(转)Struts2 Convention零配置

从struts2.1开始,struts2不再推荐使用Codebehind作为零配置插件,而是改为使用Convention插件来支持零配置,和Codebehind相比,Convention插件更彻底,该插件完全抛弃配置信息,不仅不需要是使用struts.xml文件进行配置,甚至不需要使用Annotation进行配置,而是由struts2根据约定自动配置。 如何使用Convention 1. 将st

jackyrongvip的专栏 759

struts2采用convention-plugin实现零配置心得

[size=large]从struts2.1开始,struts2不再推荐使用Codebehind作为零配置插件,而是改为使用Convention插件来支持零配置,和Codebehind相比,Convention插件更彻底,该插件完全抛弃配置信息,不仅不需要是使用struts.xml文件进行配置,甚至不需要使用Annotation进行配置,而是由struts2根据约定自动配置。 如何使用Con...

huzhian77的专栏 170

struts2 Convention零配置

从struts2.1开始,struts2不再推荐使用Codebehind作为零配置插件,而是改为使用Convention插件来支持零配置,和Codebehind相比,Convention插件更彻底,该插件完全抛弃配置信息,不仅不需要是使用struts.xml文件进行配置,甚至不需要使用Annotation进行配置,而是由struts2根据约定自动配置。 如何使用Convention 1.  ...

黑豆是条狗 166

没事学了学Java Web之Struts2-convention-plugin

Struts2 convention的特点是“约定优于配置”。开发时候遵守这些约定就可以了。       convention的安装:下载Struts2-convention-plugining-*.*.*.*.jar;然后放大WEB-INF/lib下就可以使用了。开发工具的jar包最终也是到WEB-INF/lib目录下。       好的,第一个约定你来了。convention插件会自动搜索

mydisc1的专栏 402

Struts2零配置

java-web交流群:132607763 struts2.1开始,支持了零配置。可以不需要struts.xml文件进行配置就可进行配置。 需要添加的包有: asm-xxx.jar asm-commons-xxx.jar struts2-convention-plugin-xxx.jar 这样就完成了零配置。 接着就可以对action用annotation进行配置了。 一个简单...

fenglei12的博客 122
上一篇: JAVA面向接口编程的一点人生感悟
下一篇: DB2 用import from 文件 insert_update 更新指定字段
mx1029
博客等级 码龄24年 5粉丝 9原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值