Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Error messages with (X)HTML / JSP
Error messages with (X)HTML / JSP [message #684996] Thu, 16 June 2011 15:30 Go to next message
Michael Jupe is currently offline Michael JupeFriend
Messages: 7
Registered: June 2011
Junior Member
Hey there,

(I hope I am in the right forum.)

When using Eclipse (Java EE) to create (X)HTML pages for JSP I get all sorts of problem messages. Here is a simple code of a file called index.html that is part of a dynamic web project (the file itself is located in the WebContent folder):

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "xhtml11.dtd">
<html xmlns=< ///Link to www.w3.org here, the forum does not accept links at this time///>
<head>
<title>Some title</title>
</head>
<body>
	<form action="Test.jsp" id="form_1" method="post">
		Input 1: <input type="text" name="input_1" /><br />
		Input 2: <input type="text" name="input_2" /><br />
		<input type="submit" name="Send" value="Send" />
	</form>
</body>
</html>


The messages I get are
Invalid location of tag (input).
Invalid location of tag (br).
Invalid text string (Input 1:)
Invalid text string (Input 2:)

I'de be grateful if somebody could herlp me with these confusing messages. In other (HTML) editors I don't get them.

Thanks a lot,
Michael
Re: Error messages with (X)HTML / JSP [message #685026 is a reply to message #684996] Thu, 16 June 2011 17:15 Go to previous messageGo to next message
Nick Sandonato is currently offline Nick SandonatoFriend
Messages: 126
Registered: July 2009
Senior Member
Hi Michael,

The warnings you see are generated when our validator comes across content that it doesn't expect according to the content model for a tag.

For example, with XHTML 1.1, there shouldn't be any character data as a direct child of <form>. Furthermore, the <input> tag is also an invalid descendant. To conform, the content for <form> must be one of the valid child tags; then, you can put your text and <input> tags in that. If you invoke Content Assist (Ctrl+Space), it will give you the valid child tags.

As a reference, you can use http://validator.w3.org/check which also identifies similar problems with the example markup.
Re: Error messages with (X)HTML / JSP [message #685040 is a reply to message #685026] Thu, 16 June 2011 17:39 Go to previous message
Michael Jupe is currently offline Michael JupeFriend
Messages: 7
Registered: June 2011
Junior Member
Hey Nick,

Thanks a lot for your detailed answer. I thought it had to do with XHTML, but couldn't find the reason. This helps a lot!

Thanks again!
Michael
Previous Topic:Publish Exploded WAR
Next Topic:Unable to create a web service client
Goto Forum:
  


Current Time: Fri Apr 26 20:48:39 GMT 2024

Powered by FUDForum. Page generated in 0.03205 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top