|
From: Rod J. <rod...@in...> - 2003-05-12 12:00:58
|
Thanks Juergen, excellent outline--should help towards the tutorial.
The changes you've made to simplify MVC setup are welcome. I think ease of
use is essential to get people to start using Spring. And there's an elegant
route towards richer functionality...
I'm trying to think of ways to simplify entry-level use of AOP/declarative
tx management etc, although it's reasonably intuitive as it is. Suggestions
welcome.
Rod
----- Original Message -----
From: "jürgen höller [werk3AT]" <jue...@we...>
To: <spr...@li...>
Sent: Monday, May 12, 2003 7:57 AM
Subject: [Springframework-developer] Web app setup
Hi webappers,
On an occasion, current web app setup info for Spring:
- You can use just a ControllerServlet: No ContextLoader(Listener/Servlet)
simply means no root application context.
- Mounting a root context from /WEB-INF/applicationContext.xml just needs
registering ContextLoaderListener/Servlet but no configLocation
context-param, as this is the default path.
- No MessageSource definition simply means no message definitions in this
context.
- No LocaleResolver definition means AcceptHeaderLocaleResolver (-> browser
setting).
- No HandlerMapping definition means BeanNameUrlHandlerMapping (bean name =
sub path).
- No HandlerAdapter definition means SimpleControllerHandlerAdapter.
- No ViewResolver definition means InternalResourceViewResolver (view name =
internal resource path).
A test web app leveraging MVC can thus be set up easily:
- write a Controller that returns new ModelAndView("/WEB-INF/jsp/test.jsp",
"myattr", "myvalue");
- write a simple test.jsp in WEB-INF/jsp, retrieving myattr from the request
and showing it;
- make a bean definition for the Controller in a ControllerServlet's XML
file using the name "/test.do";
- register the ControllerServlet in your web.xml for "/*.do";
- start the web container, open a browser, and call "localhost/test.do".
The first refinement could be to use symbolic view names: Return view name
"test", and explicitly register a "viewResolver"
InternalResourceViewResolver with prefix "/WEB-INF/jsp/" and suffix ".jsp".
Explicit view mappings like ResourceBundleViewResolver or explicit handler
mappings like SimpleUrlHandlerMapping can be introduced easily, but they
don't bother you if you don't like or need them (yet). And you're only
confronted with concepts like populated commands or forms if you choose to
write respective controllers.
Juergen
DI Jürgen Höller
Senior System Architect
______________________________________
werk3ATS - division systementwicklung
part of werk3AT internetmedien oeg
europaplatz 4
A - 4020 linz
t. +43 (0) 732 71 65 29 502
f. +43 (0) 732 71 65 29 3
jue...@we...
www.werk3at.com
______________________________________
werk3ATS - WIR ENTWICKELN ERFOLG
-------------------------------------------------------
Enterprise Linux Forum Conference & Expo, June 4-6, 2003, Santa Clara
The only event dedicated to issues related to Linux enterprise solutions
www.enterpriselinuxforum.com
_______________________________________________
Springframework-developer mailing list
Spr...@li...
https://lists.sourceforge.net/lists/listinfo/springframework-developer
|