jspÖ®session
session¾ÍÊÇÒ»¸öÈ«¾Ö±äÁ¿£¬ÊÇä¯ÀÀÆ÷Ïß³ÌÔÚ·þÎñÆ÷¶ËµÄ´úÀí¡£web·þÎñ³ÌÐòÖ»Òª´ò¿ª£¬session¾Í»á´æÔÚ£¬µ±ÄãµÚÒ»´Î·ÃÎÊʱ£¬session»á×Ô¶¯ÎªÄã·ÖÅäÒ»¸ösession ID£¬ËùÒÔsessionΪн¨Á¢µÄ£¬ËùÒÔsession.isNew()Ϊtrue¡£µ±ÄãË¢ÐÂÒ³Ãæʱ£¬Õâ¸ösession IDÒ»Ö±´æÔÚ(session.getId()²»±ä)£¬²»»áÏûʧ£¬ËùÒÔsession.isNew()Ϊfalse¡£³ý·ÇÄã¹Ø±ÕÄãÒª·ÃÎʵÄwebÕ¾µã£¬»òÔò¹Ø±Õsession(session.invalidate())£¬Õâ¸ösession ID²Å»áÏûʧ(session.getId()±äÁË),isNew()Ϊtrue¡£
Á½¸ö·½·¨ session.isNew() ÅжÏÊÇ·ñÊÇÒ»¸öÐÂsession
session.getId() µÃµ½Õâ¸ösession id
µ±¹Ø±ÕËùÓеÄä¯ÀÀÆ÷£¬ÔÙÖØеǼµÄʱºòsession.isNew()²Å»áÊÇtrue
µ±Ã¿´Î¶¼Ð´ò¿ªÒ»¸öä¯ÀÀÆ÷Óò»Í¬µÄÓû§µÇ¼£¬session.isNew() ÊÇΪfalse¡£session.getId()ÊDz»±äµÄ,¡£
¼´£ºsession idÏ൱ÊÇ´ò¿ªÒ»¸öä¯ÀÀÆ÷½ø³Ì(²»ÊÇÏß³Ì)ʱweb·þÎñÆ÷Ϊ±¾ä¯ÀÀÆ÷½ø³Ì·ÖÅäµÄid
³£Ó÷½·¨£º
long create_time = session.getCreationTime(); //session´´½¨Ê±¼ä
long access_time = session.getLastAccessedTime();//session×îºó·ÃÎÊʱ¼ä
//´òÓ¡sessionÀïÃæµÄattributeÖµ
Enumeration elements = session.getAttributeNames();
while (elements.hasMoreElements()) {
String id = (String)elements.nextElement();
}
response.setHeader("Refresh","5;url=/session_filter_listener/index.jsp");//ÿ5ÃëÖÓˢУ¬È»ºó¶¨Î»µ½index.jsp
Ïà¹ØÎĵµ£º
Jsp±àÂë¹æ·¶
1.1 Îļþºó׺(File Suffixes)
ÎļþÀà±ð ¡¡¡¡ ¡¡¡¡¡¡¡¡¡¡Îļþºó׺
--------------------------------------
JavaÔ´Îļþ¡¡¡¡¡¡¡¡¡¡¡¡¡¡.java
Java×Ö½ÚÂëÎļþ¡¡¡¡¡¡¡¡¡¡.class
¶¯Ì¬Ò³Ãæ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡.jsp
¾²Ì¬Ò³Ãæ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡.html
½Å±¾Îļþ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡.js
1.2 ³£ÓÃÎļþÃû(Common ......
jspÖеÚÒ»¾ä£º
<%@ page language="java" import="java.sql.*,java.util.*," contentType="text/HTML;charset=gb2312" pageEncoding="gb2312"%>
htmlÖмÓÉÏ
<meta http-equiv="Content-Type" content="text/html;charset=gb2312" />
ͨ³£ÕâÑù¾ÍûÓÐÎÊÌâÁË¡£ .
ÔÙÕߣº µ¼ÈëjsʱºòÉ ......
1.No getter method for property name problem(struts)
ÓÐÒ»ÖÖ¿ÉÄÜÊÇBeanûÓÐдÏàÓ¦µÄget·½·¨£¬ÀýÈç±äÁ¿userNameµÄget·½·¨ÊÇgetUserName£»
»¹ÓоÍÊÇÕâ¸öBeanΪ¿Õ£»
2.
MyEclipseµÄ×Ô¶¯Ìí¼ÓstrutsºÍhibernate¹¦Äܲ»ÄÜ·µ»Ø£¬Çë×¢Ò⣡
ËùÒÔÎÒÏÈʹÓÃMyEclipseµ¼ÈëstrutsºÍhibernate£¬È»ºó½«ËüÃǵÄjarµ¼Èëµ½ÁíÍâÒ»¸öн¨µÄ ......
1¡¢ÈçºÎ»ìºÏʹÓÃJspºÍSSI #include?
ÔÚJSPÖпÉÒÔʹÓÃÈçÏ·½Ê½°üº¬´¿HTML£º
µ«ÊÇÈç¹ûdata.incÖаüº¬JSP CODE £¬ÎÒÃÇ¿ÉÒÔʹÓãº
2¡¢ÈçºÎÖ´ÐÐÒ»¸öḬ̈߳²È«µÄJSP?
Ö»ÐèÔö¼ÓÈçÏÂÖ¸Áî
3¡¢JSPÈçºÎ´¦ÀíHTML FORMÖеÄÊý¾Ý?
ͨ¹ýÄÚÖõÄrequest¶ÔÏó¼´¿É£¬ÈçÏ£º
String item = request.getParameter("item");
int howM ......
ÔÚsql2000Öд´½¨´æ´¢¹ý³Ì£º
--ÇóÁ½ÊýÖ®ºÍ
create proc up_sum @a int ,@b int ,@result int output
as
select @result= @a+@b
µ÷Ó÷½·¨£º
...
CallableStatement cstmt=con.prepareCall("exec up_sum ?,?,?");
cstmt.registerOutParameter(3,java.sql.Types.INTEGER);
&nb ......