OK, I was wondering whether something like a servlet filter could do the job, access the
Actor in the session context used by Seam, thus avoiding the need for the reference in the
JSF page.
I've tried petemuir's approach, but I must be missing something basic. I have a
stateless session bean:
| @Stateful
| @Scope(SESSION)
| @SecurityDomain("ctSecDom")
| @Name("todoList")
| public class TaskSession implements TaskSessionLocal, TaskSessionRemote {
|
| private static final Logger LOGGER = Logger.getLogger( TaskSession.class);
|
| @Out(scope=SESSION)
| private String currentUser;
|
| @Factory("currentUser")public void loginToSeam() {
| LOGGER.fatal( "loginToSeam() called" );
| String username = "testuser";
| currentUser = username;
| Actor.instance().setId(username);
| }
|
| ...
|
in my XHTML page, I have:
| <f:view>
| <h:form id="plist">
| <h:outputText value="Actor: #{todoList.currentUser}"
/>
| <div style="border-style: solid; border-width: 1px;
border-color: #0000ff; padding: 8px">
| <h1>Pooled To-Do Items</h1>
| ...
|
but when I enter the URL in the browser, I get the exception:
22:07:47,872 ERROR [STDERR] Oct 9, 2006 10:07:47 PM
com.sun.facelets.compiler.TagLibraryConfig loadImplicit
INFO: Added Library from:
jar:file:/home/bsheward/platform/trunk/jboss/server/default/deploy/ctp.ear/ctpwebapp.war/WEB-INF/lib/jsf-facelets-1.jar!/META-INF/jstl-core.taglib.xml
22:07:48,173 ERROR [RendererUtils] Property not found - called by component :
{Component-Path : [Class: javax.faces.component.UIViewRoot,ViewId:
/utils/taskAdmin.xhtml][Class: javax.faces.component.html.HtmlForm,Id: plist][Class:
javax.faces.component.html.HtmlOutputText,Id: _id1]}
22:07:48,174 ERROR [STDERR] Oct 9, 2006 10:07:48 PM com.sun.facelets.FaceletViewHandler
handleRenderException
SEVERE: Error Rendering View[/utils/taskAdmin.xhtml]
javax.faces.el.PropertyNotFoundException: /utils/taskAdmin.xhtml @14,58 value="Actor:
#{todoList.currentUser}": Bean: $Proxy152, property: currentUser
at com.sun.facelets.el.LegacyValueBinding.getValue(LegacyValueBinding.java:58)
at javax.faces.component.UIOutput.getValue(UIOutput.java:75)
at
org.apache.myfaces.renderkit.RendererUtils.getStringValue(RendererUtils.java:225)
at
org.apache.myfaces.renderkit.html.HtmlTextRendererBase.renderOutput(HtmlTextRendererBase.java:65)
at
org.apache.myfaces.renderkit.html.HtmlTextRendererBase.encodeEnd(HtmlTextRendererBase.java:53)
...
Shouldn't the valid of currentUser be outjected when the JSF needs to render it? What
is the exception message actually telling me?
Any assistance would be gratefully appreciated!
Barry
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3977108#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...