Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Mixing JSTL and Scriplets  RSS feed

 
Scott Maclary
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it considered bad practice to mix JSTL and scriptlets? For instance the following code appears to work fine:



...but are there situations when this could NOT work?

Thanks,
Scotty
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66141
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Scott Maclary:
Is it considered bad practice to mix JSTL and scriptlets?


Very. The whole purpose of the JSTL and EL is to supplant, not support, scriplet usage. The only caveat is if you are still using JSP 1.2 with JSTL 1.0, in which case complete elimination of scriptlets is not always feasible.

As of JSP 2.0 on the other hand, scriplets should be considered deprecated.

Scriplets can cause problems in JSP 2.0 when used in the bodies of simple tags, to include tag files.

Bottom line: either use modern JSTL and EL, or use scriptlets. Anything in between is just a mess.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!