Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java development for the web [closed]

I'm looking to start developing for the web using Java - I have some basic Java knowledge, so that's not a problem, but I'm at a loss when it comes to deciphering the various technologies for use in web applications.

What options are available to me? How do they work? Are there any frameworks similar to Django/Ruby on Rails which I could use to simplify things?

Any links which could help with understanding what's available would be much appreciated.

like image 443
Tom Avatar asked Oct 02 '08 13:10

Tom


People also ask

Is Java still used for web development?

Web Development in JavaJava is a commonly used language for web development, especially on the server-side. Java web applications are distributed applications that run on the internet. Web development with Java allows us to create dynamic web pages where users can interact with the interface.

Is Java good for web development 2020?

PHP VS Java: Which Language is More Secure? In a nutshell: According to the research studies, both languages are popular for web application development, but Java has much better security reputation than PHP.

Can you build web apps with Java?

Java provides some technologies like Servlet and JSP that allow us to develop and deploy a web application on a server easily. It also provides some frameworks such as Spring, Spring Boot that simplify the work and provide an efficient way to develop a web application.

Is Java essential for web development?

Although you should keep in mind that Java is not the only choice for web applications, many developers choose Java over other languages because they consider Java to be the best programming language for use in web development. After all, Java is well-established, flexible, and powerful.


1 Answers

Java frameworks come in two basic flavors. One is called the "Action" Framework, the other the "Component" Framework.

Action frameworks specialize on mapping HTTP requests to Java code (actions), and binding HTTP Requests to Java objects. Servlets is the most basic of the Action Frameworks, and is the basic upon all of the others are built.

Struts is the most popular Action framework, but I can't in good conscience recommend it to anyone. Struts 2 and Stripes are more modern, and very similar to each other. Both are light on the configuration and easy to use out of the box, providing very good binding functionality.

Component Frameworks focus on the UI and tend to promote a more event driven architecture based on high level UI components (buttons, list boxes, etc.). The frameworks tend to hide that actual HTTP request from the coder under several layers. They make developing the more advanced UIs much easier. .NET is a component framework for Windows. On Java, the popular component frameworks are JSF (a standard) and Wicket.

As a rule, if you're creating a "web site". that is something more akin to presenting information (like a blog, or a community site), the Action frameworks work better. These sites tend to be simpler, get bookmarked often, require "pretty URLs" etc. This is generally easier to do with an Action framework.

Component frameworks are much better for things like back office applications with lots of UI elements and complicated workflows. You'll find, particularly with tooling, that these style of apps will go together faster using a component framework. But component frameworks have more complicated request workflow, sometimes relying on hidden state, lots of POST actions, etc. Many have "horrible" URLs, and sometimes create pages that are difficult to bookmark.

Both frameworks can be used for both tasks, just some are more suited to the task than others.

None of these frameworks directly address persistence, but many have extension modules or idioms that work tightly with JPA/EJB3 or Hibernate.

like image 155
Will Hartung Avatar answered Oct 12 '22 17:10

Will Hartung