views:

195

answers:

2

In Spring MVC there seem to be two parallel class hierarchies, one with portlet, one without.

What is that? Why is it so and what should I use.

+2  A: 

You mean as opposed to servlet? The portlet MVC framework is specifically for development of JSR-168 (maybe JSR-286 too? not sure) portlets. There is a separate portlet hierarchy because the portlet MVC workflow differs from the servlet MVC workflow.

If you're developing a portlet, you want the portlet MVC framework. Otherwise, the Servlet MVC framework is what you need and you don't need to worry about the portlet stuff.

Jeff
+5  A: 

That's because

In addition to supporting conventional (servlet-based) Web development, Spring also supports JSR-168 Portlet development. As much as possible, the Portlet MVC framework is a mirror image of the Web MVC framework, and also uses the same underlying view abstractions and integration technology.

The Spring documentation (Chapter 16. Portlet MVC Framework) provides more information about the differences.

To answer your last question: you should use the Portlet MVC framework if you are developing portlets (web applications to be deployed in a portal). If you are developing conventional web applications you should use the Web MVC framework.

Zack Mulgrew