Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Aphorismen
Applications
Business Economics & Admin.
My Computers
Cooking
Devices
Folders
Food
Hardware
Infos
Software Development
Sports
Operation Instructions
Todos
Test
Help
Glossary
Community portal
adaptions
Sidebar anpassen
Wiki RB4
Search
Search
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Seam
(section)
Page
Discussion
English
Read
Edit
View history
Toolbox
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Special pages
Page information
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=Architecture and Dynamics= ==Components== A Seam component needs a component name specified by the [[#org.jboss.seam.annotations.Name|@Name]] annotation. This name must be unique within the Seam application. When JSF asks Seam to resolve a context variable with a name that is the same as a Seam component name, and the context variable is currently undefined (null), Seam will instantiate that component, and bind the new instance to the context variable. 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 [[#org.jboss.seam.annotations.Scope|@Scope]] annotation. ==Contexts== A context defines a namespace, a set of context variables. Usually we obtain components from a context via injection, and put component instances into a context via outjection. Each Seam component type has a default scope if not explicitly specified. The scope is specified by the [[#org.jboss.seam.annotations.Scope|@Scope]] annotation. Types are: {| class="gallery" |Type |Description |Default for |- |APPLICATION |Analogous the servlet application scope. | |- |BUSINESS_PROCESS |Spans multiple conversations for multiple users as controlled declaratively by start and end states in the business process definition file. | |- |CONVERSATION |The conversation scope maintains data for a single user across a well-defined series of pages |entities, SFSB |- |EVENT |Analogous the servlet request scope. Exists form the beginning of the Restore View phase until the end of the render response phase in the JSF life cycle. |JavaBeans |- |METHOD | | |- |PAGE |Begins at the start of the JSF Render Response phase and carries on with each adjoining JSF postback until a redirect or a navigation to another page occurs. | |- |SESSION |Analogous to the servlet session scope. | |- |STATELESS |forces a component to be instatiated each time the component name is resolved. |SLSB, message driven beans |- |UNSPECIFIED | | |} ===Conversation=== There is always a conversation context often a temporary conversation context active during the apply request values, process validations, update model values, invoke application and render response phases of the JSF request lifecycle. Seam transparently propagates the conversation context (including the temporary conversation context) across JSF postbacks and redirects. If you don't do anything special, a non-faces request (a GET request for example) will not propagate the conversation context and will be processed in a new temporary conversation. ==Bijection== Dependency injection allows a component to obtain a reference to another component by having the container "inject" the other component to a setter method or instance variable. In all dependency injection implementations that we have seen, injection occurs when the component is constructed, and the reference does not subsequently change for the lifetime of the component instance. Bijection is used to assemble stateful components from various different contexts (a component from a "wider" context may even have a reference to a component from a "narrower" context). Values are injected from context variables into attributes of the component being invoked, and also outjected from the component attributes back out to the context, allowing the component being invoked to manipulate the values of contextual variables simply by setting its own instance variables. Since the value of contextual variables changes over time, and since Seam components are stateful, bijection takes place every time a component is invoked. Injected values are disinjected (i.e, set to null) immediately after method completion and outjection ==Startup== Seam does this by registering a servlet filter, a servlet and a JSF phase listener. #When the web application starts the servlet container bootstraps Seam, at which time it loads the contextual container, scans the classpath for components and serves component instances. All components annotated both with @Startup and @Scope(ScopeType.APPLICATION) are instantiated. ==Sessions== The SeamListener also captures notifications when new HTTP sessions are started, at which time it instantiates startup components that reside in the session scope (i.e., annotated with both @Startup and @Scope(ScopeType.SESSION)). ==Requests== * requests e.g. to /faces/* are routed to the Faces Servlet (s. web.xml) * the extension is replaced with javax.faces.DEFAULT_SUFFIX * the Faces Servlet hands the view ID to the registered Facelet view handler * the view handler builds the UI component tree
Summary:
Please note that all contributions to Wiki RB4 may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Uwe Heuer Wiki New:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Toggle limited content width