Regular expressions are learning - from a URL in the access to all the hyperlinks

  Abstract: Regular expressions are learning - from a URL in the access to all the hyperlinks 

  </ Td> </ tr> <tr> <td width="489" height="35" valign="top" class="ArticleTeitle"> The following example shows how to use a regular expression from a URL and find all similar output below hyperlink: 

  First, we enter the URL from the command line, open the input flow, and read the contents of URL into htmlString deposited in the string.    Then "(    ]*>)" Tectonic the regular expression, in the end find htmlString string matching string. 

  Import java.io. *; 
  Import java.net .*; 
  Import java.util.regex .*; 
  (Public class GetHref 
  Public static void main (String [] args) ( 
  InputStream in = null; 
  PrintWriter out = null; 
  String htmlString = null; 
  Try ( 
  / / Check the arguments 
  If ((args.length! = 1) & (args.length! = 2)) 
  Throw new IllegalArgumentException ( "Wrong number of args"); 

  / / Set up the streams 
  URL url = new URL (args [0]) / / Create the URL 
  Url.openStream in = () / / Open a stream to it 
  If (args.length == 2) / / Get an appropriate output stream 
  Out = new PrintWriter (new FileWriter (args [1])); 
  BufferedReader bin = new BufferedReader (new InputStreamReader (in)); 
  String line; 
  StringBuffer sb = new StringBuffer (); 
  While ((bin.readLine ())!= line = null) ( 
  If (out! = Null) out.println (line); 
  Sb = sb.append (line); 
  ) 
  HtmlString = sb.toString (); 
  / / System.out.println (sb.toString ()); 
  ) 
  / / On exceptions, the print error message and usage message. 
  Catch (Exception e) ( 
  System.err.println (e); 
  System.err.println ( "Usage: java GetURL  [   ] "); 
  ) 
  Finally (/ / Always close the streams, no matter what. 
  Try (in.close (); out.close ();) catch (Exception e) () 
  ) 

  Pattern p = Pattern.compile ( "(  ]*>)");
  Matcher m = p.matcher (htmlString); 
  Boolean result = m.find (); 
  While (result) ( 
  For (int i = 1; i <= m.groupCount (); i + +) ( 
  System.out.println (m.group (i)); 
  ) 
  Result = m.find (); 
  ) 
  ) 
  ) 
  Running Results: 
  C: \ java> java GetHref http://127.0.0.1:8080/zz3zcwbwebhome/index.jsp 

  W.zzedu.gov.cn ',' java learning room ') "> 
  Page) 'this.setHomePage (' http://10.10.1.1/index.jsp');"> 










  ……………. 
  </ Td> <td width="186" align="center" valign="top" class="ArticleTeitle"> 

  </ Td> </ tr> <tr> <td height="25" colspan="2" valign="top" class="ArticleTeitle"> 

  ↑ Back 

Create directories in JSP

  Abstract: to create directories in JSP 

  </ Td> </ tr> <tr> <td width="540" height="35" valign="top" class="ArticleTeitle"> <% – 
  Author: Hua Lian [hlian@alleasy.net] 
  Date: 2000-07-20-10-10 
  Version: 1.0 
  Features: JSP routines - to create directories in JSP 
  Call: 
  Paper trails path 
  Mkdir (String path) 
  Back to: 
  Air operations for the successful return 
  Operation failed to return to the reasons for failure. 
  If there is the question to invite feedback to hlian@alleasy.net. 
–%>

  <% @ Page contentType = "text / html; gb2312 charset ="%> 

  <% @ Page import = "java.io. *"%> 
