Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How can i embedded Perl Script in JSP?

 
daniel ong
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
daniel ong
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic