Alex Rivera | Logout

Simple Web Server and MVC framework for Java

Asked 2009-04-15T09:43:24.273
10

Does anyone know of a simple Web MVC framework and Web Server for Java that is open source?

This is intended as a simple web server and framework for students in a tutorial class.

It's important these both the web server and MVC framework are simple, OSS so students can easily peer under the hood and the tutors can easily support it, learn it and teach it.

UPDATE The suggestion I can avoid the single jar issue by unpacking several jars and joining them into one is a good suggestion. I'll definitely take it, and thus relax the single jar requirements

Edit
Report

1 Answer

1

If you're teaching someone about fixing cars, you could certainly start with a Briggs & Stratton lawn mower engine and work your way up. I'd suggest starting them with something that's immensely popular instead--a Honda Civic, in our metaphor.

Starting with an immensely popular framework will yield better Internet resources and will have the benefit of lots of others who had run into the same problems before. Also, using something used in the real world and which would appear in job postings isn't a bad way to create productive members of the development community.

I'd suggest Spring MVC. If you want to hide the IoC, that's pretty easy to do as well. A sample:

package samples;

public class SampleController extends AbstractController {

    public ModelAndView handleRequestInternal(
        HttpServletRequest request,
        HttpServletResponse response) throws Exception {

        ModelAndView mav = new ModelAndView("hello");
        mav.addObject("message", "Hello World!");
        return mav;        
    }
}
answered 2009-04-15T11:48:37.280

Your Answer