File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts Input Types and Validation with W3C

 
Gezza Hall
Ranch Hand
Posts: 33
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic