请彭老师帮忙,谢谢:)

04-03-20 zwd2878

彭老师,你好,我遇到一个莫名其妙的问题,自己实在是不知道如何解决了,特向你求救,谢谢你。

我遇到一个bean里只有一个传不过来,而其他参数都能传过来的情况呀!!

这个bean是个formbean,我建了一个registerformbean,

然后用registerAction去调用,之后提交给一个result.jsp页,这个时候所有的参数都可以,

我又建了一个Action,让他从result.jsp页提交再将所有参数提交给success.jsp,这个Action的作用是写到数据库里,其中result页中也有个<html:form>

在最后一个Action中,我用到了registerformbean中的数据,其他的参数有能取出值来,可是只有个username不可以,总是为null??

username在action中没有值,可是在registerAction中有值,在result页中也有值,从result.jsp提交到action中就没有了?? 但是其他的参数都有??

在result.jsp页中有值,我是显示的,用的<bean:write>,但是再转到写一个页的时候,我也是用的<bean:write>,这个时候,其中registerformbean中usrename就没有值了,而其他的参数都有。

在struts-config.xml中:

<form-bean name="registerActionForm" type="booksupper.RegisterActionForm" />

<action-mappings>

<action name="registerActionForm" type="booksupper.PrepareOptionAction" validate="false" path="/prepareOption">

<forward name="success" path="/register.jsp" />

</action>

<action name="registerActionForm" type="booksupper.RegisterAction" validate="true" input="/register.jsp" scope="request" path="/register">

<forward name="success" path="/result.jsp" />

<forward name="index" path="/index.jsp" />

<forward name="number" path="/not_number.jsp" />

</action>

<action name="registerActionForm" type="booksupper.SubmitToDbAction" validate="false" input="/result.jsp" scope="request" path="/submitToDb">

<forward name="success" path="/success.jsp" />

<forward name="register" path="/register.jsp" />

</action>

</action-mappings>

我不知道是什么原因,还请彭老师能指点,谢谢。

我的email是:zwd2878@126.com

再次表示感谢!!

zwd2878
2004-03-20 00:07

<form-beans>

<form-bean name="registerActionForm" type="booksupper.RegisterActionForm" />

</form-beans>

<action-mappings>

<action name="registerActionForm" type="booksupper.PrepareOptionAction" validate="false" path="/prepareOption">

<forward name="success" path="/register.jsp" />

</action>

<action name="registerActionForm" type="booksupper.RegisterAction" validate="true" input="/register.jsp" scope="request" path="/register">

<forward name="success" path="/result.jsp" />

<forward name="index" path="/index.jsp" />

<forward name="number" path="/not_number.jsp" />

</action>

<action name="registerActionForm" type="booksupper.SubmitToDbAction" validate="false" input="/result.jsp" scope="request" path="/submitToDb">

<forward name="success" path="/success.jsp" />

<forward name="register" path="/register.jsp" />

</action>

</action-mappings>

zwd2878
2004-03-20 00:09

> <form-beans>

> <form-bean name="registerActionForm"

> rm" type="booksupper.RegisterActionForm" />

> </form-beans>

> <action-mappings>

> <action name="registerActionForm"

> rm" type="booksupper.PrepareOptionAction"

> validate="false" path="/prepareOption">

> <forward name="success" path="/register.jsp"

> .jsp" />

> </action>

> <action name="registerActionForm"

> rm" type="booksupper.RegisterAction" validate="true"

> input="/register.jsp" scope="request"

> path="/register">

> <forward name="success" path="/result.jsp" />

> <forward name="index" path="/index.jsp" />

> <forward name="number" path="/not_number.jsp"

> .jsp" />

> </action>

> <action name="registerActionForm"

> rm" type="booksupper.SubmitToDbAction"

> validate="false" input="/result.jsp" scope="request"

> path="/submitToDb">

> <forward name="success" path="/success.jsp" />

> <forward name="register" path="/register.jsp"

> .jsp" />

> </action>

> </action-mappings>

zwd2878
2004-03-20 00:11

上面的几贴都不显示呀??

--<form-beans>

-- <form-bean name="registerActionForm"

--type="booksupper.RegisterActionForm" />

-- </form-beans>

-- <action-mappings>

-- <action name="registerActionForm"

--type="booksupper.PrepareOptionAction" validate="false"

--path="/prepareOption">

-- <forward name="success" path="/register.jsp" />

-- </action>

-- <action name="registerActionForm"

--type="booksupper.RegisterAction" validate="true"

--input="/register.jsp" scope="request" path="/register">

-- <forward name="success" path="/result.jsp" />

-- <forward name="index" path="/index.jsp" />

-- <forward name="number" path="/not_number.jsp" />

-- </action>

-- <action name="registerActionForm" type="booksupper.SubmitToDbAction" validate="false" input="/result.jsp" scope="request" path="/submitToDb">

<forward name="success" path="/success.jsp" />

<forward name="register" path="/register.jsp" />

</action>

</action-mappings>

zwd2878
2004-03-20 00:12

“<form-beans>

<form-bean name="registerActionForm" type="booksupper.RegisterActionForm" />

</form-beans>

<action-mappings>

<action name="registerActionForm" type="booksupper.PrepareOptionAction" validate="false" path="/prepareOption">

<forward name="success" path="/register.jsp" />

</action>

<action name="registerActionForm" type="booksupper.RegisterAction" validate="true" input="/register.jsp" scope="request" path="/register">

<forward name="success" path="/result.jsp" />

<forward name="index" path="/index.jsp" />

<forward name="number" path="/not_number.jsp" />

</action>

<action name="registerActionForm" type="booksupper.SubmitToDbAction" validate="false" input="/result.jsp" scope="request" path="/submitToDb">

<forward name="success" path="/success.jsp" />

<forward name="register" path="/register.jsp" />

</action>

</action-mappings>”

怎么还是帖不上呀??

2Go 1 2 下一页