Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

red squiggly lines under scriptlets in Eclipse

 
Chris Disilva
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I'm just learning to write java. My background is front-end dev. I'm practicising creating a .jsp page. In Eclipse, there are red squiggly lines underneath this code:



When I click the red square in the "Error" block (on the right side of the code editor), I get this explanation:

Multiple annotations found at this line:
- Processing instructions not closed
- End tag of element <p>


Here is the full code:



Would someone tell me why I am getting the squiggly lines and how to fix? I have closed the tags and the code runs in the browser, but there must be something wrong, right?

Thanks!
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64712
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please be sure to ask IDE questions in the IEDs forum. I have moved this post there for you.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64712
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are just starting out you should know right off the bat that using scriptlets as you have in that code is something that's 10 years out of date. You must be using a really old tutorial or book.

Modern JSP uses the JSTL and EL, not Java code in the page.

 
Chris Disilva
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The tutorial is dated 12/14/11 since you are dying to know.
 
Chris Disilva
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone answer the question without the put down of the tutorial I'm using?

Does anyone know what does the red squiggly lines mean?

The Eclipse IDE version I am using is the newest version Eclipse IDE for Java Developers

Thanks!
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18098
50
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, we don't care HOW recent the tutorial is. Scriptlets infringe on the Separation of Concerns afforded under Model/View/Controller (MVC). In more practical terms, they're royal pain in the rear to debug and maintain and they make reading the template HTML harder as well. We've moved beyond using JSPs as though they were ASPs these days. This kind of stuff works for quick-and-dirty, but J2EE is an expensive platform to set up and run, and if fast, cheap and sloppy is the driving criteria, I recommend something like PHP, instead. Saves time and effort all the way around. J2EE is for when security, scalability and rigour are worth the extra cost.

I cannot actually see anything wrong with your example, but scriptlets are also a strain on the IDE's parsers as the lexical scanner is having to pop back and forth between 2 wildly different syntax forms: HTML and Java code. On top of that, straight HTML isn't an entirely sane notation to begin with (which is why xhtml was invented). Top it all off with the fact that the Eclipse XML parsers never seem to be 100% trustworthy themselves and the net effect may be that you're simply getting a bogus error message.
 
Atul Chavan
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Select all of your code, press backspace and CTRL+Z to roll back the changes. It works.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic