Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

CF/PERL Conversion to JSP/PERL OH MY

by TexasTess (Beadle)
on Jun 05, 2003 at 08:09 UTC ( #263251=perlquestion: print w/replies, xml ) Need Help??

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

I am tasked with converting a large existing website written in Cold Fusion invoking a rather impressive Perl script library into a JSP/Perl website.

It wasn't easy, but I've been sucessful at getting just about all of the calls cold fusion made to the Perl scripts to work but there is one that really has me stumped and so I come to the Monastary, where all true knowledge is stored :-)

The problem: The cold fusion page called a perl script that does some nifty tricks and then cats a jpg image back to the cold fusion page. In cold fusion this is accomplished by simply making the href tag of the image be a call to the perl script. Something like:
<img src="http://server/cgi-bin/getThisImage.pl?image_name.jpg">

The owner of the webpages does not have permission to view this image, but the perl script handles that and then cats the image back to the page.

I cannot figure out how to make this work in a JSP call. Simply including it in the img tag does not work. With JSP I could invoke the perl script from a Runtime command but the script demands that the paramters be passed on the http protocol and does not accept parameters from the command line.

Perhaps I've come to the wrong forum for this, and if that is the case then please forgive the intrusion, but the monastary has never let me down and I am truely stumped with this! Any help or suggestions will be greatly appreciated!!

TexasTess
It's all about love; What you'd do to love, and what you'd love to do --Katherine Moody

Replies are listed 'Best First'.
Re: CF/PERL Conversion to JSP/PERL OH MY
by Skeeve (Parson) on Jun 05, 2003 at 08:36 UTC
    I don't understand where the problem is.
    If you still have the perl script, why can't you simply use the same kind of link as before? At last it's all HTML what the user gets. It doesn't matter if it comes from JSP or ColdFusion.
      The image tag invoked within the CF tags shows a picture. The image tag invoked alone in JSP shows nada :-)

      TexasTess
      It's all about love; What you'd do to love, and what you'd love to do -- Katherine Moody

        Well, my guess would be that Perl script also gets something via other means -- maybe ColdFusion sets up some variables in environment that Perl script depends on, and JSP does not.

        The way to solve this is probably taking a peek at the Perl script that is doing a job. Have a look if it is using environment or something else that is not the same under ColdFusion and JSP. Try to see if perl script uses %ENV hash for example.

        I am not familiar with neither ColdFusion nor JSP, but this is my guess.

        Since I know nothing about JSP and ColdFusion... Maybe you can give me/us a look at what you mean?
        For example: I don't know what you mean with: "The image tag invoked alone in JSP".
        I think both, CF and JSP give you a html-file. Each file contains the image-tag. Each file is displayed in a browser. The CF-generated file is okay, the JSP-Generated file contains a broken image, right?
Re: CF/PERL Conversion to JSP/PERL OH MY
by particle (Vicar) on Jun 05, 2003 at 13:20 UTC

    try serving this html page:

    <html><head></head><body> <img src="http://server/cgi-bin/getThisImage.pl?image_name.jpg"> </body></html>

    if it doesn't work, it's probably missing some info the perl script needs. debug the perl script. if it works, you might want to have a look at the jsp code.

    ~Particle *accelerates*

Re: CF/PERL Conversion to JSP/PERL OH MY
by TexasTess (Beadle) on Jun 05, 2003 at 15:47 UTC
    I've looked at the perl script...many of them I've had to modify to get them to work with the JSPs. There isn't anything wrong with the perl script HOWEVER, ya'll have pointed out a point I hadnt considered, that there may be something else going on aside from my code. I'll have a look at the cold fusion tag again when at work today and will post it for ya'll to see. Because I'm working in a test environment there may very well be something wrong with the IMAGE it's self! I'll check it out, thanks :-)

    TexasTess
    It's all about love; What you'd do to love, and what you'd love to do -- Katherine Moody
Re: CF/PERL Conversion to JSP/PERL OH MY
by TexasTess (Beadle) on Jun 06, 2003 at 09:53 UTC
    LOL, after some research I discovered that there was a problem with the image I was attempting to view. Resolved those problems and the code works great! DOH! Thanks for your suggestions...sorry it was a waste of time :-)

    TexasTess
    It's all about love; What you'd do to love, and what you'd love to do -- Katherine Moody

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2021-11-29 02:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?