wood burning stoves 2.0*
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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
Author

How can i embedded Perl Script in JSP?

daniel ong
Greenhorn

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.

Thanks
Ben Souther
Sheriff

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 java.net.URLConnection or with a framework like http://jakarta.apache.org/commons/httpclient. 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
Greenhorn

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?
 
Don't get me started about those stupid light bulbs.
 
subject: How can i embedded Perl Script in JSP?
 
Similar Threads
My (thin) Perl experience
Is there a data structure in Java equivalent to the hash in Perl?
Call Perl Scripts from a jsp
Server side include Vs. Scripting Language
How to call a CGI URL from JSP