Struts 2.6

classic Classic list List threaded Threaded
26 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Struts 2.6

Lukasz Lenart
Struts 2.5.14 is officially out so we can start working on Struts 2.6 :)

I think we can basically merge all the open PRs, adjust Servlet API
version and release a first beta version :)
https://github.com/apache/struts/pulls


Regards
--
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Struts 2.6

Yasser Zamani-2


On 11/27/2017 2:22 PM, Lukasz Lenart wrote:
> Struts 2.5.14 is officially out so we can start working on Struts 2.6 :)
>

Nice :) thanks for your works and time!

> I think we can basically merge all the open PRs, adjust Servlet API
> version and release a first beta version :)
> https://github.com/apache/struts/pulls
>

I think some of them are not fully discussed to being merged e.g. #169.
Some are not ready and some are failed.


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Struts 2.6

Louis Smith
In reply to this post by Lukasz Lenart
What Servlet API is 2.6 targeting?

When will you start migrating to Java 9 structure and limitations?

I have 60 apps up to spec on 2.5.10.1 or better, so should be ready for 2.6
...

Thank you again for all you do for Struts!!

Louis

Louis


On Mon, Nov 27, 2017 at 5:52 AM, Lukasz Lenart <[hidden email]>
wrote:

> Struts 2.5.14 is officially out so we can start working on Struts 2.6 :)
>
> I think we can basically merge all the open PRs, adjust Servlet API
> version and release a first beta version :)
> https://github.com/apache/struts/pulls
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Struts 2.6

Lukasz Lenart
In reply to this post by Yasser Zamani-2
2017-11-27 12:29 GMT+01:00 Yasser Zamani <[hidden email]>:
>> I think we can basically merge all the open PRs, adjust Servlet API
>> version and release a first beta version :)
>> https://github.com/apache/struts/pulls
>
> I think some of them are not fully discussed to being merged e.g. #169.
> Some are not ready and some are failed.

I meant to treat them as a scope of work :)


Regards
--
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Struts 2.6

Lukasz Lenart
In reply to this post by Louis Smith
2017-11-27 20:20 GMT+01:00 Louis Smith <[hidden email]>:
> What Servlet API is 2.6 targeting?

Servlet API 2.5

> When will you start migrating to Java 9 structure and limitations?

Hm... we thought about switching to Java 8 first. What limitations do
you have on mind?


Regards
--
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Struts 2.6

Greg Huber
In reply to this post by Lukasz Lenart
...one thing I have noticed is the number formatting on textfield has
changed.

Previously, if its value was 10 it used to show 10.0 now it only shows 10.
ie missing the decimal point and a zero.

<s:textfield name="bean.size" size="5" maxlength="5" />

public double getSize() {
        return size;
    }

I have checked 2.5.13 and it works as expected 10.0


On 27 November 2017 at 10:52, Lukasz Lenart <[hidden email]> wrote:

> Struts 2.5.14 is officially out so we can start working on Struts 2.6 :)
>
> I think we can basically merge all the open PRs, adjust Servlet API
> version and release a first beta version :)
> https://github.com/apache/struts/pulls
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Struts 2.6

Yasser Zamani-2


On 11/28/2017 11:34 AM, Greg Huber wrote:
> Previously, if its value was 10 it used to show 10.0 now it only shows 10.
> ie missing the decimal point and a zero.

Yes, we dropped `.setMinimumFractionDigits(1)` [1]. Do you have any
issue when post back the value to your action?

[1]
https://github.com/apache/struts/pull/173/commits/66ae66141362e3fd1c3db26149e15619f6c20fcb

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Struts 2.6

Greg Huber
It works ok, but I want to show the digits (.0).  Is there any way I can
now easily do this?

My price fields I have to manually set the value:

<s:textfield name="bean.price"
value="%{getText('format.number',{bean.price})}" size="5" maxlength="6" />

On 28 November 2017 at 08:15, Yasser Zamani <[hidden email]> wrote:

>
>
> On 11/28/2017 11:34 AM, Greg Huber wrote:
> > Previously, if its value was 10 it used to show 10.0 now it only shows
> 10.
> > ie missing the decimal point and a zero.
>
> Yes, we dropped `.setMinimumFractionDigits(1)` [1]. Do you have any
> issue when post back the value to your action?
>
> [1]
> https://github.com/apache/struts/pull/173/commits/
> 66ae66141362e3fd1c3db26149e15619f6c20fcb
>
Reply | Threaded
Open this post in threaded view
|

Re: Struts 2.6

