• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Struts input tags and xhtml

 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using Struts 1.1 final, and am having trouble getting valid xhtml to be rendered for the various input taglibs.
All of my pages use the following Struts html tag:

This Struts html tag does properly render the html tag markup itself, complete with xmlns, lang and xml:lang attributes.
However, the input tags inside these pages are not rendered with the required closing tag:

Results in this:

Instead of the required:

Note the closing end tag as required by xhtml.
I am using tiles, and the outer layout for all pages is where the Struts html tag resides - I'm not sure if this is somehow causing embedded tiles with input tags to fail to recognize that they are inside of an xhtml page.
Any posts about this problem I have seen state that Struts 1.1 only requires the 'xhtml="true"' attribute on the html tag in order to solve this, but this has not been my experience.
 
Ken Pelletier
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As is often the case, I discovered the answer only after posting.
So, for those who bump into a similar problem with xhtml rendering by Struts, it is indeed the case that included pages do NOT inherit the rendering style of their including page.
[CODE]<html:html xhtml="true">...</html:html>[CODE]
... will only affect the rendering of the outer-most page - the page in which it appears.
Each included fragment that itself uses Struts tags to render markup will have to indicate that they are to be rendered as xhtml.
If you use any method ( Tiles, <jsp:include../> ... ) to include a jsp page that also uses Struts tags, that included page must have the empty xhtml tag in it:
[CODE] <html:xhtml/> [CODE]
 
I'm so happy! And I wish to make this tiny ad happy too:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic