<收藏>struts2 jsp中一些参数的取得方法#,%,$

 struts2 jsp中一些参数的取得方法#,%,$

1、 例如:我们要取得session中储存一个属性username的值,可以利用下列方法:
              session.getAttribute("username") 取得username的值,
      在EL中则使用下列方法
              ${sessionScope.username}

2、例如:我们要取得用户的请求参数时,可以利用下列方法:
              request.getParameter(String name)
              request.getParameterValues(String name)
      在EL中则可以使用param和paramValues两者来取得数据。
             ${param.name}
             ${paramValues.name}

3、例如:要取得cookie中有一个设定名称为userCountry的值,可以使用${cookie.userCountry}来取得它。

4、例如:initParam取得设定web站点的环境参数(Context)
              String userid = (String)application.getInitParameter("userid");
    可以使用 ${initParam.userid}来取得名称为userid

5、pageContext取得其他有关用户要求或页面的详细信息。
              ${pageContext.request.queryString}         取得请求的参数字符串
              ${pageContext.request.requestURL}         取得请求的URL,但不包括请求之参数字符串
              ${pageContext.request.contextPath}         服务的web application 的名称
              ${pageContext.request.method}           取得HTTP 的方法(GET、POST)
              ${pageContext.request.protocol}         取得使用的协议(HTTP/1.1、HTTP/1.0)
              ${pageContext.request.remoteUser}         取得用户名称
              ${pageContext.request.remoteAddr }         取得用户的IP 地址
              ${pageContext.session.new}             判断session 是否为新的
              ${pageContext.session.id}               取得session 的ID
              ${pageContext.servletContext.serverInfo}   取得主机端的服务信息

 

【ComfyUI专栏】ComfyUI 常用工作流下载与分享网址 首先我们来分享第一个网站,Openart 网站,这个网站同时也能提供比较多的其他类型。但是如果希望下载工作流,我们可以访问到如下的这个站点。作为ComfyUI的学习用户来说,我们通常需要借助他山之石来帮助我们快速成长,因此我们需要找到能够分享和下载的网址。,当前网站是综合性网站,在网站中可以下载各种不同的类型,其中工作流只是可以下载的非常小的部分。这个网站也可以浏览不同的工作流,这个工作流的地址和访问如下的站点。 阅读详情

相关推荐

车载面试题目(ADAS)

多数功能都是依靠的前置传感器(经过Lidar、Radar、Camera融合),比如ACC、AEB、LKA、NOA、TJA、FCW等,只有少数涉及周视传感器,比如BSD、CVW、DOW。③如果前面有车切速度小于自车车速,自车减速对减速度有要求,比如3.5m/m2,④如果前车静止了,自车有个跟停距离要求,比如2-3m。试验场有不同曲率的弯道,比如125m、250m、500m的,根据需求跟车行驶,看是否会减速,能不能驶出弯道等。迭代内容:底层通讯、网络管理、诊断、刷写、信息安全、OTA。

qq_43475097的博客 2297

struts2 result param

在struts.xml配置文件中遇到了param,有点迷糊,上网查了查……似乎明白些了 <action name="Log*" method="loginFrame{1}" class="member.loginIndeAct"> <result>${tplPath}</result> <result name="l...

weixin_34007906的博客 287

osgEarth shapefile矢量生成三维模型案例 2.boston.earth

osgEarth shapefile矢量生成三维模型案例 2.boston.earth 波士顿城市建筑、路灯、公园、道路shp矢量生成三维模型案例。

qq_24934183的博客 3543

struts2 jsp中一些参数的取得方法#,%,$

1、 例如:我们要取得session中储存一个属性username的值,可以利用下列方法:              session.getAttribute("username") 取得username的值,      在EL中则使用下列方法              ${sessionScope.username}2、例如:我们要取得用户的请求参数时,可以利用下列方法:  

2133

ESP32实战:破解校园网WPA2-Enterprise认证的完整指南

