You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Lukasz Lenart <lu...@apache.org> on 2017/11/27 10:52:18 UTC

Struts 2.6

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: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: Struts 2.6

Posted by Greg Huber <gr...@gmail.com>.
... 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 <ya...@live.com> 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);
>          }
>      }
>
> }
>

Re: Struts 2.6

Posted by Yasser Zamani <ya...@live.com>.

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);
         }
     }

}

Re: Struts 2.6

Posted by Greg Huber <gr...@gmail.com>.
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 <ya...@apache.org> 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: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>

Re: Struts 2.6

Posted by Yasser Zamani <ya...@apache.org>.

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: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: Struts 2.6

Posted by Lukasz Lenart <lu...@apache.org>.
2017-11-28 10:15 GMT+01:00 Greg Huber <gr...@gmail.com>:
>>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: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: Struts 2.6

Posted by Greg Huber <gr...@gmail.com>.
>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 <lu...@apache.org> wrote:

> 2017-11-28 9:52 GMT+01:00 Greg Huber <gr...@gmail.com>:
> > 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: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>

Re: Struts 2.6

Posted by Lukasz Lenart <lu...@apache.org>.
2017-11-28 9:52 GMT+01:00 Greg Huber <gr...@gmail.com>:
> 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: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: Struts 2.6

Posted by Greg Huber <gr...@gmail.com>.
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 <ya...@apache.org> 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.
>

Re: Struts 2.6

Posted by Yasser Zamani <ya...@apache.org>.

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.

Re: Struts 2.6

Posted by Greg Huber <gr...@gmail.com>.
>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 <lu...@apache.org> wrote:

> 2017-11-28 9:21 GMT+01:00 Greg Huber <gr...@gmail.com>:
> > 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: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>

Re: Struts 2.6

Posted by Lukasz Lenart <lu...@apache.org>.
2017-11-28 9:21 GMT+01:00 Greg Huber <gr...@gmail.com>:
> 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: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: Struts 2.6

Posted by Greg Huber <gr...@gmail.com>.
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 <ya...@apache.org> 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
>

Re: Struts 2.6

Posted by Yasser Zamani <ya...@apache.org>.

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

Re: Struts 2.6

Posted by Lukasz Lenart <lu...@apache.org>.
2017-11-28 9:04 GMT+01:00 Greg Huber <gr...@gmail.com>:
> ...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: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: Struts 2.6

Posted by Greg Huber <gr...@gmail.com>.
...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 <lu...@apache.org> 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: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>

Re: Struts 2.6

Posted by Lukasz Lenart <lu...@apache.org>.
2017-11-27 12:29 GMT+01:00 Yasser Zamani <ya...@apache.org>:
>> 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: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: Struts 2.6

Posted by Yasser Zamani <ya...@apache.org>.

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.


Re: Struts 2.6

Posted by Louis Smith <dr...@gmail.com>.
All my clients app servers are on Servlet 3.1 - Glassfish is now on 4.0.

The cross-package limitation comes to mind as first concern.- how many
"add-opens" and "add-modules" would be required.

I need to get back on testing a full Struts 2.5.14 app under Java
9/Glassfish and see what I can find.

Louis


On Tue, Nov 28, 2017 at 2:18 AM, Lukasz Lenart <lu...@apache.org>
wrote:

> 2017-11-27 20:20 GMT+01:00 Louis Smith <dr...@gmail.com>:
> > 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: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>

Re: Struts 2.6

Posted by Lukasz Lenart <lu...@apache.org>.
2017-11-27 20:20 GMT+01:00 Louis Smith <dr...@gmail.com>:
> 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: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: Struts 2.6

Posted by Louis Smith <dr...@gmail.com>.
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 <lu...@apache.org>
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: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>

Re: Struts 2.6

