2Äêjava¹ºÎï³µ·ÖÎö
Ò».µã»÷ͼÊ飬չʾ¸ÃÊéµÄÏêϸÐÅÏ¢
µã»÷ͼÊé→booksÒ³Ãæ→ͨ¹ýurlÖØÐ´displayBook.jsp?isbn=¸ÃÊé±àºÅ →´«ÈëdisplayBooksÒ³Ãæ→
<c:set var="isbn" value="${param.isbn}"></c:set>
<c:forEach var="currentBook" items="${sessionScope.bookTitles}">
<c:if test="${isbn==currentBook.ISBN}">
<c:set var="bookToAdd" value="${currentBook}" scope="session" />
</c:if>
</c:forEach>
→ʹÓñêÇ©set½ÓÊÜparam±¾Ò³Ãæ´«ÈëµÄisbnÖµ£¬±äÁ¿ÃûΪisbn£¬ÓÃÀ´±£´æurlÖØÐ´µÄisbn¡£
→Ñ»·ÅжÏsession¼¯ºÏÖеÄlist¶ÔÏ󣬱éÀúÅжÏisbnÊÇ·ñµÈÓÚcurrentBooks.isbn£¬Èç¹û´æÔÚÔòÓÃset±êÇ©
¸³Öµ±£´æµ½sessionÖÐlist¼¯ºÏ¶ÔÏó→±éÀúÒ³ÃæÏÔʾ¸ÃÊéµÄÏêϸÐÅÏ¢→bookToAdd.title.....
¶þ.¹ºÎï³µ²Ù×÷
1.´´½¨Ò»¸ö´æ·Å¹ºÎï³µÐÅÏ¢µÄÀàCartItemBean
CartItemBeanÊôÐÔ:
BookBean book¶ÔÏó //¹ºÎï³µ´æ·ÅÊé¼®ÐÅÏ¢
int quantity //´æ·ÅÊé¼®µÄÊýÁ¿¸öÊý
³õʼ»¯ÔÚ¹¹Ô캯ÊýÀï
·½·¨£¨£©
getBook(£©»ñÈ¡book¶ÔÏó
getquantity£¨£©»ñÈ¡quantityÊýÁ¿
2.Servlet¿ØÖÆ
HttpSession session=requst.getSession(false);»ñÈ¡µ±Ç°session»á»°£¬Èç¹û´æÔÚÔòʹÓõ±Ç°£¬²»´æÔÚÔò·µ»ØÎª¿Õ¡£
if£¨ÅжÏsessionÊÇ·ñΪ¿Õ£©
Èç¹ûΪ¿ÕÔòÌø×ªµ½books¡£jspÒ³Ãæ
Èç¹û´æÔÚsession»á»°
»ñÈ¡µ±Ç°session¶ÔÏó bookBean book=(BookBean)session.get(book)
ÔÙ»ñÈ¡map¹ºÎï³µ¼¯ºÏ¶ÔÏó map cart=(map)session.get(cart)
ÅжÏÊÇ·ñΪ¿Õ£¬Èç¹ûΪ¿Õ¾Í´´½¨²¢±£´æµ½sessionÖС£
²»Îª¿ÕÔò:
Åжϼ¯ºÏÀïÊÇ·ñÔÚ¹ºÎï³µÖÐ
¹ºÎï³µÀà ¶ÔÏó=£¨ÀàÐÍ£©cart.get(map¼ü--book.getIsbn)--
Map¼¯ºÏ--key-isbn
--value-book
Èý.ÏÔʾ¹ºÎï³µÐÅÏ¢
Ïà¹ØÎĵµ£º
javaÖеÄʼþ»úÖÆµÄ²ÎÓëÕßÓÐ3ÖÖ½ÇÉ«£º
1.event object£º¾ÍÊÇʼþ²úÉúʱ¾ßÌåµÄ“ʼþ”£¬ÓÃÓÚlistenerµÄÏàÓ¦µÄ·½·¨Ö®ÖУ¬×÷Ϊ²ÎÊý£¬Ò»°ã´æÔÚÓëlisternerµÄ·½·¨Ö®ÖÐ
2.event source£º¾ßÌåµÄ½ÓÊÜʼþµÄʵÌ壬±ÈÈç˵£¬Äãµã»÷Ò»¸öbutton£¬ÄÇôbutton¾ÍÊÇevent source£¬ÕâÑùÄã±ØÐëʹbutton¶ÔijЩʼþ½øÐÐÏàÓ¦£¬Äã¾ÍÐè ......
½üÀ´ÔÚ×öJAVAʱÓõ½ÎļþµÄѹËõÓë½âѹ,ÆäÖÐÅöµ½Á˸öÎÊÌâ:ÏÈÓÃJAVA´úÂë´ò°üºÃµÄJARÎļþ¾¹ýC#µÄzlib´¦Àíºó,¾¹È»²»ÄÜÐÞ¸Ä!
ÍøÉÏÕÒÁ˺ÃЩ´úÂë¶¼²»¿ÉÐÐ,JAVA´´½¨µÄJAR°üÔÚÐ޸ĵÄʱºò¿ÉÒÔ·¢ÏÖ¿ªÊ¼Óиö·¾¶·û'/'»ò'\',ËäÈ»ÔÚ´Ë¿ÉÒÔÐÞ¸ÄJARÎļþ,µ«ÊÇ×ܾõµÃÒþ»¼³öÔÚÕâ,ºóÀ´µÄÊÂÊ ......
¡¾ÉùÃ÷¡¿×ªÌûµØÖ· £º http://tech.ddvip.com/2009-04/1239788309115180.html
MailSenderInfo .java :
package com.util.mail;
import java.util.Properties;
/**
* @author AllanKing
* @date 2009-11-12
*/
public class MailSenderInfo {
// ·¢ËÍÓʼþµÄ·þÎñÆ÷µÄIPºÍ¶Ë¿Ú
private String mailServerHost;
......
create PROCEDURE pagelist
@tablename nvarchar(50),
@fieldname nvarchar(50)='*',
@pagesize int output,--ÿҳÏÔʾ¼Ç¼ÌõÊý
@currentpage int output,--µÚ¼¸Ò³
@orderid nvarchar(50),--Ö÷¼üÅÅÐò
@sort int,--ÅÅÐò·½Ê½£¬1±íʾÉýÐò£¬0±íʾ½µÐòÅÅÁÐ
......