You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by ji liu <li...@yahoo.com> on 2004/08/14 15:02:54 UTC

problem occured while validating form

when validating form,some problems occured.
As MVC Model2 suggest,I use a controller to query
imformations and store them into javabeans.Then the
javabeans is used by the page which contains a form.
when the form submits,the form is validated.If some
errors occured,struts will return to input page.As the
input page need some informations to render the
page,so I make the struts return to the controller
which queries information required by the input
page.some informations may be changed when the form
submitted,but the controller doesn't know this.

How to solve this problem?
I use two controller.One is used when user requests
the page at the first time.Another is used when
validating errors occur.

_________________________________________________________
Do You Yahoo!?
150万曲MP3疯狂搜,带您闯入音乐殿堂
http://music.yisou.com/
美女明星应有尽有,搜遍美图、艳图和酷图
http://image.yisou.com
1G就是1000兆,雅虎电邮自助扩容!
http://cn.rd.yahoo.com/mail_cn/tag/1g/*http://cn.mail.yahoo.com/event/mail_1g/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: problem occured while validating form

Posted by Erik Weber <er...@mindspring.com>.
I'm having a little trouble understanding the question.


ji liu wrote:

>when validating form,some problems occured.
>As MVC Model2 suggest,I use a controller to query
>imformations and store them into javabeans.Then the
>javabeans is used by the page which contains a form.
>when the form submits,the form is validated.If some
>errors occured,struts will return to input page.As the
>input page need some informations to render the
>page,so I make the struts return to the controller
>which queries information required by the input
>page.
>
Right, a common problem with several solutions discussed frequently on
this list. What specific strategy are you using (you only say "return to
the controller")? Are you "chaining" actions by forwarding to a "setup"
(form prepopulation) action from your POST-handling action? I think that
you are, but I'm just trying to get you to be more specific.


>some informations may be changed when the form
>submitted,but the controller doesn't know this.
>  
>
Can you elaborate on this? I don't know what you mean by this.


>How to solve this problem?
>I use two controller.One is used when user requests
>the page at the first time.Another is used when
>validating errors occur.
>  
>
Can you be more specific about what you mean by "controller"? Do you
mean ActionServlet instance? Sorry for misunderstanding.

Erik

>_________________________________________________________
>Do You Yahoo!?
>150万曲MP3疯狂搜,带您闯入音乐殿堂
>http://music.yisou.com/
>美女明星应有尽有,搜遍美图、艳图和酷图
>http://image.yisou.com
>1G就是1000兆,雅虎电邮自助扩容!
>http://cn.rd.yahoo.com/mail_cn/tag/1g/*http://cn.mail.yahoo.com/event/mail_1g/
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>
>
>  
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org