Re: Upgrading Struts 2

2009-01-30 Thread Sergio Italiani
It turns out that the problem I was having - had nothing to do with
type conversion.

The problem was a chunk of my code that was responsible for formatting.
Specifically, the exception IllegalArgumentException: Cannot format
given Object as a Number was thrown because of

s:text name=format.money 
s:param name=value value=myd/
/s:text

(format.money is defined in  package properties --format.money =
{0,number,¤##0.00})

myd supposed to be a double. The problem occurred when wrong value
was inserted instead of double (e.g. 'aaa' instead of 7,5).
The same code threw no exceprion in struts 2.0, but in 2.1.6 it does.
(I said earlier that earlier that showcase run differently than blank
... but I thing that was due to the fact that I didn't copy all the
code from one project to other - sorry about that ;)

So the problem is not so serious as I thought it was.  I will try to
solve this by checking first if
myd contains double or not before formatting



On 1/26/09, Paweł Wielgus poulw...@gmail.com wrote:
 Hi all,
 just as a side note I wrote few lines about my upgrade process here [1],
 remember to delete work directory from tomcat if You are using one.

 [1] -
 http://poulwiel.blogspot.com/2009/01/migrating-from-struts-20x-to-216.html

 Best greetings,
 Paweł Wielgus.

 2009/1/25 Wes Wannemacher w...@wantii.com:
 On Sunday 25 January 2009 12:39:27 Sergio Italiani wrote:
 OK you got a point there... but again if it was XWork bug wouldn't it
 affect showcase as well. As I mentioned before If I modify the
 showcase validation pages - they work pretty well with type conversion
 and no exception is thrown. The problem is that the ShowCase is huge
 and I cannon base my new project on it. On the other hand StrutsBlank
 is small but it is  not working properly as far as type conversion is
 concerned (and I didn't proceed to try anything else... )


 To be honest Sergio, I haven't looked closely at this bug as I've had a
 few
 other things going on. I understand your sentiment as showcase is pretty
 big
 and brings in quite a few plugins to show examples of what s2 can do. I
 know
 Musachy has had a look at this bug and he's an XWork committer in addition
 to
 struts, so it's likely to get proper attention in the next few days.

 If you think you can figure out what's going on and provide a solid fix,
 go
 ahead and take a stab at it. We welcome patches and having a patch will
 likely
 speed up the time to get a fix committed. Even if your patch doesn't
 follow
 all the standards (unit tests, proper spacing, etc.), but the core logic
 of
 your patch fixes the problem, it will often accelerate things since that
 is
 usually what takes the most time. A committer can make whitespace changes
 and
 write or help with a unit test.

 -Wes

 --

 Wes Wannemacher
 Author - Struts 2 In Practice
 Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
 http://www.manning.com/wannemacher


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



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



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



Re: having trouble with type conversion in struts 2.1.6

2009-01-30 Thread Sergio Italiani
It turns out that the problem I was having - had nothing to do with
type conversion.

The problem was a chunk of my code that was responsible for formatting.
Specifically, the exception IllegalArgumentException: Cannot format
given Object as a Number was thrown because of

s:text name=format.money 
s:param name=value value=myd/
/s:text

(format.money is defined in  package properties --format.money =
{0,number,¤##0.00})

myd supposed to be a double. The problem occurred when wrong value
was inserted instead of double (e.g. 'aaa' instead of 7,5).
The same code threw no exceprion in struts 2.0, but in 2.1.6 it does.
(I said earlier that earlier that showcase run differently than blank
... but I thing that was due to the fact that I didn't copy all the
code from one project to other - sorry about that ;)

So the problem is not so serious as I thought it was.  I will try to
solve this by checking first if
myd contains double or not before formatting


On Fri, Jan 23, 2009 at 8:37 PM, Sergio Italiani sergiode...@gmail.com wrote:
 Hi All!
 Could anybody please tell me if I should add anything to the
 struts2blank  project (of struts 2.1.6)  so that type conversion error
 handling
 ( i mean the -- invalid.fieldvalue.fieldname) would work properly.
 I am clearly missing something, because instead of displaying
 invalid.fieldvalue my project (witch is based on struts2blank)
 throws--  IllegalArgumentException: Cannot format given Object as a Number.
 Any body ? I am getting desperate and thinking of abandoning
 struts2.1.6 alltoghether  :(
 Thank you in advance.

 Sergio.


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



Re: struts 2.1.6 struts2-blank adding Double validation causes Exception

2009-01-30 Thread Sergio Italiani
It turns out that the problem I was having - had nothing to do with
type conversion.

The problem was a chunk of my code that was responsible for formatting.
Specifically, the exception IllegalArgumentException: Cannot format
given Object as a Number was thrown because of

s:text name=format.money 
s:param name=value value=myd/
/s:text

(format.money is defined in  package properties --format.money =
{0,number,¤##0.00})

myd supposed to be a double. The problem occurred when wrong value
was inserted instead of double (e.g. 'aaa' instead of 7,5).
The same code threw no exceprion in struts 2.0, but in 2.1.6 it does.
(I said earlier that earlier that showcase run differently than blank
... but I thing that was due to the fact that I didn't copy all the
code from one project to other - sorry about that ;)

So the problem is not so serious as I thought it was.  I will try to
solve this by checking first if
myd contains double or not before formatting


2009/1/22 pochtaaac pochta pochta...@mail.ru:
 While having done the same with struts 2.0 blank project - work perfectly 
 well. Also works if i add the code to struts2-showcase (validation folder).

 The problem is as follows:

 I tried to add double validation to 2.1.6 blank project and if i type in form 
 illegal value - say 'aaa' - instead of showing the 
 invalid.fieldvalue.variable message it throws the following exception :


 java.lang.IllegalArgumentException: Cannot format given Object as a Number
java.text.DecimalFormat.format(DecimalFormat.java:487)
java.text.Format.format(Format.java:140)
java.text.MessageFormat.subformat(MessageFormat.java:1288)
java.text.MessageFormat.format(MessageFormat.java:836)
java.text.Format.format(Format.java:140)

 com.opensymphony.xwork2.util.LocalizedTextUtil.getMessage(LocalizedTextUtil.java:673)

 com.opensymphony.xwork2.util.LocalizedTextUtil.findText(LocalizedTextUtil.java:427)

 com.opensymphony.xwork2.TextProviderSupport.getText(TextProviderSupport.java:242)
com.opensymphony.xwork2.ActionSupport.getText(ActionSupport.java:108)

 org.apache.struts2.util.TextProviderHelper.getText(TextProviderHelper.java:79)
org.apache.struts2.components.Text.end(Text.java:161)

 org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:42)

 org.apache.jsp.example.Login_jsp._jspx_meth_s_005ftext_005f0(Login_jsp.java:268)
org.apache.jsp.example.Login_jsp._jspService(Login_jsp.java:91)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

 org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)

 org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

 org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)

 org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:154)

 org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:186)

 com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:361)

 com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:265)

 com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:249)

 org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)

 com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)

 com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)

 com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122)

 com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)

 com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)

 com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)

 com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)

 com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)

 com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)

 com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)

 com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:148)

 

