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

JSPµ÷ÓÃJavaBeanÔÚÍøÒ³É϶¯Ì¬Éú³ÉÖù״ͼ

JSPµ÷ÓÃJavaBeanÔÚÍøÒ³É϶¯Ì¬Éú³ÉÖù״ͼ
ÎÒÃǾ­³£ÒªÔÚÍøÒ³¿´µ½Ò»Ð©¶¯Ì¬¸üеÄͼƬ,×î³£¼ûµÄιýÓÚ¹ÉÆ±µÄKÏßͼ£¬±¾ÎÄÊÔͼͨ¹ýÒ»¸ö¼òµ¥µÄʵÀý£¬Ïò´ó¼ÒչʾÈçºÎͨ¹ýJSP µ÷ÓÃJavaBeanÔÚÍøÒ³É϶¯Ì¬Éú³ÉÖù״ͼ¡£
¡¡¡¡±³¾°£º±¾ÈË×î½üÔÚΪijͳ¼Æ¾Ö¿ª·¢ÏîĿʱ,Éæ¼°µ½ÔÚÍøÒ³É϶¯Ì¬Éú³ÉͼƬµÄÎÊÌ⣬·ÑÁËÒ»ÌìµÄʱ¼ä,ÖÕÓڸ㶨,Ϊ°ïÖú´ó¼ÒÔÚÒÔºóÓöµ½Í¬ÑùµÄÎÊÌâʱ²»×ßÍä·£¬ÏÖ½«Éè¼ÆË¼Ïë¼°Ô´´úÂ빫²¼³öÀ´£¬Óë´ó¼Ò¹²Ãã¡£ÒÔÏ´úÂëÔÚWindows2000³É¹¦²âÊÔͨ¹ý£¬WebÓ¦Ó÷þÎñÆ÷²ÉÓÃAllaire¹«Ë¾µÄJrun3.0¡£
¡¡¡¡µÚÒ»²½£º´´½¨Ò»¸öJava BeanÓÃÀ´Éú³ÉjpgÎļþ
¡¡¡¡Ô´³ÌÐòÈçÏ£º
//Éú³ÉͼƬµÄ Java Bean
//×÷Õß:´Þ¹ÚÓî
//ÈÕÆÚ:2001-08-24
import java.io.*;
import java.util.*;
import com.sun.image.codec.jpeg.*;
import java.awt.image.*;
import java.awt.*;
public class ChartGraphics {
¡¡BufferedImage image;
¡¡public void createImage(String fileLocation) {
¡¡¡¡try {
¡¡¡¡¡¡FileOutputStream fos = new FileOutputStream(fileLocation);
¡¡¡¡¡¡BufferedOutputStream bos = new BufferedOutputStream(fos);
¡¡¡¡¡¡JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(bos);
¡¡¡¡¡¡encoder.encode(image);
¡¡¡¡¡¡bos.close();
¡¡¡¡} catch(Exception e) {
¡¡¡¡¡¡System.out.println(e);
¡¡¡¡}
¡¡}
¡¡public void graphicsGeneration(int h1,int h2,int h3,int h4,int h5) {
¡¡¡¡final int X=10;
¡¡¡¡int imageWidth = 300;//ͼƬµÄ¿í¶È
¡¡¡¡int imageHeight = 300;//ͼƬµÄ¸ß¶È
¡¡¡¡int columnWidth=30;//ÖùµÄ¿í¶È
¡¡¡¡int columnHeight=200;//ÖùµÄ×î´ó¸ß¶È
¡¡¡¡ChartGraphics chartGraphics = new ChartGraphics();
¡¡¡¡chartGraphics.image = new BufferedImage(imageWidth, imageHeight, BufferedImage.TYPE_INT_RGB);
¡¡¡¡Graphics graphics = chartGraphics.image.getGraphics();
¡¡¡¡graphics.setColor(Color.white);
¡¡¡¡graphics.fillRect(0,0,imageWidth,imageHeight);
¡¡¡¡graphics.setColor(Color.red);
¡¡¡¡graphics.drawRect(X+1*columnWidth, columnHeight-h1, columnWidth, h1);
¡¡¡¡graphics.drawRect(X+2*columnWidth, columnHeight-h2, columnWidth, h2);
¡¡¡¡graphics.drawRect(X+3*columnWidth, columnHeight-h3, columnWidth, h3);
¡¡¡¡graphics.drawRect(X+4*columnWidth, columnHeight-h4, co


Ïà¹ØÎĵµ£º

jspÖÐincludeµÄÁ½ÖÖÐÎʽ

jspÖÐincludeµÄÁ½ÖÖÐÎʽ:      1.<%@ include file=” ”%>
                                 &nbs ......

»ùÓÚJSPµÄÎïÁ÷¹ÜÀíÆ½Ì¨

Ñ¡ÌâÒÀ¾Ý¼°Ñо¿ÒâÒå
ÏÖ´úÎïÁ÷£¬ÊÇÖ¸²úÆ·´ÓÉú²úµØµ½Ïû·ÑµØÖ®¼äµÄÕû¸ö¹©Ó¦Á´£¬ÔËÓÃÏȽøµÄ×éÖ¯·½Ê½ºÍ¹ÜÀí¼¼Êõ£¬½øÐиßЧÂʼƻ®¡¢¹ÜÀí¡¢ÅäËÍÁ´£¬ÎªÓû§Ìṩ¶à¹¦ÄÜ¡¢Ò»Ì廯µÄ×ÛºÏÐÔ·þÎñ£¬´Ó¶ø´ïµ½½µµÍÁ÷ͨ³É±¾¡¢Ìá¸ßÉú²úЧÂÊ¡¢Ôö¼ÓÆóÒµÀûÈó¡£µÄÐÂÐÍ·þÎñÒµ¡£Ëüͨ¹ý¶ÔÔËÊä¡¢²Ö´¢¡¢×°Ð¶¡¢¼Ó¹¤¡¢ÕûÀí¡¢ÅäËÍÓëÐÅÏ¢µÈ·½ÃæÓлú½áºÏ£¬ÐÎ ......

jspÉÏ´«Í·ÏñÒÔ¼°Éú³ÉËõÂÔͼ


<%@ page autoFlush="false" contentType="text/html;charset=utf-8" language="java" import="java.io.*,java.awt.Image,java.awt.image.*,com.sun.image.codec.jpeg.*,java.sql.*,com.jspsmart.upload.*,java.util.*,java.io.FileInputStream,java.io.FileOutputStream,java.awt.*"%>
<%@ page import="com.b ......

jsp»ù´¡ÖªÊ¶£¨ÕûÀí£©

¸Õ¿ªÊ¼Ñ§jsp£¬×öµÄÒ»µãÌý¿Î±Ê¼Ç¡£
1.jspÈý´óÖ¸Áî
 <%@ page ~~~~~~~~ %>
 <%@ include file=""%>
 <%@ taglib  url="" prfix=""%>
2.if(username.equals(""))
 out.println("ÐÕÃû²»ÄÜΪ¿Õ£¬Çë<a href=javascript:history.back()>·µ»Ø")£»
&&·ÀÖ¹Ö±½ÓÔÚä¯À ......

ÒýÓà JDK 6u12+Tomcat6.0+JSP¾­µäÅäÖÃ(Íêȫ׼ȷÎÞÎó£©

µÚÒ»²½£ºJDKÓëTomcatµÈµÄÏÂÔØÓëÅäÖÃ
    ×îеÄJDKΪ6.0£¨jdk-6u12-windows-i586-p.exe£©£¬tomcatΪ6.0(apache-tomcat-6.0.18.exe)
¿ª·¢»·¾³£º
JDK: jdk-6u12-windows-i586-p.exe
ÏÂÔØµØÖ·:http://java.sun.com/javase/downloads/index.jsp
Tomcat:apache-tomcat-6.0.18.exe
ÏÂÔØµØÖ·:http://tomcat.a ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