Page 1 of 1

Velocity setup in a .war deployment?

PostPosted: Wed Oct 21, 2020 7:50 pm
by joe26
Hi all,

The velocityreport.serverURL is http://localhost:8183 and I'm getting an error indicating the URL is using the Servoy container URL of http://localhost:8183/STSX/eastwood/genbc.....

The returned URL should read http://localhost:8183/eastwood/genbc... (generating barcodes)

when called with 'plugins.VelocityReport.getPDFReport('infoSheet.html',context);'

I have the configuration incorrect for the .war deployment and not sure where to do with this error.

eastwood.war is in the main Apache Tomcat webapps directory.

Is a rewrite rule necessary to remove the "STSX\" from the URL on the eastwood side?

Finally, redeployed .war as ROOT.war instead of STSX.war and deployed eastwood.war. It functions but get a
SEVERE: Item at URI http://localhost:8183/eastwood/eastwood ... styles.css not found

Not sure how this would be deployed on an existing server.

thanks,
--Joe.

Code: Select all
Oct 21, 2020 2:04:39 PM com.servoy.j2db.util.Debug error
SEVERE: IO problem for http://localhost:8183/eastwood/reports/css/styles.css
   at jobsts/scopes/globals/setSampleBarsContext:13646 (setSampleBarsContext)
   at STS3/forms/MWBase/onActionClickInfoSheet:1659 (onActionClickInfoSheet)


Code: Select all
Velocity v3.5.84
velocity.encryptPassword:     
velocityreport.serverURL:     http://localhost:8183/
velocityreport.reportfolder:     \\P2VM02\STSXTemp
velocityreport.cacheCheckTime:     
velocity.deleteTempAfterServe:   

Re: Velocity setup in a .war deployment?

PostPosted: Thu Oct 22, 2020 3:04 pm
by ptalbot
What you could try to do is to put a full URL (instead of a relative URL) for your CSS styles.css, or place it in ROOT/css/ and put the reference in your "infoSheet.html" template as:
Code: Select all
<link rel="stylesheet" href="http://localhost:8183/css/style.css" type="text/css"/>

Re: Velocity setup in a .war deployment?

PostPosted: Tue May 17, 2022 3:09 pm
by LXS
Hi,
currently i'm playing around with Servoy 2022.03 and have the same questions like joe26 how to correctly setup the Velocity plugin in a Tomcat environment with .war deployment.
I'm using the latest plugin version 3.5.93.

@ptalbot:
On earlier Servoy versions which has a dedicated Servoy Application Server installed on a server machine it was easy. Simply put eastwood.war in <servoy>/application_server/server/webapps/ folder and set property velocityreport.serverURL to the external server address.

But how is the setup with a standalone Tomcat and a .war deployment where the .war file is NOT ROOT.war?
Is the only possible way to deploy the Servoy Server on Tomcat ROOT without context?

Thank you very much!
Alex

Re: Velocity setup in a .war deployment?

PostPosted: Tue May 17, 2022 5:16 pm
by ptalbot
@Alex You can totally use velocity inside a context, it will work for the most part, provided you've setup the velocityreport.reportFolder to the folder that contains your templates, and velocityreport.serverURL to the external url of your server (including the context).
For images, charts and barcodes coming from the eastwood.war though, you will have to define the url yourself in your templates (which will be based on the server URL without the context).
I might add another servoy-admin property to setup the path of the eastwood.war to facilitate the use of images, charts and barcodes when deployed under a context, stay tuned! :)

Re: Velocity setup in a .war deployment?

PostPosted: Tue May 17, 2022 5:53 pm
by LXS
Thank you very much for your fast reply Patrick!
I'll try it out to edit the image urls in my templates!
A new servoy admin property would be nice! :-)

Alex

Re: Velocity setup in a .war deployment?

PostPosted: Tue May 17, 2022 10:31 pm
by ptalbot
Check-out Velocity v3.5.94 that should solve related url issues when deployed in a context:
I've added a new "velocity.eastwoodURL" servoy-admin property to be able to setup the external url of the eastwood war independently from the servoy context.
I've also made it so that all files (css/js/images) with a href related to a template are served by a File servlet based on the velocityreport.reportFolder location and the velocityreport.serverURL (both must be set) and the location of the template in the report folder.

Re: Velocity setup in a .war deployment?

PostPosted: Wed May 18, 2022 8:41 am
by LXS
wow Patrick! Thank you very much for the very fast new release! I'll try it out! :-)

Re: Velocity setup in a .war deployment?

PostPosted: Wed May 18, 2022 10:43 am
by LXS
Hey Patrick,
I've tested the new plugin version 3.5.94 and set the new velocity.eastwoodURL property.
It just works with tomcat context! :-)

Thanks again!