struts 提交后什么都没有. 我把重要的都贴出来了,高手帮看看有什么问题,为什么提交后不跳转显示Success.jsp的信息呢? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 没有人帮看看吗?提交以后地址变成这样:http://localhost:8080/LoginStruts/login.do;jsessionid=C627EA16A71B9BCAA740DDBCEA60DD62但是页面是空白的,成功跳转后,应该显示JavaBean的字段值啊! login.jsp<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %><%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %><%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %><html:html locale="true"> <head> <title> <bean:message key="login.jsp.title" /> </title> </head> <body> <html:errors/> <logic:present name="userbean" scope="request"> <bean:message key="login.jsp.suc" /> <bean:write name="userbean" property="userName"/> </logic:present> <html:form action="/login.do" focus="userName"> <table> <tr> <td> <bean:message key="login.jsp.username" /> </td> <td> <html:text property="userName" size="16" maxlength="16"></html:text> </td> </tr> <tr> <td> <bean:message key="login.jsp.password" /> </td> <td> <html:text property="passWord" size="16" maxlength="16"></html:text> </td> </tr> <tr> <td> <html:submit property="Submit" value="Submit"></html:submit> </td> <td> <html:reset/> </td> </tr> </table> </html:form> </body></html:html>Success.jsp<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %><%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %><%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %><html:html locale="true"> <head> <title> <bean:message key="login.jsp.title" /> </title> </head> <body> <logic:present name="userbean" scope="request"> <bean:message key="login.jsp.suc" /> <bean:write name="userbean" property="userName"/> </logic:present> </body></html:html> errors.add("userName", new ActionMessage("login.error.noa", "a"));什么意思啊你可以把用户名密码的值在action里输出,。。看是否有值。。如果你不加判断用户名为 a,b ,是不是能正确显示成功页面?我也是新手 你的Success.jsp和你的其他jsp文件是放在同一个文件夹下不?要不是,就是调用不到它,就只有调用空白了!!!!1 哎,自己找到错误了.exceute-----> execute写错了也不抱错误,真难找啊!!! 是不是你的struts包和你方法里用的方法名版本不一致,也就是说你用的可能是struts1.2的包,但是用的是struts1.0的执行方法,这样也会出现空页面,而且什么错误都不报. 我也遇到过版本的问题,但是那是标签库的问题.locale="true"不认识,jsp-config也不认识.不过我的这个问题就是因为execute写错了造成的....多谢楼上的提醒.. 关于hibernate的子查询 在javaweb项目中如何将lib文件里面的jar包移动lib外面目录? java URLEncod编码乱码问题与系统汉字编码的关系。 谁有iBatis的资料,给份谢了(新手求教) 关于struts所引用的包 这个xml查询怎么解决 在tomcat中运行,但是界面类似桌面应用,view不是jsp,jsp页面很少,这是什么技术。 关于JBoss4的一个问题 寻找java web server 下载 struts入门级问题 请教如何用程序实现提取java源码中的函数名和变量名? logic iterate的问题
提交以后地址变成这样:
http://localhost:8080/LoginStruts/login.do;jsessionid=C627EA16A71B9BCAA740DDBCEA60DD62但是页面是空白的,
成功跳转后,应该显示JavaBean的字段值啊!
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %><html:html locale="true">
<head>
<title>
<bean:message key="login.jsp.title" />
</title>
</head>
<body>
<html:errors/>
<logic:present name="userbean" scope="request">
<bean:message key="login.jsp.suc" />
<bean:write name="userbean" property="userName"/>
</logic:present>
<html:form action="/login.do" focus="userName">
<table>
<tr>
<td>
<bean:message key="login.jsp.username" />
</td>
<td>
<html:text property="userName" size="16" maxlength="16"></html:text>
</td>
</tr>
<tr>
<td>
<bean:message key="login.jsp.password" />
</td>
<td>
<html:text property="passWord" size="16" maxlength="16"></html:text>
</td>
</tr>
<tr>
<td>
<html:submit property="Submit" value="Submit"></html:submit>
</td>
<td>
<html:reset/>
</td>
</tr>
</table>
</html:form>
</body>
</html:html>Success.jsp
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %><html:html locale="true">
<head>
<title>
<bean:message key="login.jsp.title" />
</title>
</head>
<body>
<logic:present name="userbean" scope="request">
<bean:message key="login.jsp.suc" />
<bean:write name="userbean" property="userName"/>
</logic:present>
</body>
</html:html>
errors.add("userName", new ActionMessage("login.error.noa", "a"));什么意思啊
你可以把用户名密码的值在action里输出,。。看是否有值。。
如果你不加判断用户名为 a,b ,是不是能正确显示成功页面?
我也是新手
exceute-----> execute写错了也不抱错误,真难找啊!!!
不过我的这个问题就是因为execute写错了造成的....多谢楼上的提醒..