On 01/06/2023 10:18, Torsten Krah wrote:
Am Donnerstag, dem 01.06.2023 um 08:52 +0000 schrieb Lauri:
You mention a servlet part, but I do not use a servlet.
All the code is contained in the JSP page.

You need to divide that code in a JSP and in your upload servlet as you
need to provide the @MultipartConfig on that servlet which handles your
upload.
Without that you will get:

Unable to process parts as no multi-part configuration has been provided

as an exception when accessing the request.getParts() API.

The whole thing is all written there btw:

https://docs.oracle.com/javaee/6/tutorial/doc/glrbb.html

I don't know - maybe Mark does - if you can annotate a JSP page, had
never seen it or read about that so my best guess is, you can't do that
and you need to use a servlet + jsp unless you want to overwrite the
JspServlet from Tomcat with a custom one which does have that
annotation and handles the Jsp stuff.

You can do this via web.xml. See the following SO question for an example specific to this question:

https://stackoverflow.com/questions/37965890/add-annotation-to-jsp

For some more general examples:

https://github.com/apache/tomcat/blob/main/test/webapp/WEB-INF/web.xml

Search for "<jsp-file>"

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to