Generate small generated unique ids for components without explicit ids
-----------------------------------------------------------------------
Key: MYFACES-3330
URL: https://issues.apache.org/jira/browse/MYFACES-3330
Project: MyFaces Core
Issue Type: Sub-task
Components: JSR-314
Reporter: Leonardo Uribe
Assignee: Leonardo Uribe
To ensure uniqueness, MyFaces uses a unique tag id more associated to a
facelet. The effect is each page ends with ids that are too long. For example:
j_id538961478_e4e33bc
It is necessary to provide another strategy to generate component ids as small
as possible. It should meet two conditions:
1. They should be unique but
2. The same ids should be generated each time the view is built for comply with
PSS algorithm.
How to solve it?
First create a "hierarchical counter" that can generate something like this:
j_id_1
j_id_2
j_id_3
j_id_4
j_id_5_1
j_id_5_2_1
j_id_5_2_2
j_id_5_2_3
j_id_5_3
....
j_id_z
Use the max radix available for a counter, because for a html id we can use:
0123456789abcdefghijklmnopqrstuvwxyz
as valid characters.
This counter does not need to be related to the one used by MARK_CREATED, but
the same methods should be used to create additional hierarchies.
This change will improve performance too, because the generated pages will be
shorter and we can get rid two maps, so for each tag we remove a map.get call.
Additionally, with this strategy we can make PSS algorithm work better, because
the final
component ids will be more stable, and that's very important. There are some
corner use cases where to make it work it is required to enable
org.apache.myfaces.REFRESH_TRANSIENT_BUILD_ON_PSS and
org.apache.myfaces.REFRESH_TRANSIENT_BUILD_ON_PSS_PRESERVE_STATE, but with this
change we can open the possibility to do not require them at all and reduce
even more the state size.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira