将值从1个jsp发送到另一个jsp [英] Send value from 1 jsp to another jsp
问题描述
我有1个JSP,比如说1.jsp
,其中我有一个值,该值是从Action类的request.getAttribute("testvalue")
中获取的,因为我正在使用Struts框架.我需要将此值从1.jsp
发送到另一个2.jsp
.请让我知道该怎么做?
I have 1 JSP, say 1.jsp
in which I have a value which am getting from request.getAttribute("testvalue")
from action class, as I am using Struts framework. I need to send this value from 1.jsp
to another 2.jsp
. Please let me know how to do this?
也要继续,我需要将此值从2.jsp
发送到3.jsp
.
我试图避免在会话中使用设置值.
那么,让我知道该怎么做?
Also going ahead,i need to send this value from 2.jsp
to 3.jsp
.
Am trying to avoid using setting the value in session.
So let me know how to do this?
推荐答案
从请求中获取值,您应该在请求中添加值.这段代码
Getting value from the request, you should be putting a value to a request. This code
request.getAttribute("testvalue");
正在获取值,但是该代码
is getting a value, but that code
request.setAttribute("testvalue", value);
正在放它.
这是因为您要避免使用HTTP会话.
This is because you want to avoid using the HTTP session.
这篇关于将值从1个jsp发送到另一个jsp的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!