A股上市公司传智教育(股票代码 003032)旗下技术交流社区北京昌平校区

 找回密码
 加入黑马

QQ登录

只需一步,快速开始

Last week I learnt Java for 6 weeks and almost learnt Servlet during week. What is the Servlet in Java anyway? It is the abbreviation of “Server Applet”, just means an applet runs in the Server. I never learn this before, this is sort difficult for me. Here are the things that I learnt and the problems I encountered.

1.        Dup Servlets Names: Server is unable to be booted and throw the exception:
Caused by: java.lang.IllegalArgumentException: The servlets named [MyServletDemo03] and [newDemos.MyServlet] are both mapped to the url-pattern [/myServlet] which is not permitted
2.        Incorrect Library Name: Everything can be done and the code can be run correctly separately and File or Class cannot be found when running all the code together.
JunitTest can be passed.
Description The server encountered an unexpected condition that prevented it from fulfilling the request.
java.lang.NoClassDefFoundError: org/springframework/jdbc/core/RowMapper
javax.servlet.ServletException: Servlet execution threw an exception
3.        Cause recursion when invoking the method itself in a method:
Description: java.lang.StackOverFlowError
4.        Missing the pathSeparate in the Servlets names: Server is unable to be booted and throw exceptions:
org.apache.tomcat.util.modeler.BaseModelMBean.invoke Exception invoking method createStandardContext
Caused by: java.lang.IllegalArgumentException: Invalid <url-pattern> [downloadAndUpload] in servlet mapping
5.        There are 2 mistake can commit when typing the path of the invoking a verifyCode class.
1.        Miss the pathSeparate symbol ‘/’ at the beginning of the string resulting the picture is unable to be shown.
2.        Miss the Question Mark ‘?’ at the end of the string (actually before the variable value) resulting the picture is unable to be shown.
Note: If not adding the variable value at the end of the string, the verify code is only able to be changed once, due to the cache in the browser.
6.        Refuse to access the file or directory or unable to find the file. Here are 3 conditions can be resulted this problem.
1.        When typing the download_functionable class, missing the filename in the realPath can result this issue. (refuse to access)
2.        When typing the download_functionable class, missing the pathSeparate symbol between the path and filename can result this issue. (unable to find the file)
3.        When typing the upload_functionable class, missing the filename in the realPath can be resulted this issue. (refuse to access)

0 个回复

您需要登录后才可以回帖 登录 | 加入黑马