<%!
  String Mkdir (String path) ( 

  String msg = null; 
  Java.io.File dir; 

  / / Object new document 
  Dir = new java.io.File (path); 
  If (dir == null) ( 
  Msg = "wrong reasons: 
  Sorry, can not create space directory!  ";
  Return msg; 
  ) 
  If (dir.isFile ()) ( 
  Msg = "wrong reasons: 
  Have the same name document "+ dir.getAbsolutePath () +" there.  ";
  Return msg; 
  ) 

  If (! Dir.exists ()) ( 
  Boolean result = dir.mkdirs (); 
  If (result == false) ( 
  Msg = "wrong reasons: 
  Contents "+ dir.getAbsolutePath () +" failure to create, for unknown reasons!  ";
  Return msg; 
  ) 
  / / Create directories, if successful, no output. 
  Msg = "successfully created directory:" + dir.getAbsolutePath () + ""; 
  Return msg; 
  Else () 
  Msg = "wrong reasons: 
  Contents "+ dir.getAbsolutePath () +" already exists.  ";
  ) 
  Return msg; 
  ) 
%>
<%
  String filepath = "usr / home / hoyi / html / dir"; 
  String opmsg = Mkdir (filepath); 
  Out.println (opmsg); 
%>
  </ Td> <td width="173" valign="top" class="ArticleTeitle"> 
  </ Td> </ tr> <tr> <td height="25" colspan="2" valign="top" class="ArticleTeitle"> 

  ↑ Back 

How to avoid duplication

  Abstract: How to avoid duplication 

  </ Td> </ tr> <tr> <td height="35" valign="top" class="ArticleTeitle"> More Java Pitfalls This is the Chinese version of an example. 
  First, what is to repeat 
  Imagine a visit of a very big booking sites when booking tickets click on the submit button, the server may be slow processing speed, tickets still can not see the result that the failure of the request to buy their own, so once again and over click Submit button, and if not addressed, these requests will be dealt with the server, which lead to false results. 

  Second, to prevent repeat 

  Web.xml looked at (the examples of directories and files download) 

  <? Xml version = "1.0"> 
  Web-app PUBLIC "- / / Sun Microsystems, Inc / / DTD Web Application 2.3 / / EN" "http://java.sun.com/j2ee/dtds/web-app_2_3.dtd"> 

  <table Width="732" border="0"> <tr> <td width="442"> 


ControllerServlet
ControllerServlet
ControllerServlet
  Org.javapitfalls.item36.ControllerServlet 

  Id 

  Id 





  Form 
  / TicketForm.jsp 

  </ Td> <td width="280"> </ td> </ tr> </ table> 

  Success 
  / Success.jsp 



  Resubmit 
  / ResubmitError.jsp 




ControllerServlet
  / ControllerServlet 






  Look at the form ticketForm.jsp 
  <% @ Page contentType = "text / html; GBK charset ="%> 






<%
  / / The first time, the target set in a session id attribute to the success will be deleted.    After the submission of this test will be whether the attribute value is null judge to repeat. 
  If (session.isNew ()) ( 
  Session.setAttribute ( "id", session.getId ()); 
  ) 
%>

  Ozzie concerts online booking 



  <form Method="get" action="/resubmit/ControllerServlet"> 

  <table Border="1" width="50%"> 
<tr>
  <td> The number of votes: </ td> 
<td>
  <select Name="numTickets"> 
  <option Value="Please enter a Ticket #"> Please enter a Ticket # </ option> 
  <Option value = "1 Ticket" <% if (resubmit.getNumTickets () == "a Ticket") out.println ( "SELECTED");%>> 1 Ticket </ option> 
  <Option value = "2 Tickets" <% if (resubmit.getNumTickets () == "Tickets") out.println ( "SELECTED");%>> 2 Tickets </ option> 
  <Option value = "Tickets" <% if (resubmit.getNumTickets () == "Tickets") out.println ( "SELECTED");%>> 3 Tickets </ option> 
  <Option value = "Tickets" <% if (resubmit.getNumTickets () == "Tickets") out.println ( "SELECTED");%>> 4 Tickets </ option> 
  <Option value = "5 Tickets" <% if (resubmit.getNumTickets () == "5 Tickets") out.println ( "SELECTED");%>> 5 Tickets </ option> 
  <Option value = "6 Tickets" <% if (resubmit.getNumTickets () == "6 Tickets") out.println ( "SELECTED");%>> 6 Tickets </ option> 
  <Option value = "7 Tickets" <% if (resubmit.getNumTickets () == "7 Tickets") out.println ( "SELECTED");%>> 7 Tickets </ option> 
  <Option value = "8 Tickets" <% if (resubmit.getNumTickets () == "8 Tickets") out.println ( "SELECTED");%>> 8 Tickets </ option> 
  <Option value = "9 Tickets" <% if (resubmit.getNumTickets () == "Tickets 9") out.println ( "SELECTED");%>> 9 Tickets </ option> 
  </ Select> 
  </ Td> 
  </ Tr> 
