aspose file tools*
The moose likes JSP and the fly likes Can you tell me the difference of these output streams in Jsp? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Can you tell me the difference of these output streams in Jsp?" Watch "Can you tell me the difference of these output streams in Jsp?" New topic
Author

Can you tell me the difference of these output streams in Jsp?

Alexander Sales
Ranch Hand

Joined: Feb 21, 2011
Posts: 89

whats the difference in using these different tags or scriptlets when printing Strings in jsp?
ex: String helloWorld = "Hello World";


OCPJP 6, OCEWCD Java EE 6
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3775

Difference(or the rule you MUST remember) is that you should not use scriptlets or scriptlet expressions in JSPs at all. Use EL with JSTL instead (as you've done).


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Alexander Sales
Ranch Hand

Joined: Feb 21, 2011
Posts: 89

Is it really prohibited to use scriptlets? aren't there any times that we have no other choice but to use a scriptlet?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60072
    
  65

Alexander Sales wrote:Is it really prohibited to use scriptlets? aren't there any times that we have no other choice but to use a scriptlet?

Scriptlets are never necessary, and should never be used in modern JSPs. They have been discredited for almost 10 years now and using them is simply irresponsible at this point.

If there's something that you are doing in your JSP that cannot be done with modern techniques, it's a huge red flag that you are trying to do something that should not be done in a JSP at all, but likely in the page controller.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Alexander Sales
Ranch Hand

Joined: Feb 21, 2011
Posts: 89

thanks sir bear, but it is a 'nice to have' in SCWCD right?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60072
    
  65

The SCWCD is not the real world.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can you tell me the difference of these output streams in Jsp?
 
Similar Threads
${} vs %{} vs #{}?
i dont understand the language
simplest singleton
c:forEach is not working
jstl miliseconds to Date