You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Muralidhar Yaragalla <ja...@gmail.com> on 2013/03/19 22:32:32 UTC

how can i retain the field values when there is validation error in field

Hi when there is validation error in the farm the same form is being
displayed with error messages as input is configured to the same form but
the form field values are disappearing. How can i retain those values?

-- 
Thanks And Regards,
*Muralidhar Yaragalla.
*

Re: how can i retain the field values when there is validation error in field

Posted by Muralidhar Yaragalla <ja...@gmail.com>.
ok. Now i understand. I am using jstl. I am not using struts tags.


On Wed, Mar 20, 2013 at 5:03 AM, Chris Pratt <th...@gmail.com>wrote:

> Muralidhar,
>   How are you specifying the form?  If you aren't using the <s: form tags
> (or if you are using the "simple" theme), then you will have to handle the
> form value retrieval yourself.
>   (*Chris*)
>
>
> On Tue, Mar 19, 2013 at 4:19 PM, Dave Newton <da...@gmail.com>
> wrote:
>
> > As stated, there is no particular action you need to take other than not
> > redirecting.
> >
> > If the action is hit and the params interceptor is working, they'll be
> > there.
> >
> > Dave
> >
> >
> >
> > On Tue, Mar 19, 2013 at 7:11 PM, Muralidhar Yaragalla <
> > java.yaragalla@gmail.com> wrote:
> >
> > > Almost sorted out all the problems only this is remaining. Any idea how
> > to
> > > retain the field values?
> > >
> > >
> > > On Wed, Mar 20, 2013 at 3:55 AM, Lukasz Lenart <
> lukaszlenart@apache.org
> > > >wrote:
> > >
> > > > 2013/3/19 Muralidhar Yaragalla <ja...@gmail.com>:
> > > > > ok I understood. I will remove but how to retain values. any idea?
> > > >
> > > > They will retain automatically
> > > >
> > > >
> > > > Regards
> > > > --
> > > > Łukasz
> > > > + 48 606 323 122 http://www.lenart.org.pl/
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > > For additional commands, e-mail: user-help@struts.apache.org
> > > >
> > > >
> > >
> > >
> > > --
> > > Thanks And Regards,
> > > *Muralidhar Yaragalla.
> > > *
> > >
> >
> >
> >
> > --
> > e: davelnewton@gmail.com
> > m: 908-380-8699
> > s: davelnewton_skype
> > t: @dave_newton <https://twitter.com/dave_newton>
> > b: Bucky Bits <http://buckybits.blogspot.com/>
> > g: davelnewton <https://github.com/davelnewton>
> > so: Dave Newton <http://stackoverflow.com/users/438992/dave-newton>
> >
>



-- 
Thanks And Regards,
*Muralidhar Yaragalla.
*

Re: how can i retain the field values when there is validation error in field

Posted by Chris Pratt <th...@gmail.com>.
Muralidhar,
  How are you specifying the form?  If you aren't using the <s: form tags
(or if you are using the "simple" theme), then you will have to handle the
form value retrieval yourself.
  (*Chris*)


On Tue, Mar 19, 2013 at 4:19 PM, Dave Newton <da...@gmail.com> wrote:

> As stated, there is no particular action you need to take other than not
> redirecting.
>
> If the action is hit and the params interceptor is working, they'll be
> there.
>
> Dave
>
>
>
> On Tue, Mar 19, 2013 at 7:11 PM, Muralidhar Yaragalla <
> java.yaragalla@gmail.com> wrote:
>
> > Almost sorted out all the problems only this is remaining. Any idea how
> to
> > retain the field values?
> >
> >
> > On Wed, Mar 20, 2013 at 3:55 AM, Lukasz Lenart <lukaszlenart@apache.org
> > >wrote:
> >
> > > 2013/3/19 Muralidhar Yaragalla <ja...@gmail.com>:
> > > > ok I understood. I will remove but how to retain values. any idea?
> > >
> > > They will retain automatically
> > >
> > >
> > > Regards
> > > --
> > > Łukasz
> > > + 48 606 323 122 http://www.lenart.org.pl/
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > For additional commands, e-mail: user-help@struts.apache.org
> > >
> > >
> >
> >
> > --
> > Thanks And Regards,
> > *Muralidhar Yaragalla.
> > *
> >
>
>
>
> --
> e: davelnewton@gmail.com
> m: 908-380-8699
> s: davelnewton_skype
> t: @dave_newton <https://twitter.com/dave_newton>
> b: Bucky Bits <http://buckybits.blogspot.com/>
> g: davelnewton <https://github.com/davelnewton>
> so: Dave Newton <http://stackoverflow.com/users/438992/dave-newton>
>

