avoid rendering invalid ids (SPR-6840)

This commit is contained in:
Juergen Hoeller
2010-02-15 13:45:47 +00:00
parent e8a4ddd3e0
commit a6af91f7b2
2 changed files with 38 additions and 10 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2008 the original author or authors.
* Copyright 2002-2010 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,7 +17,6 @@
package org.springframework.web.servlet.tags.form;
import java.beans.PropertyEditor;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.PageContext;
@@ -145,7 +144,7 @@ public abstract class AbstractDataBoundFormElementTag extends AbstractFormTag im
* deleting invalid characters (such as "[" or "]").
*/
protected String autogenerateId() throws JspException {
return StringUtils.deleteAny(getName(), "[]");
return getName();
}
/**
@@ -158,7 +157,7 @@ public abstract class AbstractDataBoundFormElementTag extends AbstractFormTag im
* @return the value for the HTML '<code>name</code>' attribute
*/
protected String getName() throws JspException {
return getPropertyPath();
return StringUtils.deleteAny(getPropertyPath(), "[]");
}
/**