WebFacetsHOW-TOsAuthentication
YourKit Java Profiler |
ViewHelpersThis "pattern" allows to present profiled data to the end-user based on his profile. ![]() The idea is that you use facets as kind of "backing beans" for the views. This way, the view does not care about who is asking for rendering : it simply asks for a facet for the current profile and present some information in it ! Here under is an example, inside a fictious JSP, using the WebFacets taglib : <!-- First, we obtain the facet... --> <wf:useFacet name="myViewHelper" profileId="${profileId}" targetObject="${anObject}" var="myVH"/> <!-- And we use it to present some data --> <h1>${myVH.title}</h1> <p> Here are the items : <ul> <c:forEach items="${myVH.aCollection}" var="item"> <li>${item.name}</li> </c:forEach> </ul> </p> ... This is pretty big, since it allows to easily perform profile-based customizations in the page with no dirty switches everywhere and such ugly stuff. Want some examples ? Well, what about profilizing a few things in the This pattern is implemented in the Examples? using plain JSPs + JSTL. |