Re: how can i retain the field values when there is validation error in field

Posted by Dave Newton <da...@gmail.com>.
If you haven't configured any of:

* Default interceptor stack, or...
* Package-specific interceptor stack, or...
* Action-specific stack

then you're running the default stack. The default stack is defined in
struts-default.xml, contained in the struts2-core jar. It's also on the
documentation wiki, which might be good to check out.

Dave



On Tue, Mar 19, 2013 at 7:29 PM, Muralidhar Yaragalla <
java.yaragalla@gmail.com> wrote:

> where can i see the default interceptors configured. I mean in struts blank
> war application in struts.xml file there is nothing so where to check what
> are configured?
>
>
> On Wed, Mar 20, 2013 at 4:49 AM, Dave Newton <da...@gmail.com>
> wrote:
>
> > As stated, there is no particular action you need to take other than not
> > redirecting.
> >
> > If the action is hit and the params interceptor is working, they'll be
> > there.
> >
> > Dave
> >
> >
> >
> > On Tue, Mar 19, 2013 at 7:11 PM, Muralidhar Yaragalla <
> > java.yaragalla@gmail.com> wrote:
> >
> > > Almost sorted out all the problems only this is remaining. Any idea how
> > to
> > > retain the field values?
> > >
> > >
> > > On Wed, Mar 20, 2013 at 3:55 AM, Lukasz Lenart <
> lukaszlenart@apache.org
> > > >wrote:
> > >
> > > > 2013/3/19 Muralidhar Yaragalla <ja...@gmail.com>:
> > > > > ok I understood. I will remove but how to retain values. any idea?
> > > >
> > > > They will retain automatically
> > > >
> > > >
> > > > Regards
> > > > --
> > > > Łukasz
> > > > + 48 606 323 122 http://www.lenart.org.pl/
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > > For additional commands, e-mail: user-help@struts.apache.org
> > > >
> > > >
> > >
> > >
> > > --
> > > Thanks And Regards,
> > > *Muralidhar Yaragalla.
> > > *
> > >
> >
> >
> >
> > --
> > e: davelnewton@gmail.com
> > m: 908-380-8699
> > s: davelnewton_skype
> > t: @dave_newton <https://twitter.com/dave_newton>
> > b: Bucky Bits <http://buckybits.blogspot.com/>
> > g: davelnewton <https://github.com/davelnewton>
> > so: Dave Newton <http://stackoverflow.com/users/438992/dave-newton>
> >
>
>
>
> --
> Thanks And Regards,
> *Muralidhar Yaragalla.
> *
>



-- 
e: davelnewton@gmail.com
m: 908-380-8699
s: davelnewton_skype
t: @dave_newton <https://twitter.com/dave_newton>
b: Bucky Bits <http://buckybits.blogspot.com/>
g: davelnewton <https://github.com/davelnewton>
so: Dave Newton <http://stackoverflow.com/users/438992/dave-newton>

Re: how can i retain the field values when there is validation error in field

Posted by Muralidhar Yaragalla <ja...@gmail.com>.
where can i see the default interceptors configured. I mean in struts blank
war application in struts.xml file there is nothing so where to check what
are configured?


On Wed, Mar 20, 2013 at 4:49 AM, Dave Newton <da...@gmail.com> wrote:

> As stated, there is no particular action you need to take other than not
> redirecting.
>
> If the action is hit and the params interceptor is working, they'll be
> there.
>
> Dave
>
>
>
> On Tue, Mar 19, 2013 at 7:11 PM, Muralidhar Yaragalla <
> java.yaragalla@gmail.com> wrote:
>
> > Almost sorted out all the problems only this is remaining. Any idea how
> to
> > retain the field values?
> >
> >
> > On Wed, Mar 20, 2013 at 3:55 AM, Lukasz Lenart <lukaszlenart@apache.org
> > >wrote:
> >
> > > 2013/3/19 Muralidhar Yaragalla <ja...@gmail.com>:
> > > > ok I understood. I will remove but how to retain values. any idea?
> > >
> > > They will retain automatically
> > >
> > >
> > > Regards
> > > --
> > > Łukasz
> > > + 48 606 323 122 http://www.lenart.org.pl/
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > For additional commands, e-mail: user-help@struts.apache.org
> > >
> > >
> >
> >
> > --
> > Thanks And Regards,
> > *Muralidhar Yaragalla.
> > *
> >
>
>
>
> --
> e: davelnewton@gmail.com
> m: 908-380-8699
> s: davelnewton_skype
> t: @dave_newton <https://twitter.com/dave_newton>
> b: Bucky Bits <http://buckybits.blogspot.com/>
> g: davelnewton <https://github.com/davelnewton>
> so: Dave Newton <http://stackoverflow.com/users/438992/dave-newton>
>



