如何取JSP页面的值

[复制链接]
查看11 | 回复5 | 2011-3-29 07:29:48 | 显示全部楼层 |阅读模式
JSP页面:
%index = 0;%
td align=\"center\"

bean:write name=\"prpLverifyLossDto1\" property=\"surveySubmitTime\"/

input type=\"hidden\" name=\"firstSubmitTime\" value=\"bean:write name=\"prpLverifyLossDto1\" property=\"firstSubmitTime\"/\"

/td
%index;%


我现在想用JAVA代码在当前的JSP页面取到bean:write name=\"prpLverifyLossDto1\" property=\"surveySubmitTime\"/这个标签打印出来的值
和input type=\"hidden\" name=\"firstSubmitTime\" value=\"bean:write name=\"prpLverifyLossDto1\" property=\"firstSubmitTime\"/\"
这个input选框中打印出来的值。
该怎么做呢?

我试着用了
%

String firstSTime = request.getParameter(\"firstSubmitTime\");

System.out.println(\"firstSTime===\" firstSTime);

%
这个方法取值,可是输出结果为空。请问有更好的方法么?
回复

使用道具 举报

千问 | 2011-3-29 07:29:48 | 显示全部楼层
<pre id=\"best-answer-content\" class=\"reply-text mb10\">何不用JSP标签呢。jsp:setProperty/jsp:getProperty/即可在页面输出值

















<h4 class=\"ask\">追问





<pre class=\"replyask-text\" id=\"content-2973763\">因为我要把取回来的值进行转换成整形的处理,然后进行加减法,把得到的值在传给页面。所以我觉得JSP标签貌似实现不了。
回复

使用道具 举报

千问 | 2011-3-29 07:29:48 | 显示全部楼层
<pre class=\"replyask-text\" id=\"content-2974336\">你何必要这样麻烦呢,本来页面就是用来显示数据的,至于数据的操作应该交由业务来处理。写程序的同时也要考虑下它的可维护性
回复

使用道具 举报

千问 | 2011-3-29 07:29:48 | 显示全部楼层
<pre class=\"replyask-text\" id=\"content-2975056\">我也有这样想过,想把他放到后面的 类中处理。可是,我又不知道我在后面的JAVA类中算出来的数据该如何传给JSP页面。我是只小菜鸟。很多想不太明白……
回复

使用道具 举报

千问 | 2011-3-29 07:29:48 | 显示全部楼层
<pre class=\"replyask-text\" id=\"content-2975575\">你会用ssh框架吗?
回复

使用道具 举报

千问 | 2011-3-29 07:29:48 | 显示全部楼层
<pre class=\"replyask-text\" id=\"content-2973899\">如果用javascript不是得有事件触发他才可以执行吗?是吧?
AJAX我是完全不懂的
重新请求一次是什么意思呢?能否举个例子呢?
谢谢
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行