Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

JSPÑéÖ¤ÂëµÄʵÏÖ

       ×î½ü¿´SSHÐèҪʹÓÃÑéÖ¤Â룬ËùÒÔÔÚÍøÉÏÕÒÁËһϡ£Õâ¸ö´úÂëÔÚÍøÉÏÒѾ­Á÷´«ºÜ¾ÃÁË£¬´ó²¿·Ö¶¼´óͬСÒ죬Ìù³öÀ´ÒÔ±¸ºóÓá£
      ´úÂëÈçÏÂ(image.jsp)£º
<%@ page contentType="image/jpeg" import="java.awt.*,
java.awt.image.*,java.util.*,javax.imageio.*" %>
<%
int width=60, height=20;
BufferedImage image = new BufferedImage(width, height,BufferedImage.TYPE_INT_RGB);
Graphics g = image.getGraphics();
g.setColor(new Color(0xDCDCDC));
g.fillRect(0, 0, width, height);
g.setColor(Color.black);
g.drawRect(0,0,width-1,height-1);
String rand =""+ (Math.random()*10000);
rand = rand.substring(0,rand.indexOf("."));
switch(rand.length())
{
case 1: rand = "000"+rand; break;
case 2: rand = "00"+rand; break;
case 3: rand = "0"+rand; break;
default: rand = rand.substring(0,4); break;
}
session.setAttribute("rand",rand);
g.setColor(Color.black);
Integer tempNumber = new Integer(rand);
String numberStr = tempNumber.toString();
g.setFont(new Font("Atlantic Inline",Font.PLAIN,18));
String Str = numberStr.substring(0,1);
g.drawString(Str,8,17);
Str = numberStr.substring(1,2);
g.drawString(Str,20,15);
Str = numberStr.substring(2,3);
g.drawString(Str,35,18);
Str = numberStr.substring(3,4);
g.drawString(Str,45,15);
Random random = new Random();
for (int i=0;i<250;i++)
{
int x = random.nextInt(width);
int y = random.nextInt(height);
g.drawOval(x,y,0,0);
}
g.dispose();
ImageIO.write(image,"JPEG", response.getOutputStream());
%>  
ʹÓÃʱͨ¹ý<img alt="ÑéÖ¤Âë" src="image.jsp">µ÷Óá£


Ïà¹ØÎĵµ£º

ResinÏÂÅäÖÃJSPÐéÄâÖ÷»ú

1.Ìí¼Ó host ¿é
ÿһ¸öJSPÐéÄâÖ÷»úÓÐËü×Ô¼ºµÄ host ¿é¡£Ã¿Ò»¸öÖÁÉÙÒª¶¨ÒåidÀ´Ö¸¶¨ÐéÄâÖ÷»úµÄÃû×ÖºÍÒ»¸örootÓ¦ÓóÌÐò¡£Ò»¸ö <root-directory>ͨ³£ÓÃÀ´ÎªÖ÷»ú¶¨Ò»¸öĬÈϵÄwebÓ¦ÓóÌÐò¡£
ÅäÖÃÎļþƬ¶Î£º
<server>
<host id='gryffindor.caucho.com'>
  <root-directory>/home/www/gryf ......

JSP ÈÝÆ÷µÄ³õʼ»¯ºÍÏú»Ù ServletContext£¨×ª£©

ServletContext ±» Servlet ³ÌÐòÓÃÀ´Óë Web ÈÝÆ÷ͨÐÅ¡£ÀýÈçдÈÕÖ¾£¬×ª·¢ÇëÇó¡£Ã¿Ò»¸ö Web
Ó¦ÓóÌÐòº¬ÓÐÒ»¸öContext£¬±»WebÓ¦ÓÃÄڵĸ÷¸ö³ÌÐò¹²Ïí¡£ÒòΪContext¿ÉÒÔÓÃÀ´±£´æ×ÊÔ´²¢ÇÒ¹²Ïí£¬ËùÒÔÎÒËùÖªµÀµÄ
ServletContext µÄ×î´óÓ¦ÓÃÊÇWeb»º´æ----°Ñ²»¾­³£¸ü¸ÄµÄÄÚÈݶÁÈëÄڴ棬ËùÒÔ·þÎñÆ÷ÏìÓ¦ÇëÇóµÄʱºò¾Í²»ÐèÒª½øÐÐÂýËٵĴŠ......

resin·þÎñÆ÷ÖÐͨ¹ýSSI°üº¬JSPÒ³Ãæ

1¡¢Ò»¡¢ÏÈÌáÌõ¼þ£º ÔÚweb.xmlÖмÓÒÔÏÂÓï¾ä£¨Ô­Òò²Î¿¼RESIN¹Ù·½Îĵµ£©    
<servlet>
         <servlet-name>SSIServlet</servlet-name>
        <servlet-class>com.caucho.servlets.ssi.SS ......

jsp ²¥·ÅÆ÷


windows Media Player 9.0ÍøÒ³²¥·ÅÆ÷
£¨mp3.wma.wmv.asf£©
ÒÔÏÂͼƬΪһ°ã²¥mp3.wmaÎļþʱµ÷ÓÃwindows×Ô´ø²¥·ÅÆ÷windows Midia Player9.0ËùÏÔʾÍâ¹Û£¬·Ç9.0°æËùÏÔʾµÄÃæ°åÍâ¹Û¿ÉÄܲ»Í¬£¡
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
´úÂë¼ò½é£º
width£¨²¥·ÅÆ÷Ãæ°å¿í¶È£©
height£¨²¥·ÅÆ÷Ãæ°å¸ß¶È£©
autostart£¨×Ô¶¯² ......

×ܽ᣺JSPÒ³ÃæimgͼƬ»º´æÎÊÌâÏÖÏó±íÊö¼°ÎÊÌâ½â¾ö

JSPÒ³ÃæimgͼƬ»º´æÎÊÌâÏÖÏó±íÊö¼°ÎÊÌâ½â¾ö
l  ÎÊÌâ±íÊö£º
µ±¶Ôº¬ÓÐÍ·ÏñµÄ¿Í·þÈËÔ±ÐÅÏ¢½øÐÐÐÞ¸Ä(º¬¶ÔÍ·ÏñÐÅÏ¢µÄÐÞ¸Ä)ºó£¬ÖØдò¿ªÊý¾ÝÐ޸ĽçÃ棬·¢ÏÖÎı¾ÄÚÈÝÐ޸ijɹ¦£¬¶øÍ·ÏñÄÚÈÝÈÔÈ»ÏÔʾΪԭÀ´µÄÍ·Ïñ——Êý¾Ý¿âÖеĶÔÓ¦ÐÅϢͷÏñËùÔÚ×Ö¶ÎÊý¾ÝÒѾ­³É¹¦¸üС£
 
l  Ç°Ì᣺
jspÒ³ÃæÖнøÐÐÁËҳà ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