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

ireportÔÚjspÖеĵ÷ÓÃÀý×Ó

 <%@ page language="java" import="java.util.*" pageEncoding="GB18030"%>
<%@ page import="java.io.*,java.sql.*,net.sf.jasperreports.engine.*" %>
<%@ page import="com.microsoft.sqlserver.jdbc.SQLServerDriver" %>
<%@ include file="/common/header.jsp" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
 <title>±¨±í´òÓ¡</title>
 <link rel="stylesheet" type="text/css" href="<s:property value="%{default_css}"/>" />
</head>
<body id="Body">
    <%
        String reportName = request.getParameter("reportName");
        //±¨±í±àÒëÖ®ºóµÄ.jasperÎļþµÄ´æ·ÅλÖÃ
        File reportFile = new File(application.getRealPath("/report/resource/jasper/"+reportName+".jasper"));
        String url = "jdbc:sqlserver://liubin:1433;DatabaseName=db_forest_police";
        Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver").newInstance();
        //´«µÝ±¨±íÖÐÓõ½µÄ²ÎÊýÖµ£¬ÕâÀïÊÇ¿ÕÖµ
        Map parameters = new HashMap();
       
        System.out.println("-----------conn---------");
        //Á¬½Óµ½Êý¾Ý¿â
        Connection conn = DriverManager.getConnection(url,"sa","time0442");
        System.out.println("----------jasper begin-----------");
        //ÔÚ¿ØÖÆ̨´òÓ¡±¨±íÎļþµÄÎïÀí·¾¶
        System.out.println("****ÎïÀí·¾¶ ***"+reportFile.getPath());
       
  &nb


Ïà¹ØÎĵµ£º

JSPÖÐÀûÓÃÊý¾ÝÔ´¶ÔÏó½¨Á¢Êý¾Ý¿âÁ¬½Ó

ÅäÖóÌÐòµÄÔËÐÐĿ¼ÓëJDBCÊý¾ÝÔ´:
<Context path="/test" docBase="F:\JSPLesson\test" reloadable="true">
    <Resource name="jdbc/bookstore" auth="Container" type="javax.sql.DataSource"
              maxActive="1 ......

½â¾öJSPÒ³ÃæµÄÖÐÎÄÂÒÂ루2002ÄêÔ­´´£©

ºÍJavaÒ»Ñù£¬JSPÊÇÄ¿Ç°±È½ÏÈÈÃŵÄÒ»¸ö»°Ìâ¡£ËüÊÇÒ»ÖÖÔÚ·þÎñÆ÷¶Ë±àÒëÖ´ÐеÄWebÉè¼ÆÓïÑÔ£¬ÒòΪ½Å±¾ÓïÑÔ²ÉÓÃÁËJava£¬ËùÒÔJSP¼Ì³ÐÁËJavaµÄËùÓÐÓŵ㡣¿ÉÊÇÔÚʹÓÃJSP³ÌÐòµÄ¹ý³ÌÖУ¬³£Óöµ½ÖÐÎÄÂÒÂëÎÊÌ⣬ºÜ¶àÈËΪ´ËÍ·ÌÛ²»ÒÑ£¬±ÊÕß¾ÍÉîÊÜÆ亦£¬¶øÇÒʹÓÃƽ̨²»Í¬£¬ÖÐÎÄÂÒÂëÎÊÌâµÄ½â¾ö·½·¨Ò²²»Í¬£¬ÎÞÐÎÖÐÔö¼ÓÁËѧϰJSPµÄÄѶȡ£Æäʵ£¬Ô ......

JSPÊý¾ÝÌá½»ÂÒÂëÎÊÌâ

 Ô­Àí²»ËµÁË,ÍøÉÏÓкܶà,¶¼¿ÉÒÔ×Ô¼º²éµ½,ÖÁÓÚΪʲô»á³öÏÖÂÒÂë,ÊÇÒòΪJAVAÓÐʹÓùú¼Ê»¯,Óöµ½ÖÐÎÄʱ.....
ÏÂÃæ¸ø³öһЩ¼òµ¥µÄʵÓôúÂë,Ö»¹©²Î¿¼:
public class ChangeUtf8 {
 public static String getS(String Str){
        try{
       ......

Jsp ELÓï·¨

Jsp ELÓï·¨
Àý£º
${sessionScope.user.sex}
ËùÓÐEL¶¼ÊÇÒÔ ${ ΪÆðʼ¡¢ÒÔ} Ϊ½áβµÄ¡£
ÉÏÊöEL·¶ÀýµÄÒâ˼ÊÇ£º´ÓSessionÈ¡µÃÓû§µÄÐÔ±ð¡£Èç¹ûʹÓÃ֮ǰJSP´úÂëµÄд·¨ÈçÏ£º
<%
User user = (User)session.getAttribute(”user”);
String sex = user.getSex( );
%>
Á½ÕßÏà±È½Ï֮ϣ¬¿ÉÒÔ·¢ÏÖELµÄÓï·¨± ......

JSP ÈçºÎʵÏÖÍøÒ³¶¨Ê±Ìøת:


JSP ÈçºÎʵÏÖÍøÒ³¶¨Ê±Ìøת: 
<script   language="javascript">  
  <!--  
  setTimeout("document.location.href='http://www.163.com'",3000);  
  //-->  
  </script>
ˢУº
<meta   http-equiv="Refresh"   content ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