Discussions

Web tier: servlets, JSP, Web frameworks: IE, EL & XHTML

  1. IE, EL & XHTML (3 messages)

    I've got a problem with Internet Explorer's non-conformance with XHTML.

    What I'm trying to do is something like this:

    <input type="text" disabled="${locked ? 'disabled' : ''}"/>


    This example is based on the fact that there is a bean in scope with the property 'locked' and (as a good bean) has getters & setters (in this case isLocked() as it is a boolean).

    The idea is that the EL expression will generate HTML as

    <input type="text" disabled="disabled"/>


    OR

    <input type="text" disabled=""/>



    Now, according to the XHTML dtd, this syntax should be valid. HOWEVER, Internet Explorer doesn't seem to recognise the difference between the two pieces of HTML and takes the existence of the disabled attribute as a signal to disable the field (irrespective of the value of the attribute).

    I can't use a nested <c:out /> tag because the JSP is written as a JSP Document (i.e. in XML format). Similarly I can't drop an expression in the middle of a tag without it being the value for an attribute (i.e. I can't do <input type="text" ${[EL here}/>)

    How can I resolve this issue so that I can produces an XHTML document that also works with Internet Explorer?

    Threaded Messages (3)

  2. IE, EL &amp; XHTML[ Go to top ]

    Might not be proper XHTML, but how bout outputting

    <input type="text disabled>

    where the jsp is something like..

    <input type="text" ${locked? disabled}/>
  3. IE, EL &amp; XHTML[ Go to top ]

    You may need a getter of getLocked() that performs the same as isLocked()
  4. IE, EL &amp;amp; XHTML[ Go to top ]

    EL will understand the isLocked() (because it's a Java Bean accessor with a boolean return value).

    Everything from the JSP side is functioning as expected...it's really Internet Explorer that's the problem.....!!!!