Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JSP 2.0, Simple Tags, and XHTML Compliance (phew!)  RSS feed

 
Greg Werner
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am making my jsps more xhtml strict and doing "transformations" as the jsp 2.0 document calls them to make it look more like xml. I am replacing java expressions of <%= %> with <jsp:expression></jsp:expression>. I have a number of cases in my code where I have expressions as attributes for simple tags I have written. Let me give you an example:



Now I know what comment #1 is: Why mix EL and JSP notation you Greenhorn?

Answer: We have a large application which in the process of becoming all EL and using frameworks, but not there, so I need to deal with reality.

When I try to put the jsp:expression tag inside my location attribute (straight cut and paste, no marring of code), I get a missing closing quote warning instead of my old warning, apparently indicating that it is still rejected.



Is this situation, XML tag inside of XML tag forbidden under all circumstances. I would think you could put it inside of quotes or something to get around the embedded xml tags that result.

-Greg

 
Albareto McKenzie
Ranch Hand
Posts: 304
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Greg,

Some questions, are you using any IDE? Have you tried that? does location admit expressions?
 
Greg Werner
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Very fair questions, thank you for the response to my question.

I am using Eclipse 3.4.1 (our team just upgraded from 3.2.x this week). The warnings that I talk about are Eclipse warnings. To tell you the truth, I do not know if my code will or will not work when run with my application server (oc4j) with the <jsp:expression> tags. It certainly does work with the first code snippet i gave with the <%= expression tags.

Really I guess I am looking for the XHTML compliant answer, not necessarily a working answer because I already have that. Most of the 3.4.x Eclipse warnings and errors are very annoying if nothing else, but usually they point out potential problems down the road.

So in conclusion, my jsp page needs to both work and be XHTML compliant. Right now I have only achieved the first.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66203
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why on earth would it be important that your JSP source pass an XHTML compliance check when it's the generated XHTML that is sent to the browser? Who cares about the source?
 
Albareto McKenzie
Ranch Hand
Posts: 304
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was asking about the IDE because I have had "problems" (not really problems because I haven't care about them) with eclipse warning me that he don't recognize tag <div> or tag <body> but the code works perfectly.

About the other, you have to take care in the server which is the one who generetes the code :P
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!