Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the main-stream Java alternative to ASP.NET / PHP

I've heard something and seen some examples of web application built using ASP.NET / PHP and I'm wondering what would be the equivalent way of doing similar things in Java world. Looking on the Wikipedia I have found a lot of frameworks and I'm kind of confused which one is the best.

like image 917
Veronika D Avatar asked Mar 31 '10 21:03

Veronika D


People also ask

Which is faster ASP or PHP?

Regarding time to deployment (an additional concern for cost,) on average, it takes twice as much code writing to accomplish something with ASP.net than PHP, so time to deployment is faster using PHP.

Is ASP a web technology of Java?

It was created by Sun Micro systems. It's also similar to the ASP and PHP but it uses Java programming languages and it has the full access to Java APIs as well as databases. ASP stands for Active Server Pages, a server-side language which is used in web development to implement dynamic web pages.


2 Answers

The Java equivalent of PHP and "Classic" ASP would be JSP (JavaServer Pages) with scriptlets (embedded raw Java code). Scriptlets are considered poor practice in Java web development world. Taglibs and EL (Expression Language) should be preferred above scriptlets. The Java equivalent of ASP.NET (MVC) would be a Java MVC framework. There are a lot of Java-based MVC frameworks out, mostly providing a Servlet/Filter-based controller and taglibs to interact with the model (usually a Javabean) and the view (usually a JSP page, but XHTML is also possible).

To start, the Java EE API provides JSF (JavaServer Faces) for this, which in turn comes along with XHTML based templated view technology known as Facelets. Facelets is seen as a replacement of the good old JSP. Further, there are a lot of open source Java MVC frameworks which are built on top of the JSP/Servlet API and which are intended as an alternative/competition to JSF. You can find little information of all of them here, the popular ones being Spring MVC, Struts2 and Stripes.

As to which one to choose, I suggest having a look at this answer which I strongly agree.

like image 127
BalusC Avatar answered Sep 23 '22 05:09

BalusC


The best is not necessarily the same as the most mainstream. I think the most direct equivalent (thanks to its standards track nature) is JSF 2.0 & Facelets.

Having said that, there are reasons that the other frameworks exist... it's best to evaluate several and determine which one fits your team's style of development best.

See also this question.

like image 45
jsight Avatar answered Sep 23 '22 05:09

jsight