Re: struts 2.1.6 struts2-blank adding Double validation causes Exception

2009-01-30 Thread Sergio Italiani
It turns out that the problem I was having - had nothing to do with
type conversion.

The problem was a chunk of my code that was responsible for formatting.
Specifically, the exception IllegalArgumentException: Cannot format
given Object as a Number was thrown because of

s:text name=format.money 
s:param name=value value=myd/
/s:text

(format.money is defined in  package properties --format.money =
{0,number,¤##0.00})

myd supposed to be a double. The problem occurred when wrong value
was inserted instead of double (e.g. 'aaa' instead of 7,5).
The same code threw no exceprion in struts 2.0, but in 2.1.6 it does.
(I said earlier that earlier that showcase run differently than blank
... but I thing that was due to the fact that I didn't copy all the
code from one project to other - sorry about that ;)

So the problem is not so serious as I thought it was.  I will try to
solve this by checking first if
myd contains double or not before formatting


On Thu, Jan 22, 2009 at 10:04 AM, Sergio Italiani sergiode...@gmail.com wrote:
 While having done the same with struts 2.0 blank project - work
 perfectly well. Also works if i add the code to struts2-showcase
 (validation folder).

 The problem is as follows:

 I tried to add double validation to 2.1.6 blank project and if i type
 in form illegal value - say 'aaa' - instead of showing the
 invalid.fieldvalue.variable message it throws the following exception
 :


 java.lang.IllegalArgumentException: Cannot format given Object as a Number
  java.text.DecimalFormat.format(DecimalFormat.java:487)
  java.text.Format.format(Format.java:140)
  java.text.MessageFormat.subformat(MessageFormat.java:1288)
  java.text.MessageFormat.format(MessageFormat.java:836)
  java.text.Format.format(Format.java:140)
  
 com.opensymphony.xwork2.util.LocalizedTextUtil.getMessage(LocalizedTextUtil.java:673)
  
 com.opensymphony.xwork2.util.LocalizedTextUtil.findText(LocalizedTextUtil.java:427)
  
 com.opensymphony.xwork2.TextProviderSupport.getText(TextProviderSupport.java:242)
  com.opensymphony.xwork2.ActionSupport.getText(ActionSupport.java:108)
  
 org.apache.struts2.util.TextProviderHelper.getText(TextProviderHelper.java:79)
  org.apache.struts2.components.Text.end(Text.java:161)
  
 org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:42)
  
 org.apache.jsp.example.Login_jsp._jspx_meth_s_005ftext_005f0(Login_jsp.java:268)
  org.apache.jsp.example.Login_jsp._jspService(Login_jsp.java:91)
  org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
  
 org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
  org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
  org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
  
 org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
  
 org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:154)
  
 org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:186)
  
 com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:361)
  
 com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:265)
  
 com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:249)
  
 org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)
  
 com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
  
 com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
  
 com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122)
  
 com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
  
 com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)
  
 com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
  
 com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
  
 com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)
  
 com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
  
 com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
  
 com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:148)
  
 com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
  
 org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:93)
  
 com.opensymphony.xwork2

