Win a copy of Java EE 8 High Performance this week in the Java/Jakarta EE forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Customizing messages for filesize exceed in java servlet?  RSS feed

Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working on SmartGwt application with file savings. My upload servlet accepts more than one file. If one of the files is exceeding filesize treshold, I will need to localize the file and send customized error message back then.

Servlet code:

I am not associated with catching IllegalStateExceptions and checking its message. My multipart configuration is placed in web.xml

I would like to localize both the file and the message in the servlet - that means find the exceeding file and customize message - example: "File 'exmaple.mp3' is exceeding maximum size of 2 MB" and also "Your package of mp3s is exceeding maximum size of 100 MB".

Is it possible to localize the file ? Can error messages be customized in any configuration file (web.xml - multipart conf, ...) ? Any others ideas ?
Thanks for your answers
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!