I want to know what's the best way to access a WebWork2 component from
the view layer (e.g. a JSP or velocity page).  And more importantly, if
this is even a good idea (or am I breaking one of the cardinal rules of
the WebWork2 framework).  To give you some background, here is what I am
trying to do:

I have decided to implement my service layer (a.k.a. business logic,
stateless session beans, etc.) as WebWork2 components.  For example, the
service that retrieves user information is a session scoped component
called UserService.  I also have an application scoped component that
provides menu items depending on the type of user it is.  Since the menu
items are used everywhere, I do not want to have every single actions
implement MenuAware.  Instead, I would like a common toolbar.vm file
that determines which menu items to display based on the user type.  The
only way I can think of as to how to do this is to access the component
directly.  So my question is two-fold:

1.  Is it a good idea to call component (particularly application scoped
component) directly from the view layer?

2.  Are there a better ideas or a piece of WebWork2 that is more suited
for this?

Thanks,
Ben 



-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork

Reply via email to