• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSP->Servlet->PHP

 
Arpit Gadle
Ranch Hand
Posts: 69
Linux MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Dear All,

I don't whether is this the right place to post my question.

I have a form in a JSP page.When the form is submitted to a servlet, the request is processed and the response is sent to the user(a JSP page).

What I want is the request sent by the JSP page to the servlet should be sent to a php script for procecssing(from within the servlet). Is this possible?

Regards,

Arpit
 
sudhir nim
Ranch Hand
Posts: 212
Eclipse IDE Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can have the JSP page submit the form to a PHP script.
Or you can have the servlet call the PHP script using HttpUrlConnection
See
- http://java.sun.com/j2se/1.4.2/docs/api/java/net/HttpURLConnection.html
- http://hc.apache.org/httpclient-3.x/apidocs/org/apache/commons/httpclient/HttpURL.html
 
Arpit Gadle
Ranch Hand
Posts: 69
Linux MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sudhir nim wrote:
you can have the servlet call the PHP script using HttpUrlConnection




Dear Sudhir,
Thanks for your reply. Using HttpUrlConnection, will my request be preserved when calling a pHP script from servlet.

Thanks
Arpit
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!