public abstract String getKeyIdentifier()
public abstract int getKeyLocation()
public abstract boolean getCtrlKey()
public abstract boolean getShiftKey()
|
Tag: session
JSP: Afficher HTML en JSP
<%@ page session="false" %>
<%
out.println("out
is an ");
out.println(out.getClass().getName());
out.println(" object.");
%>
JSP: Affichage de l’en-tête du requête et les attribues de la session
// Print the request headers
map = new TreeMap();
enames = request.getHeaderNames();
while (enames.hasMoreElements()) {
String name = (String
Télécharger la bibliothèque BasicCircuits-0.91display.jar
public abstract String getKeyIdentifier()
public abstract int getKeyLocation()
public abstract boolean getCtrlKey()
public abstract boolean getShiftKey()
|
JSP: Utilisation de la classe Calendar avec un Bean
ASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitat
JSP: Modifier les Attributs de PageContext d’une page JSP
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%
synchronized (pageContext) {
Class thisClass = getClass();
// session.setAttribute("thisClass", thisClass);
pageContext.setAttribute("thisClass", thisClass, PageContext.PAGE_SCOPE);
System.out.println("Stored reference");
Class theClass = (Class) pageContext.getAttribute("thisClass", PageContext.PAGE_SCOPE);
System.out.println("The retrieved reference is " + theClass);
}
%>
The class that instantiated this JSP is .
JSP: Afficher les Propriétés du système
ellpadding="3" cellspacing="0">
<%
final String[] propNames = {
"java.awt.printerjob",
"java.class.path",
"java.class.version",
"java
JSP: Utilisation des sessions pour suivre les activités des utilisateurs
Using Sessions to Track Users
Session ID: <%=session.getId()%>
Session creation time: <%=new Date(session.getCrea
JSP: Créer et afficher les cookies
ull && name.length()>0) {
added = new Cookie(name,value);
response.addCookie(added);
}
%>
Cookie List
<
JSP: Utilisation des sessions en jsp
<%@ page errorPage="errorpage.jsp" %>
UseSession
<%
Integer count = (Integer)session.getAttribute("COUNT");
// If COUNT is not found, create it and add it to the session
if ( count == null ) {
count = new Integer(1);
session.setAttribute("COUNT", count);
}
else {
count = new Integer(count.intValue() + 1);
session.setAttribute("COUNT", count);
}
out.println("Hello you have visited this site: "
+ count + " times.");
%>
JSP: Siteweb de conversion de Celsius en Fehrenheit
>
<%
for (int c = 0; c <= 100; c += 10) {
int f = 32 + 9*c/5;
out.print("");
out.print("" + c + " ");
out.p
java
Télécharger la bibliothèque baselet_mailapi.jar
public abstract String getKeyIdentifier()
public abstract int getKeyLocation()
public abstract boolean getCtrlKey()
public abstract boolean getShiftKey()
java
JSP: Afficher l’heure Actuelle en jsp
<%--
Copyright (c) 2002 by Phil Hanna
All rights reserved.
You may study, use, modify, and distribute this
software for any purpose provided that this
copyright notice appears in all copies.
This software is provided without warranty
either expressed or implied.
--%>
<%@ page import="java.text.*,java.util.*" session="false"%>
<%!
DateFormat fmt = new SimpleDateFormat("hh:mm:ss aa");
String now = fmt.format(new Date());
%>
The time is <%= now %>
java
JSP: Réécriture des paramètre des sessions
>
<%@ page import="java.util.*" %>
<%
String nom = request.getParameter("name");
String valeur = request.getParameter("value");
if (name!=null && value!=null && name.length()>0) {
// Ajouter des paramètre à une Session JSP
session.setAttribute(nom,valeur);
}
java
JSP Session: Exemple d’ajout des produits dans un panier
SIS,
<%
cart.processRequest(request);
%>
You have the following items in your cart:
<%
String[] items = cart.getItems();
for (int i=0; i
- <% out.print(util.HTMLFilter.filter(items[i])); %>
<%
}
java