String based context params having fixed set of allowed values should be represented by enums #1831
Labels
mojarra-implemented
API issue implemented by Mojarra
Milestone
While working on PoC for
@FacesConfig
annotation having all context params as attributes/constants, https://github.com/eclipse-ee4j/mojarra/blob/4e486bfabe8b08e5b4588ab8e9198e0bd4c30503/impl/src/main/java/jakarta/faces/annotation/FacesConfig.java I noticed the followingString
based context param values having a fixed set of allowed values such as "auto", "none", etc but these values are in turn not represented by enums such asProjectStage
. We should introduce enums on them in order to have type safety.jakarta.faces.CLIENT_WINDOW_MODE
-->none
andurl
.jakarta.faces.STATE_SAVING_METHOD
-->client
andserver
.jakarta.faces.VALIDATE_EMPTY_FIELDS
-->auto
,true
andfalse
.There's only a slight difficulty with client window mode; the javadoc ofUpdate: it's definitely freeform. Moreover, MyFaces has its own additional variants already (ClientWindow.CLIENT_WINDOW_MODE_PARAM_NAME
literally says "but other values are possible", we should probably remove this phrase.url-redirect
,client
).The text was updated successfully, but these errors were encountered: