明明配置了,却出现 does not start with a "/" character,见鬼了,在线等 还有我的struts是struts 1.3.5 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 把<action path="/common/login"改成<action path="common/login" 请问你确定只有一个forward的name是success么? 没有设置全局forward,我修改成success111也不行,同样的错误COPY struts app 的来修改,一样报错,快疯了 应该和你的配置文件有关,确认是否配全了你的action元素和是否能url直接访问/pages/login.jsp/pages/bean-write.jsp java:------------------------package com.aherp.voice.app.action;import java.util.Map;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import org.apache.struts.action.Action;import org.apache.struts.action.ActionForm;import org.apache.struts.action.ActionForward;import org.apache.struts.action.ActionMapping;import com.aherp.voice.app.forms.LoginForm;public class LoginAction extends Action { @Override public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { System.out.println("....i'm running."); return new ActionForward("success"); }}jsp:---------------------<%@ include file="/pages/common/taglibs.jsp" %><head><html:html><html:base/><meta http-equiv="Content-Type" content="text/html; charset=GBK"><title>Insert title here</title></head><html:form action="/common/login" method="post"><table width="427" height="174" border="0" cellspacing="0"> <tr> <td width="62"> </td> <td width="95"> </td> <td width="154"> </td> <td width="177"> </td> </tr> <tr> <td height="41"> </td> <td>用户</td> <td><html:text property="userNm"/></td> <td> </td> </tr> <tr> <td height="31"> </td> <td>密码</td> <td><html:text property="userPsw"/></td> <td> </td> </tr> <html:errors header="<tr><td><ul>" suffix="</ul></td></tr>"/> <tr> <td> </td> <td colspan="2"><html-el:submit property="loginButton" styleClass="button">确定</html-el:submit></td> <td> </td> </tr></table></html:form></html:html> 访问页http://localhost:8080/voice/pages/login.jsphttp://localhost:8080/voice/pages/bean-write.jsp可以访问 return new ActionForward("success");改成return mapping.findForward("success");试一下 晕,原来因为是自己new的一个Action.吐血了 hadoop 我们爱分享---在JS中循环调用AJAX方法 怎么把xml文件转化成Document文件? java xml 郁闷的ajax Hibernate 启动的时候出现奇怪的问题,前缀发现转移(可能就是传说中的转移大法) LoadRunner测试时报的错是什么意思呀? 请问学什么能多java3d ? 向ejb高手请教有关entitybean的问题(weblogic)。 如何自学java 学习J2EE是先EJB还是先SERVLET和JSP啊? 谁能给个applet通信servlet然后存数据库的例子
改成<action path="common/login"
/pages/login.jsp
/pages/bean-write.jsp
------------------------package com.aherp.voice.app.action;import java.util.Map;import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;import com.aherp.voice.app.forms.LoginForm;public class LoginAction extends Action { @Override
public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
System.out.println("....i'm running.");
return new ActionForward("success");
}
}jsp:
---------------------
<%@ include file="/pages/common/taglibs.jsp" %><head>
<html:html>
<html:base/>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<title>Insert title here</title>
</head>
<html:form action="/common/login" method="post">
<table width="427" height="174" border="0" cellspacing="0">
<tr>
<td width="62"> </td>
<td width="95"> </td>
<td width="154"> </td>
<td width="177"> </td>
</tr>
<tr>
<td height="41"> </td>
<td>用户</td>
<td><html:text property="userNm"/></td>
<td> </td>
</tr>
<tr>
<td height="31"> </td>
<td>密码</td>
<td><html:text property="userPsw"/></td>
<td> </td>
</tr>
<html:errors header="<tr><td><ul>" suffix="</ul></td></tr>"/>
<tr>
<td> </td>
<td colspan="2"><html-el:submit property="loginButton" styleClass="button">确定</html-el:submit></td>
<td> </td>
</tr>
</table>
</html:form>
</html:html>
http://localhost:8080/voice/pages/login.jsp
http://localhost:8080/voice/pages/bean-write.jsp
可以访问
改成
return mapping.findForward("success");
试一下