Subscribe

RSS Feed (xml)

Powered By

Skin Design:
Free Blogger Skins

Powered by Blogger

Monday, December 10, 2007

java code for Variable scope: page, session and application

//File: index.jsp
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>


scope="request" />

scope="session" />

scope="application" />



Scope Example



Main File: index.jsp

































Scoped Variable Current Value

Page Scope

(scopeVarPage)
 


Request Scope

(scopeVarRequest)
 


Session Scope

(scopeVarSession)
 


Application Scope

(applicationVarPage)
 

















[Click Here to View: linked.jsp]



//////////////////////////////////////////////////////////////////////////////////////////
//File: linked.jsp
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>


Scope Example



Linked File: linked.jsp

































Scoped Variable Current Value

Page Scope

(scopeVarPage)
 


Request Scope

(scopeVarRequest)
 


Session Scope

(scopeVarSession)
 


Application Scope

(applicationVarPage)
 





//////////////////////////////////////////////////////////////////////////////////////////
//File: included.jsp
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>































Scoped Variable Current Value

Page Scope

(scopeVarPage)
 


Request Scope

(scopeVarRequest)
 


Session Scope

(scopeVarSession)
 


Application Scope

(applicationVarPage)
 

No comments: