What is JSP Scriptlet?

By: Karthik Printer Friendly Format    

Answer: JSP Scriptlet is jsp tag which is used to enclose java code in the JSP pages. Scriptlets begins with <% tag and ends with %> tag. Java code written inside scriptlet executes every time the JSP is invoked.
Example:
  <%
  //java codes
   String userName=null;
   userName=request.getParameter("userName");
   %>



Most Viewed Articles (in Interview )

What are all the different scope values for the tag?

Interview Question: What is ActionServlet?

Interview Question: What is difference between EJB 1.1 and EJB 2.0?

Interview Question: What is the difference between sessioncontext and entitycontext?

Interview Question: Is Decorator an EJB design pattern?

Interview Question: Can i map more than one table in a CMP?

Interview Question: What is abstract schema?

Interview Question: What is the difference between find and select methods in EJB?

Interview Question: Is it possible to share an HttpSession between a JSP and EJB? What happens when I change a value in the HttpSession from inside an EJB?

Question: Difference between forward and sendRedirect in JSP?

Question: What is an Expression tag in JSP?

Question: Explain the life-cycle methods in JSP?

Question: What is the directory structure of a web application?

Question: How is the MVC design pattern used in Struts framework?

Question: How would you go about analyzing performance of an application?

Latest Articles (in Interview)

Comment on this tutorial