[
https://issues.apache.org/struts/browse/STR-2247?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Paul Benedict closed STR-2247.
------------------------------
Resolution: Duplicate
Fix Version/s: 1.4.0
Assignee: Paul Benedict (was: Struts Developers)
> XHTML mode must be configurable in struts-config.xml for the entire app, not
> on page level only
> -----------------------------------------------------------------------------------------------
>
> Key: STR-2247
> URL: https://issues.apache.org/struts/browse/STR-2247
> Project: Struts 1
> Issue Type: Improvement
> Components: Taglibs
> Affects Versions: 1.2.4
> Environment: Operating System: other
> Platform: Other
> Reporter: Firepica
> Assignee: Paul Benedict
> Priority: Minor
> Fix For: 1.4.0
>
>
> Hi, everybody.
> At this moment one can tell Struts to render tags in xhtml mode only using
> <html:html xthml=true> or <html:xhtml/> tags. This is defined on page level,
> not
> application level. So that means that if you want your entire application to
> have xhtml style output then you need to put one of these tags in EVERY jsp
> you
> have.
> I believe, that it should be allowed to specify a parameter in application
> config file (say struts-config.xml), that xtml=true and all tags on all pages
> will work in this mode.
> Of course <html> and <xtml> tags will be extended to be able to override
> application wide behaviour on page level (like: <html xthml="false"> and
> <xhtml
> xhtml="false"/>), so it's gonna be backward compatible.
> As I can see from the source, such a feature is very easy to implement: there
> is
> a method isXhtml() in TagUtils,
> /**
> * Returns true if the custom tags are in XHTML mode.
> */
> public boolean isXhtml(PageContext pageContext) {
> String xhtml =
> (String) pageContext.getAttribute(
> Globals.XHTML_KEY,
> PageContext.PAGE_SCOPE);
> return "true".equalsIgnoreCase(xhtml);
> }
> Which looks only in page scope, so it can also look in application scope,
> where
> this attribute can be placed during initialization of Struts controller
> servlet.
> I propose to add extra attribute to <controller> element in
> struts-config.xml,
> which would look like:
> <controller xhtml="true"/>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.