struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Rush <michaelr...@gmail.com>
Subject html:form / styleId in xhtml mode
Date Tue, 01 Aug 2006 22:54:34 GMT
I was just looking into upgrading my app from 1.2.9 to 1.3.4 and have  
run into a snag:

2006-08-01 15:33:49,911 (ERROR) InsertTag.doEndTag - ServletException  
in '/pages/site/entry.jsp': Cannot specify "styleId" when in XHTML  
mode as the HTML "id" attribute is already used to store the bean name
javax.servlet.ServletException: Cannot specify "styleId" when in  
XHTML mode as the HTML "id" attribute is already used to store the  
bean name

FormTag dictates that the styleId attribute cannot be set in the  
html:form tag when using xhtml mode:

    protected void renderName(StringBuffer results)
             throws JspException {
         if (this.isXhtml()) {
             if (getStyleId() == null) {
                 renderAttribute(results, "id", beanName);
             } else {
                 throw new JspException(messages.getMessage 
("formTag.ignoredId"));
             }
         } else {
             renderAttribute(results, "name", beanName);
             renderAttribute(results, "id", getStyleId());
         }
     }

The question is, why?

Couldn't it just as easily be done as the following?

         if (this.isXhtml()) {
             if (getStyleId() == null) {
                 renderAttribute(results, "id", beanName);
             } else {
                 renderAttribute(results, "id", getStyleId());
             }
         }

We're using quite a bit of AJAX in our application and referring to  
document elements by id quite regularly, not to mention that  
stylesheets reference specific ids as well (i.e. all of our forms  
have a styleId attribute). Going through and renaming all of the ids  
of the forms doesn't seem very attractive. Can someone verify that  
it's necessary?

Thanks,
Michael



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message