在ssh项目中,提交form不能转到相应的Action上
悬赏:15 发布时间:2008-07-03 提问人:184168730@qq.com (初级程序员)
在ssh项目中,提交form不能转到相应的Action上,应该不是struts.jar的问题,我已经加到了lib目录下,web.xml配置文件不知道哟没有问题,请各位同僚帮忙看看。
web.xml如下:
问题补充:
已贴出 在论坛新手讨论区
该问题已经关闭: 超过15天由系统自动关闭,悬赏平分给所有参与回答的会员
web.xml如下:
<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> <context-param> <param-name> javax.servlet.jsp.jstl.fmt.localizationContext </param-name> <param-value>ApplicationResources</param-value> </context-param> <filter> <filter-name>encoding filter</filter-name> <filter-class> com.bluedot.web.filter.EncodiingFilter </filter-class> <init-param> <param-name>encoding</param-name> <param-value>UTF-8</param-value> </init-param> </filter> <filter-mapping> <filter-name>encoding filter</filter-name> <url-pattern>*.do</url-pattern> </filter-mapping> <filter-mapping> <filter-name>encoding filter</filter-name> <url-pattern>*.jsp</url-pattern> </filter-mapping> <servlet> <servlet-name>action</servlet-name> <servlet-class> org.apache.struts.action.ActionServlet </servlet-class> <init-param> <param-name>config</param-name> <param-value>/WEB-INF/struts-config.xml</param-value> </init-param> <init-param> <param-name>debug</param-name> <param-value>3</param-value> </init-param> <init-param> <param-name>detail</param-name> <param-value>3</param-value> </init-param> <load-on-startup>0</load-on-startup> </servlet> <servlet-mapping> <servlet-name>action</servlet-name> <url-pattern>*.do</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file>login.jsp</welcome-file> </welcome-file-list> <jsp-config> <taglib> <taglib-uri>/html</taglib-uri> <taglib-location>/WEB-INF/struts-html.tld</taglib-location> </taglib> <taglib> <taglib-uri>/bean</taglib-uri> <taglib-location>/WEB-INF/struts-bean.tld</taglib-location> </taglib> <taglib> <taglib-uri>/logic</taglib-uri> <taglib-location>/WEB-INF/struts-logic.tld</taglib-location> </taglib> <taglib> <taglib-uri>/tiles</taglib-uri> <taglib-location>/WEB-INF/struts-tiles.tld</taglib-location> </taglib> <taglib> <taglib-uri>/menu</taglib-uri> <taglib-location>/WEB-INF/struts-menu.tld</taglib-location> </taglib> </jsp-config> </web-app>
问题补充:
已贴出 在论坛新手讨论区
该问题已经关闭: 超过15天由系统自动关闭,悬赏平分给所有参与回答的会员
回答
把你的struts配置文件贴出来看看。很可能是配置错误。还有你的请求页面的哪个form的代码也贴出来。你光贴各web.xml无法判断错误的原因
yourgame (初级程序员) 2008-07-03
有没有错误日志
看看是不是form的action里的路径不对,如果地址栏里显示的是
http://localhost:8080/***.do
就说明你路径指定错了,还需要加上工程名
看看是不是form的action里的路径不对,如果地址栏里显示的是
http://localhost:8080/***.do
就说明你路径指定错了,还需要加上工程名
congjl2002 (资深程序员) 2008-07-03
很有可能是你的struts配置文件没配置对,在配置<form-bean>属性中配置form,然后再<action>属性中用name引用你在<form-bean>
如:
<form-bean name="BindNumber"
type="com.oc.smap.sys.form.BindNumberForm" />
<action path="/bindnumber" name="BindNumber" scope="request"
type="com.oc.smap.sys.action.BindNumberAction"
parameter="method">
<forward name="list" path="/bindNumNo.jsp" />
</action>
如:
<form-bean name="BindNumber"
type="com.oc.smap.sys.form.BindNumberForm" />
<action path="/bindnumber" name="BindNumber" scope="request"
type="com.oc.smap.sys.action.BindNumberAction"
parameter="method">
<forward name="list" path="/bindNumNo.jsp" />
</action>
song_8 (初级程序员) 2008-07-04
不能转到正确的action,还是不能跳转?
前者的话:仔细看看自己的配置文件,后者的话:确认配置文件没错的话那就重新找个struts的包
前者的话:仔细看看自己的配置文件,后者的话:确认配置文件没错的话那就重新找个struts的包
csjiaju (初级程序员) 2008-07-04
要求看STRUTS配置文件
日志报什么错???
估计是STRUTS配置文件的type配错了 改为type="org.springframework.web.struts.DelegatingActionProxy"
日志报什么错???
估计是STRUTS配置文件的type配错了 改为type="org.springframework.web.struts.DelegatingActionProxy"
shajindan (初级程序员) 2008-07-04
出问题的原因可能有两点:
1、structs配置文件中formbean配置出错
2、formbean未被注入
解决方案
1、structs。。。自己仔细看下你的配置文件。
2、formbean里面的属性是否跟页面上的input对象的name保持一直,如果不一样,structs 是不会页面上的值注入formbean里。
希望能帮到你
1、structs配置文件中formbean配置出错
2、formbean未被注入
解决方案
1、structs。。。自己仔细看下你的配置文件。
2、formbean里面的属性是否跟页面上的input对象的name保持一直,如果不一样,structs 是不会页面上的值注入formbean里。
希望能帮到你
wq21309 (初级程序员) 2008-07-05




