在web.xml中加入
<taglib>
<taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
</taglib> <taglib>
<taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-html.tld</taglib-location>
</taglib> <taglib>
<taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
</taglib> <taglib>
<taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-html.tld</taglib-location>
</taglib> <taglib>
<taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
</taglib>
解决方案 »
- myeclipse9 怎么新建一个 tomcat 工程
- tomcat+struts2中文命名的图片文件显示的问题
- Tomcat5.5.17报错
- html代码能和js完全分开吗?
- Hibernate中的java.lang.IllegalAccessError 异常
- 这种关联用one-to-one映射合适吗?总是出错!
- JSP连接SQL SERVER数据库
- 寻求一个能画图的java类
- 推荐一个cvs客户端工具。
- HP ALM和Jenkins master,怎么关联调用
- struts标签的简单问题,怎么在jsp页面显示数据库中几个字段的全部记录
- struts+filter = error ? (倾囊求助)
<body>
<title>Example </title>
<body> <form action="example.do", method="post">
please input a striung<br>
<input type="text" name="input" size="20"><br>
<input type="submit" value="Submit" name="submit"
</form>
<html>
<html>
<body>
<title>Example </title>
<body> <form action="<%=contextPath%>/example.do", method="post">
please input a striung<br>
<input type="text" name="input" size="20"><br>
<input type="submit" value="Submit" name="submit"
</form>
<html>
<html>
<body>
<title>Example </title>
<body>
<%String contextPath = request.getContextPath();%>
<form action="<%=contextPath%>/example.do", method="post">
please input a striung<br>
<input type="text" name="input" size="20"><br>
<input type="submit" value="Submit" name="submit"
</form>
<html>
<html:form action="example">
please input a striung<br>
<input type="text" name="input" size="20"><br>
<input type="submit" value="Submit" name="submit"
</form>
</html:form>
另外你out.print(request.getContextPath());是什么告诉我!!
结果是:
message Invalid path /example was requested
description The request sent by the client was syntactically incorrect (Invalid path /example was requested).此时URL是:http://127.0.0.1/example/example.do
<body>
<title> Example </title>
</body>
<%String contextPath = request.getContextPath();%>
<form action="<%=contextPath%>/example.do", method="post"> ÇëÊäÈëÖµ
<input type="text" name="test"/>
<br><br>
<input type="submit" name="Submit">
<input name="reset" type="reset">
</form></html>
怎么没配 type?也就是你的bean
给你一个例子
<form name="EquipFetchreceiptsVOE" type="com.sinosoft.vo.equipment.EquipFetchreceiptsVOE" onsubmit="return validateEquipFetchreceiptsVOE(this);" action="/fetchReceiptsAction.do">