To use the seam context, you can wrap the doPost or doGet methods with ContextualHttpServletRequest , which allows you to search for components.
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { final HttpServletRequest req = request; new ContextualHttpServletRequest( req ) { public void process() throws Exception { wrappedPost( req ); } }.run(); }
The above code example allows you to access components by name, which are declared using name annotation:
@Name("MyCcomponent")
The logger is usually introduced by @Logger annotation, I checked the source package logs, there is no component with @Name annotation that could be found. If you call a component (using @Logger) from a wrapped context, a registrar is inserted into it (into the called componenttent).
The seam uses in its components:
private static final LogProvider log = Logging .getLogProvider(MailSession.class);
source share