Posted by Lukasz Lenart <lu...@apache.org>.
2017-12-13 9:52 GMT+01:00 Yasser Zamani <ya...@apache.org>:
> On 12/13/2017 10:33 AM, Lukasz Lenart wrote:
>> I think we should create a branch (support-2-5) to continue support of
>> 2.5.x series in there and use master to work on 2.6 version. I expect
>> there will be a small 2.5.15 release soon as some issues were reported
>> but we should focus on 2.6 now.
>
> As so far, we don't have any committed change into master for 2.6, maybe
> we can wait, then when 2.6 related change was needed to being committed
> into master, then we make a fast release for 2.5.15, goto 2.6 and commit
> that change; If additional issues reported then we have to make a branch
> from 2.5.15 tag.

Works for me :)


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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: Struts 2.6

Posted by Yasser Zamani <ya...@apache.org>.

On 12/13/2017 10:33 AM, Lukasz Lenart wrote:
> I think we should create a branch (support-2-5) to continue support of
> 2.5.x series in there and use master to work on 2.6 version. I expect
> there will be a small 2.5.15 release soon as some issues were reported
> but we should focus on 2.6 now.

As so far, we don't have any committed change into master for 2.6, maybe 
we can wait, then when 2.6 related change was needed to being committed 
into master, then we make a fast release for 2.5.15, goto 2.6 and commit 
that change; If additional issues reported then we have to make a branch 
from 2.5.15 tag.

Regards.

Re: Struts 2.6

Posted by Lukasz Lenart <lu...@apache.org>.
Hi,

I think we should create a branch (support-2-5) to continue support of
2.5.x series in there and use master to work on 2.6 version. I expect
there will be a small 2.5.15 release soon as some issues were reported
but we should focus on 2.6 now.


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

2017-12-12 15:17 GMT+01:00 Lukasz Lenart <lu...@apache.org>:
> 2017-12-12 15:08 GMT+01:00 Yasser Zamani <ya...@apache.org>:
>> I am wondering why we don't solve this one time for ever in 2.6 major
>> version? In technical point-of-view we can simply refactor all Struts 2
>> to Struts and then just preparing a migration guide.
>>
>> I know there are maybe a lot of works and side effects but they will be
>> finished one they and the world will forget, I think. What do you think?
>
> This isn't about package names - this is even a good idea to have
> different package names as then you can have Struts 1 and Struts 2 in
> the same war file and allow step by step migration.
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: Struts 2.6

Posted by Lukasz Lenart <lu...@apache.org>.
2017-12-12 15:08 GMT+01:00 Yasser Zamani <ya...@apache.org>:
> I am wondering why we don't solve this one time for ever in 2.6 major
> version? In technical point-of-view we can simply refactor all Struts 2
> to Struts and then just preparing a migration guide.
>
> I know there are maybe a lot of works and side effects but they will be
> finished one they and the world will forget, I think. What do you think?

This isn't about package names - this is even a good idea to have
different package names as then you can have Struts 1 and Struts 2 in
the same war file and allow step by step migration.


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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: Struts 2.6

Posted by Yasser Zamani <ya...@apache.org>.
> 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 :)
>>
>> 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
>>

On 11/17/2017 3:46 PM, René Gielen wrote: [1]
> +1 - not again - please don't use "Servlet 3" in any name. "Async" is the asset, so let's name it like that
> It's also valid for Servlet 4.0, isn't it? :) We should better stay with features than with version numbers, we had this problem already with adding the 2 to the product brand name (Struts 2) - will a 3.0 release called Struts 3 or Struts 2 3.x ?? Same goes for Servlet versioning. So I'm still +1 for a refactoring

I am wondering why we don't solve this one time for ever in 2.6 major 
version? In technical point-of-view we can simply refactor all Struts 2 
to Struts and then just preparing a migration guide.

I know there are maybe a lot of works and side effects but they will be 
finished one they and the world will forget, I think. What do you think?

Regards.

[1] https://github.com/apache/struts/pull/179#issuecomment-345228928