Can someone tell me please does JSP display good performance when building a website with it?
Can it be as fast as PHP?
The reason I am asking is because I see these days everybody is building their front ends with PHP or ASP.NET.
Since I am a Java developer I really want to be able to build the application in Java as the backend and the frontend in JSP.
I don't think you'll have any performance problems with JSP.
But keep in mind that JSP alone is not a complete frontend technology.
You should keep all business logic (or better yet: all calls to business logic) in Servlets (or Actions, if you use an additional frontend) and really keep just the presentation in JSPs.
Many beginners make the mistake of coding their logic in their JSP pages, which quickly becomes an unmaintainable mess.
Performance wise there is not much difference between PHP, ASP, JSP or whatever. As mentioned before, getting your Java web app hosted might be a problem. Most out of the box hosting providers just don't have a servlet engine like Tomcat or Jetty as part of their standard service offering.
Having experience with both PHP and Java (JSP), I've noticed that to get up and running with JSP takes a lot more effort compared to PHP. Running a Java web app is something you really must want otherwise you'd probably give up early on in the process. PHP is easy, just put a PHP script in your web-root folder and off you go. But then again, PHP has it's dark side as well (syntax).
Java can be a lot more powerful. Especially when you get into the realm of Enterprise solutions (large, distributed and modular corporate software systems). It's therefor that Java is used mostly in that area instead of PHP (all though Yahoo! is a good example of a large business that does a lot with PHP).
Whether you decide to use Java or PHP, one thing you should do is use a framework of some sort. No need to reinvent the wheel here. For PHP there is e.g. CodeIgniter, KohanaPHP and CakePHP and in the Java realm you might want to look at Struts 2, Stripes and Spring.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With