Jsp ÑéÖ¤Âë(¼ìÑéÂë)µÄʵÏÖ
ÀûÓÃApacheµÄÒ»¸ö ¿ªÔ´ÏîÄ¿Image Tag Library(http://jakarta.apache.org/taglibs/sandbox/doc/image-doc/intro.html)
ÀûÓÃApacheµÄÒ»¸ö ¿ªÔ´ÏîÄ¿Image Tag Library(http://jakarta.apache.org/taglibs/sandbox/doc/image-doc/intro.html)
ÏÂÔرØÒªÎļþ
1)ÏÂÔØJakarta-Taglibs:
http://people.apache.org/builds/jakarta-taglibs-sandbox/nightly/
½âѹºóÈ¡³ötaglibs-image.jar·ÅÓÚ/WEB-INF/libÏÂ
½«taglibs-image.tld¿½µ½/WEB-INF/ÏÂ
2)ÏÂÔØPoor Man's Imaging Wrapper£ºImage Tag Óõ½ÁËÕâ¸ö°ü
http://www.mullassery.com/downloads/ ÌîдһЩ±ØÒªÐÅÏ¢ºó¾Í¿ÉÒÔÃâ·ÑÏÂÔØÁË
½âѹºó½«pmiw.jar¿½µ½/WEB-INF/libÏÂ
ÔÚweb.xmlÖÐÅäÖÃImageServlet
<context-param>
<param-name>ImageServletMapping</param-name>
<param-value>/gen-image</param-value>
</context-param>
<servlet>
<servlet-name>ImageServlet</servlet-name>
<servlet-class>org.apache.taglibs.image.ImageServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ImageServlet</servlet-name>
<url-pattern>/gen-image/*</url-pattern>
</servlet-mapping>
ÔÚjspÒ³ÃæÖмÓÈëʵÏÖ´úÂë(²¿·ÖÄÚÈݲο¼ÁËhttp://technology.a.lunqun.com/read.php?tid=149894&page=e&fpage=1)
1)ÔÚÒ³Ê×¼ÓÈë<%@ taglib uri="/WEB-INF/taglibs-image.tld" prefix="img" %>
2)ÔÚÒ³Ã涥¶Ë¼ÓÈë
<%
response.setHeader("Pragma", "No-cache");
response.setHeader("Cache-Control", "no-cache");
response.setDateHeader("Expires", 0);
%>
3)ÔÚÏë¼ÓÉÏÑéÖ¤ÂëµÄµØ·½¼ÓÉÏÈçÏ´úÂ룺
<%
int num = (int) java.lang.Math.round(java.lang.Math.random() * 8999);
String sRand = "" + (1000 +num);
session.setAttribute("userInfo.authcode",sRand);
%>
<img:image src="/graphics/auth.jpg" refresh="true">
<img:text text="<%=sRand.substring(0,1)%>" x="7" y="-1" font="Times New Roman" bold="false" size="22" color="0x993399" italic="true" />
<i
Ïà¹ØÎĵµ£º
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ÖÐÏÔʾ ......
jsp(java server pages)ÊÇÒ»ÖÖ¼¼Êõ,ÓÃÀ´´¦Àí¿Í»§¶ËÇëÇóµÄ,(Ä¿µÄÊÇΪÁË´ïµ½¶¯Ì¬ÍøÒ³µÄЧ¹û),´¦Àíºó´«¸ø¿Í»§¶Ë(Ò²¿ÉÒÔ˵¸øÁËä¯ÀÀÆ÷),¾Í³ÉÁËÎÒÃÇ¿´µ½µÄ¾²Ì¬ÍøÒ³(HTML)
HTML ¼ÓÈëJava´úÂë(±ÈÈç<%...%>)²»»áÓÖÈκÎЧ¹û,Ö»»á½²<%...%>ÏÔʾµ½Ò³ÃæÐÐ,»òÕ߸ù¾ÝλÖÃÓ°Ïì±àÒë. JSP(Java Server Page)Ò³ÃæÆäʵ¾ÍÊÇ ......
Java/JSPÖÐÎÄÂÒÂëÎÊÌâ½â¾öÐĵÃ
×Ô´Ó½Ó´¥JavaºÍJSPÒÔÀ´£¬¾Í²»¶ÏÓëJavaµÄÖÐÎÄÂÒÂëÎÊÌâ´ò½»µÀ£¬ÏÖÔÚÖÕÓڵõ½Á˳¹µ×µÄ½â¾ö£¬ÏÖ½«ÎÒÃǵĽâ¾öÐĵÃÓë´ó¼Ò¹²Ïí¡£
Ò»¡¢JavaÖÐÎÄÎÊÌâµÄÓÉÀ´
JavaµÄÄں˺ÍclassÎļþÊÇ»ùÓÚunicodeµÄ£¬ÕâʹJava³ÌÐò¾ßÓÐÁ¼ºÃµÄ¿çƽ̨ÐÔ£¬µ«Ò²´øÀ´ÁËһЩÖÐÎÄÂÒÂëÎÊÌâµÄÂé·³¡£ÔÒòÖ÷ÒªÓÐÁ½·½Ã棬JavaºÍJS ......
ÓÃJSP¹¹½¨¶¯Ì¬ÍøÕ¾ ËïÒÔÒå ¶Å¾é
Ò»¡¢ ʲôÊÇJSP JSP(JavaServer Pages)ÊÇÓÉSun Microsystems¹«Ë¾³«µ¼¡¢Ðí¶à¹«Ë¾²ÎÓëÒ»Æð½¨Á¢µÄÒ»ÖÖ¶¯Ì¬ÍøÒ³¼¼Êõ±ê×¼£¬ÆäÍøַΪ
http://www.javasoft.com/products/jsp¡£ ÔÚ´«Í³µÄÍøÒ³HTMLÎļþ(*.htm,*.html)ÖмÓÈëJava³ÌÐòƬ¶Î(Scriptlet)ºÍJSP±ê¼Ç(tag)£¬¾Í¹¹
³ÉÁËJSPÍøÒ³(*.jsp)¡£Web· ......
¾³£¿´µ½jspµÄ³õѧÕßÎÊtomcatÏÂÈçºÎÅäÖÃjsp¡¢servletºÍbeanµÄÎÊÌ⣬ÓÚÊÇ×ܽáÁËÒ»ÏÂÈçºÎtomcatÏÂÅäÖÃjsp¡¢servletºÍben£¬Ï£Íû¶ÔÄÇЩ³õѧÕßÓÐËù°ïÖú¡£
µÚÒ»²½£ºÏÂÔØj2sdkºÍtomcat£ºµ½sun¹Ù·½Õ¾µã£¨http://java.sun.com/j2se/1.4.2/download.html£©ÏÂÔØj2sdk£¬×¢ÒâÏÂÔذ汾ΪWindows Offline InstallationµÄSDK£¬Í¬Ê±×îºÃÏ ......