LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-18-2024, 01:30 PM   #1
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,555

Rep: Reputation: 177Reputation: 177
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?
 
  


Reply

Tags
fileupload, servlet, tomcat10, web.xml



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] FileUpload class not working with Tomcat 10.1 mfoley Linux - Server 1 11-27-2023 02:02 PM
[SOLVED] FileUpload class not working with Tomcat 10 mfoley Linux - Server 9 04-13-2022 12:11 PM
[SOLVED] Cannot compile for FileUpload class mfoley Programming 5 04-07-2022 01:31 AM
Java: what's the difference between an inner class and a static inner class? irey Programming 6 01-28-2009 03:34 AM
Running a Java executable class from another executable class LUB997 Programming 22 07-24-2005 04:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration