tags:

views:

643

answers:

6

Can you provide a link for best or elegant MVC tutorial/example for JSP/Servlet? I am going to refactor a JSP based application. so I need a good reference or template to start with. I maybe not going to use any framework.

+4  A: 

This is a step by step tutorial for the Spring Framework. Hope that helps you.

vladikoff
He is refactoring a jsp based application so it seems to be not possible to use frameworks
Koder_
If you're moving a non MVC app into an MVC style, you'll probably be changing enough that using a framework won't be extra work, and may reduce maintenance in the long run.
Dean J
I'd suggest using an established MVC framework over rolling your own
matt b
+3  A: 

I find Stripes very elegant so I'd suggest its Quick Start Guide. For Spring, there is the Developing a Spring Framework MVC application step-by-step. For Struts 2, have a look at the Tutorials from the documentation.

EDIT: I would really recommend to use a framework instead of doing everything from scratch but, if you really do so, please get Head First Servlets and JSP: Passing the Sun Certified Web Component Developer Exam and see chapter 3. Mini MVC tutorial: hands-on MVC app.

EDIT2: I don't mean to be rude but the fact that you are asking for a MVC tutorial is actually the proof you shouldn't roll out your own framework. Seriously, reconsider going this way and use an existing solution.

Pascal Thivent
A: 

you can check Controller (MVC) Tips for Java Servlets / JSP I guess that's what you are looking for.

Joset
+2  A: 

Hello,

Check this one:

http://www.amazon.com/Murachs-Java-Servlets-JSP-2nd/dp/1890774448/ref=dp%5Fcp%5Fob%5Fb%5Ftitle%5F2

Here is a brief description gotten from amazon:

it teaches how and when to use JavaServer Pages and Java servlets to build well-structured web applications that implement the MVC pattern.

Seems to be exactly what you need.

Koder_
+2  A: 

This one is also a nice basic intro to MVC: http://www.javaranch.com/journal/200603/frontman.html

BalusC
+2  A: 

Try this, Simple MVC Example. The courtesy of Ben Souther, JavaRanch Sheriff.

Adeel Ansari