This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes Sending variables problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Sending variables problem" Watch "Sending variables problem" New topic
Author

Sending variables problem

Andrei Antonescu
Ranch Hand

Joined: Jul 08, 2010
Posts: 75
Hello,

I am havin a textfield with the value 0.0. In my action i have a X variable of type Float. When the textfield is non-zero, the conversion is made correctly and the X variable is initialised in the action. When it is 0 it gives an exception because it is searching for a setter of type String (for the variable X I only have one of type Float).
I have tried to create a setX(String y) method but the result is the same.

Can you please help?
Thanks in advance
Richard Golebiowski
Ranch Hand

Joined: May 05, 2010
Posts: 213

This appears to be a known issue with Struts. Is it possible for you to use a different type for this variable?
 
jQuery in Action, 2nd edition
 
subject: Sending variables problem
 
Similar Threads
Key accelerator steals focus from textFields?
Automatic Conversion / Cast
converting float hex to int
Struts2 QUERY Regarding Built in Type Conversions in Struts2 Framework
How to test for type