hehe 你在www.apache.org上面下载struts-example
呵呵不错的
呵呵不错的
解决方案 »
- 前台运行正常 Struts 2 action 问题在 Tomcat 6.0\logs\stdout_20100414.log全是这种错误
- 什么书讲web service和java比较好的
- 在myeclipse中用xfire开发的客户端报错请大虾们给看看!
- 从TXT文件中读取数据! java
- spring循环依赖的问题,那位大侠帮忙看看啊~
- 请问大侠,java.lang.IndexOutOfBoundsException是什么原因造成的
- 关于人生的困惑,需要被指点
- 为什么会出现这样的错误
- 系统完成,如何如何打包配置到tomcat
- 请大家帮忙解释此函数
- 请问java web start是什么,干什么用的?
- 请介绍几本关于servlet的经典书! 谢谢
1.new project;
2.new ->web application;
3.new ->web->ActionForm,name为Untitled1ActionForm,添加一id,其他为默认设置
4.new->web->Action,name为Untitled1Action,FormBean name选第三步建立的formbean,scope->request,validate formbean->false,其他为默认设置
5.new->web->jsp from actionForm name为UntitledJsp1,actionForm选择第三步建立的formbean,其他为默认设置
6.在root directory下新建一jsp1.jsp.
7.修改action代码为:
public ActionForward excute(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {
return actionMapping.findForward("forward");
}
struts-config.xml 为:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
<struts-config>
<form-beans>
<form-bean name="untitled1ActionForm" type="untitled7.Untitled1ActionForm" />
</form-beans>
<action-mappings>
<action name="untitled1ActionForm" type="untitled7.Untitled1Action" validate="false" scope="request" path="/untitled1Action">
<forward name="forward" path="/jsp1.jsp" />
</action>
</action-mappings>
</struts-config>UntitledJsp1部分代码为:
<html:form action="/untitled1Action.do" method="POST">
<html:text property="id"/>
<br>
<html:submit property="submit" value="Submit"/><br>
<html:reset value ="Reset"/>
</html:form>同样做法在struts1.0正常