Re: Upgrading Struts 2

2009-01-25 Thread Sergio Italiani
Hi Andy!
Sorry for bothering you.
I tried to migrate (following Apache wiki article) from my sample app
that was based on  2.0.11 (struts blank) to 2.1.6 and as a result some
type conversions handled by the frame work stopped working  and now i
got IllegalArgumentException: Cannot format given Object as a Number
whenever i type  an invalid value  into textbox. I also noticed that
type conversion works fine in showcase...
Could you be so kind to give me any tip as what could be wrong... I am
asking you because  when you were migrating you may stamble upon
something like that.
I am new to the mailing list and to struts 2  - so I don't know if i
should address this directly to you or to the user...
Thank you in advance..

Sergio.

On Sat, Jan 24, 2009 at 4:51 PM, Andy Sykes a.sy...@ucl.ac.uk wrote:
 Hi,

 We've migrated an app from 2.0.11 to 2.1.2 (and then to 2.1.6 when it became
 GA - this was a trivial upgrade).

 I found this article on the Apache wiki very useful:
 http://cwiki.apache.org/S2WIKI/troubleshooting-guide-migrating-from-struts-20x-to-21x.html

 I had no major issues - and the performance of app 'seemed' a bit quicker
 (I've done no definitive tests, but the 'feel' was of snappier rendering).
 The only problem I ran into was where I had some nasty hack for passing
 dynamic parameters to an action through redirect-action - I was doing it in
 a non-standard way, which worked in 2.0.11. It was a quick fix to change it
 to the proper way to do it.

 Andy.

 On 24 Jan 2009, at 13:42, Matthew Seaborn wrote:

 We are currently running 2.0.11 and having been away from Struts 2 for a
 while I was pleased to a see a number of new releases.

 Has anyone done an upgrade to either 2.0.14 or 2.1.6 from a 2.0.x release?
   If so how smooth was the transition?

 Matthew Seaborn
 Software Architect
 t+44(0) 208 484 0729
 m  +44(0) 7949 465 142
 e   matthew.seab...@performgroup.com

 Sussex House
 Plane Tree Crescent
 London, TW13 7HE
 United Kingdom
 www.performgroup.com





 

 CONFIDENTIALITY - This email and any files transmitted with it, are
 confidential, may be legally privileged and are intended solely for the use
 of the individual or entity to whom they are addressed. If this has come to
 you in error, you must not copy, distribute, disclose or use any of the
 information it contains. Please notify the sender immediately and delete
 them from your system.

 SECURITY - Please be aware that communication by email, by its very
 nature, is not 100% secure and by communicating with Perform Group by email
 you consent to us monitoring and reading any such correspondence.

 VIRUSES - Although this email message has been scanned for the presence of
 computer viruses, the sender accepts no liability for any damage sustained
 as a result of a computer virus and it is the recipient's responsibility to
 ensure that email is virus free.

 AUTHORITY - Any views or opinions expressed in this email are solely those
 of the sender and do not necessarily represent those of Perform Group.

 COPYRIGHT - Copyright of this email and any attachments belongs to Perform
 Group, Companies House Registration number 6324278.



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



Re: Upgrading Struts 2

2009-01-25 Thread Sergio Italiani
Thanks for the reply,
but the issue You are referring to should have been fixed in 2.1.3. I
am using 2.1.6
Also my textbox expects Double (not Date) ... and when I put in wrong
value ..say '' the exception is thrown
Must be something else...
Any other suggestions ? I am surprised nobody else came across this...

On Sun, Jan 25, 2009 at 5:52 PM, Musachy Barroso musa...@gmail.com wrote:
 Your problem could be related to this:

 http://jira.opensymphony.com/browse/XW-670

 musachy

 On Sun, Jan 25, 2009 at 5:37 AM, Sergio Italiani sergiode...@gmail.com 
 wrote:
 Hi Andy!
 Sorry for bothering you.
 I tried to migrate (following Apache wiki article) from my sample app
 that was based on  2.0.11 (struts blank) to 2.1.6 and as a result some
 type conversions handled by the frame work stopped working  and now i
 got IllegalArgumentException: Cannot format given Object as a Number
 whenever i type  an invalid value  into textbox. I also noticed that
 type conversion works fine in showcase...
 Could you be so kind to give me any tip as what could be wrong... I am
 asking you because  when you were migrating you may stamble upon
 something like that.
 I am new to the mailing list and to struts 2  - so I don't know if i
 should address this directly to you or to the user...
 Thank you in advance..

 Sergio.

 On Sat, Jan 24, 2009 at 4:51 PM, Andy Sykes a.sy...@ucl.ac.uk wrote:
 Hi,

 We've migrated an app from 2.0.11 to 2.1.2 (and then to 2.1.6 when it became
 GA - this was a trivial upgrade).

 I found this article on the Apache wiki very useful:
 http://cwiki.apache.org/S2WIKI/troubleshooting-guide-migrating-from-struts-20x-to-21x.html

 I had no major issues - and the performance of app 'seemed' a bit quicker
 (I've done no definitive tests, but the 'feel' was of snappier rendering).
 The only problem I ran into was where I had some nasty hack for passing
 dynamic parameters to an action through redirect-action - I was doing it in
 a non-standard way, which worked in 2.0.11. It was a quick fix to change it
 to the proper way to do it.

 Andy.

 On 24 Jan 2009, at 13:42, Matthew Seaborn wrote:

 We are currently running 2.0.11 and having been away from Struts 2 for a
 while I was pleased to a see a number of new releases.

 Has anyone done an upgrade to either 2.0.14 or 2.1.6 from a 2.0.x release?
   If so how smooth was the transition?

 Matthew Seaborn
 Software Architect
 t+44(0) 208 484 0729
 m  +44(0) 7949 465 142
 e   matthew.seab...@performgroup.com

 Sussex House
 Plane Tree Crescent
 London, TW13 7HE
 United Kingdom
 www.performgroup.com





 

 CONFIDENTIALITY - This email and any files transmitted with it, are
 confidential, may be legally privileged and are intended solely for the use
 of the individual or entity to whom they are addressed. If this has come to
 you in error, you must not copy, distribute, disclose or use any of the
 information it contains. Please notify the sender immediately and delete
 them from your system.

 SECURITY - Please be aware that communication by email, by its very
 nature, is not 100% secure and by communicating with Perform Group by email
 you consent to us monitoring and reading any such correspondence.

 VIRUSES - Although this email message has been scanned for the presence of
 computer viruses, the sender accepts no liability for any damage sustained
 as a result of a computer virus and it is the recipient's responsibility to
 ensure that email is virus free.

 AUTHORITY - Any views or opinions expressed in this email are solely those
 of the sender and do not necessarily represent those of Perform Group.

 COPYRIGHT - Copyright of this email and any attachments belongs to Perform
 Group, Companies House Registration number 6324278.



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





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

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



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



Re: Upgrading Struts 2

2009-01-25 Thread Sergio Italiani
OK you got a point there... but again if it was XWork bug wouldn't it
affect showcase as well. As I mentioned before If I modify the
showcase validation pages - they work pretty well with type conversion
and no exception is thrown. The problem is that the ShowCase is huge
and I cannon base my new project on it. On the other hand StrutsBlank
is small but it is  not working properly as far as type conversion is
concerned (and I didn't proceed to try anything else... )

Thanks
Sergio,
On Sun, Jan 25, 2009 at 7:06 PM, Wes Wannemacher w...@wantii.com wrote:
 On Sunday 25 January 2009 11:44:46 Sergio Italiani wrote:
 Thanks for the reply,
 but the issue You are referring to should have been fixed in 2.1.3. I
 am using 2.1.6
 Also my textbox expects Double (not Date) ... and when I put in wrong
 value ..say '' the exception is thrown
 Must be something else...
 Any other suggestions ? I am surprised nobody else came across this...


 You are looking at an XWork JIRA, not struts. Xwork is a dependency, but the
 version numbers do not match 1-to-1. XWork is currently on version 2.1.2, and
 a fix is meant to go out with Xwork 2.1.3, which should be soon.

 -Wes


 --

 Wes Wannemacher
 Author - Struts 2 In Practice
 Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
 http://www.manning.com/wannemacher


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



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



having trouble with type conversion in struts 2.1.6

2009-01-23 Thread Sergio Italiani
Hi All!
Could anybody please tell me if I should add anything to the
struts2blank  project (of struts 2.1.6)  so that type conversion error
handling
( i mean the -- invalid.fieldvalue.fieldname) would work properly.
I am clearly missing something, because instead of displaying
invalid.fieldvalue my project (witch is based on struts2blank)
throws--  IllegalArgumentException: Cannot format given Object as a Number.
Any body ? I am getting desperate and thinking of abandoning
struts2.1.6 alltoghether  :(
Thank you in advance.

Sergio.

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



struts 2.1.6 struts2-blank adding Double validation causes Exception

2009-01-22 Thread Sergio Italiani
While having done the same with struts 2.0 blank project - work
perfectly well. Also works if i add the code to struts2-showcase
(validation folder).

The problem is as follows:

I tried to add double validation to 2.1.6 blank project and if i type
in form illegal value - say 'aaa' - instead of showing the
invalid.fieldvalue.variable message it throws the following exception
:


java.lang.IllegalArgumentException: Cannot format given Object as a Number
 java.text.DecimalFormat.format(DecimalFormat.java:487)
 java.text.Format.format(Format.java:140)
 java.text.MessageFormat.subformat(MessageFormat.java:1288)
 java.text.MessageFormat.format(MessageFormat.java:836)
 java.text.Format.format(Format.java:140)
 
com.opensymphony.xwork2.util.LocalizedTextUtil.getMessage(LocalizedTextUtil.java:673)
 
com.opensymphony.xwork2.util.LocalizedTextUtil.findText(LocalizedTextUtil.java:427)
 
com.opensymphony.xwork2.TextProviderSupport.getText(TextProviderSupport.java:242)
 com.opensymphony.xwork2.ActionSupport.getText(ActionSupport.java:108)
 org.apache.struts2.util.TextProviderHelper.getText(TextProviderHelper.java:79)
 org.apache.struts2.components.Text.end(Text.java:161)
 
org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:42)
 
org.apache.jsp.example.Login_jsp._jspx_meth_s_005ftext_005f0(Login_jsp.java:268)
 org.apache.jsp.example.Login_jsp._jspService(Login_jsp.java:91)
 org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
 org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
 org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
 org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
 
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
 
org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:154)
 
org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:186)
 
com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:361)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:265)
 
com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:249)
 
org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)
 
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
 
com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
 
com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)
 
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
 
com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)
 
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
 
com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:148)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
 
org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:93)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
 
org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
 
com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
 
com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:128)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
 
org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(ProfilingActivationInterceptor.java:104)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
 
org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)