October 23 Java Web training diary

Source: Internet
Author: User

The example program of client identity authentication is analyzed. During digest authentication, sslserversocket is mentioned by the way, requiring students to elaborate the factory mode through the sslserversocket creation process.

To better understand the authenticateservlet servlet, We need to explicitly put the processing code of both requests in this service method. Each request executes a piece of code, which is equivalent to if .. else....

Next we will explain how various form fields pass parameters to the Web server and their application scenarios in actual projects. The list box must have no option: You can discard the option by pressing Ctrl, but you cannot expect the user to do this.
Example of hidden fields: In paging query, the form only has the start time and end time, and the current page number needs to be passed as a hidden field. The email in step 1 of the Registration Wizard hides fields on the second page.
How to prevent repeated submission of forms
Why is the HTTP Request Method for Google and Baidu search get?
The getparameter and getparametervalues methods are used in actual projects.
Getparameter cannot retrieve form information in the form of multipart/form-data. You can use the decorator design mode to solve the problem.
The decorator design mode has previously been explained many times. Taking filewrapper as an example, we need to have the original file function, but we need to add the function of getting a father and determining whether we are old-fashioned, think of the decorator design pattern.

Practical cases for processing multiple list items at a time and explanations of the encoding tips

This section describes how to obtain the entity content of the request message. The data structure in the multipart/form-data format is used to test the students on their basic encoding capabilities:
For such a string: "---- XXX ---- bbbbbbbb ---- CCCCC ----", "----" is used to separate each part of the content. Extract and print each part of the content, string is required. indexof and string. the substring method. Pay attention to the string. the meanings of the two parameters of the substring method.
String src = "---- AA ---- BBB ---- CCCC ----"
String splitter = "----";
Int endindex = 0;

Int startindex = SRC. indexof (splitter)
While (startindex! =-1)
{
Endindex = SRC. indexof (splitter, startindex + splitter. Length ());
If (endindex! =-1)
{
System. Out. println (
SRC. substring (startindex + splitter. Length (), endindex ));
Startindex = endindex;
}
Else
{
Break;
}
// Startindex = endindex;
}

Use the following code to compare and explain
E = V. enumate ();
While (E. hasmoreelements ())
{
E. nextelement ();
}

I think of a practical problem in my paging encoder project many years ago: There is a loop queue, where one thread places data and the other thread retrieves data, which can be arranged as exercise questions for everyone to do, input on the keyboard to simulate data placement, and use a timer to simulate data acquisition.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.