Javaweb Error Handling Highlights

Source: Internet
Author: User
Tags try catch

One: Cause

(1) Oneself next want to go the path of the algorithm, intends to put ten algorithms and mathematical model learning, is to give oneself before javaweb a summary;

(2) Remember that Java is the first more than the language of the start, but also with Javaweb through a very long time, to do a summary of their own;

(3) Javaweb project development process errors, always recurring, in order to avoid the need to find the trouble. Here's a summary.

(4) Javaweb programming general error Handling collection

Second: Incorrect grooming of the HTTP status status code

(1) 500 error: Server Internal error server encountered an error, unable to complete the request-indicates an unexpected condition inside the server that prevented him from completing the processing of the team request, an error occurred in: Advertised program execution errors on the server.

(2) 501 (not yet implemented) the server does not have the capability to complete the request.

For example, this code may be returned when the server does not recognize the request method (other 5** are rare);

(3) 404:not Found request not found, the requested resource is not found on the server (can be subdivided into 404.1-404.3) (not found) server could not find the requested Web page;

(4) 405: The page cannot be found, that is, the page you are searching for may have been deleted, renamed, or temporarily unavailable. (please check that the URL is spelled correctly and that the HTTP verb used to access this page is not agreed (the method is not approved).) (method Disabled) Disables the method specified in the request.

(5) The rest is not uncommon. Here is not to write, the specific please see http://www.cnblogs.com/DeasonGuan/articles/Hanami.html

(6) HTTP Status 403 (Forbidden)----> Server deny request (this crawls the page when you build the crawler, so you have to crawl content through user-agent spoofing)

(7) HTTP Status 400 (Error request)-----> server does not understand the syntax of the request.

(8) HTTP Status 200 (successful)-----> Server successfully processed the request. Typically, this indicates that the server provided the requested Web page. (20x indicates successful request, 200, 4,001 like jquery and Ajax)

Three: The wrong comb Java Exceptions

(3) ClassNotFoundException: The exception for the specified class is not found, typically the exception that is thrown when a program view is loaded into a class by a string (for example, a jar package is imported successfully;

References class, forname () ClassLoader, etc.);

(2) Nosuchmethodexception: Access to a non-existent method;

(3) SQLException: the JDBC Link database access exception (database service is not open, or database password problems, etc.);

(4) IllegalArgumentException: illegal anomaly;

(5) Indexoutofboundexception: Index out-of-bounds exception. The length of the array, string, list collection is exceeded.

(6) NullPointerException: This thing is the most common, but also the most difficult to find exception: null pointer exception, access to a pointer to a null object reference (can debug to locate the wrong bit of detail

Position of the null pointer, or add an empty statement before this statement. Of course, other exceptions that cause null are also used. Baidu should be there)

(7) Emptystackexception: Empty stack exception, run a stack operation on an empty stack

(8) FileNotFoundException: When the program view opens a file that does not exist. Read and write will throw an exception (seemingly not very much, a lot of read and write files. There is no self-created by themselves OH)

(9) Other anomalies are rare. Abnormal processing see Java exception hierarchy and Java exceptions for the actual combat chapter (Trows and try Catch Dead Code)

Summary: 1) is part of a section of project that you have done for yourself. 2) to Javaweb development, STL learning is over, 3) Open Big Data algorithm, Hadoop, spark learning path. 4) It is convenient to pick up the javaweb;5 again later. Graduate students should do something, although the publication of the paper is reduced, into a general journal

Javaweb Error Handling Highlights

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.