RE: calling Perl Script from JSP?

2004-09-22 Thread Drue Reeves
Chris,
 
Thank you. This is starting to make more sense now. I may have more questions but, 
I'll go do some homework first. I'll start with the book you mentioned.
 
Thanks,
 
Drue

Chris Devers [EMAIL PROTECTED] wrote:
First of all, Perl is the language, perl is the program that runs 
programs written in Perl, and PERL isn't a word.

On Tue, 21 Sep 2004, Drue Reeves wrote:

 Why is it bad to mix JSP and Perl?

They are just much different frameworks. 

Most Java systems I'm aware of (and I'll plead guilty to some ignorance 
here) pretty much want you to do everything in Java, from the JSP 
scripts that display pages to the beans (or whatever) that implement the 
site logic to, sometimes, the database itself. 

Perl on the other hand is often the glue holding a heterogeneous 
system together. It's very good for getting a bunch of disparate pieces 
that are either old or maybe came from different places to play nicely 
together. 

I know nothing about your JSP system, but conventionally, shops that 
have decided to go with JSP seem to do everything in JSP, just because 
there's so much inertia behind getting everything locked in to Java. 


I seem to be talking about the cultures more than the languages.

Oh well.

 Maybe a better question is how do you call a Perl script from a web 
 page (and pass parameters)?

There is a lot of flexibility here.

Often, Perl *is* the web page, whether by a CGI script that runs perl 
and executes the script with each page view, or a mod_perl plugin that 
embeds perl into Apache so that scripts are persistent in memory (which 
is the approach that JSP and other languages seem to take, right?). 

But if you just have a static HTML document that needs to call Perl 
somehow, the usual way is either by a form's tag or just by 
following a link. In either case, this usually ends up being a GET or 
POST request to a Perl script that has been exposed as a web page with a 
URL. For POST requests, the parameters are sent to the script basically 
as a text document that is uploaded to the server, while for GET 
requests the data comes in following the script. Hence,

http://google.com/search?q=http%20protocol
^ ^ ^ ^-- parameters to the script
| | +--- the script / program / whatever
| + the domain
+- the protocol

And if this doesn't make sense, there's lots of documentation out there. 
This book may help clarify things -- it's old now, but the fundamentals 
haven't changed since it was published:



So, if you're working via HTTP -- as you're doing on the web -- then it 
just ends up being a URL that you GET from or maybe POST to. 

Make sense? More questions?


-- 
Chris Devers


RE: calling Perl Script from JSP?

2004-09-21 Thread NYIMI Jose \(BMB\)
 -Original Message-
 From: Drue Reeves [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, September 21, 2004 4:49 AM
 To: [EMAIL PROTECTED]; Cary Andrews
 Subject: calling Perl Script from JSP?
 
 
 
 Anyone know how to call a PERL Script from a JSP and pass 
 parameters to the script?
 
 I have a JSP that will call PERL but, everytime we try to add 
 a script nothing happens. Any ideas?
 

Very bad idea trying to mix Perl and JSP ...
Which feature of Perl do you want to use in your JSP page that you can't get from Java 
?

José.


 DISCLAIMER 

This e-mail and any attachment thereto may contain information which is confidential 
and/or protected by intellectual property rights and are intended for the sole use of 
the recipient(s) named above. 
Any use of the information contained herein (including, but not limited to, total or 
partial reproduction, communication or distribution in any form) by other persons than 
the designated recipient(s) is prohibited. 
If you have received this e-mail in error, please notify the sender either by 
telephone or by e-mail and delete the material from any computer.

Thank you for your cooperation.

For further information about Proximus mobile phone services please see our website at 
http://www.proximus.be or refer to any Proximus agent.


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




RE: calling Perl Script from JSP?

2004-09-21 Thread Jenda Krynicky
From: NYIMI Jose \(BMB\) [EMAIL PROTECTED]
  -Original Message-
  From: Drue Reeves [mailto:[EMAIL PROTECTED]
  Anyone know how to call a PERL Script from a JSP and pass
  parameters to the script?
 
  I have a JSP that will call PERL but, everytime we try to add
  a script nothing happens. Any ideas?
 

 Very bad idea trying to mix Perl and JSP ...
 Which feature of Perl do you want to use in your JSP page that you
 can't get from Java ?

 Jos.

Ease of use? Freedom? The loads of CPAN modules? Simply ... the
power?

What exactly do you mean by call?

Do you need to
1) run a Perl script after the user clicks a link or button on the
page returned by your JSP?
2) start a local Perl script while processing the JSP on the server,
capture the output and include it in the resulting page?
3) start a remote Perl CGI script while processing the JSP on the
server, capture the output and include it in the resulting page?

