[
https://issues.apache.org/jira/browse/WICKET-2184?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Juergen Donnerstag updated WICKET-2184:
---------------------------------------
Description:
Currently we are only testing a component id not to be null. However ':' and
empty Ids are effectively invalid as well.
Component.java coiuld be modified as follows:
final void setId(final String id)
{
if (!(this instanceof Page))
{
if (Strings.isEmpty(id))
{
throw new WicketRuntimeException("Null or empty
component ID's are not allowed.");
}
if (id.indexOf(':') != -1)
{
throw new WicketRuntimeException("The component
ID must not contain ':' chars.");
}
}
this.id = id;
}
was:
Currently we are only testing a component id not to be null. However ':' and
'.' are effectively invalid chars as well. ":" is used as separator between
path component and "." is used to find properties like myComponent.Required
Component.java should be modified as follows:
final void setId(final String id)
{
if (!(this instanceof Page))
{
if (Strings.isEmpty(id))
{
throw new WicketRuntimeException("Null or empty
component id is not allowed.");
}
if ((id.indexOf('.') != -1) || (id.indexOf(':') != -1))
{
throw new WicketRuntimeException("The component
id must not contain a '.' or ':'.");
}
}
this.id = id;
}
Summary: Check component id against invalid chars ':' and empty IDs
(was: Check component id against invalid chars ':' and '.')
> Check component id against invalid chars ':' and empty IDs
> ----------------------------------------------------------
>
> Key: WICKET-2184
> URL: https://issues.apache.org/jira/browse/WICKET-2184
> Project: Wicket
> Issue Type: Improvement
> Components: wicket
> Affects Versions: 1.4-RC2
> Reporter: Juergen Donnerstag
>
> Currently we are only testing a component id not to be null. However ':' and
> empty Ids are effectively invalid as well.
> Component.java coiuld be modified as follows:
> final void setId(final String id)
> {
> if (!(this instanceof Page))
> {
> if (Strings.isEmpty(id))
> {
> throw new WicketRuntimeException("Null or empty
> component ID's are not allowed.");
> }
> if (id.indexOf(':') != -1)
> {
> throw new WicketRuntimeException("The component
> ID must not contain ':' chars.");
> }
> }
> this.id = id;
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.