如何运行jsp的,从一个shell? [英] How to run a shell from Jsp?

查看:100
本文介绍了如何运行jsp的,从一个shell?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题是自我解释。
我想运行一个壳,这就是用一个按钮调用一个过程,从一个jsp。
该过程是

Hey guys, my question is self explanatory. I want to run a shell,thats calling a procedure, from a jsp using a button. The procedure is


CREATE OR REPLACE PROCEDURE DEMO_PRC (dist IN variable,mrno IN variable,
yr IN variable,flags OUT number)
IS
begin
flags:=0;
// CODE THAT GENERATES A UTIL.....
flags:=1;
end;
/

和外壳是:


sqlplus demo_user/123456@demo
var a NUMBER(4);
exec DEMO_PRC($1,$2,,$3,:a);
print a;

命名它dist.sh,它是在命令行中运行如下:

Named it dist.sh and it is run in command line as:

dist.sh 3 1937 10

但我想从JSP运行它,当我点击一个button.But我不知道语法运行shell(.SH)FOM的jsp。

But i want to run it from a jsp when i click a button.But i dunno the syntax to run shell(.sh) fom jsp.

任何帮助将AP preciated。

Any help will be appreciated.

感谢您

推荐答案

您可以通过的 运行

You can execute arbitrary processes via the Runtime class:

Runtime.getRuntime().exec("...a string here specifying the command to run...");

有这取决于你多大的控制权需要几个重载,等你需要确保用户帐户JSP中的使用已获得的一切必要的您正在运行的命令。

There are several overloads depending on how much control you need, etc. You'll need to be sure that the user account your JSPs use has access to everything necessary for the command you're running.

这篇关于如何运行jsp的,从一个shell?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