<tr>
  <td> Stadium Level: </ td> 
<td>
  <select Name="stadiumTier"> 
  <option Value="Please enter a Stadium Tier"> Please enter a Stadium Tier </ option> 
  <Option value = "Tier A" <% if (resubmit.getStadiumTier () == "Tier A") out.println ( "SELECTED");%>> Tier A </ option> 
  <Option value = "Tier B" <% if (resubmit.getStadiumTier () == "Tier B") out.println ( "SELECTED");%>> Tier B </ option> 
  <Option value = "Tier C" <% if (resubmit.getStadiumTier () == "Tier C") out.println ( "SELECTED");%>> Tier C </ option> 
  <Option value = "Tier D" <% if (resubmit.getStadiumTier () == "Tier D") out.println ( "SELECTED");%>> Tier D </ option> 
  <Option value = "Tier E" <% if (resubmit.getStadiumTier () == "Tier E") out.println ( "SELECTED");%>> Tier E </ option> 
  </ Select> 
  </ Td> 
  </ Tr> 
<tr>
  <td> Votes Price: </ td> 
<td>
  <select Name="ticketPrice"> 
  <option Value="Please enter a Ticket Price"> Please enter a Ticket Price </ option> 
  <Option value = "$ 12" <% if (resubmit.getTicketPrice () == "$ 12") out.println ( "SELECTED");%>> $ 12 </ option> 
  <Option value = "$ 17" <% if (resubmit.getTicketPrice () == "$ 17") out.println ( "SELECTED");%>> $ 17 </ option> 
  <Option value = "$ 25" <% if (resubmit.getTicketPrice () == "$ 25") out.println ( "SELECTED");%>> $ 25 </ option> 
  <Option value = "$ 35" <% if (resubmit.getTicketPrice () == "$ 35") out.println ( "SELECTED");%>> $ 35 </ option> 
  <Option value = "$ 50" <% if (resubmit.getTicketPrice () == "$ 50") out.println ( "SELECTED");%>> $ 50 </ option> 
  </ Select> 
  </ Td> 
  </ Tr> 
