File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes Removing scriptlets from a JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSP
Reply locked New topic
Author

Removing scriptlets from a JSP

Yogesh Gandhi
Ranch Hand

Joined: Dec 05, 2008
Posts: 125
I have read on internet that scriplets should not only be avoided, but any JSP should rather contain ABSOLUTELY NO JAVA CODE...

Is it really possible that every possible JSP that can be written with scriplet can also be written WITHOUT IT?

Lets say for Example

I have the following scriptlet

I am setting Header in response.

In Header, I am setting Pragma to no-cache and Cache-Control to no-cache

All this was being done in a scriplet..

Is there any way this can be done without it?

Also, i would be happy to know about a page, where in all the mappings from scriplet to JSTL are given, which can help me remove every possible scriplet in any JSP page.

I would like to learn the best practices and make it a habit



Bear Bibeault
Author and opinionated walrus
Marshal

Joined: Jan 10, 2002
Posts: 50693

Please continue any discussion in your original post on this topic.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
 
IntelliJ Java IDE
 
subject: Removing scriptlets from a JSP
 
Threads others viewed
How to control Caching in JBoss
Cache Control
Updating bean object through servlet
page redirection
Question: How do you send a JSP page as compressed GZIP encoding?
developer file tools