Lukasz Lenart
In reply to this post by Greg Huber
2017-11-28 9:04 GMT+01:00 Greg Huber <[hidden email]>:

> ...one thing I have noticed is the number formatting on textfield has
> changed.
>
> Previously, if its value was 10 it used to show 10.0 now it only shows 10.
> ie missing the decimal point and a zero.
>
> <s:textfield name="bean.size" size="5" maxlength="5" />
>
> public double getSize() {
>         return size;
>     }
>
> I have checked 2.5.13 and it works as expected 10.0

Yes, the whole discussion is here https://github.com/apache/struts/pull/173

To sum up:
- with 2.5.12 I have introduced locale aware converters with default .0
- it was considered as a bug by some users
- 2.5.14 dropped the .0


Regards
--
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Struts 2.6

Lukasz Lenart
In reply to this post by Greg Huber
2017-11-28 9:21 GMT+01:00 Greg Huber <[hidden email]>:
> It works ok, but I want to show the digits (.0).  Is there any way I can
> now easily do this?

Sorry but no :(

> My price fields I have to manually set the value:
>
> <s:textfield name="bean.price"
> value="%{getText('format.number',{bean.price})}" size="5" maxlength="6" />

Right, a bit annoying ... but that makes me think that we can use the
'format.numer' directly in the converter


Regards
--
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Struts 2.6

Greg Huber
>Right, a bit annoying ... but that makes me think that we can use the
>'format.numer' directly in the converter

Some kind of formatting would be useful and possibly eliminate the
getText() call.

Tried number, but it is an output field only, also

<s:number name="bean.size" maximumFractionDigits="1" />  still shows 10,
does not seem to do anything?



On 28 November 2017 at 08:27, Lukasz Lenart <[hidden email]> wrote:

> 2017-11-28 9:21 GMT+01:00 Greg Huber <[hidden email]>:
> > It works ok, but I want to show the digits (.0).  Is there any way I can
> > now easily do this?
>
> Sorry but no :(
>
> > My price fields I have to manually set the value:
> >
> > <s:textfield name="bean.price"
> > value="%{getText('format.number',{bean.price})}" size="5" maxlength="6"
> />
>
> Right, a bit annoying ... but that makes me think that we can use the
> 'format.numer' directly in the converter
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Struts 2.6

Yasser Zamani-2
In reply to this post by Greg Huber


On 11/28/2017 11:51 AM, Greg Huber wrote:
> Is there any way I can
> now easily do this?

I think you can write a small custom converter via extending
`com.opensymphony.xwork2.conversion.impl.StringConverter` and overriding
it's `convertToString` method [1] then you can register it globally for
java.lang.Double types via a file named `xwork-conversion.properties` in
your resources folder [2] which contains:

java.lang.Double=com.mycompany.myDoubleWithDotZerroConverter

[1]
https://github.com/apache/struts-examples/blob/master/type-conversion/src/main/java/org/apache/struts/example/ThemeDescriptorConverter.java
[2]
https://github.com/apache/struts-examples/blob/master/type-conversion/src/main/resources/xwork-conversion.properties

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Struts 2.6

Yasser Zamani-2
In reply to this post by Greg Huber


On 11/28/2017 12:14 PM, Greg Huber wrote:
> <s:number name="bean.size" maximumFractionDigits="1" />  still shows 10

I think it should be minimumFractionDigits.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Struts 2.6

Greg Huber
ah, that works OK, the eclipse context does not explain what they do, just
says: "Minimum fraction digits"

On 28 November 2017 at 08:48, Yasser Zamani <[hidden email]> wrote:

>
>
> On 11/28/2017 12:14 PM, Greg Huber wrote:
> > <s:number name="bean.size" maximumFractionDigits="1" />  still shows 10
>
> I think it should be minimumFractionDigits.
>
Reply | Threaded
Open this post in threaded view
|

Re: Struts 2.6

Lukasz Lenart
2017-11-28 9:52 GMT+01:00 Greg Huber <[hidden email]>:
> ah, that works OK, the eclipse context does not explain what they do, just
> says: "Minimum fraction digits"

but how do you use <s:number/> with <s:textfield/> ?

And feel free to register this as a bug :)


Regards
--
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Struts 2.6

Greg Huber
In reply to this post by Yasser Zamani-2
where do these live now? does not compile for me.

*ThemeDescriptorConverter.java*

import org.apache.struts.model.ThemeDescriptor;
import org.apache.struts.model.Themes;

On 28 November 2017 at 08:45, Yasser Zamani <[hidden email]> wrote:

>
>
> On 11/28/2017 11:51 AM, Greg Huber wrote:
> > Is there any way I can
> > now easily do this?
>
> I think you can write a small custom converter via extending
> `com.opensymphony.xwork2.conversion.impl.StringConverter` and overriding
> it's `convertToString` method [1] then you can register it globally for
> java.lang.Double types via a file named `xwork-conversion.properties` in
> your resources folder [2] which contains:
>
> java.lang.Double=com.mycompany.myDoubleWithDotZerroConverter
>
> [1]
> https://github.com/apache/struts-examples/blob/master/
> type-conversion/src/main/java/org/apache/struts/example/
> ThemeDescriptorConverter.java
> [2]
> https://github.com/apache/struts-examples/blob/master/
> type-conversion/src/main/resources/xwork-conversion.properties
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Struts 2.6

Greg Huber
In reply to this post by Lukasz Lenart
>but how do you use <s:number/> with <s:textfield/> ?

I do not, thought maybe I was using textfield incorrectly for numbers.  Its
read only.

On 28 November 2017 at 08:58, Lukasz Lenart <[hidden email]> wrote:

> 2017-11-28 9:52 GMT+01:00 Greg Huber <[hidden email]>:
> > ah, that works OK, the eclipse context does not explain what they do,
> just
> > says: "Minimum fraction digits"
>
> but how do you use <s:number/> with <s:textfield/> ?
>
> And feel free to register this as a bug :)
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Struts 2.6

