Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Only Java in Jsp?

 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
Is it true that Java is the only allowed language in JSP 1.2.
What could be the reason.

I feel people who are using other languages do not want to use JSP.

Thanks in adv.
 
Shawn Bayern
Author
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Pradeep Bhat:
Hi All,
Is it true that Java is the only allowed language in JSP 1.2.
What could be the reason.

I feel people who are using other languages do not want to use JSP.

JSP technically supports scripting languages other than Java, but that support is admittedly not much more than lip service. A container could come up with a proprietary way of supporting another language, but this wouldn't be portable. And that's the answer to your question: there's no way to support anything but Java portably. Microsoft's very big on supporting multiple languages at each layer in an application, but one reason they can get away with that is that, for all intents and purposes, they don't have to worry about portability across platforms. If you want the same JSP application to be deployable on Linux, Windows, and Solaris, Java is the only reasonable language to use anyway.
Having said that, keep in mind that scirpting code, like Java, within JSP pages is being strongly discouraged by most commentators anyway. Using tag libraries -- particular JSTL -- it's very easy to avoid using Java code entirely in your pages. This makes them more maintainable and more accessible to nonprogrammers. In fact, JSTL provides a mode whereby you can explicitly disable all "scriptlets" (scripting elements, to be more precise) if you choose to do so; this way, you can enforce good hygiene across your application.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic