Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Yes: Use the <a href="http://download.oracle.com/javase/6/docs/technotes/guides/scripting/programmer_guide/index.html" rel="nofollow">Scripting API</a>.</p> <p>There are implementations to run scripts written in JavaScript, Groovy, Python and lots of other languages.</p> <p><strong>[EDIT]</strong></p> <p>Since it was mentioned in the comments: Be wary of security issues.</p> <p>There are several options:</p> <ol> <li>You allow end-customers to supply scripts (say in a web form)</li> <li>You don't allow customers to supply scripts; if a script needs to be changes an administrator or developer must start a specific tool.</li> <li>You develop a system which only allows to execute "safe" scripts</li> </ol> <p>Option #3 doesn't work (= only works for the most simple cases). There is a mathematical proof that a computer program can never tell what another program can potentially do without actually executing it.</p> <p>So you can get away with option #3 if you don't allow to call methods (or only a very, very limited set of methods). But most scripting languages allow to access Java classes which means you can eventually get <code>System.exit()</code> or <code>Runtime.exec()</code>. This in turn means you have to write a parser which makes sure that the code doesn't contain something odd.</p> <p>Which you will have to update every day because the customers will come up with new ... err ... <em>interesting</em> ways to use the feature.</p> <p>Also chances are that you'll make a mistake - either the parser won't accept valid input or it will let malicious code pass. Given the complexity of the problem, the chance is between 99.9999% and 100%.</p> <p>Option #1 means no security at all but after the third change, customers will berate you to adopt it. It will work for some time until the first script kiddie comes along and ruins everything. Guess whose fault that will be? The manager who hired <s>his nephew</s>... the kid?</p> <p>So a human will have to eyeball the scripts, fix all the bugs in them and configure the system to run them. Option #2 will cause all kinds of griefs, too, but it will cause less grief, all things considered.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload