You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by riya <ra...@gmail.com> on 2009/04/08 23:02:42 UTC

Struts Action Issue

Hi, 

Recently I observed that if in JSP input text I have entered special
characters, lets say: 

displayIDNumber:  #$!@#%$!#$%!(*)&*()*(&

In the action I get displayIDNumber as "" i.e empty string. 

Nowhere in the code we are explicitly emptying the string whenever there are
special characters in the input string. 

I puzzled. Can someone please clarify? 

Thanks in advance!!
-- 
View this message in context: http://www.nabble.com/Struts-Action-Issue-tp22959505p22959505.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: Struts Action Issue

Posted by Dave Newton <ne...@yahoo.com>.
Martin Gainty wrote:
> agreed..docs maintainer please update the documentation ASAP!

One way we can help keep the documentation up-to-date is by filing a 
CLA. When we run across an obviously ancient page we can then delete it, 
  or at the bare minimum file a JIRA issue against the offending page.

It's also good to make sure when we post answers that we're posting 
relevant (and at least marginally current) information.

The page in question was deleted almost immediately after you posted the 
reference (by at least two people, although someone else beat me to the 
punch): pages with zero incoming links aren't often visited, and we 
don't always know they're still there until somebody references them for 
whatever reason.

Dave


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


RE: Struts Action Issue

Posted by Martin Gainty <mg...@hotmail.com>.
agreed..docs maintainer please update the documentation ASAP!
Thanks
Martin 
______________________________________________ 
Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung / Note de déni et de confidentialité 
This message is confidential. If you should not be the intended receiver, then we ask politely to report. Each unauthorized forwarding or manufacturing of a copy is inadmissible. This message serves only for the exchange of information and has no legal binding effect. Due to the easy manipulation of emails we cannot take responsibility over the the contents.
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.






