[weld-commits] Weld SVN: r6045 - doc/trunk/reference/en-US.
weld-commits at lists.jboss.org
weld-commits at lists.jboss.org
Sun Mar 14 05:13:00 EDT 2010
Author: nickarls
Date: 2010-03-14 05:13:00 -0400 (Sun, 14 Mar 2010)
New Revision: 6045
Modified:
doc/trunk/reference/en-US/events.xml
doc/trunk/reference/en-US/injection.xml
Log:
WELD-456, WELD-457
Modified: doc/trunk/reference/en-US/events.xml
===================================================================
--- doc/trunk/reference/en-US/events.xml 2010-03-12 06:46:09 UTC (rev 6044)
+++ doc/trunk/reference/en-US/events.xml 2010-03-14 09:13:00 UTC (rev 6045)
@@ -364,7 +364,7 @@
products.add(product);
}
- void addProduct(@Observes(during = AFTER_SUCCESS) @Deleted Product product) {
+ void removeProduct(@Observes(during = AFTER_SUCCESS) @Deleted Product product) {
products.remove(product);
}
}]]></programlisting>
Modified: doc/trunk/reference/en-US/injection.xml
===================================================================
--- doc/trunk/reference/en-US/injection.xml 2010-03-12 06:46:09 UTC (rev 6044)
+++ doc/trunk/reference/en-US/injection.xml 2010-03-14 09:13:00 UTC (rev 6045)
@@ -743,15 +743,19 @@
<programlisting role="JAVA"><![CDATA[class HttpParams
@Produces @HttpParam("")
- String getParamValue(ServletRequest request, InjectionPoint ip) {
+ String getParamValue(InjectionPoint ip) {
+ ServletRequest request = (ServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
return request.getParameter(ip.getAnnotated().getAnnotation(HttpParam.class).value());
}
}]]></programlisting>
- <para>(Note that the <literal>value()</literal> member of the <literal>HttpParam</literal>
- annotation is ignored by the container since it is annotated <literal>@Nonbinding.</literal>)</para>
+ <para>Note that acquiring of the request in this example is JSF-centric. For a more generic solution
+ you could write your own prodcuer for the request and have it injected as a method parameter.</para>
+ <para>Note also that the <literal>value()</literal> member of the <literal>HttpParam</literal>
+ annotation is ignored by the container since it is annotated <literal>@Nonbinding.</literal></para>
+
<para>The container provides a built-in bean that implements the <literal>InjectionPoint</literal>
interface:</para>
More information about the weld-commits
mailing list