JSP Scriptlets

Domain Hosting image
Web Hosting
Dedicated server
ssl certificate
Web Design image
Email
A Scriptlet can contain any variable, method declarations, language statements or expressions between <% and %> tags. These scriptlet codes can access any variable or beans, which are declared.

Within a scriptlet, the following things can be done:

• Variables or methods can be declared, which can be used in the JSP file.

• Expressions which are valid in the page scripting language can be used.

• Any implicit object or objects declared with a <jsp:useBean> element can be used.

• Any other statements valid as per the JSP syntax and java syntax can be used.

Any text HTML tags or JSP elements must be declared outside the scriptlets.

Scriptlets are executed at request time, when thenclient request is being processed.

JSP Syntax:<% scriptlet code%>

<html>
<title>Include</title>
<body bgcolor="Lightgreen">
<%@ page language="java"%>
<h1><I>Hello,</I>Welcome to JSP World</h1>
<%@include file="date.jsp"%>
<h3>We are coming back soon</h3>
</body>
</html>
<%!private int l=4;
public void mymethode(){
//Some Process}%>

<%

forint i=0;i<=10;i++)

{

out.println("<B>Hello "+i +"</B>");

out.println("kk "+i);

}%>



Domain Name Search

www.


Copyright (C) 2007. Web Domain design hosting. All rights reserved.