eclipse-ee4j / starter

Eclipse Starter for Jakarta EE
Eclipse Public License 2.0
50 stars 39 forks source link

UI: selection problem and ugly validation message #254

Closed geziefer closed 1 year ago

geziefer commented 1 year ago

If one selects "Jakarta EE 9.1" as version, the selection does not happen (1st image below), resulting in an ugly validation error when selecting something else (2nd image below)

image

image

geziefer commented 1 year ago

Reasons seams to be that version is "91" instead of "9.1"

m-reza-rahman commented 1 year ago

I’ll look into it. I guess this is in the main branch code rather than the production site? I cannot seem to be able to reproduce it on the production site.

geziefer commented 1 year ago

Clarification: Does not happen in production but on current master.

m-reza-rahman commented 1 year ago

It’s a good idea to test things out with the recent changes from Kito. I’ll do that myself too.

m-reza-rahman commented 1 year ago

So far, cannot reproduce it in the latest code either. @geziefer, could you provide steps to reproduce including OS, browser and locale settings?

geziefer commented 1 year ago

When I pull master branch as of now, do mvn clean package wildfly:run open localhost:8080/jakarta-starter-ui and then select "Jakarta EE 9.1", I don't see the selection and the log states Validating form for Jakarta EE version: 91, Jakarta EE profile: full, Java SE version: 17, Docker: false, runtime: none which is not covered by the switch case statement in Project.java.

It happens on Windows 11 with Chorme, Edge and Firefox (German locale) and Mac (English locale). I thought it could be the locale in case "9.1" is interpreted as a number (would be "9,1" in German, so the "." might be deleted in conversion), but as said, same happens in English locale.

geziefer commented 1 year ago

We might add that directly in the view's code since conversion is done from internal value, not from user input. If I add locale="en-US" to the <f:convertNumber minFractionDigits="0" maxFractionDigits="1" /> in index.xhtml for Jakarta EE version, the selection works.

jeyvison commented 1 year ago

Just tested here and can't reproduce it on Mac(english Locale) using firefox or Safari. Weird

geziefer commented 1 year ago

@jeyvison , @m-reza-rahman I think we should be safe to state explicitely to convert it in English number format in the view as it is only an internal value. Should I provide a PR for that?

m-reza-rahman commented 1 year ago

Do you mind issuing a PR? I think this is an issue of the server-side locale rather than client side.

jeyvison commented 1 year ago

Should I provide a PR for that?

Yes, please. But i'd like to understand a little bit more about the issue,also. Can you please share the JVM vendor and version you're using and the JVM locale(if thats different from OS)? From the images you shared it looks like you're using German somewhere?

geziefer commented 1 year ago

Yes, it might be, as it happens for me also on my Mac with English language setting. My JVM is "openjdk version "17.0.5" 2022-10-18" and if I print out my default locale it's "de_DE".

So, shouldn't be a problem for our production, but I'll file a PR with the little change, won't hurt there and might help others trying it out locally.

jeyvison commented 1 year ago

Got it. Thanks for the infos :)

jeyvison commented 1 year ago

@geziefer The PR is already merged, would mind test the latest master to confimr that #255 fixed it, please?

geziefer commented 1 year ago

Yes, works fine now.