Actually this could be something for the seam-dev-list but I assume
that most of them are over here, too and this discussion could be view
from a general "portable extension"-point of view
Anyway, I started to look at porting the Seam Excel module and it's
content delivery mechanism, the stuff in org.jboss.seam.document
(namely, the DocumentStore). I assume a general DocumentStore
extension would be a natural candidate for a CDI extension, yes?
I don't know the history and evolution of the code and most stuff is
probably there for a reason but as I see it, the action is split up in
a Servlet part and a PhaseListener part (for redirects?). Some
1) Given Servlet 3, JSF 2 and CDI, Is there something in this
architecture that can be simplified? I assume we still can't just dump
the data to the response stream and be done with it?
2) Assuming the redirect is still needed, could we have a
self-registering Servlet 3- style DocumentServlet that would be
available just by dropping in the JAR? And the usage from an JSF
action would be something like
@Inject DocumentStore documentStore;
Document document = documentStore.getDocument();
document.show(); // does the redirect;
There could of course be shorthands as
And the DocumentServlet would then access the same (conversation
scoped) DocumentStore and deliver the data to the response stream
or perhaps DocumentServlet could have a factory for Document and you
would just do
@Inject Document document;
document.PDFof(myByteArray).show(); // sets mime type etc and redirects
3) Haven't looked at REST-stuff that much, could a DocumentServlet
like this also be used for permanent document delivery with fixed
paths, something like http://localhost/app/documents/secrets/1234 ?
Is the following injection going to be supported in Java EE 6?
@Inject FacesContext ctx;
Because I can't even begin to count how many times I'm going to need that
when developing apps. Probably the #1 injection in JSF apps.
(True, I could make a producer method myself, but so will the n-thousand
other JSF developers).
Senior Software Engineer, Red Hat | Author of Seam in Action
Registered Linux User #231597
Maybe it's too late for 1.0 (I see the tag was made already), but the
reference document for the Java SE numberguess example has an incorrect
"Note that it
cannot use <literal>manager.getInstanceByType(Integer.class, new
as the JSF example does because there will not be any active
contexts like there is during a JSF request."
However, the JSF numberguess example doesn't use
manager.getInstanceByType(), but instead uses Instance.get().
I'm sending an email instead of creating a jira issue since the public
release seems impending, and I'm not sure a jira issue creation would get
noticed in time.
I am trying to run TCK in an embeddable OpenEJB in Tomcat. AFAIK, test-harness deploys test archives that contain web.xml.
How to change/update this web.xml content to add our configuration specific parameters for example: listeners, servlets etc... ?