Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

perl script handled by java

by tart (Beadle)
on Nov 23, 2011 at 03:51 UTC ( [id://939584]=perlquestion: print w/replies, xml ) Need Help??

tart has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,

I am not sure if this is the right place to ask this question but I have no options so here I am,

I want to know if there are ways jsp can interact with perl script.

From GUI(JSP) I want to,
1. execute the perl script.
2. capture the STDOUT generated by perl script.
3. check for error $?.
4. handle STDIN.

So I am just looking for suggestions from experienced Monks if there are any libraries available in java to make the java and perl interaction reliable to achieve what I want to do please let me know.
I am novice programmer so please feel free to post your suggestion (whatever you have in your mind) regarding what I want to achieve,

Appreciate any suggestion,

Thanks

Replies are listed 'Best First'.
Re: perl script handled by java
by Utilitarian (Vicar) on Nov 23, 2011 at 11:33 UTC
    Tomcat supports CGI, so an AJAX call to the Perl script within the JSP template is one possible workaround.

    print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."
Re: perl script handled by java
by Anonymous Monk on Nov 23, 2011 at 07:36 UTC

    So I am just looking for suggestions

    Look in the manual, use system/process as search term. Heck, you can even use STDIN/STDOUT/STDERR. This is universal. It should take all of 1 minute with a good search engine.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://939584]
Approved by Ratazong
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2024-03-19 05:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found