WebFacetsHOW-TOsAuthentication
YourKit Java Profiler |
WritingFacetsWriting web-enabled facets is strictly similar to write facets in regular Java applications. Of course, you can write your facets the Java or the Groovy way, or both ! One thing has to be noticed. With the extended web facet context, you can access the From pure Java facets : /** * A facet that does things with the request */ public class MyWebFacet implements IFacet { /** web-enabled facet context */ private IWebFacetContext context; /** from IFacet */ public IWebFacetContext getContext() { return context; } /** from IFacet */ public void setContext(IFacetContext context) { this.context = (IWebFacetContext)context; } public void doStuff() { // get the request HttpServletRequest request = getContext().getRequest(); request.setAttribute("myFacet", this); String param = request.getParameter("param"); ... } } From Groovy Facets : /* * Executable groovy script */ o = ... ; context.request.setAttribute("something", o); p = request.getParameter("param"); ... |