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

existed code in perl and need to enhance in jsp

 
Shaveta Chawla
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I have software that is a web based and is made in Perl and it is running through
CGI. I have assigned the work of doing some enhancement in the software. As I don�t know Perl and I have been working through in JSP and servlets only. Is this possible that remaining code runs in Perl and I make the enhancement in jsp, servlets or I have to code the whole project in JSP code. Please advise me any solution.


Thanks
Shaveta
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is possible to integrate some containers like Tomcat with the Apache Web Server, allowing both server side Java and CGI or other popular scripting languages such as PHP to be run at the same time from the same domain.

After that, all someone here can say is that it depends on the code.
CGI is fundamentally different from servlets and JSP.
Things like logins, sessions, concurrency issues, etc would need to be worked out. Without digging through what's already there, nobody on a forum or user list will be able to tell you with any degree of certainty how easy or difficult this will be.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, by the way.
Much of JavaRanch is running in a servlet container but the core of the bulletin board is still a CGI application.
So... yes, they can be integrated.
 
Akhilesh Trivedi
Ranch Hand
Posts: 1599
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Even I dont know perl and I am replying on whatever knowledge I have.

Perl scripts/programs run on CGI server. Just like java needs JVM, perl needs perl-software to be installed. Mostly they use Apache Web Server, install perl there and configure webserver to handle perl-requests.

You must be knowing what servlets are they run on servlet-containers/servers like Tomcat.

Now, the question is to have these both CGI-perl part and servlet part together or handle them separately? I dont know if there is any server which can do this both, that is handle perl requests and also handle servlets together, I think tomcat can be configured to handle CGI requests (by tuning some configuration file server.xml/web.xml?)but I doubt if that would suppress handling of servlets. Else you may need separate servers one for CGI and one for servlets, plus a common webserver that takes cares of requests. The webserver would find if request is CGi pass it to CGI server and if it is servlet pass it to servlet-container.

Overall, as Ben said, it would more be an analysis part than a direct solution available. What goes on client side? and what goes on server side? how much is CGI stuff, how much has to be coded in JSP? what server is currently in use, does it have the possibility to act as servlet container? if not then will it be required to transfer data to future-written servlets running on different server? how much will this delegation be... any session-management issues between CGI scripts and servlets??
 
Shaveta Chawla
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you so much. But i am still confused how would i do it. because i have to run both the parts at the same time. i have to run both perl and jsp code and infer something from the data which is the backend.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My point was that we can't really give you a lot of direction for something like this.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic