CodesJava

Easy learning with example program codes

Session attribute of JSP page directive


This attribute checks whether JSP page is in a particular HTTP session or not. It can have true or false value. Default value is true.

Syntax: <%@ page session=”value”%>

Example:

welcome.jsp

<%@ page session="true" %> 
 
<html>
	<head>
		<title>session page directive example</title>
	</head>
	<body> 
		<h3>Hello this is a session page directive example.</h3> 
		<%
			out.print("Session id:" + session.getId());
		%>
	</body>
</html>

web.xml

<web-app>
 
  <welcome-file-list>
          <welcome-file>welcome.jsp</welcome-file>
  </welcome-file-list>	
 
</web-app>

Output:

jsp example 7
 
Download this example.
 
Next Topic: buffer attribute in JSP page directive with example.
Previous Topic: Session attribute of JSP page directive with example.

Related Topics:

import attribute of JSP page directive with example.
Session attribute of JSP page directive with example.
buffer attribute in JSP page directive with example.
autoFlush attribute in JSP page directive with example.
contentType attribute in JSP page directive with example.
isErrorPage and errorPage attribute in JSP page directive with example.
isThreadSafe attribute in JSP page directive with example.
language attribute in JSP page directive with example.
info attribute in JSP page directive with example.
JSP include directive with example.
JSP taglib directive with example.

 

Sign Up/ Sign In
Ask a Question


Industrial Training

We offers Placement Oriented Training on Java, Spring, JSF, Hibernate, PHP, AngularJS, Angular 4, PLSQL, Oracle BI Publisher etc. We also provides Online training, please mail us at hr@codesjava.com.

Development

We also provides the Development services for Website Development , Java Development, PHP Development, Android App Development etc. You can contact us on hr@codesjava.com.

Copyright © 2018 CodesJava DMCA.com Protection Status SiteMap Reference: Java Wiki