craigmcc 2003/06/04 10:37:36
Modified: contrib/struts-faces/src/example/org/apache/struts/webapp/example
LinkSubscriptionRenderer.java
LinkSubscriptionTag.java
Log:
Update the example app sources for the new EA4 release of JavaServer
Faces.
Revision Changes Path
1.2 +14 -6
jakarta-struts/contrib/struts-faces/src/example/org/apache/struts/webapp/example/LinkSubscriptionRenderer.java
Index: LinkSubscriptionRenderer.java
===================================================================
RCS file:
/home/cvs/jakarta-struts/contrib/struts-faces/src/example/org/apache/struts/webapp/example/LinkSubscriptionRenderer.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- LinkSubscriptionRenderer.java 7 Mar 2003 03:22:42 -0000 1.1
+++ LinkSubscriptionRenderer.java 4 Jun 2003 17:37:36 -0000 1.2
@@ -64,10 +64,14 @@
import java.io.IOException;
import javax.faces.FacesException;
+import javax.faces.FactoryFinder;
+import javax.faces.application.Application;
+import javax.faces.application.ApplicationFactory;
import javax.faces.component.UIComponent;
import javax.faces.component.UIOutput;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
+import javax.faces.el.ValueBinding;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.logging.Log;
@@ -119,17 +123,21 @@
ResponseWriter writer = context.getResponseWriter();
HttpServletRequest request = (HttpServletRequest)
- context.getServletRequest();
+ context.getExternalContext().getRequest();
HttpServletResponse response = (HttpServletResponse)
- context.getServletResponse();
+ context.getExternalContext().getResponse();
String name = (String) component.getAttribute("name");
String page = (String) component.getAttribute("page");
// Generate the URL to be encoded
StringBuffer url = new StringBuffer(request.getContextPath());
url.append(page);
+ ApplicationFactory factory = (ApplicationFactory)
+ FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY);
+ Application application = factory.getApplication();
+ ValueBinding binding = application.getValueBinding(name);
Subscription subscription = (Subscription)
- context.getModelValue(name);
+ binding.getValue(context);
if (subscription == null) {
throw new FacesException
("No subscription under attribute '" + name + "'");
1.2 +9 -11
jakarta-struts/contrib/struts-faces/src/example/org/apache/struts/webapp/example/LinkSubscriptionTag.java
Index: LinkSubscriptionTag.java
===================================================================
RCS file:
/home/cvs/jakarta-struts/contrib/struts-faces/src/example/org/apache/struts/webapp/example/LinkSubscriptionTag.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- LinkSubscriptionTag.java 7 Mar 2003 03:22:42 -0000 1.1
+++ LinkSubscriptionTag.java 4 Jun 2003 17:37:36 -0000 1.2
@@ -65,9 +65,7 @@
import java.io.IOException;
import javax.faces.component.UIComponent;
-import javax.faces.component.UIOutput;
-import javax.faces.webapp.FacesTag;
-import javax.servlet.jsp.JspException;
+import javax.faces.webapp.UIComponentTag;
/**
@@ -78,7 +76,7 @@
* @version $Revision$ $Date$
*/
-public class LinkSubscriptionTag extends FacesTag {
+public class LinkSubscriptionTag extends UIComponentTag {
// ------------------------------------------------------------- Attributes
@@ -108,11 +106,11 @@
/**
- * <p>Create a new component for this tag.</p>
+ * Return the component type for this tag.</p>
*/
- public UIComponent createComponent() {
+ public String getComponentType() {
- return (new UIOutput());
+ return ("Output");
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]