> Date: Mon, 13 Apr 2009 18:07:12 -0400
> Subject: Re: Struts Action Issue
> From: musachy@gmail.com
> To: user@struts.apache.org
> 
> That doesn't make any sense. That link is outdated (very) from the
> webwork days. Forms can use either POST or GET.
> 
> @original poster: add breakpoints to the ParametersInterceptor and see
> if your params are getting filtered out by it.
> 
> musachy
> 
> On Mon, Apr 13, 2009 at 4:18 PM, Martin Gainty <mg...@hotmail.com> wrote:
> >
> > except webwork forms expect method="POST"
> > http://cwiki.apache.org/WW/webwork-2-ui-tag-guide.html
> > is there any specific reason why you need to implement with method="get"
> >
> > did you use the FieldExpression-Validator as suggested earlier?
> >
> > what are the specific errors you are seeing with either scenario
> > please post relevant jsp/taglib configs/XML configurations and backend Action/Interceptor code
> >
> > thks
> > Martin
> > ______________________________________________
> > Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung / Note de déni et de confidentialité
> > This message is confidential. If you should not be the intended receiver, then we ask politely to report. Each unauthorized forwarding or manufacturing of a copy is inadmissible. This message serves only for the exchange of information and has no legal binding effect. Due to the easy manipulation of emails we cannot take responsibility over the the contents.
> > Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
> > Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.
> >
> >
> >
> >
> >
> >
> >> Date: Mon, 13 Apr 2009 11:56:42 -0700
> >> From: rachana8p@gmail.com
> >> To: user@struts.apache.org
> >> Subject: RE: Struts Action Issue
> >>
> >>
> >> Hi,
> >>
> >> I followed the replies but could not resolve the issue. Another update I
> >> have is this request is an Ajax.Request with method = 'get'.
> >>
> >> Can this cause any trouble? Changing get to post however does not help.
> >> Please advise.
> >>
> >> Thanks!
> >>
> >> mgainty wrote:
> >> >
> >> >
> >> > agree with Rommel
> >> > a FieldValidationInterceptor would accomplish this objective
> >> > http://struts.apache.org/2.0.14/docs/fieldexpression-validator.html
> >> > HINT place validation logic in expression validator e.g.
> >> > <![CDATA[#myField <> '']]> Date: Thu, 9 Apr 2009 07:23:42 -0700
> >> >> From: charlesmel1974@yahoo.com
> >> >> Subject: Re: Struts Action Issue
> >> >> To: user@struts.apache.org
> >> >> CC: charlesmel1974@yahoo.com
> >> >>
> >> >> Riya,
> >> >>
> >> >> I'm sure that if you trace the request submission from JSP to your Action
> >> >> class
> >> >> by debugging it step by step you will find where the culprit will be. I
> >> >> had one experience
> >> >> before that took me hours to figure out whats wrong in our JSP page where
> >> >> its not showing
> >> >> block of data. After debugging step by step, the logic that checks for
> >> >> the string to show the block of
> >> >> data had a trailing empty character. That string was saved in the
> >> >> database with the trailing space char.
> >> >> and when we pulled it and check for the matching string, our JSP was
> >> >> screwed up. So just a note
> >> >> always trim the data(String) you push to your database.
> >> >>
> >> >> Goodluck on the debugging spree :).
> >> >>
> >> >> Rommel
> >> >>
> >> >>
> >> >>
> >> >> ________________________________
> >> >> From: Muthu Velappan <mu...@aspiresys.com>
> >> >> To: Struts Users Mailing List <us...@struts.apache.org>
> >> >> Sent: Thursday, April 9, 2009 5:49:38 AM
> >> >> Subject: RE: Struts Action Issue
> >> >>
> >> >> Out of curiosity, I gave the same value in my application and tested, I
> >> >> got
> >> >> the exact junk back in my action not even a truncated one. So, please
> >> >> check
> >> >> whether ur action bypasses only this kind of string or even valid string
> >> >> like "test" or "sample". If it doesn't show valid string then there is
> >> >> problem with view file field name and action variable name. If valid
> >> >> strings
> >> >> are working fine and only this kind of string seems to be a problem then
> >> >> please generate the issue in a small testcase and send it across.
> >> >>
> >> >> Thanks,
> >> >> Muthu
> >> >>
> >> >> -----Original Message-----
> >> >> From: riya [mailto:rachana8p@gmail.com]
> >> >> Sent: Thursday, April 09, 2009 2:33 AM
> >> >> To: user@struts.apache.org
> >> >> Subject: Struts Action Issue
> >> >>
> >> >>
> >> >> Hi,
> >> >>
> >> >> Recently I observed that if in JSP input text I have entered special
> >> >> characters, lets say:
> >> >>
> >> >> displayIDNumber:  #$!@#%$!#$%!(*)&*()*(&
> >> >>
> >> >> In the action I get displayIDNumber as "" i.e empty string.
> >> >>
> >> >> Nowhere in the code we are explicitly emptying the string whenever there
> >> >> are
> >> >> special characters in the input string.
> >> >>
> >> >> I puzzled. Can someone please clarify?
> >> >>
> >> >> Thanks in advance!!
> >> >> --
> >> >> View this message in context:
> >> >> http://www.nabble.com/Struts-Action-Issue-tp22959505p22959505.html
> >> >> Sent from the Struts - User mailing list archive at Nabble.com.
> >> >>
> >> >>
> >> >> ---------------------------------------------------------------------
> >> >> 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
> >> >
> >> > _________________________________________________________________
> >> > Rediscover Hotmail®: Get e-mail storage that grows with you.
> >> > http://windowslive.com/RediscoverHotmail?ocid=TXT_TAGLM_WL_HM_Rediscover_Storage1_042009
> >> >
> >>
> >> --
> >> View this message in context: http://www.nabble.com/Struts-Action-Issue-tp22959505p23026901.html
> >> Sent from the Struts - User mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> For additional commands, e-mail: user-help@struts.apache.org
> >>
> >
> > _________________________________________________________________
> > Rediscover Hotmail®: Now available on your iPhone or BlackBerry
> > http://windowslive.com/RediscoverHotmail?ocid=TXT_TAGLM_WL_HM_Rediscover_Mobile1_042009
> 
> 
> 
> -- 
> "Hey you! Would you help me to carry the stone?" Pink Floyd
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 

_________________________________________________________________
Rediscover Hotmail®: Now available on your iPhone or BlackBerry
http://windowslive.com/RediscoverHotmail?ocid=TXT_TAGLM_WL_HM_Rediscover_Mobile1_042009

Re: Struts Action Issue

Posted by Musachy Barroso <mu...@gmail.com>.
That doesn't make any sense. That link is outdated (very) from the
webwork days. Forms can use either POST or GET.

@original poster: add breakpoints to the ParametersInterceptor and see
if your params are getting filtered out by it.

musachy

On Mon, Apr 13, 2009 at 4:18 PM, Martin Gainty <mg...@hotmail.com> wrote:
>
> except webwork forms expect method="POST"
> http://cwiki.apache.org/WW/webwork-2-ui-tag-guide.html
> is there any specific reason why you need to implement with method="get"
>
> did you use the FieldExpression-Validator as suggested earlier?
>
> what are the specific errors you are seeing with either scenario
> please post relevant jsp/taglib configs/XML configurations and backend Action/Interceptor code
>
> thks
> Martin
> ______________________________________________
> Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung / Note de déni et de confidentialité
> This message is confidential. If you should not be the intended receiver, then we ask politely to report. Each unauthorized forwarding or manufacturing of a copy is inadmissible. This message serves only for the exchange of information and has no legal binding effect. Due to the easy manipulation of emails we cannot take responsibility over the the contents.
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.
>
>
>
>
>
>
>> Date: Mon, 13 Apr 2009 11:56:42 -0700
>> From: rachana8p@gmail.com
>> To: user@struts.apache.org
>> Subject: RE: Struts Action Issue
>>
>>
>> Hi,
>>
>> I followed the replies but could not resolve the issue. Another update I
>> have is this request is an Ajax.Request with method = 'get'.
>>
>> Can this cause any trouble? Changing get to post however does not help.
>> Please advise.
>>
>> Thanks!
>>
>> mgainty wrote:
>> >
>> >
>> > agree with Rommel
>> > a FieldValidationInterceptor would accomplish this objective
>> > http://struts.apache.org/2.0.14/docs/fieldexpression-validator.html
>> > HINT place validation logic in expression validator e.g.
>> > <![CDATA[#myField <> '']]> Date: Thu, 9 Apr 2009 07:23:42 -0700
>> >> From: charlesmel1974@yahoo.com
>> >> Subject: Re: Struts Action Issue
>> >> To: user@struts.apache.org
>> >> CC: charlesmel1974@yahoo.com
>> >>
>> >> Riya,
>> >>
>> >> I'm sure that if you trace the request submission from JSP to your Action
>> >> class
>> >> by debugging it step by step you will find where the culprit will be. I
>> >> had one experience
>> >> before that took me hours to figure out whats wrong in our JSP page where
>> >> its not showing
>> >> block of data. After debugging step by step, the logic that checks for
>> >> the string to show the block of
>> >> data had a trailing empty character. That string was saved in the
>> >> database with the trailing space char.
>> >> and when we pulled it and check for the matching string, our JSP was
>> >> screwed up. So just a note
>> >> always trim the data(String) you push to your database.
>> >>
>> >> Goodluck on the debugging spree :).
>> >>
>> >> Rommel
>> >>
>> >>
>> >>
>> >> ________________________________
>> >> From: Muthu Velappan <mu...@aspiresys.com>
>> >> To: Struts Users Mailing List <us...@struts.apache.org>
>> >> Sent: Thursday, April 9, 2009 5:49:38 AM
>> >> Subject: RE: Struts Action Issue
>> >>
>> >> Out of curiosity, I gave the same value in my application and tested, I
>> >> got
>> >> the exact junk back in my action not even a truncated one. So, please
>> >> check
>> >> whether ur action bypasses only this kind of string or even valid string
>> >> like "test" or "sample". If it doesn't show valid string then there is
>> >> problem with view file field name and action variable name. If valid
>> >> strings
>> >> are working fine and only this kind of string seems to be a problem then
>> >> please generate the issue in a small testcase and send it across.
>> >>
>> >> Thanks,
>> >> Muthu
>> >>
>> >> -----Original Message-----
>> >> From: riya [mailto:rachana8p@gmail.com]
>> >> Sent: Thursday, April 09, 2009 2:33 AM
>> >> To: user@struts.apache.org
>> >> Subject: Struts Action Issue
>> >>
>> >>
>> >> Hi,
>> >>
>> >> Recently I observed that if in JSP input text I have entered special
>> >> characters, lets say:
>> >>
>> >> displayIDNumber:  #$!@#%$!#$%!(*)&*()*(&
>> >>
>> >> In the action I get displayIDNumber as "" i.e empty string.
>> >>
>> >> Nowhere in the code we are explicitly emptying the string whenever there
>> >> are
>> >> special characters in the input string.
>> >>
>> >> I puzzled. Can someone please clarify?
>> >>
>> >> Thanks in advance!!
>> >> --
>> >> View this message in context:
>> >> http://www.nabble.com/Struts-Action-Issue-tp22959505p22959505.html
>> >> Sent from the Struts - User mailing list archive at Nabble.com.
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> 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
>> >
>> > _________________________________________________________________
>> > Rediscover Hotmail®: Get e-mail storage that grows with you.
>> > http://windowslive.com/RediscoverHotmail?ocid=TXT_TAGLM_WL_HM_Rediscover_Storage1_042009
>> >
>>
>> --
>> View this message in context: http://www.nabble.com/Struts-Action-Issue-tp22959505p23026901.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>
> _________________________________________________________________
> Rediscover Hotmail®: Now available on your iPhone or BlackBerry
> http://windowslive.com/RediscoverHotmail?ocid=TXT_TAGLM_WL_HM_Rediscover_Mobile1_042009



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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


RE: Struts Action Issue

Posted by Martin Gainty <mg...@hotmail.com>.
except webwork forms expect method="POST"
http://cwiki.apache.org/WW/webwork-2-ui-tag-guide.html
is there any specific reason why you need to implement with method="get"

did you use the FieldExpression-Validator as suggested earlier?

what are the specific errors you are seeing with either scenario
please post relevant jsp/taglib configs/XML configurations and backend Action/Interceptor code

thks
Martin 
______________________________________________ 
Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung / Note de déni et de confidentialité 
This message is confidential. If you should not be the intended receiver, then we ask politely to report. Each unauthorized forwarding or manufacturing of a copy is inadmissible. This message serves only for the exchange of information and has no legal binding effect. Due to the easy manipulation of emails we cannot take responsibility over the the contents.
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.






> Date: Mon, 13 Apr 2009 11:56:42 -0700
> From: rachana8p@gmail.com
> To: user@struts.apache.org
> Subject: RE: Struts Action Issue
> 
> 
> Hi, 
> 
> I followed the replies but could not resolve the issue. Another update I
> have is this request is an Ajax.Request with method = 'get'. 
> 
> Can this cause any trouble? Changing get to post however does not help. 
> Please advise. 
> 
> Thanks! 
> 
> mgainty wrote:
> > 
> > 
> > agree with Rommel 
> > a FieldValidationInterceptor would accomplish this objective
> > http://struts.apache.org/2.0.14/docs/fieldexpression-validator.html
> > HINT place validation logic in expression validator e.g.
> > <![CDATA[#myField <> '']]> Date: Thu, 9 Apr 2009 07:23:42 -0700
> >> From: charlesmel1974@yahoo.com
> >> Subject: Re: Struts Action Issue
> >> To: user@struts.apache.org
> >> CC: charlesmel1974@yahoo.com
> >> 
> >> Riya,
> >> 
> >> I'm sure that if you trace the request submission from JSP to your Action
> >> class
> >> by debugging it step by step you will find where the culprit will be. I
> >> had one experience
> >> before that took me hours to figure out whats wrong in our JSP page where
> >> its not showing
> >> block of data. After debugging step by step, the logic that checks for
> >> the string to show the block of
> >> data had a trailing empty character. That string was saved in the
> >> database with the trailing space char.
> >> and when we pulled it and check for the matching string, our JSP was
> >> screwed up. So just a note
> >> always trim the data(String) you push to your database.
> >> 
> >> Goodluck on the debugging spree :).
> >> 
> >> Rommel
> >> 
> >> 
> >> 
> >> ________________________________
> >> From: Muthu Velappan <mu...@aspiresys.com>
> >> To: Struts Users Mailing List <us...@struts.apache.org>
> >> Sent: Thursday, April 9, 2009 5:49:38 AM
> >> Subject: RE: Struts Action Issue
> >> 
> >> Out of curiosity, I gave the same value in my application and tested, I
> >> got
> >> the exact junk back in my action not even a truncated one. So, please
> >> check
> >> whether ur action bypasses only this kind of string or even valid string
> >> like "test" or "sample". If it doesn't show valid string then there is
> >> problem with view file field name and action variable name. If valid
> >> strings
> >> are working fine and only this kind of string seems to be a problem then
> >> please generate the issue in a small testcase and send it across. 
> >> 
> >> Thanks,
> >> Muthu
> >> 
> >> -----Original Message-----
> >> From: riya [mailto:rachana8p@gmail.com] 
> >> Sent: Thursday, April 09, 2009 2:33 AM
> >> To: user@struts.apache.org
> >> Subject: Struts Action Issue
> >> 
> >> 
> >> Hi, 
> >> 
> >> Recently I observed that if in JSP input text I have entered special
> >> characters, lets say: 
> >> 
> >> displayIDNumber:  #$!@#%$!#$%!(*)&*()*(&
> >> 
> >> In the action I get displayIDNumber as "" i.e empty string. 
> >> 
> >> Nowhere in the code we are explicitly emptying the string whenever there
> >> are
> >> special characters in the input string. 
> >> 
> >> I puzzled. Can someone please clarify? 
> >> 
> >> Thanks in advance!!
> >> -- 
> >> View this message in context:
> >> http://www.nabble.com/Struts-Action-Issue-tp22959505p22959505.html
> >> Sent from the Struts - User mailing list archive at Nabble.com.
> >> 
> >> 
> >> ---------------------------------------------------------------------
> >> 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
> > 
> > _________________________________________________________________
> > Rediscover Hotmail®: Get e-mail storage that grows with you. 
> > http://windowslive.com/RediscoverHotmail?ocid=TXT_TAGLM_WL_HM_Rediscover_Storage1_042009
> > 
> 
> -- 
> View this message in context: http://www.nabble.com/Struts-Action-Issue-tp22959505p23026901.html
> Sent from the Struts - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 

_________________________________________________________________
Rediscover Hotmail®: Now available on your iPhone or BlackBerry
http://windowslive.com/RediscoverHotmail?ocid=TXT_TAGLM_WL_HM_Rediscover_Mobile1_042009

RE: Struts Action Issue

Posted by riya <ra...@gmail.com>.
Hi, 

I followed the replies but could not resolve the issue. Another update I
have is this request is an Ajax.Request with method = 'get'. 

Can this cause any trouble? Changing get to post however does not help. 
Please advise. 

Thanks! 

mgainty wrote:
> 
> 
> agree with Rommel 
> a FieldValidationInterceptor would accomplish this objective
> http://struts.apache.org/2.0.14/docs/fieldexpression-validator.html
> HINT place validation logic in expression validator e.g.
> <![CDATA[#myField <> '']]> Date: Thu, 9 Apr 2009 07:23:42 -0700
>> From: charlesmel1974@yahoo.com
>> Subject: Re: Struts Action Issue
>> To: user@struts.apache.org
>> CC: charlesmel1974@yahoo.com
>> 
>> Riya,
>> 
>> I'm sure that if you trace the request submission from JSP to your Action
>> class
>> by debugging it step by step you will find where the culprit will be. I
>> had one experience
>> before that took me hours to figure out whats wrong in our JSP page where
>> its not showing
>> block of data. After debugging step by step, the logic that checks for
>> the string to show the block of
>> data had a trailing empty character. That string was saved in the
>> database with the trailing space char.
>> and when we pulled it and check for the matching string, our JSP was
>> screwed up. So just a note
>> always trim the data(String) you push to your database.
>> 
>> Goodluck on the debugging spree :).
>> 
>> Rommel
>> 
>> 
>> 
>> ________________________________
>> From: Muthu Velappan <mu...@aspiresys.com>
>> To: Struts Users Mailing List <us...@struts.apache.org>
>> Sent: Thursday, April 9, 2009 5:49:38 AM
>> Subject: RE: Struts Action Issue
>> 
>> Out of curiosity, I gave the same value in my application and tested, I
>> got
>> the exact junk back in my action not even a truncated one. So, please
>> check
>> whether ur action bypasses only this kind of string or even valid string
>> like "test" or "sample". If it doesn't show valid string then there is
>> problem with view file field name and action variable name. If valid
>> strings
>> are working fine and only this kind of string seems to be a problem then
>> please generate the issue in a small testcase and send it across. 
>> 
>> Thanks,
>> Muthu
>> 
>> -----Original Message-----
>> From: riya [mailto:rachana8p@gmail.com] 
>> Sent: Thursday, April 09, 2009 2:33 AM
>> To: user@struts.apache.org
>> Subject: Struts Action Issue
>> 
>> 
>> Hi, 
>> 
>> Recently I observed that if in JSP input text I have entered special
>> characters, lets say: 
>> 
>> displayIDNumber:  #$!@#%$!#$%!(*)&*()*(&
>> 
>> In the action I get displayIDNumber as "" i.e empty string. 
>> 
>> Nowhere in the code we are explicitly emptying the string whenever there
>> are
>> special characters in the input string. 
>> 
>> I puzzled. Can someone please clarify? 
>> 
>> Thanks in advance!!
>> -- 
>> View this message in context:
>> http://www.nabble.com/Struts-Action-Issue-tp22959505p22959505.html
>> Sent from the Struts - User mailing list archive at Nabble.com.
>> 
>> 
>> ---------------------------------------------------------------------
>> 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
> 
> _________________________________________________________________
> Rediscover Hotmail®: Get e-mail storage that grows with you. 
> http://windowslive.com/RediscoverHotmail?ocid=TXT_TAGLM_WL_HM_Rediscover_Storage1_042009
> 

-- 
View this message in context: http://www.nabble.com/Struts-Action-Issue-tp22959505p23026901.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


RE: Struts Action Issue

Posted by Martin Gainty <mg...@hotmail.com>.
agree with Rommel 
a FieldValidationInterceptor would accomplish this objective
http://struts.apache.org/2.0.14/docs/fieldexpression-validator.html
HINT place validation logic in expression validator e.g.
<param name="expression"><![CDATA[#myField <> '']]></param

Unless you're using Hibernate or iBatis (or any ORM which will create SQL Statements) I would strongly suggest your DBA to place Triggers to validate Data inserts before pushing into DB..(Once the aberrant character is in your DB there is no extracting)

I would also suggest incorporating jsp precompile jsp's into your build cycle to catch
any misconfigs in tld's
here is one courtesy of Glassfish
--assumes AS_INSTALL is set to GlassfishDefaultInstallationFolder
--assumes AS_JAVA is set to GlassfishJavaDefaultInstallationFolder
--assumes AS_ANT_LIB is set to GlassfishAntLibrary

@echo off
REM
REM Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.
REM Use is subject to license terms.
REM
setlocal
call "%AS_INSTALL%\config\asenv.bat"
"%AS_JAVA%\bin\java" -cp "%AS_INSTALL%\lib\javaee.jar;%AS_INSTALL%\lib\appserv-ext.jar;%AS_INSTALL%\lib\appserv-rt.jar;%AS_ANT_LIB%\ant.jar;%AS_ANT_LIB%\ant-launcher.jar;%AS_INSTALL%\lib\appserv-jstl.jar;%AS_INSTALL%\lib\jsf-api.jar;%AS_INSTALL%\lib\jsf-impl.jar;%AS_JAVA%\lib\tools.jar;%AS_INSTALL%\lib" org.apache.jasper.JspC -schemas "/schemas/" -dtds "/dtds/" %*
endlocal

Viel Gluck/Bon Chance/GoodLuck
Martin 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung / Note de déni et de confidentialité 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.






> Date: Thu, 9 Apr 2009 07:23:42 -0700
> From: charlesmel1974@yahoo.com
> Subject: Re: Struts Action Issue
> To: user@struts.apache.org
> CC: charlesmel1974@yahoo.com
> 
> Riya,
> 
> I'm sure that if you trace the request submission from JSP to your Action class
> by debugging it step by step you will find where the culprit will be. I had one experience
> before that took me hours to figure out whats wrong in our JSP page where its not showing
> block of data. After debugging step by step, the logic that checks for the string to show the block of
> data had a trailing empty character. That string was saved in the database with the trailing space char.
> and when we pulled it and check for the matching string, our JSP was screwed up. So just a note
> always trim the data(String) you push to your database.
> 
> Goodluck on the debugging spree :).
> 
> Rommel
> 
> 
> 
> ________________________________
> From: Muthu Velappan <mu...@aspiresys.com>
> To: Struts Users Mailing List <us...@struts.apache.org>
> Sent: Thursday, April 9, 2009 5:49:38 AM
> Subject: RE: Struts Action Issue
> 
> Out of curiosity, I gave the same value in my application and tested, I got
> the exact junk back in my action not even a truncated one. So, please check
> whether ur action bypasses only this kind of string or even valid string
> like "test" or "sample". If it doesn't show valid string then there is
> problem with view file field name and action variable name. If valid strings
> are working fine and only this kind of string seems to be a problem then
> please generate the issue in a small testcase and send it across. 
> 
> Thanks,
> Muthu
> 
> -----Original Message-----
> From: riya [mailto:rachana8p@gmail.com] 
> Sent: Thursday, April 09, 2009 2:33 AM
> To: user@struts.apache.org
> Subject: Struts Action Issue
> 
> 
> Hi, 
> 
> Recently I observed that if in JSP input text I have entered special
> characters, lets say: 
> 
> displayIDNumber:  #$!@#%$!#$%!(*)&*()*(&
> 
> In the action I get displayIDNumber as "" i.e empty string. 
> 
> Nowhere in the code we are explicitly emptying the string whenever there are
> special characters in the input string. 
> 
> I puzzled. Can someone please clarify? 
> 
> Thanks in advance!!
> -- 
> View this message in context:
> http://www.nabble.com/Struts-Action-Issue-tp22959505p22959505.html
> Sent from the Struts - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> 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

_________________________________________________________________
Rediscover Hotmail®: Get e-mail storage that grows with you. 
http://windowslive.com/RediscoverHotmail?ocid=TXT_TAGLM_WL_HM_Rediscover_Storage1_042009

Re: Struts Action Issue

Posted by Charlesmel Carino <ch...@yahoo.com>.
Riya,

I'm sure that if you trace the request submission from JSP to your Action class
by debugging it step by step you will find where the culprit will be. I had one experience
before that took me hours to figure out whats wrong in our JSP page where its not showing
block of data. After debugging step by step, the logic that checks for the string to show the block of
data had a trailing empty character. That string was saved in the database with the trailing space char.
and when we pulled it and check for the matching string, our JSP was screwed up. So just a note
always trim the data(String) you push to your database.

Goodluck on the debugging spree :).

Rommel



________________________________
From: Muthu Velappan <mu...@aspiresys.com>
To: Struts Users Mailing List <us...@struts.apache.org>
Sent: Thursday, April 9, 2009 5:49:38 AM
Subject: RE: Struts Action Issue

Out of curiosity, I gave the same value in my application and tested, I got
the exact junk back in my action not even a truncated one. So, please check
whether ur action bypasses only this kind of string or even valid string
like "test" or "sample". If it doesn't show valid string then there is
problem with view file field name and action variable name. If valid strings
are working fine and only this kind of string seems to be a problem then
please generate the issue in a small testcase and send it across. 

Thanks,
Muthu

-----Original Message-----
From: riya [mailto:rachana8p@gmail.com] 
Sent: Thursday, April 09, 2009 2:33 AM
To: user@struts.apache.org
Subject: Struts Action Issue


Hi, 

Recently I observed that if in JSP input text I have entered special
characters, lets say: 

displayIDNumber:  #$!@#%$!#$%!(*)&*()*(&

In the action I get displayIDNumber as "" i.e empty string. 

Nowhere in the code we are explicitly emptying the string whenever there are
special characters in the input string. 

I puzzled. Can someone please clarify? 

Thanks in advance!!
-- 
View this message in context:
http://www.nabble.com/Struts-Action-Issue-tp22959505p22959505.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
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

RE: Struts Action Issue

Posted by Muthu Velappan <mu...@aspiresys.com>.
Out of curiosity, I gave the same value in my application and tested, I got
the exact junk back in my action not even a truncated one. So, please check
whether ur action bypasses only this kind of string or even valid string
like "test" or "sample". If it doesn't show valid string then there is
problem with view file field name and action variable name. If valid strings
are working fine and only this kind of string seems to be a problem then
please generate the issue in a small testcase and send it across. 

Thanks,
Muthu

-----Original Message-----
From: riya [mailto:rachana8p@gmail.com] 
Sent: Thursday, April 09, 2009 2:33 AM
To: user@struts.apache.org
Subject: Struts Action Issue


Hi, 

Recently I observed that if in JSP input text I have entered special
characters, lets say: 

displayIDNumber:  #$!@#%$!#$%!(*)&*()*(&

In the action I get displayIDNumber as "" i.e empty string. 

Nowhere in the code we are explicitly emptying the string whenever there are
special characters in the input string. 

I puzzled. Can someone please clarify? 

Thanks in advance!!
-- 
View this message in context:
http://www.nabble.com/Struts-Action-Issue-tp22959505p22959505.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
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