The fact is that you don't specify at what level you want a Perl-JSP interaction.
If it's the "basic" client-server interaction, you can probably benefit from LWP::UserAgent and its powerful descendant WWW::Mechanize. Both let you build up a flexible "client-side" to interact with the JSP "server-side", even if the second is more suited to mimic a browser interaction with the server (and you get both of them, actually, because WWW::Mechanize is a subclass of LWP::UserAgent).
Flavio
perl -ple'$_=reverse' <<<ti.xittelop@oivalf
Don't fool yourself.
| [reply] |
#!/usr/bin/perl
use strict;
use warnings;
use LWP::UserAgent;
my $url = "http://www.perlmonks.org/?displaytype=xml;node_id=609084";
# Create a user agent
my $ua = LWP::UserAgent->new;
# Set the user agent string - useful for spelunking logs
$ua->agent( "myapp" );
# Get the data
my $res = $ua->get( $url );
# Check the outcome of the response
if( $res->is_success ) {
print $res->content, "\n";
}
I do this all the time ... the perl cgi-script (or mod_perl handler) will parse params, construct a url, fetch data (normally xml), and then format the fetched data.
Update: removed the extraneous use of HTTP::Request ... thanks polettix | [reply] [d/l] |
It depends on who is calling who or if both are running in parallel. If JSP is calling perl, Runtime.getRuntime().exec(...)
can run any shell command, including invocation of a Perl program and give it arguments in the command line which Perl picks up as @ARGV.If it's the other way round, there are many ways for Perl to invoke the .jsp, including using ``, system(), but the most comprehensive is IPC::Run3. If it's parallel, then maybe communicate through a named pipe.
| [reply] [d/l] |