jsp Ò³Ãæ³öÏÖÂÒÂë
´Ó html Ò³Ã渴ÖƵ½ jsp Ò³Ãæ³öÏÖÂÒÂ룺
½« html µÄ <?xml version="1.0" encoding="UTF-8"?> ¸ÄΪ jsp µÄ
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> ¼´¿É½â¾öÎÊÌâ¡£
Ïà¹ØÎĵµ£º
session¾ÍÊÇÒ»¸öÈ«¾Ö±äÁ¿£¬ÊÇä¯ÀÀÆ÷Ïß³ÌÔÚ·þÎñÆ÷¶ËµÄ´úÀí¡£web·þÎñ³ÌÐòÖ»Òª´ò¿ª£¬session¾Í»á´æÔÚ£¬µ±ÄãµÚÒ»´Î·ÃÎÊʱ£¬session»á×Ô¶¯ÎªÄã·ÖÅäÒ»¸ösession ID£¬ËùÒÔsessionΪн¨Á¢µÄ£¬ËùÒÔsession.isNew()Ϊtrue¡£µ±ÄãË¢ÐÂÒ³Ãæʱ£¬Õâ¸ösession IDÒ»Ö±´æÔÚ(session.getId()²»±ä)£¬²»»áÏûʧ£¬ËùÒÔsession.isNew()Ϊfalse¡£³ý· ......
Ò»¡¢Expression Language
EL±í´ïʽÓÃÓÚ»ñÈ¡²¢ÏÔʾҳÃæÊý¾Ý£¬²¢Ìæ»»JSPÒ³ÃæÖеĽű¾±í´ïʽ¡£ËüÊÇJSP 2.0¹æ·¶ÖеÄÒ»Ãż¼Êõ ¡£Òò´Ë£¬ÈôÏëÕýÈ·½âÎöEL±í´ïʽ£¬ÐèʹÓÃÖ§³ÖServlet2.4/JSP2.0¼¼ÊõµÄWEB·þÎñÆ÷¡£
1¡¢ EL±í´ïʽÒþʽ¶ÔÏó
Òþº¬¶ÔÏóÃû³Æ
Ãè Êö
pageContext
¶ÔÓ¦ÓÚJSPÒ ......
jspÒ³Ãæµ÷Óà <link type="text/css" rel="stylesheet" href="css/style.css"/>Ñùʽ±í
ÆäËûÑùʽ¶¼¿ÉÒÔÔÙÒ³ÃæÕý³£ÏÔʾ
.button-qingchu{background:url(images/qingchu.jpg); width:70px; height:30px; border:0px;} ÏñÕâÑùµÄ±³¾°Í¼Æ¬Ñùʽ¾ÍÏÔʾ²»³öͼƬÊÇʲôÎÊÌ⣡ Myeclipse 6.5
ÔÚhtmlÖж¼¿ÉÒÔÏÔʾ ÔÚjspÖÐÏÔʾ ......
ÏÖÔÚÖ÷Á÷µÄÍøÕ¾¿ª·¢ÓïÑÔÎÞÍâºõasp¡¢php¡¢asp.net¡¢jspµÈ¡£
ÍøÒ³´Ó¿ªÊ¼¼òµ¥µÄhmtlµ½¸´ÔӵķþÎñÓïÑÔ£¬×ß¹ýÁË10¶à¸öÄêÍ·£¬¸÷ÖÖ¼¼Êõ²ã³ö²»Çµ¥¸öµÄÖ÷Á÷¼¼ÊõÒ²ÔÚ²»¶Ï·Ðµİ汾£¬ÏÖÔÚ·ÖÎöϸ÷ÖÖÓïÑÔµÄÇø±ð¡¢ÓÅÊÆ¡¢ÁÓÊÆ¡¢¿ª·¢×¢ÒâÊÂÏ
......
<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.FilterDispatcher
</filter-class>
</filter>
<filter-mapping>
<filter-name>strut ......