• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Okay to write JSP tags in HTML?

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there anything wrong with writing JSP tags in psuedo-HTML? I've been writing tags in XHTML, but it would seem that XHTML could not be compliant with both an XHTML standard and the HTML5 standard.
 
Bartender
Posts: 1845
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by pseudo HTML?
I normally go for XHTML compliant where it is reasonable and possible.
Remember that JSP gets evaluated and produces HTML. As long as the end result of evaluating the JSP matches your end use, then I would think that you are fine.

That can mean that your JSP might not be easily run through tools like lint without errors/warnings.
 
Rob Wehrstein
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By psuedo HTML, I mean non-HTML-compliant HTML (for example: a JSP scriptlet). I thought about putting an HTML5 doctype in the JSP tag file, but it is not clear to me if this is compliant with the JSP tag specification.
 
Sheriff
Posts: 67269
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The JSP engine could care less about anything that's not JSP markup. It could be the Declaration of Independence for all it cares.

The JSP is evaluated on the server before being sent to the client. What the browser sees is the resulting HTML, which should be valid HTML.

By the way -- DON'T use scriptlets! They're obsolete by 14 years. 14 years! You should be using the JSTL and EL.
 
Bear Bibeault
Sheriff
Posts: 67269
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
P.S. Read this article for a deeper understanding of how JSP works.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!