Project

General

Profile

Defect #1597

POST with a JSFile in multipart body fails in the VelocityWebServlet

Added by Robert Ivens about 2 months ago. Updated about 2 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
velocity
Target version:
-
Start date:
03/21/2025
Due date:
% Done:

0%

Estimated time:
Browser (if web client):

Description

I do a REST call (in developer 2024.12.0) from an NG Client to Velocity 3.8.3 as a multipart. Then when I add a JSFile I get the following error. When I remove the JSFile from the call then it does come through.
Also maybe related to this multipart code. When I send 1 parameter in the multipart then the parameter section in the request is empty, but the body dopes show the parts.

javax.servlet.ServletException: Servlet execution threw an exception
   com.servoy.eclipse.ngclient.ui.IndexPageFilter.doFilter(IndexPageFilter.java:167)
   com.servoy.eclipse.ngclient.startup.resourceprovider.ResourceProvider.doFilter(ResourceProvider.java:341)
   com.servoy.eclipse.designer.rfb.startup.EditorContentFilter.doFilter(EditorContentFilter.java:198)
   org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
Root Cause

java.lang.NoSuchMethodError: 'void com.servoy.extensions.plugins.file.JSFile.<init>(java.io.File)'
   net.stuff.servoy.plugin.velocityreport.util.Utils.wrapIntoJSFile(Utils.java:918)
   net.stuff.servoy.plugin.velocityreport.server.VelocityWebServlet.getParametersMap(VelocityWebServlet.java:2001)
   net.stuff.servoy.plugin.velocityreport.server.VelocityWebServlet.vrService(VelocityWebServlet.java:755)
   net.stuff.servoy.plugin.velocityreport.server.VelocityWebServlet.doPost(VelocityWebServlet.java:275)
   net.stuff.servoy.plugin.velocityreport.server.VelocityWebServlet.service(VelocityWebServlet.java:217)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:590)
   com.servoy.j2db.server.servlets.WebServicesServlet.service(WebServicesServlet.java:24)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:590)
   com.servoy.eclipse.ngclient.ui.IndexPageFilter.doFilter(IndexPageFilter.java:167)
   com.servoy.eclipse.ngclient.startup.resourceprovider.ResourceProvider.doFilter(ResourceProvider.java:341)
   com.servoy.eclipse.designer.rfb.startup.EditorContentFilter.doFilter(EditorContentFilter.java:198)
   org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)

Files

velocityreport.jar (638 KB) velocityreport.jar Patrick Talbot, 03/22/2025 05:56 PM

History

#1

Updated by Patrick Talbot about 2 months ago

  • File velocityreport.jar added
  • Category set to velocity

Looks like they have changed the signature of the JSFile constructor, which now also ask for an IClientPluginAccess parameter...

I still need to keep the compatibility with older Servoy versions though :(

Could you try the attached jar and tell me if this fixes the issue, please?

#2

Updated by Robert Ivens about 2 months ago

This version does indeed work for me with 2024.12.

As for my multipart question. It seems that the servlet assumes that a DELETE request never has a payload. In my case I send a multipart payload. But the request always shows "multipart: false", even though the content-type is set to multipart.
So the parameters property is an empty object and the parts array is not there.
The call works fine with a POST and PUT.

#3

Updated by Patrick Talbot about 2 months ago

  • File deleted (velocityreport.jar)
#4

Updated by Patrick Talbot about 2 months ago

Both issues are fixed in v3.8.4

Although the specs says that the content received in DELETE has no generally defined semantics, and it is recommended to either reject the request or ignore the content, I have now allowed in this version for multipart content to be parsed (if present) for any HTTP verbs...

See updated jar attached and v3.8.4 release.

Also available in: Atom PDF