Velocity setup in a .war deployment?

Questions and answers on developing, deploying and using plugins and JavaBeans

Velocity setup in a .war deployment?

Postby joe26 » Wed Oct 21, 2020 7:50 pm

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:   
joe26
 
Posts: 172
Joined: Wed Jun 19, 2013 10:30 pm

Re: Velocity setup in a .war deployment?

Postby ptalbot » Thu Oct 22, 2020 3:04 pm

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"/>
Patrick Talbot
Freelance - Open Source - Servoy Valued Professional
https://www.servoyforge.net
Velocity rules! If you don't use it, you don't know what you're missing!
User avatar
ptalbot
 
Posts: 1654
Joined: Wed Mar 11, 2009 5:13 am
Location: Montreal, QC

Re: Velocity setup in a .war deployment?

Postby LXS » Tue May 17, 2022 3:09 pm

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
Alexander Stefan
Dr. Maison & Partner GmbH
www.servoy-plugins.de
www.maison-partner.de
LXS
 
Posts: 151
Joined: Thu Mar 01, 2007 12:00 am

Re: Velocity setup in a .war deployment?

Postby ptalbot » Tue May 17, 2022 5:16 pm

@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! :)
Patrick Talbot
Freelance - Open Source - Servoy Valued Professional
https://www.servoyforge.net
Velocity rules! If you don't use it, you don't know what you're missing!
User avatar
ptalbot
 
Posts: 1654
Joined: Wed Mar 11, 2009 5:13 am
Location: Montreal, QC

Re: Velocity setup in a .war deployment?

Postby LXS » Tue May 17, 2022 5:53 pm

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
Alexander Stefan
Dr. Maison & Partner GmbH
www.servoy-plugins.de
www.maison-partner.de
LXS
 
Posts: 151
Joined: Thu Mar 01, 2007 12:00 am

Re: Velocity setup in a .war deployment?

Postby ptalbot » Tue May 17, 2022 10:31 pm

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.
Patrick Talbot
Freelance - Open Source - Servoy Valued Professional
https://www.servoyforge.net
Velocity rules! If you don't use it, you don't know what you're missing!
User avatar
ptalbot
 
Posts: 1654
Joined: Wed Mar 11, 2009 5:13 am
Location: Montreal, QC

Re: Velocity setup in a .war deployment?

Postby LXS » Wed May 18, 2022 8:41 am

wow Patrick! Thank you very much for the very fast new release! I'll try it out! :-)
Alexander Stefan
Dr. Maison & Partner GmbH
www.servoy-plugins.de
www.maison-partner.de
LXS
 
Posts: 151
Joined: Thu Mar 01, 2007 12:00 am

Re: Velocity setup in a .war deployment?

Postby LXS » Wed May 18, 2022 10:43 am

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!
Alexander Stefan
Dr. Maison & Partner GmbH
www.servoy-plugins.de
www.maison-partner.de
LXS
 
Posts: 151
Joined: Thu Mar 01, 2007 12:00 am


Return to Plugins and Beans

Who is online

Users browsing this forum: No registered users and 7 guests

cron