Java Tutorial/JSP/Application

Материал из Java эксперт
Перейти к: навигация, поиск

Set/Get Variable in Application in JSP

index.jsp



   <source lang="java">

<%

 String theSharedObject = "JSP is cool";
 application.setAttribute("message", theSharedObject);

%> <HTML>

 <HEAD>
   <TITLE>Application Object - Page 1</TITLE>
 </HEAD>
 <BODY>
This page sets data that can be retrieved by other pages in the application.

Click