In the first case you just need to either construct the URL to the
script plus the parameters or create a form action=URL of the
script with some hidden fields for those values and let the user
submit the form.

In the other two cases you are very unlikely to get much help in
here. Try a Java/JSP related mailing list. I have no idea how to do
either in Java and I'd love it to remain so.

Jenda
= [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =
When it comes to wine, women and song, wizards are allowed
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response




RE: calling Perl Script from JSP?

2004-09-21 Thread Drue Reeves
Mainly some LDAP calls. PERL makes it easy to develop applications that do search and 
modify in LDAP with very little code. Java and C++ take much more code. Plus, PERL had 
some example code that made the development very simple.
 
Why is it bad to mix JSP and PERL?
 
Maybe a better question is how do you call a PERL script from a web page (and pass 
parameters)?
 
Thank you,
 
Drue

NYIMI Jose (BMB) [EMAIL PROTECTED] wrote:
 -Original Message-
 From: Drue Reeves [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, September 21, 2004 4:49 AM
 To: [EMAIL PROTECTED]; Cary Andrews
 Subject: calling Perl Script from JSP?
 
 
 
 Anyone know how to call a PERL Script from a JSP and pass 
 parameters to the script?
 
 I have a JSP that will call PERL but, everytime we try to add 
 a script nothing happens. Any ideas?
 

Very bad idea trying to mix Perl and JSP ...
Which feature of Perl do you want to use in your JSP page that you can't get from Java 
?

José.


 DISCLAIMER 

This e-mail and any attachment thereto may contain information which is confidential 
and/or protected by intellectual property rights and are intended for the sole use of 
the recipient(s) named above. 
Any use of the information contained herein (including, but not limited to, total or 
partial reproduction, communication or distribution in any form) by other persons than 
the designated recipient(s) is prohibited. 
If you have received this e-mail in error, please notify the sender either by 
telephone or by e-mail and delete the material from any computer.

Thank you for your cooperation.

For further information about Proximus mobile phone services please see our website at 
http://www.proximus.be or refer to any Proximus agent.



RE: calling Perl Script from JSP?

2004-09-21 Thread Chris Devers
First of all, Perl is the language, perl is the program that runs 
programs written in Perl, and PERL isn't a word.

On Tue, 21 Sep 2004, Drue Reeves wrote:

  Why is it bad to mix JSP and Perl?

They are just much different frameworks. 

Most Java systems I'm aware of (and I'll plead guilty to some ignorance 
here) pretty much want you to do everything in Java, from the JSP 
scripts that display pages to the beans (or whatever) that implement the 
site logic to, sometimes, the database itself. 

Perl on the other hand is often the glue holding a heterogeneous 
system together. It's very good for getting a bunch of disparate pieces 
that are either old or maybe came from different places to play nicely 
together. 

I know nothing about your JSP system, but conventionally, shops that 
have decided to go with JSP seem to do everything in JSP, just because 
there's so much inertia behind getting everything locked in to Java. 


I seem to be talking about the cultures more than the languages.

Oh well.

  Maybe a better question is how do you call a Perl script from a web 
 page (and pass parameters)?

There is a lot of flexibility here.

Often, Perl *is* the web page, whether by a CGI script that runs perl 
and executes the script with each page view, or a mod_perl plugin that 
embeds perl into Apache so that scripts are persistent in memory (which 
is the approach that JSP and other languages seem to take, right?). 

But if you just have a static HTML document that needs to call Perl 
somehow, the usual way is either by a form's action tag or just by 
following a link. In either case, this usually ends up being a GET or 
POST request to a Perl script that has been exposed as a web page with a 
URL. For POST requests, the parameters are sent to the script basically 
as a text document that is uploaded to the server, while for GET 
requests the data comes in following the script. Hence,

http://google.com/search?q=http%20protocol
^  ^  ^ ^-- parameters to the script
|  |  +--- the script / program / whatever
|  + the domain
+- the protocol

And if this doesn't make sense, there's lots of documentation out there. 
This book may help clarify things -- it's old now, but the fundamentals 
haven't changed since it was published:

http://www.oreilly.com/openbook/webclient/

So, if you're working via HTTP -- as you're doing on the web -- then it 
just ends up being a URL that you GET from or maybe POST to. 

Make sense? More questions?


-- 
Chris Devers

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response