本文详细介绍了如何使用ESP32开发板破解校园网WPA2-Enterprise认证的完整指南。通过硬件准备、环境搭建、核心代码实现及常见问题排查,帮助开发者解决企业级WiFi连接难题,特别适用于校园网环境下的物联网设备开发。

weixin_29194817的博客 454

stackelberg博弈_博弈论、多智能体、强化学习(随便记点东西)

多智能体应用场景:已实现:游戏AI。正在努力:UAV,物资运输,快递分发,交通系统。未来:社会学,预测群体行为,城市区域合作,国际关系。博弈论基本定义:玩家集合: 策略集合: 收益函数: 囚徒困境:两智能体矩阵博弈坦白抵赖坦白1,13,0抵赖0,32,2占优策略与最佳应对:上表中两者均具有占优策略,即无论如何都应该选坦白。那么构造下表。坦白抵赖坦白1,13,0抵赖0,12,2对于玩家一来说,坦白...

weixin_39611722的博客 2997

老项目Struts2.3升级到2.5过程中遇到的问题

1、Struts2找不到org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter https://blog.youkuaiyun.com/hgx_suiyuesusu/article/details/78167616 2、ClassNotFoundException: org.apache.logging.log4j.Logger https://blog.youkuaiyun.com/weixin_42756361/article/details/

Brave_heart4pzj的博客 2852

Open3D 基于法线的双边滤波

基于法线的双边滤波是一种用于点云平滑的技术,它结合了点与其邻域点之间的几何距离和法线方向的相似性,从而在去除噪声的同时保留几何特征。这种滤波方法广泛应用于点云处理领域,尤其是在需要保留表面细节和边缘的场景中。

纵马踏花向自由 2500

关于struts2.5.18框架访问jsp时报404的错误

最近在搭建struts2框架的时候遇到了jsp404的错误,于是我开始在百度上搜各种技术博客,对着各种各样的问题试了很久,仔细检查了很多遍发现路径没有写错,url映射也是没问题的,web.xml和struts.xml的配置也都没有问题,但是就是没有解决这个问题,当时一度想把电脑砸了。 后来实在没办法,把eclipse全部删干净,从头开始,我开始导入jar包,然后我就发现我这一次导进来的jar包好像...

tianc_pig的博客 756

【ESP 保姆级教程】玩转emqx数据集成篇④ ——数据桥接之HTTP服务

主要是学习数据桥接功能以及构建自己的http服务器,这是一个非常有用的功能。包括各种传感器上报基本上都需要数据桥接功能支持,所以还是希望认真学习这一块开发,然后结合数据库存储等等知识点进行进一步学习。

单片机菜鸟哥的博客 1307

PCL 点云格式转换【2024最新版】

常见点云格式转化汇总包括txt、stl、csv、ply、obj、xyz、las等。博客长期更新,本文最近一次更新时间为:2024年9月14日,代码更新至PCL1.14.1版本。

点云侠的博客 39万+

struts2.5方法访问篇

自从用了struts2的2.5版本之后,整个人都不好了有木有,按照以前2.3的配置了一下,全是错误。泪奔ing... 这里介绍一下访问指定方法的方式 假设Test类在test包里,类中有一个test1方法,返回值是success,还有一个test2方法,返回值是error。有a.jsp,b.jsp和c.jsp三个页面。 1、"method"属性指定方法访问 我们在a.jsp中这么写 点我

yeyun666的博客 626

基于STM32设计的4G远程视频侦查小车(图传+远程控制+EMQX+MQTT)(204)

当前设计了一款基于STM32F103ZET6主控芯片和废旧Android手机改造的4G侦查小车。该设计充分利用已有的智能手机硬件资源,实现摄像头画面的实时采集与上传,以及远程控制功能。这样的设计不仅降低了成本,而且充分利用了废旧手机中高性能的硬件资源,如摄像头、4G通信模块和电池等,实现了资源的有效循环利用。

2528

Struts2 2.5.2的套路

Struts2 2.5版本出现的几个奇怪的问题

593435542的博客 1万+

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

SIMATIC S7-1200, S7-1500 PID 控制[手册]

SIMATIC S7-1200, S7-1500 PID 控制[手册]

