wood burning stoves 2.0*
The moose likes Struts and the fly likes Struts Input Types and Validation with W3C Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts Input Types and Validation with W3C" Watch "Struts Input Types and Validation with W3C" New topic
Author

Struts Input Types and Validation with W3C

Gezza Hall
Ranch Hand

Joined: Jan 04, 2005
Posts: 33
Hello. I'm validating the output of my pages against the W3C validator at http://validator.w3.org.

It has brought to my attention that any struts input type tags, such as html:text, do not place a closing tag on the html:

<input type="text" name="emailAddress" value="...">

...which obviously fails the validation.

This must be a common problem - what is the workaround for this please?
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
in HTML, having an <input> tag without an </input> tag is acceptable. You just have to tell the validator which version of HTML you're using.

For example, put the following as the first line of your page:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

and I expect the validator will accept the page.


Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts Input Types and Validation with W3C