interview questions and answers

Java Interview Questions | JSP Interview Questions

Home interview questions JAVA interview questions JSP 
Friday, 10 February 2012
Main Menu
Home
Online Test
Contest
Search
FAQs
Contact Us
Login
Most Popular Category
JAVA

Microsoft Technologies
ASP, C#, DotNet, ...

Programming
C++, PHP, VB, ...

SAP

Testing

Web Technologies

Polls
Does personal networking help in job search?
 
IT Placement Papers interview questions JAVA interview questions JSP

This category contains JSP Interview Questions and Answers


What is JSP declaration?

PDF Print E-mail

JSP Decleratives are the JSP tag used to declare variables. Declaratives are enclosed in the <%! %> tag and ends in semi-colon. You declare variables and functions in the declaration tag and can use anywhere in the JSP. Here is the example of declaratives: <%@page contentType="text/html" %> <%! int cnt=0; private int getCount(){ //increment cnt and return the value cnt++; return cnt; } %>

Values of Cnt are:

<%=getCount()%>

13. Question: What is JSP Scriptlet? 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"); %>




Be first to comment this article

Only registered users can write comments.
Please login or register.

 
< Prev   Next >

Java Interview Questions | JSP Interview Questions

Top!
Top!
Copyright © 2008 InterviewDuniya.com All Rights Reserved.
Partner Site: Maheshwari Matrimony