-- 
Thanks And Regards,
*Muralidhar Yaragalla.
*

Re: how can i retain the field values when there is validation error in field

Posted by Dave Newton <da...@gmail.com>.
As stated, there is no particular action you need to take other than not
redirecting.

If the action is hit and the params interceptor is working, they'll be
there.

Dave



On Tue, Mar 19, 2013 at 7:11 PM, Muralidhar Yaragalla <
java.yaragalla@gmail.com> wrote:

> Almost sorted out all the problems only this is remaining. Any idea how to
> retain the field values?
>
>
> On Wed, Mar 20, 2013 at 3:55 AM, Lukasz Lenart <lukaszlenart@apache.org
> >wrote:
>
> > 2013/3/19 Muralidhar Yaragalla <ja...@gmail.com>:
> > > ok I understood. I will remove but how to retain values. any idea?
> >
> > They will retain automatically
> >
> >
> > Regards
> > --
> > Łukasz
> > + 48 606 323 122 http://www.lenart.org.pl/
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>
>
> --
> Thanks And Regards,
> *Muralidhar Yaragalla.
> *
>



-- 
e: davelnewton@gmail.com
m: 908-380-8699
s: davelnewton_skype
t: @dave_newton <https://twitter.com/dave_newton>
b: Bucky Bits <http://buckybits.blogspot.com/>
g: davelnewton <https://github.com/davelnewton>
so: Dave Newton <http://stackoverflow.com/users/438992/dave-newton>

Re: how can i retain the field values when there is validation error in field

Posted by Muralidhar Yaragalla <ja...@gmail.com>.
Almost sorted out all the problems only this is remaining. Any idea how to
retain the field values?


On Wed, Mar 20, 2013 at 3:55 AM, Lukasz Lenart <lu...@apache.org>wrote:

> 2013/3/19 Muralidhar Yaragalla <ja...@gmail.com>:
> > ok I understood. I will remove but how to retain values. any idea?
>
> They will retain automatically
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
Thanks And Regards,
*Muralidhar Yaragalla.
*

Re: how can i retain the field values when there is validation error in field

Posted by Muralidhar Yaragalla <ja...@gmail.com>.
The following is what i am doing

<action name="createVotingTopic"
class="com.ymd.ums.lv.action.VotingTopicAction" method="execute">
               <result name="success">/jsp/lv/voteTopic.jsp</result>

               <result name="input" >/jsp/lv/voteTopic.jsp    </result>
          </action>

When there is field validation error then it is getting directed to the
same jsp but the values are not retained. am i doing something wrong?


On Wed, Mar 20, 2013 at 3:55 AM, Lukasz Lenart <lu...@apache.org>wrote:

> 2013/3/19 Muralidhar Yaragalla <ja...@gmail.com>:
> > ok I understood. I will remove but how to retain values. any idea?
>
> They will retain automatically
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
Thanks And Regards,
*Muralidhar Yaragalla.
*

Re: how can i retain the field values when there is validation error in field

Posted by Lukasz Lenart <lu...@apache.org>.
2013/3/19 Muralidhar Yaragalla <ja...@gmail.com>:
> ok I understood. I will remove but how to retain values. any idea?

They will retain automatically


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

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


Re: how can i retain the field values when there is validation error in field

Posted by Muralidhar Yaragalla <ja...@gmail.com>.
ok I understood. I will remove but how to retain values. any idea?


On Wed, Mar 20, 2013 at 3:49 AM, Lukasz Lenart <lu...@apache.org>wrote:

> 2013/3/19 Muralidhar Yaragalla <ja...@gmail.com>:
> > I i use just plain input error messages getting printed but the values of
> > the fields are not retained.
>
> You cannot use redirect and expect that the values will be retained.
> Remove type="redirect".
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
Thanks And Regards,
*Muralidhar Yaragalla.
*

Re: how can i retain the field values when there is validation error in field

Posted by Lukasz Lenart <lu...@apache.org>.
2013/3/19 Muralidhar Yaragalla <ja...@gmail.com>:
> I i use just plain input error messages getting printed but the values of
> the fields are not retained.

You cannot use redirect and expect that the values will be retained.
Remove type="redirect".


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

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


Re: how can i retain the field values when there is validation error in field

Posted by Muralidhar Yaragalla <ja...@gmail.com>.
I i use just plain input error messages getting printed but the values of
the fields are not retained.