Yasser Zamani
In reply to this post by Greg Huber


On 11/28/2017 12:36 PM, Greg Huber wrote:
> where do these live now? does not compile for me.
>
> *ThemeDescriptorConverter.java*
>
> import org.apache.struts.model.ThemeDescriptor;
> import org.apache.struts.model.Themes;

No I mentioned those as examples. You instead should write your own,
like below:

package com.mycompany.blahblah /*update this to your one*/

public class MyDoubleWithDotZeroStringConverter extends
com.opensymphony.xwork2.conversion.impl.StringConverter
{
@Override
     protected String convertToString(Locale locale, Object value) {
         if (Double.class.isInstance(value)) {
             NumberFormat format = NumberFormat.getNumberInstance(locale);
             format.setGroupingUsed(false);
             format.setMinimumFractionDigits(1);
             format.setMaximumFractionDigits(Integer.MAX_VALUE);
             return format.format(value);
         } else {
             return super.convertToString(locale, value);
         }
     }

}

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Struts 2.6

Lukasz Lenart
In reply to this post by Greg Huber
2017-11-28 10:15 GMT+01:00 Greg Huber <[hidden email]>:
>>but how do you use <s:number/> with <s:textfield/> ?
>
> I do not, thought maybe I was using textfield incorrectly for numbers.  Its
> read only.

Ok, ok :) So <s:number/> is better though :)


Regards
--
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Struts 2.6

Greg Huber
In reply to this post by Yasser Zamani
... String convertToString(Map arg0, Object arg1) {

Possibly will look into something like this, but its easier for now to use:

value="%{getText('format.double',{bean.size})}"

where

format.double={0,number,##0.0}

ie
<s:textfield accesskey="v" name="bean.size"
value="%{getText('format.double',{bean.size})}" size="5" maxlength="5"
readonly="#readonly" />

Thanks.


On 28 November 2017 at 09:15, Yasser Zamani <[hidden email]> wrote:

>
>
> On 11/28/2017 12:36 PM, Greg Huber wrote:
> > where do these live now? does not compile for me.
> >
> > *ThemeDescriptorConverter.java*
> >
> > import org.apache.struts.model.ThemeDescriptor;
> > import org.apache.struts.model.Themes;
>
> No I mentioned those as examples. You instead should write your own,
> like below:
>
> package com.mycompany.blahblah /*update this to your one*/
>
> public class MyDoubleWithDotZeroStringConverter extends
> com.opensymphony.xwork2.conversion.impl.StringConverter
> {
> @Override
>      protected String convertToString(Locale locale, Object value) {
>          if (Double.class.isInstance(value)) {
>              NumberFormat format = NumberFormat.getNumberInstance(locale);
>              format.setGroupingUsed(false);
>              format.setMinimumFractionDigits(1);
>              format.setMaximumFractionDigits(Integer.MAX_VALUE);
>              return format.format(value);
>          } else {
>              return super.convertToString(locale, value);
>          }
>      }
>
> }
>
12