call ruby through jsp
I have a ruby program on my machine.
I want call it over the web.
I have built a jsp page for this and have made a call:
<%
Runtime rt = Runtime.getRuntime();
开发者_运维知识库Process proc = rt.exec("ruby somepathtoruby.rb");
%>
Doesn't seem to be working properly though.
Can anyone help me out here?
I believe you can capture the output of the Ruby program the same way you would capture the output of any other separate process you launch from Java
This page shows how to do it for a standalone Java application. You should be able to work it into a scriptlet in your JSP.
精彩评论