Free WebSchools.com

Google


Submit ArticleForumsLive chat Webhosting Link TO Us SEO Toolsjobs & interview


HOME

Java Server Pages

JSP Introduction
JSP Syntax
JSP Expression
JSP Declaration
JSP Comments

JSP Directives
JSP Actions
JavaBeans
JSP Sessions
JSP JDBC
JSP And HTML Forms
JSP With XML

JSP Exam


JSP Expression tutorial







Basic principle of expression to use

  • Semicolon cannot be used to end an expression
  • The expression element can contain any expression that is valid according to java language specification
An expression can be complex and composed of more than one part of expression. The parts of an expression are evaluated in left-to –right order. This evaluation is performed at the run time, and thus has full access to information about the request. For example the following shows the date and time that the page requested.

Current time: <%=new java.util.Date() %>

These are certain implicit object that can be used inside an expression. These are discussed later in detail, but the ones that are frequently used are given here.
  • request , the HTTPServletRequest
  • response the HTTPServletResponse
  • out, the print Writer used to send output to the client


Here is an example

Your hostname: <%=request.getRemoteHost()%>





Inform Friend About This Site

Your Name:

Friend's Name:

Friend's Email: