@MultipartConfig override in web.xml

前端 未结 1 621
予麋鹿
予麋鹿 2020-12-16 04:21

So I have this servlet :

    @WebServlet(name = \"StudentRegistrationUsn\", urlPatterns = {\"/university/student/registration\"})
@MultipartConfig(maxFileSiz         


        
相关标签:
1条回答
  • 2020-12-16 04:48

    The <servlet-class> is missing in web.xml. This exception is basically caused because the name of the to-be-loaded class is null.

    In fact, you need to redefine everything, including the URL patterns.

    <servlet>
        <servlet-name>StudentRegistrationUsn</servlet-name>
        <servlet-class>com.example.StudentRegistrationUsn</servlet-class>
        <multipart-config>
            <max-file-size>10485760</max-file-size>
            <max-request-size>20971520</max-request-size>
            <file-size-threshold>5242880</file-size-threshold>
        </multipart-config>
    </servlet>
    <servlet-mapping>
        <servlet-name>StudentRegistrationUsn</servlet-name>
        <url-pattern>/university/student/registration</url-pattern>
    </servlet-mapping>
    
    0 讨论(0)
提交回复
热议问题