问个struts初级问题 首页指向一个action,在这个action中读取数据库,然后由这个action掉转到index.jsp上 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 能提供一些配置方式或代码吗?比如如何指向action,index.jsp中如何写程序读数据 比如说:你在访问的时候输入http://xxx.xxx.xxx.x:8011/ProjectName/index.do这时候就可访问你的INDEX.DO了. 当然,肯定要在你的STRUTS-CONFIG.XML中配置啊. 是的,刚接触struts,但急需解决这问题 今天是来送分了是想能够直接用http://xxx.xxx.xxx.x:8011/ProjectName/就能访问,欢迎页设index.do好像不行 <welcome-file-list> <welcome-file>index.do</welcome-file></welcome-file-list> 楼上的我这样设不行struts_config.xml里也有<action-mappings > <action path="/index" scope="request" type="com.chuzuwu.struts.action.IndexAction" /> </action-mappings>IndexAction的execute()也设转到index.jsp文件(此文件存在),但还是提示404找不到文件 我使用的方法是首页默认是index.html。然后他的功能就是指向index.jsp所需要的action 也可以让你的首页是一个SERVLET.做完工作之后跳到你的INDEX.JSP 我知道可以用servlet做,但不就是想用struts吗,突然发现这玩意做不了,郁闷,做过的人指导一下 你先在welcome-file中设置一个index.html文件,在这个文件中什么内容都没有,只要添加下面的话:<body onload="window.location.href='/index.do'"></body>这样就能直接转向index.do了,然后index.do中读取数据库,处理完之后页面跳转到index.jsp现实结果 首页 必须事先走 index.do web.xml 要有 *.dostruts_config.xml 里<action-mappings > <action path="/index" scope="request" type="com.chuzuwu.struts.action.IndexAction"> <forward name="index" path="/common/index.jsp"/> </action> </action-mappings> action 类 里面 return mapping.findForward("index"); struts2和spring3整合项目,action无法调用业务逻辑组件的方法 SSH关于异常的处理 多模块问题 我上班了.可是......... 这里可以下载《JSF第一步》增删改数据库表中记录的简明示例 将后台线程的告警信息体现到WEB页面? java 程序中如何调用web service 运行时老是错误 请问怎样访问部署在Weblogic7中的Entity Bean的LocalHome,高分相送 讨论:IBM WebSphere,大侠请进! 用jsp如何获取tomcat安装目录? 【100分在线等】求Hibernate 两字段和 排序问题
比如如何指向action,index.jsp中如何写程序读数据
<welcome-file>index.do</welcome-file>
</welcome-file-list>
<action-mappings >
<action
path="/index"
scope="request"
type="com.chuzuwu.struts.action.IndexAction" /> </action-mappings>IndexAction的execute()也设转到index.jsp文件(此文件存在),但还是提示404找不到文件
<body onload="window.location.href='/index.do'">
</body>这样就能直接转向index.do了,然后index.do中读取数据库,处理完之后页面跳转到index.jsp现实结果
web.xml 要有 *.do
struts_config.xml 里
<action-mappings >
<action
path="/index"
scope="request"
type="com.chuzuwu.struts.action.IndexAction"> <forward name="index" path="/common/index.jsp"/>
</action>
</action-mappings> action 类 里面
return mapping.findForward("index");