Seam SVN: r8200 - branches/Seam_2_0/seam-gen/view/stylesheet.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2008-05-16 01:39:22 -0400 (Fri, 16 May 2008)
New Revision: 8200
Modified:
branches/Seam_2_0/seam-gen/view/stylesheet/theme.css
Log:
whitespace
Modified: branches/Seam_2_0/seam-gen/view/stylesheet/theme.css
===================================================================
--- branches/Seam_2_0/seam-gen/view/stylesheet/theme.css 2008-05-16 05:38:59 UTC (rev 8199)
+++ branches/Seam_2_0/seam-gen/view/stylesheet/theme.css 2008-05-16 05:39:22 UTC (rev 8200)
@@ -3,7 +3,7 @@
}
a:active, a:link, a:visited {
- color: #0D5798;
+ color: #0D5798;
}
a:hover {
color: #8CAFCD;
@@ -41,7 +41,7 @@
}
.rich-table {
- width:100%;
+ width:100%;
}
h1 {
@@ -63,7 +63,7 @@
.columnHeader:hover
{
- color: #FF6600;
+ color: #FF6600;
}
.message {
@@ -113,5 +113,5 @@
}
.rich-stglpanel-body {
- overflow: auto;
+ overflow: auto;
}
16 years, 6 months
Seam SVN: r8199 - trunk/seam-gen/view/stylesheet.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2008-05-16 01:38:59 -0400 (Fri, 16 May 2008)
New Revision: 8199
Modified:
trunk/seam-gen/view/stylesheet/theme.css
Log:
whitespace
Modified: trunk/seam-gen/view/stylesheet/theme.css
===================================================================
--- trunk/seam-gen/view/stylesheet/theme.css 2008-05-16 05:37:19 UTC (rev 8198)
+++ trunk/seam-gen/view/stylesheet/theme.css 2008-05-16 05:38:59 UTC (rev 8199)
@@ -41,7 +41,7 @@
}
.rich-table {
- width:100%;
+ width:100%;
}
h1 {
@@ -63,7 +63,7 @@
.columnHeader:hover
{
- color: #FF6600;
+ color: #FF6600;
}
.message {
@@ -113,5 +113,5 @@
}
.rich-stglpanel-body {
- overflow: auto;
+ overflow: auto;
}
16 years, 6 months
Seam SVN: r8198 - branches/Seam_2_0/seam-gen/resources.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2008-05-16 01:37:19 -0400 (Fri, 16 May 2008)
New Revision: 8198
Modified:
branches/Seam_2_0/seam-gen/resources/messages_en.properties
Log:
grammer error in message string
Modified: branches/Seam_2_0/seam-gen/resources/messages_en.properties
===================================================================
--- branches/Seam_2_0/seam-gen/resources/messages_en.properties 2008-05-16 05:37:00 UTC (rev 8197)
+++ branches/Seam_2_0/seam-gen/resources/messages_en.properties 2008-05-16 05:37:19 UTC (rev 8198)
@@ -78,8 +78,8 @@
javax.faces.validator.DoubleRangeValidator.MINIMUM=value must be greater than or equal to {0}
javax.faces.validator.DoubleRangeValidator.NOT_IN_RANGE=value must be between {0} and {1}
javax.faces.validator.DoubleRangeValidator.TYPE=value is not of the correct type
-javax.faces.validator.LengthValidator.MAXIMUM=value is must be shorter than or equal to {0} characters
-javax.faces.validator.LengthValidator.MINIMUM=value is must be longer than or equal to {0} characters
+javax.faces.validator.LengthValidator.MAXIMUM=value must be shorter than or equal to {0} characters
+javax.faces.validator.LengthValidator.MINIMUM=value must be longer than or equal to {0} characters
javax.faces.validator.LongRangeValidator.MAXIMUM=value must be less than or equal to {0}
javax.faces.validator.LongRangeValidator.MINIMUM=value must be greater than or equal to {0}
javax.faces.validator.LongRangeValidator.NOT_IN_RANGE=value must be between {0} and {1}
16 years, 6 months
Seam SVN: r8197 - trunk/seam-gen/resources.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2008-05-16 01:37:00 -0400 (Fri, 16 May 2008)
New Revision: 8197
Modified:
trunk/seam-gen/resources/messages_en.properties
Log:
grammer error in message string
Modified: trunk/seam-gen/resources/messages_en.properties
===================================================================
--- trunk/seam-gen/resources/messages_en.properties 2008-05-15 15:18:26 UTC (rev 8196)
+++ trunk/seam-gen/resources/messages_en.properties 2008-05-16 05:37:00 UTC (rev 8197)
@@ -78,8 +78,8 @@
javax.faces.validator.DoubleRangeValidator.MINIMUM=value must be greater than or equal to {0}
javax.faces.validator.DoubleRangeValidator.NOT_IN_RANGE=value must be between {0} and {1}
javax.faces.validator.DoubleRangeValidator.TYPE=value is not of the correct type
-javax.faces.validator.LengthValidator.MAXIMUM=value is must be shorter than or equal to {0} characters
-javax.faces.validator.LengthValidator.MINIMUM=value is must be longer than or equal to {0} characters
+javax.faces.validator.LengthValidator.MAXIMUM=value must be shorter than or equal to {0} characters
+javax.faces.validator.LengthValidator.MINIMUM=value must be longer than or equal to {0} characters
javax.faces.validator.LongRangeValidator.MAXIMUM=value must be less than or equal to {0}
javax.faces.validator.LongRangeValidator.MINIMUM=value must be greater than or equal to {0}
javax.faces.validator.LongRangeValidator.NOT_IN_RANGE=value must be between {0} and {1}
16 years, 6 months
Seam SVN: r8196 - in trunk/examples/mail: resources/WEB-INF and 2 other directories.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-05-15 11:18:26 -0400 (Thu, 15 May 2008)
New Revision: 8196
Added:
trunk/examples/mail/src/org/jboss/seam/example/mail/MailSenderServlet.java
Modified:
trunk/examples/mail/
trunk/examples/mail/resources/WEB-INF/web.xml
trunk/examples/mail/view/index.xhtml
Log:
Add servlet example to mail example
Property changes on: trunk/examples/mail
___________________________________________________________________
Name: svn:ignore
- test-build
dist
exploded-archives
+ test-build
dist
exploded-archives
test-output
Modified: trunk/examples/mail/resources/WEB-INF/web.xml
===================================================================
--- trunk/examples/mail/resources/WEB-INF/web.xml 2008-05-15 13:25:37 UTC (rev 8195)
+++ trunk/examples/mail/resources/WEB-INF/web.xml 2008-05-15 15:18:26 UTC (rev 8196)
@@ -41,6 +41,17 @@
<url-pattern>*.seam</url-pattern>
</servlet-mapping>
+ <servlet>
+ <servlet-name>Mail Servlet</servlet-name>
+ <servlet-class>org.jboss.seam.example.mail.MailSenderServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>Mail Servlet</servlet-name>
+ <url-pattern>/mail/sender</url-pattern>
+ </servlet-mapping>
+
<session-config>
<session-timeout>10</session-timeout>
</session-config>
Added: trunk/examples/mail/src/org/jboss/seam/example/mail/MailSenderServlet.java
===================================================================
--- trunk/examples/mail/src/org/jboss/seam/example/mail/MailSenderServlet.java (rev 0)
+++ trunk/examples/mail/src/org/jboss/seam/example/mail/MailSenderServlet.java 2008-05-15 15:18:26 UTC (rev 8196)
@@ -0,0 +1,45 @@
+package org.jboss.seam.example.mail;
+
+import java.io.IOException;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.jboss.seam.Component;
+import org.jboss.seam.servlet.ContextualHttpServletRequest;
+
+public class MailSenderServlet extends HttpServlet
+{
+
+ @Override
+ protected void doGet(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException
+ {
+ new ContextualHttpServletRequest(req)
+ {
+
+ @Override
+ public void process() throws Exception
+ {
+ Person person = (Person) Component.getInstance(Person.class);
+ String firstname = req.getParameter("name");
+ String email = req.getParameter("email");
+ person.setAddress(email);
+ person.setFirstname(firstname);
+ MailExample mailExample = (MailExample) Component.getInstance(MailExample.class);
+ mailExample.sendPlain();
+ resp.getWriter().write("Email sent successfully");
+ resp.setStatus(200);
+ }
+
+ }.run();
+ }
+
+ @Override
+ protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
+ {
+ doGet(req, resp);
+ }
+
+}
Property changes on: trunk/examples/mail/src/org/jboss/seam/example/mail/MailSenderServlet.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/examples/mail/view/index.xhtml
===================================================================
--- trunk/examples/mail/view/index.xhtml 2008-05-15 13:25:37 UTC (rev 8195)
+++ trunk/examples/mail/view/index.xhtml 2008-05-15 15:18:26 UTC (rev 8196)
@@ -38,6 +38,35 @@
<h:messages infoStyle="info" errorStyle="error" fatalStyle="fatal" warnStyle="warn" />
</h:form>
+ <p>You can also send from inside a servlet:</p>
+
+ <form action="#{facesContext.externalContext.requestContextPath}/mail/sender" method="get">
+ <table>
+ <tr>
+ <td>
+ Name
+ </td>
+ <td>
+ <input name="name" />
+ </td>
+ </tr>
+ <tr>
+ <td>
+ Email Address
+ </td>
+ <td>
+ <input name="email" />
+ </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>
+ <input type="submit" value="Send" />
+ </td>
+ </tr>
+ </table>
+ </form>
+
<h2>Help - it's not working!</h2>
<ul>
<li><b>Setting an SMTP relay</b> - If you have problems sending emails from this example you might have a firewall
16 years, 6 months
Seam SVN: r8195 - in trunk: ui/src/main/java/org/jboss/seam/ui/facelet and 1 other directory.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-05-15 09:25:37 -0400 (Thu, 15 May 2008)
New Revision: 8195
Added:
trunk/src/main/org/jboss/seam/mock/MockFacesContextFactory.java
trunk/src/main/org/jboss/seam/mock/MockLifecycleFactory.java
trunk/ui/src/main/java/org/jboss/seam/ui/facelet/MockHttpSessionManager.java
trunk/ui/src/main/java/org/jboss/seam/ui/facelet/MockServletContextManager.java
trunk/ui/src/main/java/org/jboss/seam/ui/facelet/RendererFacesContextFactory.java
trunk/ui/src/main/java/org/jboss/seam/ui/facelet/RendererRequest.java
Modified:
trunk/src/main/org/jboss/seam/mock/AbstractSeamTest.java
trunk/src/main/org/jboss/seam/mock/MockFacesContext.java
trunk/src/main/org/jboss/seam/mock/MockHttpServletRequest.java
trunk/src/main/org/jboss/seam/mock/MockLifecycle.java
trunk/ui/src/main/java/org/jboss/seam/ui/facelet/FaceletsRenderer.java
Log:
first commit for JBSEAM-2915
Modified: trunk/src/main/org/jboss/seam/mock/AbstractSeamTest.java
===================================================================
--- trunk/src/main/org/jboss/seam/mock/AbstractSeamTest.java 2008-05-15 11:02:44 UTC (rev 8194)
+++ trunk/src/main/org/jboss/seam/mock/AbstractSeamTest.java 2008-05-15 13:25:37 UTC (rev 8195)
@@ -12,6 +12,7 @@
import javax.el.ELResolver;
import javax.el.ValueExpression;
+import javax.faces.FactoryFinder;
import javax.faces.application.Application;
import javax.faces.application.FacesMessage;
import javax.faces.component.UIViewRoot;
@@ -504,6 +505,7 @@
}
});
seamFilter.destroy();
+ facesContext.release();
afterRequest();
return conversationId;
}
@@ -938,6 +940,7 @@
application = new SeamApplication(new MockApplication());
conversationViewRootAttributes = new HashMap<String, Map>();
seamFilter = createSeamFilter();
+ FactoryFinder.setFactory(FactoryFinder.FACES_CONTEXT_FACTORY, MockFacesContextFactory.class.getName());
for (ELResolver elResolver : getELResolvers())
{
Modified: trunk/src/main/org/jboss/seam/mock/MockFacesContext.java
===================================================================
--- trunk/src/main/org/jboss/seam/mock/MockFacesContext.java 2008-05-15 11:02:44 UTC (rev 8194)
+++ trunk/src/main/org/jboss/seam/mock/MockFacesContext.java 2008-05-15 13:25:37 UTC (rev 8195)
@@ -199,7 +199,8 @@
@Override
public void release()
{
- setCurrentInstance(null);
+ setCurrentInstance(null);
+ MockFacesContextFactory.setFacesContext(null);
}
@Override
@@ -217,6 +218,8 @@
public MockFacesContext setCurrent()
{
setCurrentInstance(this);
+
+ MockFacesContextFactory.setFacesContext(this);
return this;
}
Added: trunk/src/main/org/jboss/seam/mock/MockFacesContextFactory.java
===================================================================
--- trunk/src/main/org/jboss/seam/mock/MockFacesContextFactory.java (rev 0)
+++ trunk/src/main/org/jboss/seam/mock/MockFacesContextFactory.java 2008-05-15 13:25:37 UTC (rev 8195)
@@ -0,0 +1,29 @@
+package org.jboss.seam.mock;
+
+import javax.faces.FacesException;
+import javax.faces.context.FacesContext;
+import javax.faces.context.FacesContextFactory;
+import javax.faces.lifecycle.Lifecycle;
+
+public class MockFacesContextFactory extends FacesContextFactory
+{
+
+ private static FacesContext facesContext;
+
+ @Override
+ public FacesContext getFacesContext(Object context, Object request, Object response, Lifecycle lifecycle) throws FacesException
+ {
+ return facesContext;
+ }
+
+ public static void setFacesContext(FacesContext facesContext)
+ {
+ MockFacesContextFactory.facesContext = facesContext;
+ }
+
+ public static FacesContext getFacesContext()
+ {
+ return MockFacesContextFactory.facesContext;
+ }
+
+}
Property changes on: trunk/src/main/org/jboss/seam/mock/MockFacesContextFactory.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/src/main/org/jboss/seam/mock/MockHttpServletRequest.java
===================================================================
--- trunk/src/main/org/jboss/seam/mock/MockHttpServletRequest.java 2008-05-15 11:02:44 UTC (rev 8194)
+++ trunk/src/main/org/jboss/seam/mock/MockHttpServletRequest.java 2008-05-15 13:25:37 UTC (rev 8195)
@@ -10,6 +10,7 @@
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.security.Principal;
+import java.util.ArrayList;
import java.util.Arrays;
import java.util.Enumeration;
import java.util.HashMap;
@@ -40,7 +41,8 @@
private String principalName;
private Set<String> principalRoles;
private Cookie[] cookies;
- private String method;
+ private String method;
+ private Enumeration locales;
public MockHttpServletRequest(HttpSession session)
{
@@ -61,6 +63,7 @@
this.method = method;
// The 1.2 RI NPEs if this header isn't present
headers.put("Accept", new String[0]);
+ locales = new IteratorEnumeration(new ArrayList().iterator());
}
public Map<String, String[]> getParameters()
@@ -341,8 +344,7 @@
public Enumeration getLocales()
{
- //TODO
- return null;
+ return locales;
}
public boolean isSecure()
Modified: trunk/src/main/org/jboss/seam/mock/MockLifecycle.java
===================================================================
--- trunk/src/main/org/jboss/seam/mock/MockLifecycle.java 2008-05-15 11:02:44 UTC (rev 8194)
+++ trunk/src/main/org/jboss/seam/mock/MockLifecycle.java 2008-05-15 13:25:37 UTC (rev 8195)
@@ -2,6 +2,7 @@
package org.jboss.seam.mock;
import javax.faces.FacesException;
+import javax.faces.FactoryFinder;
import javax.faces.context.FacesContext;
import javax.faces.event.PhaseListener;
import javax.faces.lifecycle.Lifecycle;
@@ -10,6 +11,12 @@
{
public static final Lifecycle INSTANCE = new MockLifecycle();
+
+ public MockLifecycle()
+ {
+ MockLifecycleFactory.setLifecycle(this);
+ FactoryFinder.setFactory(FactoryFinder.LIFECYCLE_FACTORY, MockLifecycleFactory.class.getName());
+ }
@Override
public void addPhaseListener(PhaseListener pl)
Added: trunk/src/main/org/jboss/seam/mock/MockLifecycleFactory.java
===================================================================
--- trunk/src/main/org/jboss/seam/mock/MockLifecycleFactory.java (rev 0)
+++ trunk/src/main/org/jboss/seam/mock/MockLifecycleFactory.java 2008-05-15 13:25:37 UTC (rev 8195)
@@ -0,0 +1,42 @@
+package org.jboss.seam.mock;
+
+import java.util.Arrays;
+import java.util.Iterator;
+
+import javax.faces.lifecycle.Lifecycle;
+import javax.faces.lifecycle.LifecycleFactory;
+
+public class MockLifecycleFactory extends LifecycleFactory
+{
+
+ private static Lifecycle lifecycle;
+
+ public static void setLifecycle(Lifecycle lifecycle)
+ {
+ MockLifecycleFactory.lifecycle = lifecycle;
+ }
+
+ public static Lifecycle getLifecycle()
+ {
+ return MockLifecycleFactory.lifecycle;
+ }
+
+ @Override
+ public void addLifecycle(String lifecycleId, Lifecycle lifecycle)
+ {
+ throw new IllegalArgumentException("Not supported");
+ }
+
+ @Override
+ public Lifecycle getLifecycle(String lifecycleId)
+ {
+ return lifecycle;
+ }
+
+ @Override
+ public Iterator<String> getLifecycleIds()
+ {
+ return Arrays.asList(DEFAULT_LIFECYCLE).iterator();
+ }
+
+}
Property changes on: trunk/src/main/org/jboss/seam/mock/MockLifecycleFactory.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/ui/src/main/java/org/jboss/seam/ui/facelet/FaceletsRenderer.java
===================================================================
--- trunk/ui/src/main/java/org/jboss/seam/ui/facelet/FaceletsRenderer.java 2008-05-15 11:02:44 UTC (rev 8194)
+++ trunk/ui/src/main/java/org/jboss/seam/ui/facelet/FaceletsRenderer.java 2008-05-15 13:25:37 UTC (rev 8195)
@@ -1,29 +1,15 @@
package org.jboss.seam.ui.facelet;
import java.io.IOException;
-import java.io.StringWriter;
-import java.net.URL;
-import javax.faces.component.UIViewRoot;
-import javax.faces.context.FacesContext;
-import javax.faces.context.ResponseWriter;
-
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.AutoCreate;
import org.jboss.seam.annotations.Install;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.annotations.intercept.BypassInterceptors;
-import org.jboss.seam.core.ResourceLoader;
import org.jboss.seam.faces.Renderer;
-import org.jboss.seam.mock.MockExternalContext;
-import org.jboss.seam.mock.MockFacesContext;
-import org.jboss.seam.ui.util.JSF;
-import com.sun.facelets.Facelet;
-import com.sun.facelets.impl.DefaultFaceletFactory;
-import com.sun.facelets.impl.DefaultResourceResolver;
-
/**
*
* Implementation of Renderer using Facelets
@@ -42,167 +28,25 @@
@Install(value = true, precedence = Install.BUILT_IN, classDependencies="com.sun.facelets.Facelet")
public class FaceletsRenderer extends Renderer
{
- /**
- * Sets up and tears down the rendering (FacesContext, ExternalContext) using
- * Seam's mock contexts if JSF is not currently running. Also switches out the
- * ViewRoot for the duration. Any output written to the ResponseWriter is
- * buffered.
- *
- * @author Pete Muir
- *
- */
- protected abstract class RenderingContext
- {
-
- public RenderingContext(String viewId)
- {
- this.viewId = viewId;
- }
-
- private String viewId;
-
- private ClassLoader originalClassLoader;
- private ResponseWriter originalResponseWriter;
- private UIViewRoot originalViewRoot;
- private StringWriter writer = new StringWriter();
-
- /**
- * Call to execute the process method inside the RenderingContext
- */
- public void run()
- {
- try
- {
- init();
- process();
- }
- finally
- {
- cleanup();
- }
- }
-
- private void init()
- {
- // Make sure we are using the correct ClassLoader
- originalClassLoader = Thread.currentThread().getContextClassLoader();
- Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
-
- // If a FacesContext isn't available, set one up
- if (FacesContext.getCurrentInstance() == null)
- {
- MockFacesContext mockFacesContext = new MockFacesContext(new MockExternalContext())
- .setCurrent();
- mockFacesContext.createViewRoot();
- }
-
- FacesContext facesContext = FacesContext.getCurrentInstance();
-
- // Wrap the ResponseWriter
- originalResponseWriter = facesContext.getResponseWriter();
- facesContext.setResponseWriter(facesContext.getRenderKit().createResponseWriter(writer,
- null, null));
-
- // Create a new UIViewRoot
- originalViewRoot = facesContext.getViewRoot();
- UIViewRoot viewRoot = new UIViewRoot();
- viewRoot.setRenderKitId(facesContext.getApplication().getViewHandler().calculateRenderKitId(facesContext));
- viewRoot.setViewId(viewId);
- viewRoot.setLocale(originalViewRoot.getLocale());
- facesContext.setViewRoot(viewRoot);
- }
-
- private void cleanup()
- {
- FacesContext facesContext = FacesContext.getCurrentInstance();
- if (originalResponseWriter != null)
- {
- facesContext.setResponseWriter(originalResponseWriter);
- }
- if (originalViewRoot != null)
- {
- facesContext.setViewRoot(originalViewRoot);
- }
- Thread.currentThread().setContextClassLoader(originalClassLoader);
- }
-
- /**
- * Return any output written to the ResponseWriter as a String
- */
- public String getOutput()
- {
- return writer.getBuffer().toString();
- }
-
- /**
- * Override to execute within a RenderingContext
- */
- protected abstract void process();
-
- }
+
/**
* Render the viewId, anything written to the JSF ResponseWriter is
- * returned
+ * returned
*/
@Override
- public String render(final String viewId)
+ public String render(final String viewId)
{
- RenderingContext context = new RenderingContext(viewId) {
-
- @Override
- public void process()
- {
- FacesContext facesContext = FacesContext.getCurrentInstance();
- try
- {
- renderFacelet(facesContext, faceletForURL(resourceURL(viewId)));
- }
- catch (IOException e)
- {
- throw new RuntimeException("Error rendering view", e);
- }
- }
-
- };
- context.run();
-
- return context.getOutput();
- }
-
- /**
- * Get a viewId as a URL
- */
- protected URL resourceURL(String viewId)
- {
-
- URL url = ResourceLoader.instance().getResource(viewId);
-
- if (url == null)
+ RendererRequest rendererRequest = new RendererRequest(viewId);
+ try
{
- throw new IllegalArgumentException("resource doesn't exist: " + viewId);
+ rendererRequest.run();
}
-
- return url;
+ catch (IOException e)
+ {
+ throw new RuntimeException("error rendering " + viewId, e);
+ }
+ return rendererRequest.getOutput();
}
-
- /**
- * Get a Facelet for a URL
- */
- protected Facelet faceletForURL(URL url) throws IOException
- {
- return new DefaultFaceletFactory(FaceletCompiler.instance(), new DefaultResourceResolver())
- .getFacelet(url);
- }
-
- /**
- * Render a Facelet
- */
- protected void renderFacelet(FacesContext facesContext, Facelet facelet) throws IOException
- {
- UIViewRoot root = facesContext.getViewRoot();
- facelet.apply(facesContext, root);
- JSF.renderChildren(facesContext, root);
- }
}
Added: trunk/ui/src/main/java/org/jboss/seam/ui/facelet/MockHttpSessionManager.java
===================================================================
--- trunk/ui/src/main/java/org/jboss/seam/ui/facelet/MockHttpSessionManager.java (rev 0)
+++ trunk/ui/src/main/java/org/jboss/seam/ui/facelet/MockHttpSessionManager.java 2008-05-15 13:25:37 UTC (rev 8195)
@@ -0,0 +1,49 @@
+package org.jboss.seam.ui.facelet;
+
+import static org.jboss.seam.ScopeType.SESSION;
+
+import javax.servlet.http.HttpSession;
+
+import org.jboss.seam.Component;
+import org.jboss.seam.annotations.AutoCreate;
+import org.jboss.seam.annotations.Create;
+import org.jboss.seam.annotations.Install;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.annotations.Unwrap;
+import org.jboss.seam.annotations.intercept.BypassInterceptors;
+import org.jboss.seam.contexts.Contexts;
+import org.jboss.seam.mock.MockHttpSession;
+
+@Name("org.jboss.seam.ui.facelet.mockHttpSession")
+@Scope(SESSION)
+@BypassInterceptors
+@Install(dependencies="org.jboss.seam.faces.renderer")
+@AutoCreate
+public class MockHttpSessionManager
+{
+
+ private HttpSession session;
+
+ @Create
+ public void create()
+ {
+ this.session = new MockHttpSession(MockServletContextManager.instance());
+ }
+
+ @Unwrap
+ public HttpSession getSession()
+ {
+ return session;
+ }
+
+ public static HttpSession instance()
+ {
+ if (!Contexts.isSessionContextActive())
+ {
+ throw new IllegalStateException("Session context is not active");
+ }
+ return (HttpSession) Component.getInstance(MockHttpSessionManager.class, SESSION);
+ }
+
+}
Property changes on: trunk/ui/src/main/java/org/jboss/seam/ui/facelet/MockHttpSessionManager.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/ui/src/main/java/org/jboss/seam/ui/facelet/MockServletContextManager.java
===================================================================
--- trunk/ui/src/main/java/org/jboss/seam/ui/facelet/MockServletContextManager.java (rev 0)
+++ trunk/ui/src/main/java/org/jboss/seam/ui/facelet/MockServletContextManager.java 2008-05-15 13:25:37 UTC (rev 8195)
@@ -0,0 +1,49 @@
+package org.jboss.seam.ui.facelet;
+
+import static org.jboss.seam.ScopeType.APPLICATION;
+
+import javax.servlet.ServletContext;
+
+import org.jboss.seam.Component;
+import org.jboss.seam.annotations.AutoCreate;
+import org.jboss.seam.annotations.Create;
+import org.jboss.seam.annotations.Install;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.annotations.Unwrap;
+import org.jboss.seam.annotations.intercept.BypassInterceptors;
+import org.jboss.seam.contexts.Contexts;
+import org.jboss.seam.mock.MockServletContext;
+
+@Name("org.jboss.seam.ui.facelet.mockServletContext")
+@Scope(APPLICATION)
+@BypassInterceptors
+@Install(dependencies="org.jboss.seam.faces.renderer")
+@AutoCreate
+public class MockServletContextManager
+{
+
+ private ServletContext servletContext;
+
+ @Create
+ public void create()
+ {
+ this.servletContext = new MockServletContext();
+ }
+
+ @Unwrap
+ public ServletContext getServletContext()
+ {
+ return servletContext;
+ }
+
+ public static ServletContext instance()
+ {
+ if (!Contexts.isApplicationContextActive())
+ {
+ throw new IllegalStateException("Application context is not active");
+ }
+ return (ServletContext) Component.getInstance(MockServletContextManager.class, APPLICATION);
+ }
+
+}
Property changes on: trunk/ui/src/main/java/org/jboss/seam/ui/facelet/MockServletContextManager.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/ui/src/main/java/org/jboss/seam/ui/facelet/RendererFacesContextFactory.java
===================================================================
--- trunk/ui/src/main/java/org/jboss/seam/ui/facelet/RendererFacesContextFactory.java (rev 0)
+++ trunk/ui/src/main/java/org/jboss/seam/ui/facelet/RendererFacesContextFactory.java 2008-05-15 13:25:37 UTC (rev 8195)
@@ -0,0 +1,75 @@
+package org.jboss.seam.ui.facelet;
+
+import static org.jboss.seam.ScopeType.APPLICATION;
+
+import javax.faces.FactoryFinder;
+import javax.faces.context.FacesContext;
+import javax.faces.lifecycle.Lifecycle;
+import javax.faces.lifecycle.LifecycleFactory;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+
+import org.jboss.seam.Component;
+import org.jboss.seam.annotations.AutoCreate;
+import org.jboss.seam.annotations.Create;
+import org.jboss.seam.annotations.Destroy;
+import org.jboss.seam.annotations.Install;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.annotations.intercept.BypassInterceptors;
+import org.jboss.seam.contexts.Contexts;
+
+
+/**
+ * A copy of the FacesServlet for use in our Renderer.
+ *
+ * Shamelessly adapted from the RI
+ *
+ * @author Pete Muir
+ *
+ */
+
+@Name("org.jboss.seam.ui.facelet.facesContextFactory")
+@Scope(APPLICATION)
+@BypassInterceptors
+@Install(dependencies="org.jboss.seam.faces.renderer")
+@AutoCreate
+public class RendererFacesContextFactory
+{
+
+ private javax.faces.context.FacesContextFactory facesContextFactory;
+ private Lifecycle lifecycle;
+
+ @Create
+ public void create()
+ {
+ // Acquire our FacesContextFactory instance
+ facesContextFactory = (javax.faces.context.FacesContextFactory) FactoryFinder.getFactory (FactoryFinder.FACES_CONTEXT_FACTORY);
+
+ // Acquire our Lifecycle instance
+ LifecycleFactory lifecycleFactory = (LifecycleFactory) FactoryFinder.getFactory(FactoryFinder.LIFECYCLE_FACTORY);
+ lifecycle = lifecycleFactory.getLifecycle(LifecycleFactory.DEFAULT_LIFECYCLE);
+ }
+
+ public FacesContext getFacesContext(ServletRequest request, ServletResponse response)
+ {
+ return facesContextFactory.getFacesContext(MockServletContextManager.instance(), request, response, lifecycle);
+ }
+
+ @Destroy
+ public void destroy()
+ {
+ facesContextFactory = null;
+ lifecycle = null;
+ }
+
+ public static RendererFacesContextFactory instance()
+ {
+ if (!Contexts.isApplicationContextActive())
+ {
+ throw new IllegalStateException("Application context is not active");
+ }
+ return (RendererFacesContextFactory) Component.getInstance(RendererFacesContextFactory.class, APPLICATION);
+ }
+
+}
Property changes on: trunk/ui/src/main/java/org/jboss/seam/ui/facelet/RendererFacesContextFactory.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/ui/src/main/java/org/jboss/seam/ui/facelet/RendererRequest.java
===================================================================
--- trunk/ui/src/main/java/org/jboss/seam/ui/facelet/RendererRequest.java (rev 0)
+++ trunk/ui/src/main/java/org/jboss/seam/ui/facelet/RendererRequest.java 2008-05-15 13:25:37 UTC (rev 8195)
@@ -0,0 +1,114 @@
+package org.jboss.seam.ui.facelet;
+
+import java.io.IOException;
+import java.io.StringWriter;
+import java.net.URL;
+
+import javax.faces.component.UIViewRoot;
+import javax.faces.context.FacesContext;
+
+import org.jboss.seam.core.ResourceLoader;
+import org.jboss.seam.jsf.DelegatingFacesContext;
+import org.jboss.seam.mock.MockHttpServletRequest;
+import org.jboss.seam.mock.MockHttpServletResponse;
+import org.jboss.seam.ui.util.JSF;
+
+import com.sun.facelets.Facelet;
+import com.sun.facelets.impl.DefaultFaceletFactory;
+import com.sun.facelets.impl.DefaultResourceResolver;
+
+public class RendererRequest
+{
+
+ private FacesContext originalFacesContext;
+ private FacesContext facesContext;
+
+ private MockHttpServletRequest request;
+ private MockHttpServletResponse response;
+
+ private ClassLoader originalClassLoader;
+
+ private StringWriter writer;
+
+ private String viewId;
+
+ public RendererRequest(String viewId)
+ {
+ this.viewId = viewId;
+ }
+
+ private void init()
+ {
+ request = new MockHttpServletRequest(MockHttpSessionManager.instance());
+ response = new MockHttpServletResponse();
+
+ // Make sure we are using the correct ClassLoader
+ // TODO Is this still necessary
+ originalClassLoader = Thread.currentThread().getContextClassLoader();
+ Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
+
+ // Generate the FacesContext from the JSF FacesContextFactory
+ originalFacesContext = FacesContext.getCurrentInstance();
+ facesContext = RendererFacesContextFactory.instance().getFacesContext(request, response);
+ DelegatingFacesContext.setCurrentInstance(facesContext);
+
+ // Create the viewRoot
+ UIViewRoot newRoot = facesContext.getApplication().getViewHandler().createView(facesContext, viewId);
+ facesContext.setViewRoot(newRoot);
+
+ // Set the responseWriter to write to a buffer
+ writer = new StringWriter();
+ facesContext.setResponseWriter(facesContext.getRenderKit().createResponseWriter(writer,
+ null, null));
+ }
+
+ private void cleanup()
+ {
+ facesContext.release();
+ DelegatingFacesContext.setCurrentInstance(originalFacesContext);
+
+ Thread.currentThread().setContextClassLoader(originalClassLoader);
+
+ originalFacesContext = null;
+ facesContext = null;
+ request = null;
+ response = null;
+ originalClassLoader = null;
+ }
+
+ public void run() throws IOException
+ {
+ init();
+ renderFacelet(facesContext, faceletForViewId(viewId));
+ cleanup();
+ }
+
+ public String getOutput()
+ {
+ return writer.getBuffer().toString();
+ }
+
+ /**
+ * Get a Facelet for a URL
+ */
+ protected Facelet faceletForViewId(String viewId) throws IOException
+ {
+ URL url = ResourceLoader.instance().getResource(viewId);
+ if (url == null)
+ {
+ throw new IllegalArgumentException("resource doesn't exist: " + viewId);
+ }
+ return new DefaultFaceletFactory(FaceletCompiler.instance(), new DefaultResourceResolver())
+ .getFacelet(url);
+ }
+
+ /**
+ * Render a Facelet
+ */
+ protected void renderFacelet(FacesContext facesContext, Facelet facelet) throws IOException
+ {
+ UIViewRoot root = facesContext.getViewRoot();
+ facelet.apply(facesContext, root);
+ JSF.renderChildren(facesContext, root);
+ }
+}
Property changes on: trunk/ui/src/main/java/org/jboss/seam/ui/facelet/RendererRequest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
16 years, 6 months
Seam SVN: r8194 - in branches/Seam_1_2_1_AP: examples/mail and 1 other directory.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-05-15 07:02:44 -0400 (Thu, 15 May 2008)
New Revision: 8194
Modified:
branches/Seam_1_2_1_AP/
branches/Seam_1_2_1_AP/examples/mail/
Log:
ignores
Property changes on: branches/Seam_1_2_1_AP
___________________________________________________________________
Name: svn:ignore
- *.ipr
*.iws
*.iml
jboss-seam.jar
jboss-seam-ui.jar
jboss-seam-debug.jar
jboss-seam-gen.jar
jboss-seam-pdf.jar
jboss-seam-mail.jar
jboss-seam-remoting.jar
jboss-seam-ioc.jar
test-output
testng-failures.xml
report
output
build
dist
+ *.ipr
*.iws
*.iml
jboss-seam.jar
jboss-seam-ui.jar
jboss-seam-debug.jar
jboss-seam-gen.jar
jboss-seam-pdf.jar
jboss-seam-mail.jar
jboss-seam-remoting.jar
jboss-seam-ioc.jar
test-output
testng-failures.xml
report
output
build
dist
dist.tar.gz
dist.zip
Property changes on: branches/Seam_1_2_1_AP/examples/mail
___________________________________________________________________
Name: svn:ignore
+ build
16 years, 6 months
Seam SVN: r8193 - in branches/Seam_1_2_1_AP/examples/mail: view and 1 other directory.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-05-15 07:00:06 -0400 (Thu, 15 May 2008)
New Revision: 8193
Modified:
branches/Seam_1_2_1_AP/examples/mail/src/org/jboss/seam/example/mail/MailExample.java
branches/Seam_1_2_1_AP/examples/mail/view/index.xhtml
Log:
JBPAPP-803, port of r4991
Modified: branches/Seam_1_2_1_AP/examples/mail/src/org/jboss/seam/example/mail/MailExample.java
===================================================================
--- branches/Seam_1_2_1_AP/examples/mail/src/org/jboss/seam/example/mail/MailExample.java 2008-05-14 16:56:29 UTC (rev 8192)
+++ branches/Seam_1_2_1_AP/examples/mail/src/org/jboss/seam/example/mail/MailExample.java 2008-05-15 11:00:06 UTC (rev 8193)
@@ -81,6 +81,16 @@
asynchronousMailProcessor.scheduleSend(3000, person);
}
+ public void sendTemplate() {
+ try {
+ renderer.render("/templating.xhtml");
+ facesMessages.add("Email sent successfully");
+ } catch (Exception e) {
+ log.error("Error sending mail", e);
+ facesMessages.add("Email sending failed: " + e.getMessage());
+ }
+ }
+
@Factory("numbers")
public URL getFile()
{
Modified: branches/Seam_1_2_1_AP/examples/mail/view/index.xhtml
===================================================================
--- branches/Seam_1_2_1_AP/examples/mail/view/index.xhtml 2008-05-14 16:56:29 UTC (rev 8192)
+++ branches/Seam_1_2_1_AP/examples/mail/view/index.xhtml 2008-05-15 11:00:06 UTC (rev 8193)
@@ -33,7 +33,7 @@
<h:commandButton action="#{mailExample.sendHtml}" value="Send HTML Email" />
<h:commandButton action="#{mailExample.sendAttachment}" value="Send a simple email with attachment" />
<h:commandButton action="#{mailExample.sendAsynchronous}" value="Send a simple email asynchronously" />
- <h:commandButton action="/templating.xhtml" value="Send Templated Email" />
+ <h:commandButton action="#{mailExample.sendTemplate}" value="Send a templated email" />
</h:panelGrid>
<h:messages infoStyle="info" errorStyle="error" fatalStyle="fatal" warnStyle="warn" />
</h:form>
16 years, 6 months
Seam SVN: r8192 - in trunk/src: main/org/jboss/seam/jsf and 1 other directory.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-05-14 12:56:29 -0400 (Wed, 14 May 2008)
New Revision: 8192
Added:
trunk/src/main/org/jboss/seam/jsf/DelegatingFacesContext.java
Modified:
trunk/src/mail/org/jboss/seam/mail/ui/context/MailFacesContextImpl.java
Log:
factor out a delegating faces context utility class
Modified: trunk/src/mail/org/jboss/seam/mail/ui/context/MailFacesContextImpl.java
===================================================================
--- trunk/src/mail/org/jboss/seam/mail/ui/context/MailFacesContextImpl.java 2008-05-14 14:13:29 UTC (rev 8191)
+++ trunk/src/mail/org/jboss/seam/mail/ui/context/MailFacesContextImpl.java 2008-05-14 16:56:29 UTC (rev 8192)
@@ -1,23 +1,15 @@
package org.jboss.seam.mail.ui.context;
-import java.util.Iterator;
-
-import javax.el.ELContext;
-import javax.faces.application.Application;
-import javax.faces.application.FacesMessage;
-import javax.faces.application.FacesMessage.Severity;
-import javax.faces.component.UIViewRoot;
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
-import javax.faces.context.ResponseStream;
import javax.faces.context.ResponseWriter;
-import javax.faces.render.RenderKit;
+import org.jboss.seam.jsf.DelegatingFacesContext;
-public class MailFacesContextImpl extends FacesContext
+
+public class MailFacesContextImpl extends DelegatingFacesContext
{
- private FacesContext delegate;
private ExternalContext externalContext;
private ResponseWriter responseWriter;
@@ -27,132 +19,31 @@
this(delegate, null);
}
- public MailFacesContextImpl(FacesContext facesContext, String urlBase)
+ public MailFacesContextImpl(FacesContext delegate, String urlBase)
{
- this.delegate = facesContext;
- externalContext = new MailExternalContextImpl(delegate.getExternalContext(), urlBase);
- responseWriter = new MailResponseWriter(delegate.getResponseWriter(), delegate.getResponseWriter().getContentType());
+ super(delegate);
+ externalContext = new MailExternalContextImpl(getDelegate().getExternalContext(), urlBase);
+ responseWriter = new MailResponseWriter(getDelegate().getResponseWriter(), getDelegate().getResponseWriter().getContentType());
}
@Override
- public void addMessage(String clientId, FacesMessage message)
- {
- delegate.addMessage(clientId, message);
- }
-
- @Override
- public Application getApplication()
- {
- return delegate.getApplication();
- }
-
- @Override
- public Iterator getClientIdsWithMessages()
- {
- return delegate.getClientIdsWithMessages();
- }
-
- @Override
public ExternalContext getExternalContext()
{
return externalContext;
}
@Override
- public Severity getMaximumSeverity()
- {
- return delegate.getMaximumSeverity();
- }
-
- @Override
- public Iterator getMessages()
- {
- return delegate.getMessages();
- }
-
- @Override
- public Iterator getMessages(String clientId)
- {
- return delegate.getMessages(clientId);
- }
-
- @Override
- public RenderKit getRenderKit()
- {
- return delegate.getRenderKit();
- }
-
- @Override
- public boolean getRenderResponse()
- {
- return delegate.getRenderResponse();
- }
-
- @Override
- public boolean getResponseComplete()
- {
- return delegate.getResponseComplete();
- }
-
- @Override
- public ResponseStream getResponseStream()
- {
- return delegate.getResponseStream();
- }
-
- @Override
public ResponseWriter getResponseWriter()
{
return responseWriter;
}
@Override
- public UIViewRoot getViewRoot()
- {
- return delegate.getViewRoot();
- }
-
- @Override
- public void release()
- {
- delegate.release();
- }
-
- @Override
- public void renderResponse()
- {
- delegate.renderResponse();
- }
-
- @Override
- public void responseComplete()
- {
- delegate.responseComplete();
- }
-
- @Override
- public void setResponseStream(ResponseStream responseStream)
- {
- delegate.setResponseStream(responseStream);
- }
-
- @Override
public void setResponseWriter(ResponseWriter responseWriter)
{
this.responseWriter = responseWriter;
}
-
- @Override
- public void setViewRoot(UIViewRoot root)
- {
- delegate.setViewRoot(root);
- }
- public FacesContext getDelegate()
- {
- return delegate;
- }
-
public static void start(String urlBase)
{
FacesContext mailFacesContext = new MailFacesContextImpl(getCurrentInstance(), urlBase);
@@ -168,12 +59,5 @@
}
}
-
- @Override
- public ELContext getELContext()
- {
- return delegate.getELContext();
- }
-
}
Added: trunk/src/main/org/jboss/seam/jsf/DelegatingFacesContext.java
===================================================================
--- trunk/src/main/org/jboss/seam/jsf/DelegatingFacesContext.java (rev 0)
+++ trunk/src/main/org/jboss/seam/jsf/DelegatingFacesContext.java 2008-05-14 16:56:29 UTC (rev 8192)
@@ -0,0 +1,165 @@
+package org.jboss.seam.jsf;
+
+import java.util.Iterator;
+
+import javax.el.ELContext;
+import javax.faces.application.Application;
+import javax.faces.application.FacesMessage;
+import javax.faces.application.FacesMessage.Severity;
+import javax.faces.component.UIViewRoot;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseStream;
+import javax.faces.context.ResponseWriter;
+import javax.faces.render.RenderKit;
+
+/**
+ * Implementation of FacesContext that delegates all calls.
+ *
+ * Further, it exposes {@link #setCurrentInstance(FacesContext)} as a public
+ * method
+ *
+ * @author Pete Muir
+ *
+ */
+public class DelegatingFacesContext extends FacesContext
+{
+
+ private FacesContext delegate;
+
+ public DelegatingFacesContext(FacesContext delegate)
+ {
+ this.delegate = delegate;
+ }
+
+ @Override
+ public void addMessage(String clientId, FacesMessage message)
+ {
+ delegate.addMessage(clientId, message);
+ }
+
+ @Override
+ public Application getApplication()
+ {
+ return delegate.getApplication();
+ }
+
+ @Override
+ public Iterator getClientIdsWithMessages()
+ {
+ return delegate.getClientIdsWithMessages();
+ }
+
+ @Override
+ public ExternalContext getExternalContext()
+ {
+ return delegate.getExternalContext();
+ }
+
+ @Override
+ public Severity getMaximumSeverity()
+ {
+ return delegate.getMaximumSeverity();
+ }
+
+ @Override
+ public Iterator getMessages()
+ {
+ return delegate.getMessages();
+ }
+
+ @Override
+ public Iterator getMessages(String clientId)
+ {
+ return delegate.getMessages(clientId);
+ }
+
+ @Override
+ public RenderKit getRenderKit()
+ {
+ return delegate.getRenderKit();
+ }
+
+ @Override
+ public boolean getRenderResponse()
+ {
+ return delegate.getRenderResponse();
+ }
+
+ @Override
+ public boolean getResponseComplete()
+ {
+ return delegate.getResponseComplete();
+ }
+
+ @Override
+ public ResponseStream getResponseStream()
+ {
+ return delegate.getResponseStream();
+ }
+
+ @Override
+ public ResponseWriter getResponseWriter()
+ {
+ return delegate.getResponseWriter();
+ }
+
+ @Override
+ public UIViewRoot getViewRoot()
+ {
+ return delegate.getViewRoot();
+ }
+
+ @Override
+ public void release()
+ {
+ delegate.release();
+ }
+
+ @Override
+ public void renderResponse()
+ {
+ delegate.renderResponse();
+ }
+
+ @Override
+ public void responseComplete()
+ {
+ delegate.responseComplete();
+ }
+
+ @Override
+ public void setResponseStream(ResponseStream responseStream)
+ {
+ delegate.setResponseStream(responseStream);
+ }
+
+ @Override
+ public void setResponseWriter(ResponseWriter responseWriter)
+ {
+ delegate.setResponseWriter(responseWriter);
+ }
+
+ @Override
+ public void setViewRoot(UIViewRoot root)
+ {
+ delegate.setViewRoot(root);
+ }
+
+ public FacesContext getDelegate()
+ {
+ return delegate;
+ }
+
+ @Override
+ public ELContext getELContext()
+ {
+ return delegate.getELContext();
+ }
+
+ public static void setCurrentInstance(FacesContext context)
+ {
+ FacesContext.setCurrentInstance(context);
+ }
+
+}
Property changes on: trunk/src/main/org/jboss/seam/jsf/DelegatingFacesContext.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
16 years, 6 months
Seam SVN: r8191 - branches/Seam_1_2_1_AP/examples/dvdstore/src/com/jboss/dvd/seam.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2008-05-14 10:13:29 -0400 (Wed, 14 May 2008)
New Revision: 8191
Modified:
branches/Seam_1_2_1_AP/examples/dvdstore/src/com/jboss/dvd/seam/Checkout.java
branches/Seam_1_2_1_AP/examples/dvdstore/src/com/jboss/dvd/seam/CheckoutAction.java
Log:
JBPAPP-807
Modified: branches/Seam_1_2_1_AP/examples/dvdstore/src/com/jboss/dvd/seam/Checkout.java
===================================================================
--- branches/Seam_1_2_1_AP/examples/dvdstore/src/com/jboss/dvd/seam/Checkout.java 2008-05-14 13:54:54 UTC (rev 8190)
+++ branches/Seam_1_2_1_AP/examples/dvdstore/src/com/jboss/dvd/seam/Checkout.java 2008-05-14 14:13:29 UTC (rev 8191)
@@ -10,7 +10,7 @@
{
// public void startCheckout();
public void createOrder();
- public void submitOrder();
+ public Order submitOrder();
public void destroy();
}
Modified: branches/Seam_1_2_1_AP/examples/dvdstore/src/com/jboss/dvd/seam/CheckoutAction.java
===================================================================
--- branches/Seam_1_2_1_AP/examples/dvdstore/src/com/jboss/dvd/seam/CheckoutAction.java 2008-05-14 13:54:54 UTC (rev 8190)
+++ branches/Seam_1_2_1_AP/examples/dvdstore/src/com/jboss/dvd/seam/CheckoutAction.java 2008-05-14 14:13:29 UTC (rev 8191)
@@ -7,9 +7,8 @@
package com.jboss.dvd.seam;
-import java.math.BigDecimal;
-
import java.io.Serializable;
+import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -74,7 +73,7 @@
@End
@CreateProcess(definition="OrderManagement")
- public void submitOrder() {
+ public Order submitOrder() {
try {
completedOrder = purchase(customer, currentOrder);
@@ -88,11 +87,10 @@
Contexts.getEventContext().set("prod", product);
FacesMessages.instance().addFromResourceBundle("checkoutInsufficientQuantity");
}
-
- //return null;
- } catch (Throwable t) {
- t.printStackTrace();
+// e.printStackTrace();
+ return null;
}
+ return completedOrder;
}
16 years, 6 months