下面是login.jsp页面
--------------------------------------------------------------
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<% ...
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
在 action中
将formbean中内容复制到javabean中可用
BeanUtils.copyProperties(javabean,formbean);
if(user.getBirthdayString()!=null && !user.getBirthdayString().trim().isEmpty())
{
BeanUtils.copyProperty(bean, "birthday", user.getBirthdayString());
}
copyProperties方法可实现自动转型.
当预知会出现不可转类型时,可用copyPro ...
- 18:12
- 浏览 (141)
- 评论 (0)
<logic:messagesPresent>
<fieldset class="errorMessage">
<legend>
<bean:message key="errors.header" />
</legend>
<ul>
<html:messages id="i">
<li>
<bean:write name="i" />
</li>
</html:messa ...
- 16:37
- 浏览 (188)
- 评论 (0)







评论排行榜