RESIN FAQ ****************************************************************************************************************** ***************************************** Environment Variable Settings ClassPath C: / J2SDK / Lib / dt.jar; c: /j2sdk/lib/tools.jarjava_home c: / j2sdkpath C: / j2sdk / bin ************************ *********************************************************** ****************
============================================================================================================================================================================================================= ======================================= 1, the creation of the virtual directory "WEB-APP ID = '/ test' app-dir = 'e: / site_web'>
Examples are as follows
============================================================================================================================================================================================================= ================================================================================================ 6 / support Chinese <% @ Page ContentType = TEXT / HTML; Charset = GB2312 "%> <% @ page import =" java.sql. * "%> ============================= ============================================================================================================================================================================================================= ============== 7, link mysql data download JDBC driver http://www.mysql.com/downloads/api-jdbc-stable.html After unlocking mysql-connector-java -3.0.8-stable-bin.jar file is copied to x: / resin / lib or d: / j2sdk / jre / lib / ext directory.
The test program must use the root account because this test is to test <% @ page consttype = "text / html; charset = GB2312"%> <% @ page import = "java.sql. *"%> <% @ Page Import = "
<% Class.forName ( "org.gjt.mm.mysql.Driver") newInstance (); String url = "jdbc:.? mysql: // localhost / mysql user = root & password = & useUnicode = true & characterEncoding = gb2312 "; // testDB name for your database Connection conn = DriverManager.getConnection (url); Statement stmt = conn.createStatement (ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE); String sql =" select * from user "; ResultSet rs = Stmt.executeQuery (SQL); while (rs.next ()) {%> Your first field content is: <% = rs.getstring (1)%>I have a personal solution: modify Apache 2.0.44, in conf / httpd.conf file, find adddefaultcharset ISO-8859-1 changed #adddefaultcharset ISO-8859-1AdddefaultCharset GB2312
Restart Apache after the modification is complete, if not, restart the system. Addilaguage EN .GBADDLANGUAGE EN-CN .GBADDDEFAULTCHARSET ZH ======================================== =================================================== Apache supports SSI Inclued # addtype text / Html .shtml # addoutputfilter incrudes .shtml
Go to the front ##
Change it to: Options INDEXES FOLLOWSYMLINKS INCLUDES If users do not want to execute scripts or shell commands, you can add keyword INCLUDESNOEXEC in the Options option row, which allows SSI, but cannot perform CGI or script commands (Note: High In the version of the Apache server, the content mentioned above has been included in the configuration file httpd.conf).
Http://www.yesky.com/softchannel/72342371945349120/20020510/1610538.shtml
2. Create a file .htaccess
If the user can't access the server profile directly, you can create a file called .htaccess file using the file editor. Note that the file name must have a symbol "." So the server can know that the file is hidden file, thereby increasing the security of the file to avoid error operations. In the .htaccess file, you need to add the following three lines of text:
Options Indexes Followsymlinks include addtype application / x-httpd-cgi .cgi addtype text / x-server-pased-html .shtml
After completion, you can upload the .htaccess file to the corresponding directory of the server, which is valid for all subdirectories. If the user wants to disable the CGI or shell command on the directory level, you can add keyword incrudesnoexec on the .htaccess file.
3. Use .shtml or .html?
Any file containing SSI must pass the server's parsing process before it is submitted to the client. This will increase the server's load. If the user only wants to use SSI to use SSI in several special pages, you can change the file's suffix name to .shtml, so that the server can only parse the .shtml file containing the SSI. On the other hand, if there is a multiple page using SSI, but the user does not want to use .SHTML's suffix name, you can use the following command line in the .htaccess file:
AddType text / x-server-pased-html .html
How to use SSI?
SSI follows the following format when using:
2, the incrude command The incrude command can insert the text or image in other documents into the currently parsed document, this is the key to the entire SSI. You can instantly update the entire site instantly through the incrude command.
The incrude command has two different parameters:
Virtual: Gives the virtual path to a document to the server. E.g:
File: Give the relative path to the current directory, where "../" cannot be used, and the absolute path cannot be used. E.g:
This requires all of each directory that contains a header.html file.