File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes How can i embedded Perl Script in JSP? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "How can i embedded Perl Script in JSP?" Watch "How can i embedded Perl Script in JSP?" New topic

How can i embedded Perl Script in JSP?

daniel ong

Joined: May 18, 2005
Posts: 5
Is there any way i can embedded Perl Script in JSP and get the value of the JSP variable into Perl Script?

Can anyone show me some guidelines. The server i use is Tomcat 5.0.

Ben Souther

Joined: Dec 11, 2004
Posts: 13410

If your container supports cgi (Tomcat as a standalone has a cgi-servlet) or if you are using a container in conjunction with a webserver that does. You could use sendRedirect to get the user to your perl script.

You could also make a post directly to your perl script (whereever it's running) from your JSP/Servlet app with or with a framework like This way you could send Post data to it, and read the results back within your JSP. The end user wouldn't know you were calling a Perl script. This could get pretty complicated if the perl script needs to set cookies, read cgi headers, and or send redirect calls itself.

Another approach would be a shared file or shared database together with either of the above ideas.

No matter how you approach it, it will probably get ugly.
What's the Perl script doing that can't be implemented in JSP?

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
daniel ong

Joined: May 18, 2005
Posts: 5
I'm facing a problem with JavaMail, sending an internal mail from a jsp webpage, a UNIX operation machine to workers in the same domain.

The problem is our network is design that the UNIX operation machine did not connect to the exchange server under the same domain as the mail domain.

Since i do not have much knowledge in the connection cobnfiguration to the exchange server, so i try to send mail through perl script that can be use in the UNIX operation machine.

Do you think it can works?
I agree. Here's the link:
subject: How can i embedded Perl Script in JSP?
It's not a secret anymore!