Java web项目引入struts2后无法访问到项目中的jsp页面问题解决

Java web项目引入struts2后无法访问到项目中的jsp页面问题解决:今天写javaweb项目时: 项目名:StudentInfoManage 部署到Tomcat上后,在浏览器输入:127.0.0.1:8888/StudentInfoManage弹出404 刚开始以为是web.xml中配置了struts2核心过滤器的问题 但是仔细思考后不对,就算配置了核心过滤器也应该能够访问项目中webroot目录下的jsp页面,后来解决问题: 1.要把Referenced Libraries目录下的 strut

weixin_42837131的博客 1543

深度学习工具包 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&#39;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(&#39;DeepLearnToolbox&#39;));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(&#39;state&#39;,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&#39;); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand(&#39;state&#39;,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 = &#39;sigm&#39;;%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, &#39;Too big error&#39;);```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(&#39;state&#39;,0)sae = saesetup([784 100]);sae.ae{1}.activation_function = &#39;sigm&#39;;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)&#39;)% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = &#39;sigm&#39;;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, &#39;Too big error&#39;);```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x&#39;,28,28,60000))/255;test_x = double(reshape(test_x&#39;,28,28,10000))/255;train_y = double(train_y&#39;);test_y = double(test_y&#39;);%% 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&#39;ll get around 1.2% errorrand(&#39;state&#39;,0)cnn.layers = { struct(&#39;type&#39;, &#39;i&#39;) %input layer struct(&#39;type&#39;, &#39;c&#39;, &#39;outputmaps&#39;, 6, &#39;kernelsize&#39;, 5) %convolution layer struct(&#39;type&#39;, &#39;s&#39;, &#39;scale&#39;, 2) %sub sampling layer struct(&#39;type&#39;, &#39;c&#39;, &#39;outputmaps&#39;, 12, &#39;kernelsize&#39;, 5) %convolution layer struct(&#39;type&#39;, &#39;s&#39;, &#39;scale&#39;, 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, &#39;Too big error&#39;);```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(&#39;state&#39;,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, &#39;Too big error&#39;);%% ex2 neural net with L2 weight decayrand(&#39;state&#39;,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, &#39;Too big error&#39;);%% ex3 neural net with dropoutrand(&#39;state&#39;,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, &#39;Too big error&#39;);%% ex4 neural net with sigmoid activation functionrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);nn.activation_function = &#39;sigm&#39;; % 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, &#39;Too big error&#39;);%% ex5 plotting functionalityrand(&#39;state&#39;,0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = &#39;softmax&#39;; % 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, &#39;Too big error&#39;);%% 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(&#39;state&#39;,0)nn = nnsetup([784 20 10]); nn.output = &#39;softmax&#39;; % 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, &#39;Too big error&#39;);```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

struts2 参数绑定(Jsp获取参数的方法)

  在JSP页面与ACTION之间的桥梁对于程序员来说就是set get方法以及valueStack,既然对方始终获取不了值,那么要么是valueStack有问题(这个框架的东东应该不会错),那就是set get 方法的问题。最后找到使用自动生成set get方法的权限由问题。private 将其更改为public 搞定!!!还是谢谢各位热心帮忙! 看到你这种方式,我想你应该是在用 Stru...

zw7534313的专栏 458

efm32 入门.pdf

本PDF共计22页,介绍的是操作驱动API,下载与否自己斟酌。

struts2.3和2.5框架配置入门

这玩意要给我折腾死 当前最新的struts2版本是struts2.5,当前的不少教材则介绍的struts2.3 而他们的配置方法是不一样的,这让萌新很受伤 配置所需步骤 1 导入.jar包 2 配置src下的struct.xml文件 3 配置WEB-INF下的.xml文件 这些是基本步骤了,然后再写两个.jsp页面实验一下能否运行 1导入.jar包 这个首先从官网上下载,然后在lib文件夹里把.jar包复制粘贴到项目的.lib文件夹。对于struts2.5来说,这些是必须的 对于struts2.3来说,

Aruko的博客 834

