求struts的一个简单的例子 hehe 你在www.apache.org上面下载struts-example呵呵不错的 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 用jb9集成struts1.1作一最简单的例子如下: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正常 laoer(laoer):自己带的例子在哪啊 求助:XWorkList 怎么接值啊? struts2.3.3+hibernate4.1.2final 运行报错 hibernate 删除记录问题 struts2 又jsp向action传值问题. 服务端向客户端传值问题 请教一个最简单的STRUTS问题 JBOSS重新登录时间的设置 急急急急急急急急急,求大神! 现做一门户网站,有分开布署的论坛系统和新闻发布系统,如何实现单点登录??? ***如何动态创建消息队列 请问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正常