<tr>
  <td Colspan="2" align="center"> <input TYPE="submit" VALUE="Submit"> </ td> 
  </ Tr> 
  </ Table> 


  </ Form> 

  </ Body> 


  Below are dealing with the form ControllerServlet.java 

  Package org.javapitfalls.item36; 

  Import java.io. *; 
  Import java.util .*; 
  Import javax.servlet .*; 
  Import javax.servlet.http .*; 
  Import org.javapitfalls.item36 .*; 

  Public class ControllerServlet extends HttpServlet ( 

  Private static String SESSION_ID; 

  Public void destroy () () 

  Public void init () (throws ServletException 

  SESSION_ID = getInitParameter ( "id"); 
  ) 

  Protected void doGet (HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException ( 

  Process (req, res); 

  ) 

  Protected void process (HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException ( 

  HttpSession session = req.getSession (false); 
  String numTickets = req.getParameter ( "numTickets"); 
  String stadiumTier = req.getParameter ( "stadiumTier"); 
  String ticketPrice = req.getParameter ( "ticketPrice"); 

  If (session == null) ( 

  If ((numTickets == null) | | (stadiumTier == null) | | (ticketPrice == null)) ( 

  GetServletConfig (). GetServletContext (). GetNamedDispatcher ( "form"). Forward (req, res); 

  Else () 

  Throw new ServletException ( "[form] Page Not Found"); 

  ) 

  Else () 

  If ((! NumTickets.equals ( "Please enter a Ticket #")) & & 
  (! StadiumTier.equals ( "Please enter a Stadium Tier")) & & (! TicketPrice.equals ( "Please enter a Ticket Price"))) ( 

  String sessionValidatorID = (String) session.getAttribute (SESSION_ID); 
  If (sessionValidatorID! = Null) (/ / the first time to deal with 
  Session.removeAttribute (SESSION_ID); 
  GetServletConfig (). GetServletContext (). GetNamedDispatcher ( "success"). Forward (req, res); 

  ) Else (/ / handle to repeat 
  GetServletConfig (). GetServletContext (). GetNamedDispatcher ( "resubmit"). Forward (req, res); 

  ) 
  Else () 

  GetServletConfig (). GetServletContext (). GetNamedDispatcher ( "form"). Forward (req, res); 

  ) 

  ) 
  ) 

  ) 
  Function TempSave (ElementID) (CommentsPersistDiv.setAttribute ( "CommentContent" document.getElementById (ElementID). Value); CommentsPersistDiv.save ( "CommentXMLStore");) function Restore (ElementID) (CommentsPersistDiv.load ( "CommentXMLStore"); document . getElementById (ElementID). CommentsPersistDiv.getAttribute value = ( "CommentContent");) </ td> </ tr> <tr> 

  ↑ Back 

NTsky this message v1.2

  Abstract: This message NTsky v1.2 

  </ Td> </ tr> <tr> <td height="35" valign="top" class="ArticleTeitle"> 1, the use of this message javabean jsp + + + mysql servlet 
  2, the realization of the message MVC model, entirely through servlet control data, and use the connection pool, all of the source code.    </ Td> </ tr> <tr> 

  ↑ Back 

JSP and interactive data JavaScirpt

  Abstract: JSP and interactive data JavaScirpt 

  </ Td> </ tr> <tr> <td height="35" valign="top" class="ArticleTeitle"> <table width = "100%" border = "0" cellspacing = "0" cellpadding = " 0 "> <tr> <td width="277" height="86" align="center" valign="top"> </ td> <td width="407" valign="top"> 

  For WEB procedures, the front-end (JavaScript) and back-end (JSP / Servlet) is not shared data can only be a back-end process (JSP) to output data, generating pages to the front pages this time generation The JavaScript code may be only so-called jsp data.    Similarly, JavaScript, only to the data submitted to the backend JSP code, JSP process can be JavaScript data. 

  How to achieve it in the pages of the use of JavaScript in jsp data or jsp pages use the JavaScript data? 

  First, the JavaScript pages of data submitted to the background of how the procedures jsp 
  â‘  can JavaScript data to xxx.JSP? Var1 = aaa & var2 = bbb in the form of the parameters passed as a URL JSP procedures used at this time jsp 
  <% String strVar1 = request.getParameter ( "var1 ");%> can get to the JavaScript scripting transfer from the data; 

  â‘¡ form through the use of JavaScript added to hide domain information, and then use the form to the way the data transfer to the JSP procedures. 

  </ Td> </ tr> </ table> 

  Second, in the pages of JavaScript how to use the data behind the data JSP procedures 
  This relatively simple, and used directly in the JavaScript scripting <strVar1%% => jsp procedures will be in the data transfer to use the JavaScript scripting. 

  Third, reference to the following examples: 

  1, test.jsp 

  <% @ Page contentType = "text / html; gb2312 charset ="%> 

<%
  String s1 = "Hello"; 
  String s2 = "World!"; 
%>

  <script Language="JavaScript"> 
  /************************************************* The following 
  * JavaScript scripts, placed in the position of any of pages can be 
  * Insertclick () function to transfer access to JSP pages in the variable s1, 
  * JavaScript can then modify the value of this variable, and through the 
  * Post to the way JSP procedures to use. 
  ************************************************** *************/ 
  Function insertclick () ( 
  Var1 ="<%= s1%> "; 
  Document.forms [ "insertForm"]. Mc.value var1 = + document.forms [ "insertForm"]. Mc.value; 
  Document.insertForm.submit (); 
  ) 
  / / 
  </ Script> 

  <form Name="insertForm" method="post" action="get.jsp"> 
  <Input type = "hidden" name = "mc" value ="<%= s2%> "> 
  <input Type="button" value="提交" onclick="insertclick()"> 
  </ Form> 

  2, get.jsp 

<%
  String strVar1 = request.getParameter ( "mc"); 
  Out.print (strVar1); 
%>

  </ Td> </ tr> <tr> 

  ↑ Back 

Jsp Access Resource Kit

  Abstract: Access Resource Kit jsp 

  </ Td> </ tr> <tr> <td height="35" valign="top" class="ArticleTeitle"> <table width="736" border="0"> <tr> <td width = " 730 "> </ td> </ tr> </ table> 

  Write a tool categories: 

  Package jsfdb.model; import java.util.ResourceBundle; import java.util.MissingResourceException; import java.util.logging.Level; import java.util.logging.Logger; public class ModelUtils (/ / attention to how to access resources attribute documents location 
  Public static final String RESOURCES = ModelUtils.class.getPackage (). GetName () +. "Res.ModelResources"; private static ResourceBundle resources; public static void log (Throwable x) (Logger.global.log (Level.SEVERE, x . getMessage (), x);) public static synchronized ResourceBundle getResources () (if (resources == null) (try ResourceBundle.getBundle resources = (RESOURCES);) catch (MissingResourceException x) (log (x); throw new InternalError (x.getMessage ());) return resources;) 
  Public static String getResource (String key) (return getResources (). GetString (key);)) 

  Calling in JSP: 

  <% @ Page contentType = "text / html; GBK charset ="%> 
  <% @ Page import = "java.util.Locale"%> 
  <% @ Page import = "jsfdb.model .*"%> 
<%
  String s2 = ModelUtils.getResource ( "indexWindowTitle"); 

  String s3 = ModelUtils.getResource ( "indexPageTitle"); 

  Out.println ( "window title =" + + s2 " 
");
  Out.println ( "page title =" + + s3 " 
");

  Out.println (ModelUtils.RESOURCES); 
%>

  The result: 

  Window Title = = JSF test page headline Please fill in the following information 
  Jsfdb.model.res.ModelResources 

  Attachment: ModelResources_zh_CN.properties 
  JSF indexWindowTitle = \ u6d4b \ u8bd5 
  IndexPageTitle = \ u8bf7 \ u586b \ u5199 \ u4e0b \ u5217 \ u7684 \ u4fe1 \ u606f 

  </ Td> </ tr> <tr> 

  ↑ Back 

Data reported to broadcast communications

  Abstract: The data reported to broadcast communications 

  Data reported to broadcast communications 

  DatagramSocket only allows data to send a purpose address, java.net package provides a MulticastSocket category, was allowed to broadcast data to be sent to all customers of the port.    MulticastSocket used in the client, listening to the broadcast server data. 

  We are above procedures in some amendments, the use of radio communications MulticastSocket achieve.    Completion of the functions of the new procedures is to simultaneously run multiple clients can receive to the server to send the same message that in the respective screens. 

  1. Customers, procedures: MulticastClient.java 

  Import java.io. *; 
  Import java.net .*; 
  Import java.util .*; 
  (Public class MulticastClient 
  Public static void main (String args []) throws IOException 
  ( 
  MulticastSocket socket = new MulticastSocket (4446); 
  / / Create 4446 port broadcasting socket InetAddress address = InetAddress.getByName ( "230.0.0.1"); 
  / / Get the address of 230.0.0.1 socket.joinGroup information (address); 
  / / Use joinGroup () will be bundled with Socket radio address on DatagramPacket packet; 

  For (int i = 0; i <5; i + +) ( 
  Byte [] = new byte buf [256]; 
  / / Create buffer packet = new DatagramPacket (buf, buf.length); 
  / / Create socket.receive reported receiving data (packet); / / receiver String received = new String (packet.getData ()); 
  / / From the receiver to receive data on an array of bytes, 
  / / And thus construct a String object System.out.println ( "Quote of theMoment:" + received); 
  / / Print been a string) / / cycle 5th socket.leaveGroup (address); 
  / / Socket radio address from the lifting of bundled socket.close () / / close Broadcasting socket) 
  ) 

  2. Server side procedures: MulticastServer.java 

  (Public class MulticastServer 
  Public static void main (String args []) throws java.io.IOException 
  ( 
  New MulticastServerThread (). Start (); 
  / / Launch of a server thread) 
  ) 

  3. Procedures MulticastServerThread.java 

  Import java.io. *; 
  Import java.net .*; 
  Import java.util .*; 
  Public class MulticastServerThread extends QuoteServerThread 
  / / QuoteServerThread succession to a new server thread category MulticastServerThread 
  ( 
  Private long FIVE_SECOND = 5000; / / definition of constant public MulticastServerThread 5 seconds (String name) throws IOException 
  ( 
  Super ( "MulticastServerThread"); 
  / / Call Father category, which is QuoteServerThread constructor) 

  Public void run () / / rewrite father of the main threads ( 
  While (moreQuotes) ( 
  / / According to determine whether to continue to sign variable cycle try ( 
  Byte [] = new byte buf [256]; 
  / / Create buffer String dString = null; 
  If (in == null) dString = new Date (). ToString (); 
  / / If the initialization of the failure to open the file, 
  / / Used as a date to send the string else dString = getNextQuote (); 
  / / Otherwise call from the member function in the document read out dString.getByte string buf = (); 
  / / String into the byte array, in order to send send it 
  InetAddress group = InetAddress.getByName ( "230.0.0.1"); 
  / / Get the address of 230.0.0.1 information DatagramPacket packet = new DatagramPacket (buf, buf.length, group, 4446); 
  / / In accordance with the buffer zone, radio address, and port number to create DatagramPacket object socket.send (packet); / / Send the Packet 
  Try ( 
  Sleep ((long) (Math.random () * FIVE_SECONDS)); 
  / / Random waiting for a period of time, five seconds between 0 ~) catch (InterruptedException e) () / / Exception Handling) catch (IOException e) (/ / Exception Handling e.printStackTrace (); / / Print the wrong stack 

  MoreQuotes = false; / / purchase marks the end of cycle) 
  ) 
  Socket.close () / / close Broadcasting socket) 
  ) 

  So far, Java network programming has been on the completion of this chapter.    Readers Through the study, the network should be programmed with a clear understanding of certain concepts may not be very clear, or the need for more practice to further grasp.    Programming language learning is different from the general study, and stressed the importance of practice.    Readers should URL network programming, the Socket TCP, UDP programming a lot of practice to better grasp mentioned in this chapter some of the concepts, we can really learn the essence of Java network programming! 

  The final section the examples cited by readers about the need to personally test, if they encounter problems, the solution to the.    According to its own best intentions can be improved.    Only in this way can a better understanding of these procedures, understanding, which contains programming ideas. 





  ↑ Back 

Rm players and jsp

  Abstract: rm players and jsp 

  </ Td> </ tr> <tr> <td height="35" valign="top" class="ArticleTeitle"> jsp page embedded with the rm format with players, players rm format images and music.    Function TempSave (ElementID) (CommentsPersistDiv.setAttribute ( "CommentContent" document.getElementById (ElementID). Value); CommentsPersistDiv.save ( "CommentXMLStore");) function Restore (ElementID) (CommentsPersistDiv.load ( "CommentXMLStore"); document . getElementById (ElementID). CommentsPersistDiv.getAttribute value = ( "CommentContent");) </ td> </ tr> <tr> 

  ↑ Back 

Using EL, JSTL form data processing

  Abstract: EL, JSTL form data processing 

  </ Td> </ tr> <tr> <td height="35" valign="top" class="ArticleTeitle"> <table width = "103%" border = "0" cellspacing = "0" cellpadding = " 0 "> <tr> <td width="286" height="86" align="left" valign="top"> </ td> <td width="398" valign="top"> 

  We used: 
  Request.getParameter (String name) and 
  Request.getParameterValues (String name) 
  Users in the form of input data, but can be used in the EL implied param object and 
  ParamValues to obtain data.    As follows: 


  Here param functions and request.getParameter (String name) the same, 
  And paramValues 
  And request.getParameterValues (String name) the same. 
  See examples: 
  Form (Form.html) 

<head>

  </ Td> </ tr> </ table> 

  </ Head> 
<body>
  <form Name="Example" method="post" action="Form.jsp"> 

  Name: <input type = "text" name = "Name" size = "15" maxlength = "15"> 


  Password: <input type = "password" name = "Password" size = "15" maxlength = "15"> 


  Sex: <input type = "radio" name = "Sex" value = "Male" checked> M 
  <input Type="radio" name="Sex" value="Female"> women 


  Age: 
  <select Name="Old"> 
  <option Value="10"> 10 to 20 </ option> 
  <option Value="20" selected> 21 to 30 </ option> 
  <option Value="30"> 31 ~ 40 </ option> 
  <option Value="40"> 41 to 65 </ option> 
  </ Select> 


  Interests: 
  <input Type="checkbox" name="Habit" value="Read"> 
  Read 
  <input Type="checkbox" name="Habit" value="Game"> 
  Games 
  <input Type="checkbox" name="Habit" value="Travel"> 
  Tourism 
  <input Type="checkbox" name="Habit" value="Music"> 
  Listen to music 
  <input Type="checkbox" name="Habit" value="Tv"> 
  Watching TV 



  <input Type="submit" value="提交"> 
  <input Type="reset" value="清除"> 


  </ Form> 

  </ Body> 

  Second, the JSP document processing forms 

  <% @ Page contentType = "text / html; charset = GB2312"%> 
  <% @ Taglib prefix = "c" uri = "http://java.sun.com/jsp/jstl/core"%> 
  <% @ Taglib prefix = "fmt" uri = "http://java.sun.com/jsp/jstl/fmt"%> 


<head>

  </ Head> 
<body>

  Using EL, JSTL form data processing 

  Name: 

  Password: 

  Sex:    M 

  F 

  Age: 
  10 ~ 20 

  21 ~ 30 

  31 ~ 40 

  41 ~ 65 


  Interests: 

  •   Read 1 

  •   Games 

  •   Tourism 

  •   Listen to music 

  •   Watching TV 



  •   </ Body> 



      </ Td> </ tr> <tr> 

      ↑ Back 

    Computer Chanshuadi test

      Abstract: The computer test Chanshuadi 

      </ Td> </ tr> <tr> <td height="35" valign="top" class="ArticleTeitle"> randomly selected from a database of 20 Chanshuadi, automatic test and check points.    I read a textbook example of rewriting, and I hope to help beginners jsp.    </ Td> </ tr> <tr> 

      ↑ Back 

    keep looking »