=========== 网 产生 产生 四: ===================================================================================================================================================================================== Num = math.abs (r.nextint ()% 10000); string verifynum = new integer (num) .tostring ();%> Double type <% r = new random (); Num = r. Nextdouble () * 10000; string verifynum = new double (num) .tostring ();%> ========== jsp Chinese problem: =============== ====================================== WHER: Page Display | Database Read / Write | Chinese Parameters obtained from the previous page | The Chinese problem solution in the file: 1. Plus <% @ Page ContentType = "TEXT / HTML; Charset = GB2312"%> 2, strTemp = New String ("ISO-8859 -1 ")," GB2312 "); or strTemp = new string (strTemp.getbytes (" UTF-8 ")," GB2312 "); <% @ include file =" ../ inc / security.jsp "eNCoding = "GB2312"%> When inserting into the database, first use the unicode-> Native Code when JDBC Driver queries from the database, use the native code-> unicode ========= JAR ===== ==================================================== Jar CVF Test.jar Test. Class test.gif ========== 建 档 应用 应用 应用 应用 应用 应用 应用 使用 使用 应用 使用 应用 使用 使用 使用 使用 使用 使用 使用 使用 使用 使用
======= Example first: (Testhello.java Save in H: / Java Learning / 2.2.javadoc) / ** This is a description of Java application * / polic class testhello {/ ** Function, output one sentence * / public static void main (string args []) {system.out.println ("Hello, congratulations!");} // main ()} / ** Testhello * / second step : cmd-> h: / java learning /2.2.javadoc->Javadoc testHello.java-> Enter. At this point, there is 10.html files below H: / Java / 2.2.javadoc, one folder Resources, A stylesheet.css ============================================================================= === 1 Request for forwarding, shared data servlet class in the Request range using javax.servlet.RequestDispatcher.ForWord () method RequestDispatcher rd = request.getRequestDispatcher ("Hello.jsp"); rd.forword (request, response); JSP Use 2 redirection, not shared data in the request.sendredirect ("http: //") in the request ("http: ///"); 3 contains requestdispatcher rd = request.getRequestDispatcher ("Hello.jsp"); rd.includ (Request, Response); Use <% @ include file = "heder.jsp"%>