LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Java fileupload class not working, part 2 (https://www.linuxquestions.org/questions/linux-server-73/java-fileupload-class-not-working-part-2-a-4175735032/)

mfoley 03-18-2024 01:30 PM

Java fileupload class not working, part 2
 
When I upgraded to Tomcat 10.1.13 I had to change the java class I was using to jakarta.servlet.annotation.MultipartConfig. See my previous thread:
https://www.linuxquestions.org/quest...1-a-4175729983.

That worked, but I've run into a problem. This class requires the following config in WEB-INF/web.xml:
Code:

<servlet>
          <servlet-name>uploadfile</servlet-name>
          <jsp-file>/myprog1.jsp</jsp-file>
          <multipart-config>
              <location>/tmp</location>
              <max-file-size>20848820</max-file-size> 
              <max-request-size>418018841</max-request-size>
              <file-size-threshold>1048576</file-size-threshold>
          </multipart-config>
</servlet>
<servlet-mapping>
            <servlet-name>uploadfile</servlet-name>
            <url-pattern>/myprog1.jsp</url-pattern>
</servlet-mapping>

All that worked, but then I needed to add another program with fileupload so I added another entry to web.xml after the above one:
Code:

<servlet>
          <servlet-name>uploadfile</servlet-name>
          <jsp-file>/myprog2.jsp</jsp-file>
          <multipart-config>
              <location>/tmp</location>
              <max-file-size>20848820</max-file-size> 
              <max-request-size>418018841</max-request-size>
              <file-size-threshold>1048576</file-size-threshold>
          </multipart-config>
</servlet>
<servlet-mapping>
            <servlet-name>uploadfile</servlet-name>
            <url-pattern>/myprog2.jsp</url-pattern>
</servlet-mapping>

Well, that didn't work so well. Now any program that uses fileupload, including myprog1.jsp, ends up launching myprog2.jsp.

How do I configure this to permit more than one fileupload program?


All times are GMT -5. The time now is 07:04 AM.