java - xhtml not showing session scoped values -
i have managedbean session scoped injects 2 session scoped beans, both have proper getter , setters.
my class follows:
@managedbean(name="oneclass") @sessionscoped public class oneclasscontroller implements serializable { @managedproperty(value="#{myotherbean}") public anotherclass another; @managedproperty(value="#{requestbean}") public requestclass request; public string foo() { = getanotherservice(request); return "page?faces-redirect=true"; } //getters , setters anotherclass , requestclass }
now, request class holds values web service request. values filled within form in xhtml page.
when user finishes filling request , fires action button, enters foo
method. debug shows request correct data, , when call it, another
gets filled correctly.
now, page.xhtml
looks this:
<h:outputtext value="#{requestbean.agentid}" /> <h:outputtext value="#{myotherbean.name}" /> <h:outputtext value="#{myotherbean.lastname}" />
when page
rendered, values requestbean
showed correctly, anotherbean
values show empty. refreshing page won't help.
if trigger button in page.xhtml
print out in action method values anotherbean
:
log.info("another name: " + another.getname());
they print out fine.
i have in web.xml
saving method set server.
by way, not real naming convention using, right i'm in computer without ides nor jdk whatsoever, i'm trying replicate code best can.
how can show correct values in page
?
try using,
<h:outputtext value="#{oneclass.another.name}" /> <h:outputtext value="#{oneclass.another.lastname}" />
to view variables in sessionscope can a:
<h:outputtext value="#{sessionscope}" />
this confirm if "myotherbean" in session scope or not.
Comments
Post a Comment