jsp怎样获取struts2中action里的值。

jsp怎样获取struts2中action类里的值?方式一、Action中定义成员变量,并生成get/set方法,在JSP页面可以取到这个变量值。    例如:action类:public class BookAction extends ActionSupport { private Book book; private List&lt;Book&gt; books; ... publi...

qq_29606237的博客 4815

Struts2最新版(2.5.12)快速入门(二) Struts2之Action

Struts2之Action 1、action与servlet   在struts1中 一个Action类完全等同于一个servlet类,但在struts2中,你也可以把它看作是一个servlet类,因为其处理业务逻辑方式和servlet大致相同,但是其本质却和servlet没半毛钱关系。我们使用servlet处理业务逻辑的话,如果一个servlet类里面有多个处理业务逻辑请求的话

无名氏灬的博客 2724

Sturs2java给jsp传值_Struts2.5 利用Ajax将json数据传值到JSP的实例

AJAX +JSON=》JSPAJAXAJAX 是一种在无需重新加载整个网页的情况下,能够更新部分网页的技术。通过在后台与服务器进行少量数据交换,AJAX 可以使网页实现异步更新。这意味着可以在不重新加载整个网页的情况下,对网页的某部分进行更新。传统的网页(不使用 AJAX)如果需要更新内容,必须重载整个网页页面。JSONJSON(JavaScript Object Notation, JS 对象...

weixin_29218963的博客 199

struts2.5.2解决中文乱码

页面、配置、项目文件编码、tomcat编码必须一致,建议用utf-8。 一、页面      二、配置      web.xml         encodingFilter org.springframework.web.filter.CharacterEncodingFilter encodin

韦庆礼的专栏 java C# .NET JSP 2433

jsp页面获取后台传过来的list集合的长度

在jsp页面导入函数标签库http://java.sun.com/jsp/jstl/functions"%> list的长度是:${fn:length(list)} 而不能使用在jsp页面中不能通过${list.size}取列表长度。

阶段丶成长的博客 2万+

struts2升级到2.5版本需要注意的几点

最近在阿里云服务器总是受到DDOS攻击,后来发现是因为struts版本过低,导致被入侵,于是升级了一下struts的版本到2.5,希望可以一次性解决这个问题,下面是升级到struts2.5版本的步骤: 一:替换jar包 注意:并不是图片里有的都要放到自己的项目中,自己的项目中用到了哪些,就替换掉哪些,要注意的是:如果你的项目中没有用到log4j.xml在换成2.5以后,运行t...

yxhxj2006的专栏 5043

struts2 在服务端接收客户端提交时取得 session 的两种方法

struts2 在服务端接收客户端提交时取得 session 的两种方法 struts2 取 session 不同于传统的 Servlet,而是需要继承 Servlet 或者是调用 ActionContext,两种方法在 struts2 中均可使用,侧重不同,结果一样。 导入类 import org.apache.struts2.ServletActionContext; impo

NULL BLOG 1369

Struts2.5版本之后Tomcat启动报错问题

初次学习Struts2,本着学习最新版本知识的原则,使用了Struts2.5.5版本。使用2.1版本没有问题,但是2.5版本果然会报错,完全靠自学。。。我真是解决两个小时啊!对新手来说上手坑真的比较多。。。 1.导入lib,我们只需要导入一些最小依赖包,下面列出的是我导入的 commons-fileupload-1.3.2.jar commons-io-2.4.jar commons-la...

Daniel的博客 1万+

使用struts2.5版本遇到的问题

我的环境         Eclipse JavaEE |1.8JDK |Tomcat8.0| 动态web项目3.1| struts2.5.2     struts相关包         我使用的是struts2.5.2版本,是目前的最新版本。需要的核心包如下:         其实包是看你自己需要,比如struts2-convention-plugin-2.5.2.jar包是用来使用

en_reading的博客 1万+
上一篇: Struts2中action重定向跳转到jsp页面两种配置方式
下一篇: 在ie6及以前版本中url传递中文url解决办法
wangguoping
博客等级 码龄19年 1粉丝 32原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值