What is the difference between JSP expression language and scriptlets?

What is the difference between JSP expression language and scriptlets?

View Answers

September 24, 2008 at 12:37 PM

Hi friend,

Expressions :
The results of evaluating the expression are converted to a string and directly included within the output page.
They are used to display simple values of variables or return values by invoking a bean's getter methods.
They begin within <%= ... %> tags and do not include semicolons:

Scriptlet can contain any number of language statements, variable or method declarations,or expressions that are valid in the page scripting language.
In scriplets declare variables or methods to use later in the file, write expressions valid in the page scripting language,
implicit objects or any object declared.


Scriptlets are used to write the code in any language but that language is mentioned in page language attribute.

ex:<% System.out.println("Hello World "); %>

expession are used to display the simple values and returning values.

ex:

<%! public String getName(){

return "Hello World";

} %>

< %=getName(); %>

For read more information :
http://www.roseindia.net/jsp/

Thanks









Related Tutorials/Questions & Answers:
What is the difference between JSP expression language and scriptlets? - JSP-Servlet
What is the difference between JSF, Servlet and JSP?
Advertisements
What is the difference between the >> and >>> operators?
Difference between JSP and Servlets
what is the difference between extends and implements
what is the difference between extends and implements
difference between <%@ include ...> and <jsp:include>
what is difference between jdk1.5 and jdk1.6 - JSP-Interview Questions
What is the difference between $message and $$message?
what is the Difference between weblogic and jboss?
what is the difference between pop and oop
What is the difference between hibernate and spring
What is the difference between PHP4 and PHP5?
What is difference between a PROCEDURE & FUNCTION ?
What is the difference between a constructor and a method?
What is difference between the java and javascript?
What is difference between the java and javascript?
What is the difference between a JDK and a JVM?
What is difference between Path and Classpath?
What is difference between TRUNCATE & DELETE
What is the difference between JPA and Hibernate?
What is the difference between ereg_replace() and eregi_replace()?
What is the difference between the functions unlink and unset?
What are the difference between abstract class and interface?
What’s the difference between include and require?
what is the difference between distributed application and web application?
What’s the difference between load() and get()?
What is difference between singleton and prototype bean?
what is difference between objectan primitive? - Java Beginners
what is the difference between productList==null and productList.size()==0
What is the difference between the Boolean & operator and the && operator?
What are difference between Bean Factory and Application Context ?
Difference Between Servlet and JSP
what is the difference between the eclipse and myeclipse - IDE Questions
What is the difference between component and tag in JSF?
What is the difference between a break statement and a continue statement?
What is the difference between IN and BETWEEN, that are used inside a WHERE clause?
What is the difference between GET and POST method?
What is the difference between EJB 3.0 and JPA - Framework
What is the difference between UNION and UNION ALL in SQL?
What is difference between UNIX Hosting and Window Hosting?
What is difference between Core Java and Advanced Java?
What is difference between Core Java and Advanced Java?
What is the difference between a HAVING CLAUSE and a WHERE CLAUSE?
About JSP Expression Language - JSP-Servlet
What is the difference between a data analyst and a data scientist?
What is difference between data analyst and data scientist?
what is the difference between frontcontroller and actionservlet? - Struts
What is the difference between an if statement and a switch statement?
What is the difference between Big Data and Hadoop?

Ads