struts2 属性注入的一个问题 struts2属性注入的时候,对象的属性只能注入一个,其他属性注入不进去。例如:user对象 username和password ,页面上写user.username和user.password 只能注入一个username。struts属性注入spring 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <body><form action="${pageContext.request.contextPath}/login/loginAction" method="post" id="login_form"><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td bgcolor="9fc967"> </td> </tr> <tr> <td height="604"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="604" background="${pageContext.request.contextPath}/images/login_02.gif"> </td> <td width="989"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="345" background="${pageContext.request.contextPath}/images/login_1.jpg"> </td> </tr> <tr> <td height="47"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="539" height="47" background="${pageContext.request.contextPath}/images/login_05.gif" nowrap="nowrap"> </td> <td width="206" background="${pageContext.request.contextPath}/images/login_06.gif" nowrap="nowrap"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="17%" height="22"><div align="center"><span class="STYLE1">用户</span></div></td> <td width="58%" height="22"><div align="center"> <input name="user.username" id="username" type="text" size="15" style="height:17px; border:solid 1px #bbbbbb" /> </div></td> <td width="25%" height="22"> </td> </tr> <tr> <td height="22"><div align="center"><span class="STYLE1">密码</span></div></td> <td height="22"><div align="center"> <input name="user.password" id="password" type="password" size="15" style="height:17px; border:solid 1px #bbbbbb" /> </div></td> <td height="22"><div align="center"><img src="${pageContext.request.contextPath}/images/dl.gif" width="39" height="18" id="sub" style="cursor:pointer"></div></td> </tr> </table> </td> <td width="244" background="${pageContext.request.contextPath}/images/login_07.gif" nowrap="nowrap"> </td> </tr> </table></td> </tr> <tr> <td height="212" background="${pageContext.request.contextPath}/images/login_08.gif"> </td> </tr> </table></td> <td background="${pageContext.request.contextPath}/images/login_04.gif"> </td> </tr> </table></td> </tr> <tr> <td bgcolor="70ad21"> </td> </tr></table> </form></body> 问题解决了,是因为user对象的getter方法没写(我只写了setter方法),因为之前用spring注入对象用的多了,习惯的只写setter方法,但是struts2貌似不可以,看来只能看src才能知道其原理了。 tomcat突然不能运行jsp了,非常急,在线等~~~ 项目运行时出现的问题,大家帮帮忙解决 用servlet跳转时报的异常 怎样把中文标点符号替换成英文标点符号 请教package之后!? 读文本文件出现怪问题!(附原代码) 关于JBuilder8中显示中文为乱码,急!在线等待! 这段java/jsp程序的作用是什么? 如何根据请求值(request.getParameter)来使用户到达指定的页面?来者有份,来者有分! 怎样通过Ip地址连接Sql server 数据库? HASHMAP 类型转换求助 求获取客户端真实IP的代码
<form action="${pageContext.request.contextPath}/login/loginAction" method="post" id="login_form">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td bgcolor="9fc967"> </td>
</tr>
<tr>
<td height="604">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="604" background="${pageContext.request.contextPath}/images/login_02.gif"> </td>
<td width="989"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="345" background="${pageContext.request.contextPath}/images/login_1.jpg"> </td>
</tr>
<tr>
<td height="47">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="539" height="47" background="${pageContext.request.contextPath}/images/login_05.gif" nowrap="nowrap"> </td>
<td width="206" background="${pageContext.request.contextPath}/images/login_06.gif" nowrap="nowrap"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="17%" height="22"><div align="center"><span class="STYLE1">用户</span></div></td>
<td width="58%" height="22"><div align="center">
<input name="user.username" id="username" type="text" size="15" style="height:17px; border:solid 1px #bbbbbb" />
</div></td>
<td width="25%" height="22"> </td>
</tr>
<tr>
<td height="22"><div align="center"><span class="STYLE1">密码</span></div></td>
<td height="22"><div align="center">
<input name="user.password" id="password" type="password" size="15" style="height:17px; border:solid 1px #bbbbbb" />
</div></td>
<td height="22"><div align="center"><img src="${pageContext.request.contextPath}/images/dl.gif" width="39" height="18" id="sub" style="cursor:pointer"></div></td>
</tr>
</table>
</td>
<td width="244" background="${pageContext.request.contextPath}/images/login_07.gif" nowrap="nowrap"> </td>
</tr>
</table></td>
</tr>
<tr>
<td height="212" background="${pageContext.request.contextPath}/images/login_08.gif"> </td>
</tr>
</table></td>
<td background="${pageContext.request.contextPath}/images/login_04.gif"> </td>
</tr>
</table></td>
</tr>
<tr>
<td bgcolor="70ad21"> </td>
</tr>
</table> </form>
</body>