Professional Web Applications Themes

calling Perl Script from JSP? - PERL Beginners

> -----Original Message-----  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 ...

  1. #1

    Default RE: calling Perl Script from JSP?

    > -----Original Message----- 

    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 ourwebsite at http://www.proximus.be or refer to any Proximus agent.

    NYIMI Guest

  2. #2

    Default RE: calling Perl Script from JSP?

    From: "NYIMI Jose \(BMB\)" <net> 
    >
    > 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é.[/ref]

    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
    ===== cz === 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

    Jenda Guest

  3. #3

    Default RE: calling Perl Script from JSP?

    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)" <net> wrote: 

    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.


    Drue Guest

  4. #4

    Default RE: calling Perl Script from JSP?

    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:
     

    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.
     

    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 doent 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 doent 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 doentation 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
    Chris Guest

  5. #5

    Default RE: calling Perl Script from JSP?

    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 <com> 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:
     

    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.
     

    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 doent 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 doent 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 doentation 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

    Drue Guest

  6. #6

    Default SSI from script

    Hi everyone.

    I'm trying to call a SSI from a page generated by a Perl script. Obviously the SSI can't be called because it is not an HTML file. But if I use the .htaccess parsing method, a with .shtml, (AddHandler server-pd .pl) I got all the code of my script listed.

    This SSI will call another .pl , a counter to be precise.
    I could include the code of the counter in the main script, but I didn't wrote the counter and don't want to do anything wrong, I mean I respect other's work.
    I was thinking in 'use' or 'require', but it's not about the functions in the counter, it's about the whole output.

    Any advice on where to look now?
    Thanks.
    -rm-

    Ramon Guest

Similar Threads

  1. Error calling Win32::Printer from a perl script hosted in IIS onWin2k3
    By Eadmund@letterbee.com in forum PERL Modules
    Replies: 3
    Last Post: June 4th, 06:05 PM
  2. calling perl script from mysql trigger
    By kees hessels in forum MySQL
    Replies: 2
    Last Post: April 12th, 05:04 PM
  3. Replies: 2
    Last Post: October 23rd, 09:22 PM
  4. Calling a Perl Script from C
    By David in forum UNIX Programming
    Replies: 3
    Last Post: August 26th, 04:07 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139