Re: Extending StrutsTypeConverter :: How to detect specific type of "Class toClass"?

2017-10-02 Thread Lukasz Lenart
2017-10-02 10:20 GMT+02:00 Yasser Zamani : > On 10/2/2017 11:00 AM, Lukasz Lenart wrote: >> was off for few days to take few >> off-road rides on my dirty bike;-) > > :) cool! I hope you did not reach any issue with your bike's Struts :) > > Just joking! welcome back

Re: Extending StrutsTypeConverter :: How to detect specific type of "Class toClass"?

2017-10-02 Thread Lukasz Lenart
2017-10-02 17:45 GMT+02:00 Burton Rhodes : > Lukasz - > I've created a fix in my fork of the struts project on GitHub. Should I > still create the JIRA or just submit a pull request? Not sure about > protocol here. Yes, please create the JIRA ticket and then reference it

Re: Extending StrutsTypeConverter :: How to detect specific type of "Class toClass"?

2017-10-02 Thread Burton Rhodes
Lukasz - I've created a fix in my fork of the struts project on GitHub. Should I still create the JIRA or just submit a pull request? Not sure about protocol here. Thanks, Burton On Mon, Oct 2, 2017 at 5:11 AM, Burton Rhodes wrote: > Lukasz - yes. The checkbox.ftl was

Re: Extending StrutsTypeConverter :: How to detect specific type of "Class toClass"?

2017-10-02 Thread Burton Rhodes
Lukasz - yes. The checkbox.ftl was overridden using the technique you linked to. For my case, I just performed the "simple" theme modification. However, after looking at the other checkbox.ftl files - it appears they just include the /simple/checkbox.ftl file - so the code change is only

Re: Extending StrutsTypeConverter :: How to detect specific type of "Class toClass"?

2017-10-02 Thread Yasser Zamani
On 10/2/2017 11:00 AM, Lukasz Lenart wrote: > was off for few days to take few > off-road rides on my dirty bike;-) :) cool! I hope you did not reach any issue with your bike's Struts :) Just joking! welcome back Ɓukasz! Actually such days traverses hardly for me as I do not hear about you

Re: Extending StrutsTypeConverter :: How to detect specific type of "Class toClass"?

2017-10-02 Thread Lukasz Lenart
2017-10-01 22:02 GMT+02:00 Burton Rhodes : > As a followup to my last email, it appears the Struts default design > pattern for checkboxes (submitting false values with hidden value) is the > cause. An easy fix for this would be to allow the developer to override > this

Re: Extending StrutsTypeConverter :: How to detect specific type of "Class toClass"?

2017-10-01 Thread Yasser Zamani
Good time Burton, Thank you for your code but I think adding a new parameter maybe is not a real necessary in this case. If we add it then it crowds check box tag out more, confuses users with more options, needs support for a long time and needs documentation. Maybe these are not necessary in

Re: Extending StrutsTypeConverter :: How to detect specific type of "Class toClass"?

2017-10-01 Thread Burton Rhodes
As a followup to my last email, it appears the Struts default design pattern for checkboxes (submitting false values with hidden value) is the cause. An easy fix for this would be to allow the developer to override this design pattern by a s:checkbox parameter (e.g. requiredValue). The default

Re: Extending StrutsTypeConverter :: How to detect specific type of "Class toClass"?

2017-10-01 Thread Burton Rhodes
Got it. I'll use that for now. Don't you think that is a bit of a hack? Do you think this be fixed or reported as a "bug"? On Sun, Oct 1, 2017 at 7:54 AM, Yasser Zamani wrote: > Hello Burton, > > Thank you; I examined your example and found out this behavior is >

Re: Extending StrutsTypeConverter :: How to detect specific type of "Class toClass"?

2017-10-01 Thread Yasser Zamani
Hello Burton, Thank you; I examined your example and found out this behavior is because of something in Struts named "automatic checkbox detection", CheckboxInterceptor. When your `choices` count is bigger than 1, you'll see your desired behavior because CheckboxInterceptor does nothing with

Re: Extending StrutsTypeConverter :: How to detect specific type of "Class toClass"?

2017-09-30 Thread Burton Rhodes
Well shoot - after further testing it seems the issue is still present. I isolated the issue in a simple mvn webapp (see link below). Essentially Struts conversion fails when: 1) setting form input element to a List, 2) there is only one checkbox in the list, 3) the checkbox is not checked when

Re: Extending StrutsTypeConverter :: How to detect specific type of "Class toClass"?

2017-09-29 Thread Burton Rhodes
Sorry for the delay. I have upgraded to the newest version and everything seems to be working. Thanks! On Mon, Sep 25, 2017 at 2:34 AM, Lukasz Lenart wrote: > 2017-09-25 5:04 GMT+02:00 Burton Rhodes : > > When extending the StrutsTypeConverter,

Re: Extending StrutsTypeConverter :: How to detect specific type of "Class toClass"?

2017-09-25 Thread Lukasz Lenart
2017-09-25 5:04 GMT+02:00 Burton Rhodes : > When extending the StrutsTypeConverter, is there anyway to figure out if > the "toClass" is a List or a List? I have found that when > converting data from a submitted webpage that has a value of a List in a > single variable,

Re: Extending StrutsTypeConverter :: How to detect specific type of "Class toClass"?

2017-09-25 Thread Yasser Zamani
Hello Burton, I could post back lists without any custom converter as below: ```jsp ``` But about your question: Java uses something called "type erasure", which means at runtime both List and List are equivalent. The compiler knows the

Extending StrutsTypeConverter :: How to detect specific type of "Class toClass"?

2017-09-24 Thread Burton Rhodes
When extending the StrutsTypeConverter, is there anyway to figure out if the "toClass" is a List or a List? I have found that when converting data from a submitted webpage that has a value of a List in a single variable, the standard struts conversion fails. For example: display as . When the