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
-
INTRODUCTION TO 'C': C is a programming language developed at AT & T's Bell laboratories of USA in 1972.it was designed by d...
-
ARRAYS: An array is a group of related data items that share a common name.For instance,we can define an array name salary to represent a se...
-
Learning about Parameters Parameters are variables that being passed to a Sub. Look at the first line of the Command Button's Click even...
-
In this section we will explain you about JSP Action tags and in the next section we will explain the uses of these tags with examples. We w...
-
A JSP declaration lets you define methods or fields that get inserted into the main body of the servlet class (outside of the service method...
-
STANDARD LIBRARY STRING FUNCTIONS: 1)strlen() 2)strcpy() 3)strcat() 4)strcmp() 1)strlen(): which tells about the length of the string means ...
-
The SQL DISTINCT clause is used together with the SQL SELECT keyword, to return a dataset with unique entries for certain database table col...
-
JSP pages are high level extension of servlet and it enable the developers to embed java code in html pages. JSP files are finally compiled ...
-
The SQL SELECT INTO statement is used to select data from a SQL database table and to insert it to a different table at the same time. The g...
-
STRINGS: The way a group of integers can be stored in an integer array, similarly a group of characters can be stored in a character array. ...
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.