This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Servlets and the fly likes servlets vs php Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "servlets vs php" Watch "servlets vs php" New topic

servlets vs php

Paramita Ray

Joined: Jul 21, 2006
Posts: 1
I am new to programming and trying to build a system that takes constant user input that quite frequently require validation.Front-end is being built using AJAX and back-end database is MYSQL.Its a single tier client-server architechture.I am wondering what to use for the system to interact with the database...PHP or JSP-Servlets? I've 6 months of familiarity with JSP-Servlets-Struts and 1 month and a half with PHP.At the moment, I find myself equally comfortable in both. Also, how good is it an idea to put HTML in PHP files especially for input that requires validation?
Narendra Dhande
Ranch Hand

Joined: Dec 04, 2004
Posts: 951

Servlet , JSP requires application framework and application server in place to run the codes. PHP does not require the application server. You can attach the PHP plugin to the webserver with the minimal efforts. Lot of web-sites in the real world are using PHP and there is no complaints.

Both the techologies are alomost free. So depending on the application needs you have to select the technology. As for my knowledges Servlet/JSP technology will not help you in client side scripting and validations. PHP also will not do anything on the client side, But generate HTML codes for client side easisily.

Also there are lot of ready made applications are available on web in PHP. These applications are custimizable.


Narendra Dhande
SCJP 1.4,SCWCD 1.4, SCBCD 5.0, SCDJWS 5.0, SCEA 5.0
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

Originally posted by Narendra Dhande:
Servlet , JSP requires application framework and application server in place to run the codes.

Not true.
There is no requirement to use a framework with Servlets/JSP.
In some cases, a framework will save you a lot of time and energy by allowing you to leverage the work of others.

There are frameworks available for both PHP and Server Side Java.
They seem to have caught on more in the Java world.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
I agree. Here's the link:
subject: servlets vs php
It's not a secret anymore!