since I have java 8 installed, I already have that capability! I tested some javascript on a page using {{script language="javascript"}} and it works perfectly.

The reason I wanted to do this, is I am using an entry validation library to validate user input in the browser, but of course you would want to re-validate on the server side, and why duplicate efforts in velocity, when you already have the library in javascript?

Dan

-----Original Message----- From: Thomas Mortagne
Sent: Friday, August 05, 2016 1:32 AM
To: XWiki Users
Subject: Re: [xwiki-users] Using Javascript as a scripting language

Two possibilities:
* you have a javascript engine (Nashorn) provided with the JDK (at
least the Oracle one and OpenJDK) so no need to do anything in that
case
* Nashorn is not part of the JRE but it's compatible with it so you
can take the nashorn.jar from the JDK or build your own JRE version
(see http://stackoverflow.com/questions/28054849/nashorn-script-engine-is-null-on-java-8-se-embedded).
Note that I never tested that, just found it when Googling a bit.

Then you use what you suggested in your mail.

On Thu, Aug 4, 2016 at 8:30 PM, dullfig <da...@grmcompany.com> wrote:
Hello:

What would need to happen (install engine?) for me to be able to do the
following:

{{script language="javascript"}}

{{/sript}}

in other words, server side javascript

Dan



--
View this message in context: http://xwiki.475771.n2.nabble.com/Using-Javascript-as-a-scripting-language-tp7600580.html
Sent from the XWiki- Users mailing list archive at Nabble.com.
_______________________________________________
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users



--
Thomas Mortagne
_______________________________________________
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users

_______________________________________________
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users

Reply via email to