Re: ognl can't handle converting from string to float?

2010-02-11 Thread BlackKnight

Hi, Cimballi,

  I find it out, it's a bug of xwork 2.1.2, not ognl~~.
 
  The converstion failed in xwork2,


  Acctually , xwork guys has already noticed this and have  it 
fixed since xwork2.1.3.


  Xwork2.1.3. Changlong : 
http://jira.opensymphony.com/secure/ReleaseNote.jspa?projectId=10050&styleName=Html&version=21790 
<http://jira.opensymphony.com/secure/ReleaseNote.jspa?projectId=10050&styleName=Html&version=21790>


   [XW-677 <http://jira.opensymphony.com/browse/XW-677>] - 
double/float parameters not converted when <= 0


Struts2.1.8 is using xwork 2.1.6 so it didn't have this problem in 
dealing with 0.0:-)


 


Frankie

Cimballi 写道:

Frankie, here it works also with "0.0" entered in the UI.

Cimballi


On Wed, Feb 10, 2010 at 11:32 AM, BlackKnight  wrote:
  

Hi Cimballi,


 Have you tried to set latitude = 0f (in java class) or  0.0 in the web
textfield and then submit the form?

 I debuged the source code and I believe there is a bug in ongl when
handling float value 0,

 Of course when the value is not 0f, ognl can handle converition from string
to float quite well.


Frankie


Cimballi 写道:


I have a working case with this declaration :
private Float latitude; and getXxx setXxx.

And in the JSP : 

Using Struts 2.1.8.1

Cimballi


2010/2/9 BlackKnight :

  

Hi,

Just curious,

Lib Version:
ognl 2.6.11/Struts2.1.6,

Initial setting:
I have a float variable utm1 in my java model class, the initial value
is set to to 0f,

Problem Desc:
when submitting the form, struts2 throw a error something like "can't
find the setter methods SetUtm1(String)".

Debug and trace info:
After the submitting, struts2 call ognl to set value of utm1, first ognl
look up for a converter to convert the para type(String) to the java
class type(Java.lang. float). However, there isn't any converter handle
such kind of convertion. So the ognl try to treat the para as a string
and apply the SetUtm1(String) methods.

Question:
Is it true that ognl didn't handle convertion from string to float? How
do you guys handle float variable in struts2 form?

Any comments? Thanks


Frank

-
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





-
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: ognl can't handle converting from string to float?

2010-02-10 Thread BlackKnight

Hi Cimballi,


  Have you tried to set latitude = 0f (in java class) or  0.0 in the 
web textfield and then submit the form?


  I debuged the source code and I believe there is a bug in ongl when 
handling float value 0,


 Of course when the value is not 0f, ognl can handle converition from 
string to float quite well.



Frankie


Cimballi 写道:

I have a working case with this declaration :
private Float latitude; and getXxx setXxx.

And in the JSP : 

Using Struts 2.1.8.1

Cimballi


2010/2/9 BlackKnight :
  

Hi,

Just curious,

Lib Version:
ognl 2.6.11/Struts2.1.6,

Initial setting:
I have a float variable utm1 in my java model class, the initial value
is set to to 0f,

Problem Desc:
when submitting the form, struts2 throw a error something like "can't
find the setter methods SetUtm1(String)".

Debug and trace info:
After the submitting, struts2 call ognl to set value of utm1, first ognl
look up for a converter to convert the para type(String) to the java
class type(Java.lang. float). However, there isn't any converter handle
such kind of convertion. So the ognl try to treat the para as a string
and apply the SetUtm1(String) methods.

Question:
Is it true that ognl didn't handle convertion from string to float? How
do you guys handle float variable in struts2 form?

Any comments? Thanks


Frank

-
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



ognl can't handle converting from string to float?

2010-02-09 Thread BlackKnight
Hi,

Just curious,

Lib Version:
ognl 2.6.11/Struts2.1.6,

Initial setting:
I have a float variable utm1 in my java model class, the initial value
is set to to 0f,

Problem Desc:
when submitting the form, struts2 throw a error something like "can't
find the setter methods SetUtm1(String)".

Debug and trace info:
After the submitting, struts2 call ognl to set value of utm1, first ognl
look up for a converter to convert the para type(String) to the java
class type(Java.lang. float). However, there isn't any converter handle
such kind of convertion. So the ognl try to treat the para as a string
and apply the SetUtm1(String) methods.

