From seam-commits at lists.jboss.org Mon Nov 23 21:12:52 2009 Content-Type: multipart/mixed; boundary="===============9149063669466208477==" MIME-Version: 1.0 From: seam-commits at lists.jboss.org To: seam-commits at lists.jboss.org Subject: [seam-commits] Seam SVN: r11655 - tags/JBPAPP_4_3_CP07_FP_CR1a/doc/Seam_Reference_Guide/en-US. Date: Mon, 23 Nov 2009 21:12:52 -0500 Message-ID: <200911240212.nAO2CqJT029014@svn01.web.mwc.hst.phx2.redhat.com> --===============9149063669466208477== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: laubai Date: 2009-11-23 21:12:51 -0500 (Mon, 23 Nov 2009) New Revision: 11655 Modified: tags/JBPAPP_4_3_CP07_FP_CR1a/doc/Seam_Reference_Guide/en-US/Concepts.xml tags/JBPAPP_4_3_CP07_FP_CR1a/doc/Seam_Reference_Guide/en-US/Configuratio= n.xml tags/JBPAPP_4_3_CP07_FP_CR1a/doc/Seam_Reference_Guide/en-US/Conversation= s.xml tags/JBPAPP_4_3_CP07_FP_CR1a/doc/Seam_Reference_Guide/en-US/Events.xml tags/JBPAPP_4_3_CP07_FP_CR1a/doc/Seam_Reference_Guide/en-US/Groovy.xml tags/JBPAPP_4_3_CP07_FP_CR1a/doc/Seam_Reference_Guide/en-US/Jms.xml tags/JBPAPP_4_3_CP07_FP_CR1a/doc/Seam_Reference_Guide/en-US/Security.xml tags/JBPAPP_4_3_CP07_FP_CR1a/doc/Seam_Reference_Guide/en-US/Tutorial.xml tags/JBPAPP_4_3_CP07_FP_CR1a/doc/Seam_Reference_Guide/en-US/Webservices.= xml tags/JBPAPP_4_3_CP07_FP_CR1a/doc/Seam_Reference_Guide/en-US/Xml.xml Log: Commented out visible TODO items for CP07 build. Modified: tags/JBPAPP_4_3_CP07_FP_CR1a/doc/Seam_Reference_Guide/en-US/Conce= pts.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- tags/JBPAPP_4_3_CP07_FP_CR1a/doc/Seam_Reference_Guide/en-US/Concepts.xm= l 2009-11-24 00:33:31 UTC (rev 11654) +++ tags/JBPAPP_4_3_CP07_FP_CR1a/doc/Seam_Reference_Guide/en-US/Concepts.xm= l 2009-11-24 02:12:51 UTC (rev 11655) @@ -15,7 +15,7 @@ Let's start by describing the contexts built in to Seam. = - +
Seam contexts Seam contexts are created and destroyed by the framework. T= he application does not control context demarcation via explicit Java API calls. Context are usually i= mplicit. In some cases, however, contexts are @@ -61,16 +61,16 @@ Let's look at each context in turn. = - +
Stateless context Components which are truly stateless (stateless session be= ans, primarily) always live in the stateless context (this is really a non-context). Stateles= s components are not very interesting, and are arguably not very object-oriented. Nevertheless, they are = important and often useful. - +
= - +
Event context The event context is the "narrowest" stateful context, and= is a generalization of the notion of the @@ -83,9 +83,9 @@ When you invoke a Seam component via RMI, or Seam Remoting= , the event context is created and destroyed just for the invocation. - +
= - +
Page context The page context allows you to associate state with a part= icular instance of a rendered page. You can @@ -95,9 +95,9 @@ serialized to the client, so this construct is extremely r= obust with respect to multi-window operation and the back button. - +
= - +
Conversation context The conversation context is a truly central concept in Sea= m. A conversation is a @@ -145,9 +145,9 @@ Alternatively, Seam may be configured to keep conversation= al state in the client browser. = - +
= - +
Session context A session context holds state associated with the user log= in session. While there are some cases @@ -157,9 +157,9 @@ = In a JSR-168 portal environment, the session context repre= sents the portlet session. = - +
= - +
Business process context = The business process context holds state associated with t= he long running business process. This @@ -169,18 +169,18 @@ business process is defined externally using a p= rocess definition language, so there are no special annotations for business process dema= rcation. = - +
= - +
Application context = The application context is the familiar servlet context fr= om the servlet spec. Application context is mainly useful for holding static information such as confi= guration data, reference data or metamodels. For example, Seam stores its own configuration and metamod= el in the application context. = - +
= - +
Context variables = A context defines a namespace, a set of context = variables. These work much the @@ -207,9 +207,9 @@ Usually, however, we obtain components from a context via = injection, and put component instances into a context via outjection. = - +
= - +
Context search priority = Sometimes, as above, component instances are obtained from= a particular known scope. Other times, all @@ -242,9 +242,9 @@ Whenever you access a component by name from a JSF page, a= priority search occurs. = = - +
= - +
Concurrency model = Neither the servlet nor EJB specifications define any faci= lities for managing concurrent requests @@ -279,11 +279,11 @@ This concurrency model means that AJAX clients can safely = use volatile session and conversational state, without the need for any special work on the part o= f the developer. - +
= - +
= - +
Seam components = Seam components are POJOs (Plain Old Java Objects). In particu= lar, they are JavaBeans or EJB 3.0 @@ -310,7 +310,7 @@ = - +
Stateless session beans = Stateless session bean components are not able to hold sta= te across multiple invocations. Therefore, @@ -334,9 +334,9 @@ or @In(create=3Dtrue). They should not = be directly instantiated via JNDI lookup or the new operator. = - +
= - +
Stateful session beans = Stateful session bean components are able to hold state no= t only across multiple invocations of the @@ -364,9 +364,9 @@ or @In(create=3Dtrue). They should not = be directly instantiated via JNDI lookup or the new operator. = - +
= - +
Entity beans = Entity beans may be bound to a context variable and functi= on as a seam component. Because entities @@ -397,9 +397,9 @@ Seam entity bean components may be instantiated using Component.getInstance(), @In(create=3Dtrue) or directly using th= e new operator. = - +
= - +
JavaBeans = Javabeans may be used just like a stateless or stateful se= ssion bean. However, they do not provide @@ -423,9 +423,9 @@ or @In(create=3Dtrue). They should not = be directly instantiated using the = new operator. = - +
= - +
Message-driven beans = Message-driven beans may function as a seam component. How= ever, message-driven beans are called quite @@ -441,9 +441,9 @@ Message-driven beans are never instantiated by the applica= tion. They are instantiated by the EJB container when a message is received. - +
= - +
Interception = In order to perform its magic (bijection, context demarcat= ion, validation, etc), Seam must intercept @@ -476,9 +476,9 @@ ]]> = - +
= - +
Component names = All seam components need a name. We can assign a name to a= component using the @@ -545,9 +545,9 @@ name by the components.xml file include= d in the Seam jar. = = - +
= - +
Defining the component scope = We can override the default scope (context) of a component= using the @Scope @@ -566,9 +566,9 @@ org.jboss.seam.ScopeType defines an enu= meration of possible scopes. = - +
= - +
Components with multiple roles = Some Seam component classes can fulfill more than one role= in the system. For example, we often have @@ -601,9 +601,9 @@ ... = }]]> = - +
= - +
Built-in components Like many good frameworks, Seam eats its own dogfood and i= s implemented mostly as a set of built-in @@ -617,11 +617,11 @@ convenient static instance() methods: = - +
= - +
= - +
Bijection Dependency injection or inversi= on of control is by now a familiar @@ -795,9 +795,9 @@ ... = }]]> = - +
= - +
Lifecycle methods = = @@ -831,9 +831,9 @@ specifying @Startup(depends=3D{....}). = = - +
= - +
Conditional installation = @@ -949,9 +949,9 @@ use it in your application. = - +
= - +
Logging = = @@ -1024,9 +1024,9 @@ classpath, Seam with use it. If it is not, Seam will use JDK l= ogging. = - +
= - +
The <literal>Mutable</literal> interface and <literal>@Read= Only</literal> = Many application servers feature an amazingly broken implement= ation of HttpSession @@ -1128,9 +1128,9 @@ of managing an entity bean instance using a Seam component. = = - +
= - +
Factory and manager components = We often need to work with objects that are not Seam component= s. But we still want to be able to inject @@ -1240,6 +1240,6 @@ on every access, a consistent view is provided. = - +
= Modified: tags/JBPAPP_4_3_CP07_FP_CR1a/doc/Seam_Reference_Guide/en-US/Confi= guration.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- tags/JBPAPP_4_3_CP07_FP_CR1a/doc/Seam_Reference_Guide/en-US/Configurati= on.xml 2009-11-24 00:33:31 UTC (rev 11654) +++ tags/JBPAPP_4_3_CP07_FP_CR1a/doc/Seam_Reference_Guide/en-US/Configurati= on.xml 2009-11-24 02:12:51 UTC (rev 11655) @@ -8,12 +8,12 @@ off by the following sections; you'll never need to type any of th= is stuff yourself, since you can just copy and paste from the example applications! = - +
Basic Seam configuration = First, let's look at the basic configuration that is needed= whenever we use Seam with JSF. = - +
Integrating Seam with JSF and your servlet container</t= itle> = <para> Of course, you need a faces servlet! </para> @@ -67,9 +67,9 @@ <param-value>true</param-value> </context-param>]]></programlisting> = - </sect2> + </section> = - <sect2> + <section> <title>Using facelets = If you want follow our advice and use facelets instead = of JSP, add the following lines to @@ -86,9 +86,9 @@ .xhtml ]]> = - +
= - +
Seam Resource Servlet = The Seam Resource Servlet provides resources used by Se= am Remoting, captchas (see the security @@ -104,9 +104,9 @@ Seam Resource Servlet /seam/resource/* ]]> - +
= - +
Seam servlet filters = Seam doesn't need any servlet filters for basic operati= on. However, there are several features which @@ -158,7 +158,7 @@ = Adding the master filter enables the following built-in= filters. = - +
Exception handling This filter provides the exception mapping function= ality in pages.xml (almost all applications will need this). It also takes care o= f rolling back uncommitted transactions when @@ -178,9 +178,9 @@ ]]> = = - +
= - +
Conversation propagation with redirects This filter allows Seam to propagate the conversati= on context across browser redirects. It intercepts any browser redirects and adds a request pa= rameter that specifies the Seam conversation @@ -190,9 +190,9 @@ in components.xml: = ]]> - +
= - +
Multipart form submissions This feature is necessary when using the Seam file = upload JSF control. It detects multipart form requests and processes them according to the multipart= /form-data specification (RFC-2388). To @@ -217,9 +217,9 @@ this value, the request will be aborted. The d= efault setting is 0 (no size limit). - +
= - +
Character encoding Sets the character encoding of submitted form data.= = @@ -244,9 +244,9 @@ already specify an encoding. The default setti= ng is false. - +
= - +
RichFaces = = @@ -292,9 +292,9 @@ = - +
= - +
Identity Logging = = @@ -312,9 +312,9 @@ ]]> = - +
= - +
Context management for custom servlets Requests sent direct to some servlet other than the= JSF servlet are not processed through the JSF lifecycle, so Seam provides a servlet filter that can = be applied to any other servlet that needs @@ -339,9 +339,9 @@ Seam exposes the conversation id as a property of the = built in component conversation. = - +
= - +
Adding custom filters Seam can install your filters for you, allowing you= to specify where in the chain your filter is placed (the servlet specification= doesn't provide a well defined order if you @@ -360,10 +360,10 @@ should be further down the chain than the RichFaces fi= lter (@Filter(within=3D"org.jboss.seam.web.aja= x4jsfFilter")). = - - +
+
= - +
Integrating Seam with your EJB container = We need to apply the SeamInterceptor= to our Seam components. The simplest way to @@ -414,9 +414,9 @@ = ]]> = - +
= - +
Don't forget! = There is one final item you need to know about. You mus= t place a seam.properties, @@ -436,11 +436,11 @@ component explicitly in components.xml,= just like some other competing frameworks do! I think you'll like our way better. = - +
= - +
= - +
Using Alternate JPA Providers = Seam comes packaged and configured with Hibernate as the de= fault JPA provider. @@ -482,9 +482,9 @@ provider needs. Don't forget to package your new provider's j= ar files in the = application if they are needed. - +
= - +
Configuring Seam in Java EE 5 = @@ -498,7 +498,7 @@ = If you're running in a Java EE 5 environment, this is all t= he configuration required to start using Seam! = - +
Packaging = Once you've packaged all this stuff together into an EA= R, the archive structure will look something @@ -564,11 +564,11 @@ only about a third of the way there. If you're too overwhe= lmed by all this tedious configuration stuff, feel free to skip over the rest of this section and come b= ack to it later. = - +
= - +
= - +
Configuring Seam in J2EE = Seam is useful even if you're not yet ready to take the plu= nge into EJB 3.0. In this case you would use @@ -596,7 +596,7 @@ JavaBeans instead of EJB3, and another version that uses JPA a= nd JavaBeans. These example applications are ready to deploy into any J2EE application server. = - +
Boostrapping Hibernate in Seam = Seam will bootstrap a Hibernate SessionFactory= from your @@ -610,9 +610,9 @@ ]]> = - +
= - +
Boostrapping JPA in Seam = Seam will bootstrap a JPA EntityManagerFactory= from your @@ -626,9 +626,9 @@ ]]> = - +
= - +
Packaging = We can package our application as a WAR, in the followi= ng structure: @@ -668,10 +668,10 @@ If we want to deploy Hibernate in a non-EE environment = like TestNG, we need to do a little bit more work. = - - +
+
= - +
Configuring Seam in Java SE, without JBoss Embedded = It is possible to use Seam completely outside of an EE envi= ronment. In this case, you need to tell Seam @@ -685,9 +685,9 @@ ]]> = Of course, you'll also need to define a datasource. - +
= - +
Configuring jBPM in Seam Seam's jBPM integration is not installed by default, so you= 'll need to enable jBPM by installing a built-in component. You'll also need to explicitly list your p= rocess and pageflow definitions. In @@ -732,7 +732,7 @@ The most important thing to notice here is that jBPM transa= ction control is disabled. Seam or EJB3 should control the JTA transactions. = - +
Packaging = There is not yet any well-defined packaging format for = jBPM configuration and process/pageflow @@ -782,11 +782,11 @@ approveDocument.jpdl.xml documentLifecycle.jpdl.xml]]> = - +
= - +
= - +
Configuring SFSB and Session Timeouts in JBoss AS = It is very important that the timeout for Stateful Session = Beans is set higher than the timeout for HTTP @@ -829,9 +829,9 @@ To override this value for your own application, simply inc= lude this entry in your application's own web.xml. = - +
= - +
Running Seam in a Portlet = @@ -847,6 +847,6 @@ Seam Integration with JBoss Portlet Bridge is marked as techno= logy preview, so standard support is not guaranteed. = = - +
= Modified: tags/JBPAPP_4_3_CP07_FP_CR1a/doc/Seam_Reference_Guide/en-US/Conve= rsations.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- tags/JBPAPP_4_3_CP07_FP_CR1a/doc/Seam_Reference_Guide/en-US/Conversatio= ns.xml 2009-11-24 00:33:31 UTC (rev 11654) +++ tags/JBPAPP_4_3_CP07_FP_CR1a/doc/Seam_Reference_Guide/en-US/Conversatio= ns.xml 2009-11-24 02:12:51 UTC (rev 11655) @@ -259,10 +259,10 @@ workspace management. = - + = Usually, if a component exists in a parent conversation of the = @@ -1243,4 +1243,4 @@ - \ No newline at end of file + Modified: tags/JBPAPP_4_3_CP07_FP_CR1a/doc/Seam_Reference_Guide/en-US/Event= s.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- tags/JBPAPP_4_3_CP07_FP_CR1a/doc/Seam_Reference_Guide/en-US/Events.xml = 2009-11-24 00:33:31 UTC (rev 11654) +++ tags/JBPAPP_4_3_CP07_FP_CR1a/doc/Seam_Reference_Guide/en-US/Events.xml = 2009-11-24 02:12:51 UTC (rev 11655) @@ -104,10 +104,10 @@ Furthermore, the view id mentioned in the <page>= ; element need not correspond to a real JSP or Facelets page! So= , we can reproduce the functionality of a traditional action-oriented f= ramework - like Struts or WebWork using page actions. For example: + like Struts or WebWork using page actions. = = - + = = Modified: tags/JBPAPP_4_3_CP07_FP_CR1a/doc/Seam_Reference_Guide/en-US/Groov= y.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- tags/JBPAPP_4_3_CP07_FP_CR1a/doc/Seam_Reference_Guide/en-US/Groovy.xml = 2009-11-24 00:33:31 UTC (rev 11654) +++ tags/JBPAPP_4_3_CP07_FP_CR1a/doc/Seam_Reference_Guide/en-US/Groovy.xml = 2009-11-24 02:12:51 UTC (rev 11655) @@ -40,7 +40,7 @@ = - TODO: write a quick overview of the Groovy syntax add-on + =
Modified: tags/JBPAPP_4_3_CP07_FP_CR1a/doc/Seam_Reference_Guide/en-US/Jms.x= ml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- tags/JBPAPP_4_3_CP07_FP_CR1a/doc/Seam_Reference_Guide/en-US/Jms.xml 200= 9-11-24 00:33:31 UTC (rev 11654) +++ tags/JBPAPP_4_3_CP07_FP_CR1a/doc/Seam_Reference_Guide/en-US/Jms.xml 200= 9-11-24 02:12:51 UTC (rev 11655) @@ -31,7 +31,7 @@ = - +
Asynchronicity = @@ -69,7 +69,7 @@ same. They can just "plug and play" by adding a line to components.xml. = - +
Asynchronous methods = @@ -219,9 +219,9 @@ Asynchronous methods cannot return any other value to the call= er. = - +
= - +
Asynchronous methods with the Quartz Dispatcher = @@ -336,9 +336,9 @@ = The @IntervalDuration, @Interval= Cron, and @IntervalNthBusinessDay annotations = are mutually exclusive. If they are used in the same method, a Run= timeException will be thrown. = - +
= - +
Asynchronous events Component-driven events may also be asynchronous. To raise= an event for asynchronous @@ -349,11 +349,11 @@ Components may observe asynchronous events in the usual wa= y, but remember that only the = business process context is propagated to the asynchronous= thread. - +
= - +
= - +
Messaging in Seam = @@ -361,7 +361,7 @@ Seam components. = - +
Configuration To configure Seam's infrastructure for sending JMS messages, @@ -395,9 +395,9 @@ auto-create=3D"true" = queue-jndi-name=3D"queue/paymentQueue"/>]]> = - +
= - +
Sending messages Now, you can inject a JMS TopicPublisher and @@ -438,24 +438,24 @@ } = }]]> = - +
= - +
Receiving messages using a message-driven bean You can process messages using any EJB3 message driven bean. M= essage-driven beans may even be Seam components, in which case it is possibl= e to inject other event and application scoped Seam components. - +
= - +
Receiving messages in the client Seam Remoting lets you subscribe to a JMS topic from client-si= de JavaScript. This is described in . - +
= - +
Modified: tags/JBPAPP_4_3_CP07_FP_CR1a/doc/Seam_Reference_Guide/en-US/Secur= ity.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- tags/JBPAPP_4_3_CP07_FP_CR1a/doc/Seam_Reference_Guide/en-US/Security.xm= l 2009-11-24 00:33:31 UTC (rev 11654) +++ tags/JBPAPP_4_3_CP07_FP_CR1a/doc/Seam_Reference_Guide/en-US/Security.xm= l 2009-11-24 02:12:51 UTC (rev 11655) @@ -8,7 +8,7 @@ for securing both domain and page resources within your Seam project. = - +
Overview = @@ -30,7 +30,7 @@ = - +
Which mode is right for my application? = @@ -44,10 +44,10 @@ If on the other hand, your application requires security checks ba= sed on contextual state or complex business rules, then you will require the features provided by the advanced mode. - - +
+
= - +
Requirements = @@ -79,9 +79,9 @@ = = - +
= - +
Disabling Security = @@ -104,9 +104,9 @@ Page restrictions - +
= - +
Authentication = @@ -115,7 +115,7 @@ authentication requirements Seam offers a much more simplified metho= d of authentication that hides the complexity of JAAS. = - +
Configuration = @@ -151,9 +151,9 @@ to authenticate the user. = - +
= - +
Writing an authentication method = @@ -205,7 +205,7 @@ authentication method returns false to indicate= the authentication failed. = - +
Identity.addRole() = @@ -228,9 +228,9 @@ = - +
= - +
Special Considerations = @@ -257,11 +257,11 @@ userStats.setLastLoginDate(new Date()); userStats.incrementLoginCount(); }]]> - +
= - +
= - +
Writing a login form = @@ -291,9 +291,9 @@ action will clear the security state of the currently authenticate= d user. = - +
= - +
Simplified Configuration - Summary So to sum up, there are the three easy steps to configure authenti= cation: @@ -317,9 +317,9 @@ = - +
= - +
Handling Security Exceptions = @@ -375,9 +375,9 @@ Seam includes some special functionality for handling this problem. = - +
= - +
Login Redirection = @@ -420,9 +420,9 @@ the conversation in your authenticate() method. = - +
= - +
HTTP Authentication = @@ -450,7 +450,7 @@ authentication realm that is presented to the user when they authe= nticate. = - +
Writing a Digest Authenticator = @@ -478,11 +478,11 @@ } } ]]> - +
= - +
= - +
Advanced Authentication Features = @@ -490,7 +490,7 @@ security requirements. = - +
Using your container's JAAS configuration = @@ -508,13 +508,13 @@ container your Seam application is deployed in. It merely instr= ucts Seam Security to authenticate itself using the configured JAAS security policy. - +
= - +
= - +
= - +
Error Messages = @@ -597,9 +597,9 @@ - +
= - +
Authorization = @@ -610,7 +610,7 @@ above. = - +
Core concepts = @@ -628,9 +628,9 @@ for example customer:delete, or custom= er:insert. = - +
= - +
Securing components = @@ -638,7 +638,7 @@ @Restrict annotation. = - +
The @Restrict annotation = @@ -718,9 +718,9 @@ in Identity, which in this case can then dete= rmine if the user has the required permission for modifying the specified Account object. - +
= - +
Inline restrictions Sometimes it might be desirable to perform a security check in c= ode, without using the @@ -762,10 +762,10 @@ if (!Identity.instance().hasPermission("customer", "create", null)) throw new AuthorizationException("You may not create new customers");= ]]> = - - +
+
= - +
Security in the user interface = @@ -826,9 +826,9 @@ ]]> = - +
= - +
Securing pages Page security requires that the application is using a pa= ges.xml file, however is @@ -859,9 +859,9 @@ admin role. = - +
= - +
Securing Entities = @@ -990,7 +990,7 @@ your JPA provider. = - +
Entity security with JPA = @@ -1014,9 +1014,9 @@ = ]]> = - +
= - +
Entity security with a Managed Hibernate Session = @@ -1025,13 +1025,13 @@ need to do anything special to use entity security. = - +
= - +
= - +
= - +
Writing Security Rules = @@ -1040,7 +1040,7 @@ checks are processed, and how to implement permission checks for a S= eam application. = - +
Permissions Overview = @@ -1051,9 +1051,9 @@ algorithms for evaluating large numbers of complex rules involving= multiple conditions. = - +
= - +
Configuring a rules file = @@ -1083,9 +1083,9 @@ Once the RuleBase component is configured, it's= time to write the security rules. - +
= - +
Creating a security rules file For this step you need to create a file called security.d= rl in the @@ -1215,7 +1215,7 @@ intended for. = - +
Wildcard permission checks = @@ -1237,13 +1237,13 @@ This rule allows users with the admin role to= perform any action for any customer permission check. - +
= - +
= - +
= - +
SSL Security = @@ -1299,9 +1299,9 @@ sensitive data from pages using HTTPS to other pages using HTTP. = - +
= - +
CAPTCHA = @@ -1311,7 +1311,7 @@ prevent automated processes from interacting with your application. = - +
Configuring the CAPTCHA Servlet To get up and running, it is necessary to configure the Seam Resou= rce Servlet, which will provide the Captcha @@ -1328,9 +1328,9 @@ /seam/resource/* ]]> = - +
= - +
Adding a CAPTCHA to a form = @@ -1349,9 +1349,9 @@ validated against the CAPTCHA when the form is submitted. = - +
= - +
Customising the CAPTCHA algorithm = @@ -1378,11 +1378,11 @@ } }]]> = - +
= - +
= - +
Security Events = @@ -1534,9 +1534,9 @@ = - +
= - +
Run As = @@ -1573,9 +1573,9 @@ RunAsOperation. = - +
= - +
Extending the Identity component = @@ -1621,6 +1621,6 @@ } }]]> = - +
= Modified: tags/JBPAPP_4_3_CP07_FP_CR1a/doc/Seam_Reference_Guide/en-US/Tutor= ial.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- tags/JBPAPP_4_3_CP07_FP_CR1a/doc/Seam_Reference_Guide/en-US/Tutorial.xm= l 2009-11-24 00:33:31 UTC (rev 11654) +++ tags/JBPAPP_4_3_CP07_FP_CR1a/doc/Seam_Reference_Guide/en-US/Tutorial.xm= l 2009-11-24 02:12:51 UTC (rev 11655) @@ -163,12 +163,12 @@ - A Seam component must have a com= ponent name specified by the @Name annotation. This name must be unique within the= Seam application. When JSF asks Seam to resolve a currently undefined (nul= l) context variable whose name matches that of a Seam component, Seam will = instantiate that component, and bind the new instance to the context variab= le. In this case, Seam will instantiate a User the first= time JSF encounters a variable named user. + A Seam component must have a com= ponent name specified by the annotation. This name must be unique within the Seam application. When JS= F asks Seam to resolve a currently undefined (null) context variable whose = name matches that of a Seam component, Seam will instantiate that component= , and bind the new instance to the context variable. In this case, Seam wil= l instantiate a User the first time JSF encounters a var= iable named user. = - Whenever Seam instantiates a component, it= binds the new instance to a context variable in the component's default context. The default context is specified using the = @Scope annotation= . The User bean is a session scoped component. + Whenever Seam instantiates a component, it= binds the new instance to a context variable in the component's default context. The default context is specified using the = annotation. The User bean is a session scoped component. @@ -271,7 +271,7 @@ - The @In annotation marks an attribute of the bean as injected = by Seam. In this case, the attribute is injected from a context variable na= med user (the instance variable name). + The ann= otation marks an attribute of the bean as injected by Seam. In this case, t= he attribute is injected from a context variable named user (the instance variable name). @@ -1059,48 +1059,60 @@ JavaBeans (There was no reason to use session beans, since= they do not access the database, or have any other transactional behavior). Let's start with the proces= s definition: - - - -<process-definition name=3D"todo"> + todo.jpdl.xml Example + + = + + = + + + + = + + + + + + + = + = -<start-state name=3D"start"> -<transition to=3D"todo"/> -</start-state> - = -<task-node name=3D"todo"> -<task name=3D"todo" description=3D"#{todoList.description}"> -<assignment actor-id=3D"#{actor.id}"/> -</task> -<transition to=3D"done"/> -</task-node> - = -<end-state name=3D"done"/> - = -</process-definition> - = - The <start-state> node represents the logical start - of the process. When the process starts, i= t immediately transitions to the - todo node. - = - The <task-node> node represents a wait - state, where business proce= ss execution pauses, waiting for one or more - tasks to be performed. - = - The <task> ele= ment defines a task to be performed by - a user. Since there is only one task defin= ed on this node, when it is complete, - execution resumes, and we transition to th= e end state. The task gets its description - from a Seam component named todoL= ist (one of the JavaBeans). - = - Tasks need to be assigned to a user or = group of users when they are created. In this - case, the task is assigned to the current = user, which we get from a built-in Seam - component named actor. = Any Seam component may be used to perform task - assignment. - = - The <end-state> node defines the logical end of the - business process. When execution reaches t= his node, the process instance is destroyed. - - +]]> + + + + messages.jsp Explanatory Notes + + + + + The ]]> node represents the logical beginning of the process. When the process b= egins, it immediately transitions to the todo node. + + + + + The ]]>= node represents a wait state, where business process = execution pauses, waiting for one or more tasks to be performed. + + + + + The ]]> elem= ent defines a task to be performed by a user. Since there is only one task = defined on this node, when it is complete, execution resumes, and we transi= tion to the end state. The task receives its description from the = todoList JavaBean. + + + + + Tasks are assigned to a user or group of users= when they are created. Here, the task is assigned to the current user, ret= rieved from the built-in actor Seam component. (Any Seam= component may be used to perform task assignment.) + + + + + The ]]>= node defines the logical end of the business process. When execution reach= es this node, the process instance is destroyed. + + + + + + = = If we view this process definition using the process de= finition editor provided by JBossIDE, this is @@ -1180,41 +1192,53 @@ The second JavaBean is responsible for starting busines= s process instances, and ending tasks. = - - - -(a)Name("todoList") + TodoList.java Example + = + - = - The description property accepts user i= nput form the JSP page, and exposes it to the - process definition, allowing the task desc= ription to be set. - = - The Seam @CreateProcess annotation creates a new jBPM process - instance for the named process definition.= - = - The Seam @StartTask = annotation starts work on a task. The - @EndTask ends the t= ask, and allows the business process execution - to resume. - +}]]> + + + + + TodoList.java Explanatory Notes + + + + + The description property accepts user input fr= om the JSP page, and exposes it to the process definition, allowing the tas= k description to be set. + + + + + The Seam @CreateProcess ann= otation creates a new jBPM process instance for the named process definitio= n. + + + + + The Seam @StartTask annotat= ion starts work on a task. The @EndTask ends the task, a= nd allows the business process execution to resume. + + + + + + = = In a more realistic example, @StartTask and @EndTask would not @@ -1379,10 +1403,10 @@ configuration and not very interesting.
= -
+ =
= @@ -1412,70 +1436,89 @@ The example is implemented using one JavaBean, three JS= P pages and a jPDL pageflow definition. Let's begin with the pageflow: - - - -<pageflow-definition = + pageflow.jpdl.xml Example + = + = -<start-page name=3D"displayGuess" view-id=3D"/numberGuess.jspx"> - <redirect/> - <transition name=3D"guess" to=3D"evaluateGuess"> - <action expression=3D"#{numberGuess.guess}"/> - </transition> - <transition name=3D"giveup" to=3D"giveup"/> - </start-page> + + + + + + + + = - <decision name=3D"evaluateGuess" expression=3D"#{numberGuess.correc= tGuess}"> - <transition name=3D"true" to=3D"win"/> - <transition name=3D"false" to=3D"evaluateRemainingGuesses"/> - </decision> + + + + = - <decision name=3D"evaluateRemainingGuesses" expression=3D"#{numberG= uess.lastGuess}"> - <transition name=3D"true" to=3D"lose"/> - <transition name=3D"false" to=3D"displayGuess"/> - </decision> + + + + = - <page name=3D"giveup" view-id=3D"/giveup.jspx"> - <redirect/> - <transition name=3D"yes" to=3D"lose"/> - <transition name=3D"no" to=3D"displayGuess"/> - </page> + + + + + = - <page name=3D"win" view-id=3D"/win.jspx"> - <redirect/> - <end-conversation/> - </page> + + + + = - <page name=3D"lose" view-id=3D"/lose.jspx"> - <redirect/> - <end-conversation/> - </page> + + + + = -</pageflow-definition> - = - The <page> ele= ment defines a wait state where the - system displays a particular JSF view and = waits for user input. The - view-id is the same JSF= view id used in plain JSF navigation rules. - The redirect attribute = tells Seam to use post-then-redirect when - navigating to the page. (This results in f= riendly browser URLs.) - = - The <transition> element names a JSF outcome. The - transition is triggered when a JSF action = results in that outcome. Execution will then - proceed to the next node of the pageflow g= raph, after invocation of any jBPM transition - actions. - = - A transition <action> is just like a JSF action, - except that it occurs when a jBPM transiti= on occurs. The transition action can invoke - any Seam component. - = - A <decision> n= ode branches the pageflow, and - determines the next node to execute by eva= luating a JSF EL expression. - + + + + + = +]]> + +
+ + + pageflow.jpdl.xml Explanatory Notes.</= title> + <para> + <orderedlist> + <listitem> + <para> + The <literal><![CDATA[<page>]]></literal> elem= ent defines a wait state, during which the system displays a particular JSF= view and waits for user input. The <literal>view-id</literal> is the same = JSF view ID used in plain JSF navigation rules. The <literal>redirect</lite= ral> attribute tells Seam to use post-then-redirect when navigating to the = page. (This results in browser-friendly URLs.) + </para> + </listitem> + <listitem> + <para> + The <literal><![CDATA[<transition>]]></literal= > element names a JSF outcome. The transition itself is triggered when a JS= F action results in the named outcome. After any jBPM transition actions ar= e invoked, execution will proceed to the next node of the pageflow graph. + </para> + </listitem> + <listitem> + <para> + A transition <literal><![CDATA[<action>]]></li= teral> is just like a JSF action, except that it is triggered when a jBPM t= ransition occurs. The transition action can invoke any Seam component. + </para> + </listitem> + <listitem> + <para> + A <literal><![CDATA[<decision>]]></literal> no= de branches the pageflow, and determines the next node to be executed by ev= aluating a JSF EL expression. + </para> + </listitem> + </orderedlist> + </para> + </formalpara> + = = <para> Here is what the pageflow looks like in the JBoss Devel= oper Studio pageflow editor: </para> @@ -1608,124 +1651,115 @@ <para> As is <literal>lose.jspx</literal> (which I can't be bo= thered copy/pasting). Finally, the JavaBean Seam component: </para> <!-- Can't use code hightlighting with callouts --> - <example> - <title> - - - - - -(a)Name("numberGuess") + NumberGuess.java Example + = +randomNumber) - { - biggest =3D currentGuess - 1; - } - if (currentGuess<randomNumber) - { - smallest =3D currentGuess + 1; - } - guessCount ++; - } - = - public boolean isCorrectGuess() - { - return currentGuess=3D=3DrandomNumber; - } - = - public int getBiggest() - { - return biggest; - } - = - public int getSmallest() - { - return smallest; - } - = - public int getGuessCount() - { - return guessCount; - } - = - public boolean isLastGuess() - { - return guessCount=3D=3DmaxGuesses; - } + private int randomNumber; + private Integer currentGuess; + private int biggest; + private int smallest; + private int guessCount; + private int maxGuesses; + private boolean cheated; + = + @Create + public void begin() { + randomNumber =3D new Random().nextInt(100); + guessCount =3D 0; + biggest =3D 100; + smallest =3D 1; + } + = + public void setCurrentGuess(Integer guess) { + this.currentGuess =3D guess; + } + = + public Integer getCurrentGuess() { + return currentGuess; + } + = + public void guess() { + if (currentGuess>randomNumber) { + biggest =3D currentGuess - 1; + } + if (currentGuess - - - The first time a JSP page asks for a numberGuess component, Seam - will create a new one for it, and the @Create method will be invoked, - allowing the component to initialize itsel= f. - - - - + public void cheated() { + cheated =3D true; + } + = + public boolean isCheat() { + return cheated; + } + = + public List getPossibilities() { + List result =3D new ArrayList(); + for(int i=3Dsmallest; i<=3Dbiggest; i++) result.add(i); + return result; + } + = +}]]> + +
+ + + NumberGuess.java Explanatory Notes</ti= tle> + <para> + <orderedlist> + <listitem> + <para> + The first time a JSP page asks for a <literal>= numberGuess</literal> component, Seam creates a new component, and the <lit= eral>@Create</literal> method will be invoked, allowing the component to in= itialize itself. + </para> + </listitem> + </orderedlist> + <!-- </programlistingco> --> + <!-- </example> --> + </para> + </formalpara> = + = = = @@ -1758,10 +1792,10 @@ = </section> = - <section> +<!-- <section> <title>How it works TODO - + --> = = @@ -1937,208 +1971,216 @@ The search functionality is implemented using a session= -scope stateful session bean, similar to the one we saw in the message list example above. = - - - - -(a)Stateful + HotelSearchingAction.java Example + + = + hotels; + = + public void find() { + page =3D 0; + queryHotels(); + } + public void nextPage() { + page++; + queryHotels(); + } + = + private void queryHotels() { + hotels =3D em.createQuery( + "select h from Hotel h where lower(h.name) like #{pattern}" + = + "or lower(h.city) like #{pattern} " + = + "or lower(h.zip) like #{pattern} " + + "or lower(h.address) like #{pattern}") .setMaxResults(pageSize) .setFirstResult( page * pageSize ) .getResultList(); - } - = - public boolean isNextPageAvailable() - { - return hotels!=3Dnull && hotels.size()=3D=3DpageSize; - } - = - public int getPageSize() { - return pageSize; - } - = - public void setPageSize(int pageSize) { - this.pageSize =3D pageSize; - } - = - @Factory(value=3D"pattern", scope=3DScopeType.EVENT) - public String getSearchPattern() - { - return searchString=3D=3Dnull ? = - "%" : '%' + searchString.toLowerCase().replace('*', '%') + '%'; - } - = - public String getSearchString() - { - return searchString; - } - = - public void setSearchString(String searchString) - { - this.searchString =3D searchString; - } - = - @Remove - public void destroy() {} -} - = - The EJB standard @Stateful annotation identifies this class as a - stateful session bean. Stateful session be= ans are scoped to the conversation context by - default. - = - The @Restrict annota= tion applies a security restriction to the - component. It restricts access to the comp= onent allowing only logged-in users. The - security chapter explains more about secur= ity in Seam. - = - The - @DataModel - annotation exposes a List as a JSF - ListDataModel. This mak= es it easy to implement clickable lists for - search screens. In this case, the list of = hotels is exposed to the page as a - ListDataModel in th= e conversation variable named - hotels. - = - The EJB standard @Remove annotation specifies that a stateful - session bean should be removed and its sta= te destroyed after invocation of the annotated - method. In Seam, all stateful session bean= s must define a method with no parameters marked - @Remove. This metho= d will be - called when Seam destroys the session cont= ext. - + } + = + public boolean isNextPageAvailable() { + return hotels!=3Dnull && hotels.size()=3D=3DpageSize; + } + = + public int getPageSize() { + return pageSize; + } + = + public void setPageSize(int pageSize) { + this.pageSize =3D pageSize; + } + = + @Factory(value=3D"pattern", scope=3DScopeType.EVENT) + public String getSearchPattern() { + return searchString=3D=3Dnull ? = + "%" : '%' + searchString.toLowerCase().replace('*', '%') + '%'; + } + = + public String getSearchString() { + return searchString; + } + = + public void setSearchString(String searchString) { + this.searchString =3D searchString; + } + = + @Remove + public void destroy() {} +}]]> + +
+ + NumberGuess.java Explanatory Notes</ti= tle> + <para> = + <orderedlist> + <listitem> + <para> + The EJB standard <literal>@Stateful</literal> = annotation identifies this class as a stateful session bean. Stateful sessi= on beans are scoped to the conversation context by default. + </para> + </listitem> + <listitem> + <para> + The <literal>@Restrict</literal> annotation ap= plies a security restriction to the component. It restricts access to the c= omponent, allowing only logged-in users. The <!-- #retag: xref plz -->secur= ity chapter explains more about security in Seam. + </para> + </listitem> + <listitem> + <para> + The <xref linkend=3D"datamodel-annotation" /> = annotation exposes a <literal>List</literal> as a JSF <literal>ListDataMode= l</literal>. This makes it easy to implement clickable lists for search scr= eens. In this case, the list of hotels is exposed to the page as a <literal= >ListDataModel</literal> in the conversation variable named <literal>hotels= </literal>. + </para> + </listitem> + <listitem> + <para> + The EJB standard <literal>@Remove</literal> an= notation specifies that a stateful session bean should be removed and its s= tate destroyed after invocation of the annotated method. In Seam, all state= ful session beans must define a method <literal>@Remove</literal>, with no = marked parameters. This method will be called when Seam destroys the sessio= n context. + </para> + </listitem> + </orderedlist> + <!-- </programlistingco> --> + <!-- </example> --> + </para> + </formalpara> + = = <para> The main page of the application is a Facelets page. Le= t's look at the fragment which relates to searching for hotels: </para> - <example> - <title> - - -<div class=3D"section"> + main.xhtml Example + = + = -<span class=3D"errors"> - <h:messages globalOnly=3D"true"/> -</span> + + + = -<h1>Search Hotels</h1> +

Search Hotels

= -<h:form id=3D"searchCriteria"> -<fieldset> = - <h:inputText id=3D"searchString" value=3D"#{hotelSearch.searchString}" = - style=3D"width: 165px;"> - <a:support event=3D"onkeyup" actionListener=3D"#{hotelSearch.find}" = - reRender=3D"searchResults" /> - </h:inputText> -   - <a:commandButton id=3D"findHotels" value=3D"Find Hotels" action= =3D"#{hotelSearch.find}" = - reRender=3D"searchResults"/> -   - <a:status> - <f:facet name=3D"start"> - <h:graphicImage value=3D"/img/spinner.gif"/> - </f:facet> - </a:status> - <br/> - <h:outputLabel for=3D"pageSize">Maximum results:</h:outputLabe= l>  - <h:selectOneMenu value=3D"#{hotelSearch.pageSize}" id=3D"pageSize"= > - <f:selectItem itemLabel=3D"5" itemValue=3D"5"/> - <f:selectItem itemLabel=3D"10" itemValue=3D"10"/> - <f:selectItem itemLabel=3D"20" itemValue=3D"20"/> - </h:selectOneMenu> - </fieldset> - </h:form> + +
= + + + +   + +   + + + + + +
+ Maximum results:= 0; + + + + + +
+
= - </div> + = - <a:outputPanel id=3D"searchResults"> - <div class=3D"section"> - <h:outputText value=3D"No Hotels Found" - rendered=3D"#{hotels !=3D null and hotels.rowCount=3D=3D0}"/> - <h:dataTable id=3D"hotels" value=3D"#{hotels}" var=3D"hot" = - rendered=3D"#{hotels.rowCount>0}"> - <h:column> - <f:facet name=3D"header">Name</f:facet> - #{hot.name} - </h:column> - <h:column> - <f:facet name=3D"header">Address</f:facet> - #{hot.address} - </h:column> - <h:column> - <f:facet name=3D"header">City, State</f:facet> - #{hot.city}, #{hot.state}, #{hot.country} - </h:column> - <h:column> - <f:facet name=3D"header">Zip</f:facet> - #{hot.zip} - </h:column> - <h:column> - <f:facet name=3D"header">Action</f:facet> - <s:link id=3D"viewHotel" value=3D"View Hotel" = - action=3D"#{hotelBooking.selectHotel(hot)}"/> - </h:column> - </h:dataTable> - <s:link value=3D"More results" action=3D"#{hotelSearch.nextPage}" = - rendered=3D"#{hotelSearch.nextPageAvailable}"/> - </div> -</a:outputPanel> + +
+ + 0}"> + + Name + #{hot.name} + + + Address + #{hot.address} + + + City, State + #{hot.city}, #{hot.state}, #{hot.country} + = + + Zip + #{hot.zip} + + + Action + + + + +
+
]]>
- = - The RichFaces Ajax <a:suppo= rt> tag allows a JSF action - event listener to be called by asynchronou= s XMLHttpRequest when a - JavaScript event like onkeyup occurs. Even better, the - reRender attribute = lets us render a fragment of the JSF page and - perform a partial page update when the asy= nchronous response is received. - = - The RichFaces Ajax <a:statu= s> tag lets us display a cheesy - annimated image while we wait for asynchro= nous requests to return. - = - The RichFaces Ajax <a:outpu= tPanel> tag defines a region of - the page which can be re-rendered by an as= ynchronous request. - = - The Seam <s:link> tag lets us attach a JSF action - listener to an ordinary (non-JavaScript) H= TML link. The advantage of this over the - standard JSF <h:commandLink>= ; is that it preserves the - operation of "open in new window" and "ope= n in new tab". Also notice that we use a - method binding with a parameter: = #{hotelBooking.selectHotel(hot)}. - This is not possible in the standard Unifi= ed EL, but Seam provides an extension to the - EL that lets you use parameters on any met= hod binding expression. - If you're wondering how navigation occu= rs, - you can find all the rules in WEB= -INF/pages.xml; - this is discussed in the navigation sectio= n of this book. - = - +
+
+ main.xhtml Explanatory Notes + + + + + The RichFaces Ajax ]]> tag allows a JSF action event listener to be called by asyn= chronous XMLHttpRequest when a JavaScript event such as = onkeyup occurs. Even better, the reRender attribute lets us render a fragment of the JSF page and perform a part= ial page update when the asynchronous response is received. + + + + + The RichFaces Ajax ]]> tag lets us display an animated image while we wait for asyn= chronous requests to return. + + + + + The RichFaces Ajax ]]> tag defines a region of the page which can be re-render= ed by an asynchronous request. + + + + + The Seam ]]> tag lets us attach a JSF action listener to an ordinary (non-JavaScript)= HTML link. The advantage of this over the standard JSF ]]> is that it preserves the "open in new window" a= nd "open in new tab" operations. Also note that we use a method binding wit= h a parameter: #{hotelBooking.selectHotel(hot)}. This is= not possible in standard Unified EL, but Seam provides an extension to an = EL that allows parameters on any method binding expression. + + + Navigation rules can be found in WEB-= INF/pages.xml. These are discussed further in . + + + + + + = + = = This page displays the search results dynamically as we= type, and lets us choose a hotel and pass it @@ -2150,126 +2192,125 @@ achieve a natural cache of persistent data related to the = conversation. The following code example is pretty long. But if you think of it as a list of scripted = actions that implement the various steps of the conversation, it's understandable. Read the class from= top to bottom, as if it were a story. - - - - -(a)Stateful + HotelBookingAction.java Example + = + - = - This bean uses an EJB3 extend= ed persistence context, so that any - entity instances remain managed for the wh= ole lifecycle of the stateful session bean. - - = - The - @Out - annotation declares that an attribute val= ue is outjected to - a context variable after method invocation= s. In this case, the context variable named - hotel will be set t= o the value of the hotel - instance variable after every action liste= ner invocation completes. - = - The - @Begin - annotation specifies that the annotated me= thod begins a long-running - conversation, so the curren= t conversation context will not be destroyed - at the end of the request. Instead, it wil= l be reassociated with every request from the - current window, and destroyed either by ti= meout due to conversation inactivity or - invocation of a matching @End method. - = - The - @End - annotation specifies that the annotated m= ethod ends the current long-running - conversation, so the current conversation = context will be destroyed at the end of the - request. - = - This EJB remove method will be called w= hen Seam destroys the conversation context. - Don't forget to define this method! - + +
+ HotelBookingAction.java Explanatory No= tes + + + + + This bean uses an EJB3 extended pers= istence context, so that entity instances remain managed for the= whole lifecycle of the stateful session bean. + + + + + The annota= tion declares that an attribute value is "outjected" to a context variable = after method invocations. In this case, the context variable named hotel will be set to the value of the hotel i= nstance variable after every action listener invocation. + + + + + The @Begin annotation speci= fies that the annotated method begins a long-running conversation= , so the current conversation context will not be destroyed at t= he end of the request. Instead, it will be reassociated with every request = from the current window, and destroyed either by timeout due to conversatio= n inactivity or invocation of a matching @End method. + + + + + The annota= tion specifies that the annotated method ends the current long-running conv= ersation, so the current conversation context will be destroyed at the end = of the request. + + + + + This EJB remove method must be defined, and wi= ll be called when Seam destroys the conversation context. + + + + + + = + = = @@ -2377,8 +2418,8 @@ = - TODO - Look in the dvdstore directory. + =
@@ -2387,8 +2428,8 @@ The Hibernate Booking demo is a straight port of the Bookin= g demo to an alternative architecture that uses Hibernate for persistence and JavaBeans instead of sessio= n beans. = - TODO - Look in the hibernate directory. +
=
Modified: tags/JBPAPP_4_3_CP07_FP_CR1a/doc/Seam_Reference_Guide/en-US/Webse= rvices.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- tags/JBPAPP_4_3_CP07_FP_CR1a/doc/Seam_Reference_Guide/en-US/Webservices= .xml 2009-11-24 00:33:31 UTC (rev 11654) +++ tags/JBPAPP_4_3_CP07_FP_CR1a/doc/Seam_Reference_Guide/en-US/Webservices= .xml 2009-11-24 02:12:51 UTC (rev 11655) @@ -7,7 +7,7 @@ services to run within a Seam environment. = - +
Configuration and Packaging To allow Seam to intercept web service requests so that the necessar= y Seam contexts can be created for the request, = @@ -40,9 +40,9 @@ ]]> = - +
= - +
Conversational Web Services So how are conversations propagated between web service requests? S= eam uses a SOAP header element present @@ -89,7 +89,7 @@ As you can see, the response message contains the same conv= ersationId element as the request. = - +
A Recommended Strategy = @@ -112,11 +112,11 @@ features to be used in the web service class itself. = = - +
= - +
= - +
An example web service = @@ -196,7 +196,7 @@ and delegating the real work to a conversational Seam component. = - +
= = Modified: tags/JBPAPP_4_3_CP07_FP_CR1a/doc/Seam_Reference_Guide/en-US/Xml.x= ml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- tags/JBPAPP_4_3_CP07_FP_CR1a/doc/Seam_Reference_Guide/en-US/Xml.xml 200= 9-11-24 00:33:31 UTC (rev 11654) +++ tags/JBPAPP_4_3_CP07_FP_CR1a/doc/Seam_Reference_Guide/en-US/Xml.xml 200= 9-11-24 02:12:51 UTC (rev 11655) @@ -11,7 +11,7 @@ properties file or in web.xml, and configur= ation via components.xml. = = - +
Configuring components via property settings = Seam components may be provided with configuration propert= ies either via servlet context parameters, @@ -32,9 +32,9 @@ component named org.jboss.seam.core.manager with a setter method named setConversationTimeout().) = - +
= - +
Configuring components via <literal>components.xml</lit= eral> = = @@ -241,9 +241,9 @@ (at development time). You'll see this approach used in th= e Seam examples. = = - +
= - +
Fine-grained configuration files = If you have a large number of components that need to be c= onfigured in XML, it makes much more sense @@ -282,9 +282,9 @@ Alternatively, you may put configuration for all classes i= n the com.helloworld package in com/helloworld/components.xml. = - +
= - +
Configurable property types = Properties of string, primitive or primitive wrapper type = may be configured just as you would expect: = @@ -347,9 +347,9 @@ #{policyPricingRules} ]]> = - +
= - +
Using XML Namespaces = Throughout the examples, there have been two competing way= s of declaring components: with and without @@ -536,7 +536,7 @@ = = - +
= = --===============9149063669466208477==--