Can anyone recommend a simple Java web application framework?

I'm trying to get started on what I hope will be a relatively fast Java web application, but most of the frameworks I've tried (Apache Wicket, Liftweb) require so many settings, and trying to wrap my head around Maven, when it all worked great with Eclipse, I spent the whole weekend just trying to get to the point where I am writing my first line of code!

Can anyone recommend a simple Java Webapp framework that doesn't include Maven, terribly complex directory structures, or lots of XML files that need to be edited manually?

+65
java web-frameworks
Sep 22 '08 at 19:30
source share
33 answers
  • one
  • 2

I have not tried it myself, but I think

http://www.playframework.org/

has great potential ...

coming from php and classic asp, this is the first java infrastructure that seems promising to me ....

Edit the original questionnaire - 2011-06-09

I just want to provide an update.

I went with Play, and that was exactly what I asked for. It requires a very small configuration and just works out of the box. This is unusual in that he avoids some common Java practices in favor of keeping things as simple as possible.

In particular, he actively uses static methods and even makes some introspection of variable names passed to methods, which is not supported by the Java reflection API.

The perception of the game is that its first goal is a useful web structure, and adhering to common Java practices and idioms is secondary to this. This approach makes sense to me, but Java purists might not like it, and it would be better with Apache Wicket .

In general, if you want to create a web application with the convenience and simplicity comparable to the Ruby on Rails infrastructure, but in Java and with the advantages of Java tools (for example, Eclipse), then the Play Framework is an excellent choice.

+50
Oct 25 '09 at 19:15
source share

(Updated for Spring 3.0)

I am coming with Spring MVC .

You need to download Spring from here