Question:
Is it true that ognl didn't handle convertion from string to float? How
do you guys handle float variable in struts2 form?

Any comments? Thanks


Frank

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



Any good Open source project using Struts2 + Hibernate+Spring I can learn from ?

2009-10-02 Thread BlackKnight
Hi,Folks,

I've been using SSH for a while and are hoping to learn from some open
source code if there are any.

As for .net there are petshop. and Ejb there are petstore.

Are there any good open sourced project using SSH?


Thanks!

Frank

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



Why submit didn't support param

2009-08-18 Thread BlackKnight
Hi,

Just currious y struts didn't support  in 

I am having a problem:

A list of controls are produced using iterator, user can remove each of
them by clicking submit near each of them.

If i use , i can send the id of the row via , but the data
user has inputed will be lost! Also the iterator will be empty!

If I use  I have no way to know which row the control is located!

Are trying to modify the struts2 source code! but it's really really a
mess for a beginer like me!!

Any suggestions?!




Frank

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



checkbox in an iterator!

2009-07-21 Thread BlackKnight
Hi guys,

I have a checkbox



in an iterator.

However after the validation fail.

The value of the varible "test" in the valuestack became "true, ",

then after servral fail submit the value of the the varible "test" in
the valuestack became "true,

true,true,true,true,true..". Any Suggestions?

Thanks!


Frank

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



Struts2.16 Source Code study:Help! What happened in request.getParameterMap()?

2009-07-21 Thread BlackKnight
Hi, guys

I am studying struts2 source code.

I am wondering how struts2 get those parameters from a submitted
webform. So I traced the program from filterdispatch.class into
DefaultActionMapper.class(). I found a method

public void handleSpecialParameters(HttpServletRequest request,
ActionMapping mapping) {
.
Map parameterMap = request.getParameterMap();//the line

..
}

The thing I don't understand is before this line was called. debug show
the parameterMap in request is empty! however after this line. the
parameterMap was filled with values!!!And this methods is not traceable.
So my questions are:

1) where did struts2 /xwork2 get parameter from the webform and put them
into the request body.
2) what happened in that line?

Thanks in advance!


Frank

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



How to do pager with two select?

2009-07-05 Thread BlackKnight
Hi guys,

I got a problem implementing a Pager with two select.

I have 2 select, a submit button and an iterator in a s:form,.

Once user hit submit, the content in select will send to a action as
criterias and load the data. I have no problem with that.

BUT, BUT how can I add a pager in this form? I tried to use 4
links(first last.), once user hit a link, it will call a action but
I can't get the value of select in the action! They are both null.

I have been bothered for similar problems for a while, any suggestions
and hints will be appreciated!

Thanks in advance!


Frank

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



Re: Generating Dynamic radio button list

2009-06-25 Thread BlackKnight

Jim Kiley ??:

You need to provide Struts with an actual List (or Set or the like).  It
looks like you are providing a single String.  You will need to parse that
String out into a List of Strings in order for  to treat it as a
List.
jk

2009/6/24 BlackKnight 

  

Hi,

I am trying to generate a dynamic raido buttom list using



where optionvalue is stored in database equal

#{'Faculty':'Faculty','Staff':'Staff','Resident':'Resident','Intern':'Intern'}

however struts2 doesn't generate the radio button list intead he
generate only 1 radio button with value equals

#{'Faculty':'Faculty','Staff':'Staff','Resident':'Resident','Intern':'Intern'}

Any help?


Thanks!


Frank

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






  

Hi, JK,

Thanks for your help ,

The problem is I am trying to generate a form from the DB. So the number 
of radio button list could vary. That could make the parsing method 
quite complex.(Actually I am not sure how to do that yet), any suggestions?




Frank


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



Generating Dynamic radio button list

2009-06-24 Thread BlackKnight
Hi,

I am trying to generate a dynamic raido buttom list using



where optionvalue is stored in database equal
#{'Faculty':'Faculty','Staff':'Staff','Resident':'Resident','Intern':'Intern'}

however struts2 doesn't generate the radio button list intead he
generate only 1 radio button with value equals
#{'Faculty':'Faculty','Staff':'Staff','Resident':'Resident','Intern':'Intern'}

Any help?


Thanks!


Frank

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