jsp页面如何用java代码付int类型的值

jsp也面 通过formbean 获取内容
<%
String deviceBuyTime=""
double deviceMoney=0.0;
int recordId=0;
deviceBuyTime=devicefrom.getDeviceBuyTime();
deviceMoney=devicefrom.getDeviceMoney();
recordId=devicefrom.getRecordId();
%>
<html:hidden property="recordId" value="<%=recordId%>"/>
<html:text property="deviceMoney" value="<%=deviceMoney%>">
运行提示我:The method setValue(String) in the type BaseInputTag is not applicable for the arguments (double)
我想知道 怎么才能通过<%=%> 这种形式付值,
我的formbean 里面 money 是doube 类型 ID 是int类型
另外:
我在action 里封装了一个 formbean 如 request.setAttribute("xiugai", actForm);
那么jsp 页面 如何用struts1 的 标签 将内容读取出来,最好能举例子谢谢,不要网上粘贴的那些

第1个回答  2015-08-04
<% int i=1;%>

楼主需要的是这个么?如果不是,那能说详细些么

第2个回答  2012-05-28
<html:text html:hidden这种标签的value只能是string类型的,因此

<html:hidden property="recordId" value="<%=String.valueOf(recordId)%>"/>
<html:text property="deviceMoney" value="<%=String.valueOf(deviceMoney)%>">本回答被提问者采纳
第3个回答  推荐于2017-09-22
先将int类型的值,转换为String类型,再进行赋值,如:
<%=String.valueOf(recordId)%>
第4个回答  2012-05-28
如果你存在了request.setAttribute("key",value); 那么request.getAttribute("key")就能拿到;
后者用el表达式范围${RequestScope.key}.
第5个回答  2012-05-28
你可以找一下你的这个声明:double deviceMoney=0.0; 有没有错误
相似回答