使用取到bean:write的值,并赋值给java变量

<logic:iterate id="item" name="list" type="com.worthtech.app.bean.Expense" indexId="index">
				        <%
				        int i =((java.lang.Integer)pageContext.findAttribute("index")).intValue();
				      	if((i%2)==0){//斑马线
				        %>
				        	<tr class="SelcetOff">
				        <%}else{%>
				       		<tr class="SelcetOn">
				        <%}%>
				          <td><div align="center"><bean:write name="item" property="date"/></div></td>
				          <td><div align="center"><bean:write name="item" property="addtime"/></div></td>
				          
				           <bean:define id="var" name="item" property="addtime" type="java.lang.String"/>
				        	<%
				        	java.lang.String old=var;
				        	java.lang.String now=com.worthtech.app.util.Util.getCurrentDate("yyyy-MM-dd");
				        	int oldMonth=java.lang.Integer.parseInt(old.substring(5,7));
				        	int oldDay=java.lang.Integer.parseInt(old.substring(8,10));
				        	int nowMonth=java.lang.Integer.parseInt(now.substring(5,7));
				        	int nowDay=java.lang.Integer.parseInt(now.substring(8,10));
				        	if((nowMonth-oldMonth)*30+nowDay-oldDay>7){
				        	%> 
				          		<td><div align="center"><a href="expense.portal?action=view&backto=add&id=<bean:write name="item" property="id"/>" target="mainFrame">查看</a></div></td>
				        	<%}else{ %>
				          		<td><div align="center">
				          			<a href="expense.portal?action=view&backto=add&id=<bean:write name="item" property="id"/>" target="mainFrame">查看</a>
				          			<a href="expense.portal?action=update&backto=add&id=<bean:write name="item" property="id"/>" target="mainFrame">修改</a>
				          		</div></td>
				        	<% } %>
				        </tr>
					</logic:iterate>

你可能感兴趣的:(java,html,bean)