aspose file tools*
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 EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts Input Types and Validation with W3C" Watch "Struts Input Types and Validation with W3C" New topic

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

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.

Consultant, Sima Solutions
I agree. Here's the link:
subject: Struts Input Types and Validation with W3C
Similar Threads
Validate HTML
W3C Validator
An empty Page is displayed at start
Need XHTML validator.
Search HTML 4.1 Transcoding Parser