On Wed, Mar 20, 2013 at 3:43 AM, Lukasz Lenart <lu...@apache.org>wrote:

> 2013/3/19 Muralidhar Yaragalla <ja...@gmail.com>:
> > I have tried this
> >
> > <action name="createVotingTopic"
> > class="com.ymd.ums.lv.action.VotingTopicAction" method="execute">
> >                <result name="success">/jsp/lv/voteTopic.jsp</result>
> >
> >                <result name="input" type="redirect">
> >                    <param name="location">/jsp/lv/voteTopic.jsp</param >
> >               </result>
> >           </action>
> >
> > But even error messages not getting printed.
>
> You use redirect result type which drops the current request, remove
> type="redirect"
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
Thanks And Regards,
*Muralidhar Yaragalla.
*

Re: how can i retain the field values when there is validation error in field

Posted by Lukasz Lenart <lu...@apache.org>.
2013/3/19 Muralidhar Yaragalla <ja...@gmail.com>:
> I have tried this
>
> <action name="createVotingTopic"
> class="com.ymd.ums.lv.action.VotingTopicAction" method="execute">
>                <result name="success">/jsp/lv/voteTopic.jsp</result>
>
>                <result name="input" type="redirect">
>                    <param name="location">/jsp/lv/voteTopic.jsp</param >
>               </result>
>           </action>
>
> But even error messages not getting printed.

You use redirect result type which drops the current request, remove
type="redirect"


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

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


Re: how can i retain the field values when there is validation error in field

Posted by Muralidhar Yaragalla <ja...@gmail.com>.
I have tried this

<action name="createVotingTopic"
class="com.ymd.ums.lv.action.VotingTopicAction" method="execute">
               <result name="success">/jsp/lv/voteTopic.jsp</result>

               <result name="input" type="redirect">
                   <param name="location">/jsp/lv/voteTopic.jsp</param >
              </result>
          </action>

But even error messages not getting printed.


On Wed, Mar 20, 2013 at 3:04 AM, Paul Benedict <pb...@apache.org> wrote:

> You retain those values by doing a forward to a view (JSP, freemarker,
> etc.) whose view knows how to render the appropriate model object in the
> action.
>
> Paul
>
> On Tue, Mar 19, 2013 at 4:32 PM, Muralidhar Yaragalla <
> java.yaragalla@gmail.com> wrote:
>
> > Hi when there is validation error in the farm the same form is being
> > displayed with error messages as input is configured to the same form but
> > the form field values are disappearing. How can i retain those values?
> >
> > --
> > Thanks And Regards,
> > *Muralidhar Yaragalla.
> > *
> >
>



-- 
Thanks And Regards,
*Muralidhar Yaragalla.
*

Re: how can i retain the field values when there is validation error in field

Posted by Muralidhar Yaragalla <ja...@gmail.com>.
I have used redirect as follows

<action name="createVotingTopic"
class="com.ymd.ums.lv.action.VotingTopicAction" method="execute">
               <result name="success">/jsp/lv/voteTopic.jsp</result>

               <result name="input" type="redirect">
                   <param name="location">/jsp/lv/voteTopic.jsp</param >
              </result>
          </action>

This did not work eighter.


On Wed, Mar 20, 2013 at 3:04 AM, Paul Benedict <pb...@apache.org> wrote:

> You retain those values by doing a forward to a view (JSP, freemarker,
> etc.) whose view knows how to render the appropriate model object in the
> action.
>
> Paul
>
> On Tue, Mar 19, 2013 at 4:32 PM, Muralidhar Yaragalla <
> java.yaragalla@gmail.com> wrote:
>
> > Hi when there is validation error in the farm the same form is being
> > displayed with error messages as input is configured to the same form but
> > the form field values are disappearing. How can i retain those values?
> >
> > --
> > Thanks And Regards,
> > *Muralidhar Yaragalla.
> > *
> >
>



-- 
Thanks And Regards,
*Muralidhar Yaragalla.
*

Re: how can i retain the field values when there is validation error in field

Posted by Paul Benedict <pb...@apache.org>.
You retain those values by doing a forward to a view (JSP, freemarker,
etc.) whose view knows how to render the appropriate model object in the
action.

Paul

On Tue, Mar 19, 2013 at 4:32 PM, Muralidhar Yaragalla <
java.yaragalla@gmail.com> wrote:

> Hi when there is validation error in the farm the same form is being
> displayed with error messages as input is configured to the same form but
> the form field values are disappearing. How can i retain those values?
>
> --
> Thanks And Regards,
> *Muralidhar Yaragalla.
> *
>