Servlet Common Error Versue

xiaoxiao2021-03-06  121

Servlet Common Error Catheter:

_____________________________________________________

Possible cause of failure

_____________________________________________________

Servlet does not compile except for the usual Java language error, there are some reasons for servlet:

1 No import javax.servlet. * Or javax.servlet.http. *;

Category 2 does not implement subclass servlet or one subclass;

3 servlet.jar is not set in the class path

_____________________________________________________

There may be many reasons for no loading of servlet:

1 Use the wrong URL (eg, no specified / servlet);

2 cases wrong;

The 3 category is not in the servlet path of the servlet engine;

4 The associated class is not in the classpath of the Servlet engine;

5 servlet failed during initialization

6 The servlet engine is not in operation;

7 Web server is not in operation

____________________________________________________

Empty Parameter View GetParameteter () Does a parameter with multiple values

____________________________________________________

Empty pointer exception This may indicate such a failure: Creating a session from the session extraction value

____________________________________________________

Error Value of the initial parameters Value confirm that the parameter name spelling is the same as the servlet attribute in the program.

(Note cases)

_____________________________________________________

Empty initialization parameter init () method does not call super.init (config)

_____________________________________________________

The servlet engine hangs the destroy () method when it is closed, and super.destroy ();

_____________________________________________________

The wrong MIME type ensures that setContentType () is called before writing to the response stream;

_____________________________________________________

The destroyed data value is confirmed whether or not to use the instance variable in a non-petrified method.

Remember: SingleThreadMode is implemented unless displayed, otherwise

Single instance of servlet can be run by multiple threads, if this is the case,

Any instance variable is shared by all threads.

转载请注明原文地址:https://www.9cbs.com/read-101552.html

New Post(0)