To configure your web application to use Spring, add the following servlet to your web.xml

 <web-app> <servlet> <servlet-name>spring-dispatcher</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>spring-dispatcher</servlet-name> <url-pattern>/*</url-pattern> </servlet-mapping> </web-app> 

Then you need to create the Spring configuration file /WEB-INF/spring-dispatcher-servlet.xml

Your first version of this file may be simple:

 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:context="http://www.springframework.org/schema/context" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"> <context:component-scan base-package="com.acme.foo" /> <mvc:annotation-driven /> </beans> 

Spring will automatically detect classes annotated with @Controller

Simple controller:

 package com.acme.foo; import java.util.logging.Logger; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; @Controller @RequestMapping("/person") public class PersonController { Logger logger = Logger.getAnonymousLogger(); @RequestMapping(method = RequestMethod.GET) public String setupForm(ModelMap model) { model.addAttribute("person", new Person()); return "details.jsp"; } @RequestMapping(method = RequestMethod.POST) public String processForm(@ModelAttribute("person") Person person) { logger.info(person.getId()); logger.info(person.getName()); logger.info(person.getSurname()); return "success.jsp"; } } 

And details.jsp

 <%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%> <form:form commandName="person"> <table> <tr> <td>Id:</td> <td><form:input path="id" /></td> </tr> <tr> <td>Name:</td> <td><form:input path="name" /></td> </tr> <tr> <td>Surname:</td> <td><form:input path="surname" /></td> </tr> <tr> <td colspan="2"><input type="submit" value="Save Changes" /></td> </tr> </table> </form:form> 

This is just the tip of the iceberg as to what Spring can do ...

Hope this helps.

+48
Sep 22 '08 at 20:47
source share

I really understand Stripes . Full customization includes some cut and paste XML into your web.xml application, and then you are disabled. No configuration is required since Stripes is a configuration-bound environment. Overriding the default behavior is done using Java 1.5 annotations. The documentation is excellent. I spent about 1-2 hours reading the tutorial and setting up my first application.

I can’t make an in-depth comparison with Struts or Spring-MVC, since I have not built a full-scale one in it (like in Struts), but it looks like it will be at the level of this architecture level.

+28
Sep 22 '08 at 20:28
source share

Search http://grails.org/

You code it with groovy, a dynamic Java-based language, and run smoothly with Java code, classes, and libraries. The syntax is not hard to learn or far from Java. Try a few minutes to launch and launch the website. Just follow http://grails.org/Installation and http://grails.org/Quick+Start

Greetz, GHad

+20
Sep 22 '08 at 19:35
source share

Check out WaveMaker to create a quick, easy web application. They have a drag-and-drop browser for the Dojo / JavaScript widget, and the backend is 100% Java.

+8
Sep 22 '08 at 20:19
source share

Stripes: pretty good. a book about this came from pragmatic programmers: http://www.pragprog.com/titles/fdstr/stripes . No XML. Requires java 1.5 or later.

tapestry: tried the old version 3.x. I am told that the current version 5.x is in beta and is pretty good.

Stripes should be better in terms of maven care, without xml and quick head wraps.

BR,
~ A

+7
Sep 22 '08 at 20:34
source share

Grails is written for Groovy, not Java. AppFuse simply reduces the setup time required to launch any number of Webapp frameworks, and not to promote any of them.

I suggest Spring MVC. Following well-written tutorials, you will have a simple and simple model with automatic wiring (no XML configuration!) To whatever viewing technology you like.

Want to add the delete action to your customer list? Just add a method called “delete” to your client controller and it will be automatically passed URL / clients / delete.

Need to bind query parameters to an object? Just add an instance of the target to your method, and Spring MVC will use reflection to bind your parameters, recording your logic as easily as if the client were passing a strongly typed object to begin with.

Sick of forced MVC division of labor? Just return your method to void and write your answer directly on the Writer servlet, if that is your thing.

+6
Sep 22 '08 at 20:10
source share

Apache Wicket, Liftweb) require such configuration, configuration

I do not agree, I use Wicket for all my projects and have never looked back! it does not take long, even an hour, to create a complete environment for working with Wicket ..

+6
Sep 24 '08 at 0:52
source share

I like Spring MVC, using 2.5 functions, very little involved in XML.

+5
Sep 22 '08 at 20:18
source share

Stripes Framework is a great foundation. The only configuration includes a few lines in your web.xml.

This is a direct-request Java web framework.

+5
Sep 22 '08 at 20:25
source share

Take a look at the Ninja web platform.

This is a pure Java MVC framework in the tradition of Rails. It does not use xml-based configuration and has everything you need to get started: session management, security management, html rendering, json rendering and analysis, rendering and analysis of XML files. It also features an embedded test environment and is 100% compatible with traditional servlet containers.

It uses Maven, though, but Maven used correctly, makes software development super easy. It also allows you to use any Ide right away :)

By the way, Ninja development is really productive - make changes to your code and see the results right away.

Check out: http://www.ninjaframework.org .

+5
Jun 07 '13 at 9:25
source share

I like to write plain old servlets + winstone servlet container. From there I use templating libraries (speed, XSLT, etc.) and database access libraries (hibernation, torque, etc.) the way I need them, and not for the real structure.

+4
Sep 22 '08 at 19:35
source share

I really don't understand what's the matter with getting maven + eclipse to work if you don't need to change pom.xml too much :)

Most of the frameworks that the maven user has maven archetypes that can generate a stub project.

So basically steps should be:

  • Install maven
  • Add class variable of class M2_REPO in eclipse
  • Create a project with an archetype
  • Import project in eclipse

As for Wicket, there is no reason why you could not use it without maven. The best part about maven is that it takes care of all the dependencies, so you don't need to. On the other hand, if the only thing you want to do is prototyping multiple pages, than Wicket might be redundant. But, if your application grows, in the end, the benefits of Wicket will be displayed with each form, link or page added :)

+3
Sep 23 '08 at 9:11
source share

Try Apache Click

This is similar to Wicket, but much more productive and easy to learn.

+3
Feb 01 2018-10-01T00
source share

Tapestry 5 can be set up very quickly using maven archetypes. See Tapestry 5 Tutorial: http://tapestry.apache.org/tapestry5/tutorial1/

+2
Sep 22 '08 at 23:29
source share

IMO's correct answer depends on two things: 1. What is the purpose of the web application you want to write? You just told us that you want to write it quickly, but not what you are actually trying to do. For example. Do I need a database? Is this a kind of business application (hint: maybe search for "scaffolding")? .. or a game? .. or are you just experimenting with sthg? 2. What framework are you most familiar with right now? What often takes the most time is reading documents and figuring out how things work (really). If you want this done quickly, stick to what you already know well.

+2
Sep 23 '08 at 10:18
source share

After many painful experiences with Struts, Tapestry 3/4, JSF, JBoss Seam, GWT, I will stick with Wicket. Wicket Bench for Eclipse is convenient, but not 100% complete, but still useful. The MyEclipse plugin for deployment on Tomcat is an ace. No Maven just deploys once, changes are automatically copied to Tomcat. Magic.

My suggestion: Wicket 1.4, MyEclipse, Subclipse, Wicket Bench, Tomcat 6. Installation will take about an hour, but most of them will download tomcat and Eclipse plugins.

Hint: do not use Wicket Bench libs, manually install Wicket 1.4 libs in the project.

This site took me about 2 hours to write http://ratearear.co.uk - don’t go there from work !! And this is about 3 days of work http://tnwdb.com

Good luck. Tim

+2
Sep 23 '08 at 10:43
source share

The web4j tool sells itself as simple and straightforward. Some moments:

  • uses one xml file (web.xml needed by all servlets)
  • no dependency on Maven (or any other third party tool / jar)
  • full stack, open source (BSD)
  • fewest classes of any complete java stack infrastructure
  • SQL placed in text files
  • encourages the use of immutable objects
  • minimum toolkit (JSP / JSTL, Java, SQL)
+2
Oct 27 '09 at 0:42
source share

Grails is the way to go if you want to make CRUD easy and create a quick prototype application that plays well with Eclipse. Follow the instructions “Build your first Grails application” here http://grails.org/Tutorials , and you can run your own application in less than an hour.

+2
Dec 14 '09 at 23:03
source share

You can try JRapid . Using Domain Driven Design, you define your application and generate a full stack for your web application. It uses well-known open source frameworks and generates a very nice and ready-to-use interface.

+2
Nov 26 2018-10-10T00:
source share

I did not use its AppFuse to facilitate the unpleasant customization that ships with Java Web Development.

+1
Sep 22 '08 at 19:42
source share

try Wavemaker http://wavemaker.com for free, easy to use. The learning curve for creating great Java applications with WaveMaker is only a few weeks!

+1
01 Oct '10 at 8:21
source share
+1
Jun 27 '11 at 13:21
source share

try vaadin! Very simple and you can easily work with the user interface! www.vaadin.com

+1
Aug 04 2018-11-11T00:
source share

The other day I found a really lightweight Java web environment.

It is called Jodd and gives you a lot of the reasons you expect from Spring, but in a really lightweight package that is <1MB.

http://jodd.org/

+1
Jun 07 2018-12-12T00:
source share

Also see activeweb . its simple, lightweight and uses a few other things that I like (guice, maven ...). Its controllers can serve everything you need, including json, Html, plain text, PDF files, images ... You can create soothing controllers and even use annotations to determine which http methods (POST, GET, ...) accept the controller method.

+1
Jul 28 2018-12-12T00:
source share

I would consider sticking to JSPs, servlets, and JSTLs After more than 12 years of working with web frameworks in several companies I worked with, I always find my own return to the good old JSPs. Yes, there are some things you need to write to yourself that some frameworks run automatically. But if you approach it correctly and create some basic utilities on top of your servlets, this gives you maximum flexibility, and you can easily do what you want. I did not find real benefits for writing to any of the frameworks. And I keep watching.

A look at all of the above answers also means that there is no real unified structure that would be good and rules.

+1
Jun 05 '13 at 9:49 on
source share

Have you tried DWR? http://directwebremoting.org

0
Sep 22 '08 at 19:43
source share
0
Oct 25 '09 at 19:23
source share

I recently found AribaWeb Framework that looks very promising. It offers good functionality (even AJAX), good documentation. written in Groovy / Java and even containing Tomcat-Server. Trying to get into Spring is really crazy.

0
01 Oct '10 at 8:36
source share
  • one
  • 2



All Articles