Syntax of JSP Scriptles are:
<%
//java codes
%>
JSP Scriptlets begins with <% and ends %> .We can embed any amount of java code in the JSP Scriptlets. JSP Engine places these code in the _jspService() method. Variables available to the JSP Scriptlets are:
* request:
request represents the clients request and is a subclass of HttpServletRequest. Use this variable to retrieve the data submitted along the request.
Example:
<%
//java codes
String userName=null;
userName=request.getParameter("userName");
%>
* response:
response is subclass of HttpServletResponse.
* session:
session represents the HTTP session object associated with the request.
* out:
out is an object of output stream and is used to send any output to the client.
Other variable available to the scriptlets are pageContext, application,config and exception.
INTRODUCTION TO JSP EXPRESSIONS
Syntax of JSP Expressions are:
<%="Any thing" %>
JSP Expressions start with
Syntax of JSP Scriptles are with <%= and ends with %>. Between these this you can put anything and that will converted to the String and that will be displayed.
Example:
<%="Hello World!" %>
Above code will display 'Hello World!'.
Popular Posts
-
Learning about Events (Continue) Lets program the Form_Load event. "MsgBox" is Visual Basic command that launch a message box. for...
-
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE>Using JavaServer Pages...
-
Dot Net Publish at Scribd or explore others: Presentations & Slid ...
-
Adding Controls to the Form There are many controls you can use with your program: Buttons, Text Boxes, Pictures, Scroll Bars and more. You ...
-
Classes (II) Overloading operators C++ incorporates the option to use standard operators to perform operations with classes in addition to w...
-
Changing the button's Properties Now you have a button on your form. You can change its location by dragging it, and change its size by ...
-
FEATURE C C++ JAVA Paradigms Procedural Procedural, OOP, Generic Programming OOP, Generic Programming (from Java 5) Form of Compiled Sour...
-
SQL Server Express is a free, easy to use, redistributable version of SQL Server 2005 designed for building simple data-driven applications....
-
Learning about Events Visual Basic is "Event Driven" language. What does it mean? Everything that happening, launch an event. You...
-
Simple Binding Data Binding Data Binding is binding controls to data from the database. With data binding we can bind a control to a partic...
Very informative, keep posting such good articles, it really helps to know about things.
ReplyDeleteI am extremely impressed along with your writing abilities and also with the format in your blog.
ReplyDeleteStay up to the excellent high quality writing, it's rare to find a nice weblog like this one these
days.