0

I getting no value from my session bean back. I also have added a setter Method, but same result

Here's my code

managedBean

@Named
@SessionScoped
public class ManagedBean implements Serializable {

private static final long serialVersionUID = 1L;

@EJB
private GetNamesLocal names;

private String namen;

public String getNamen() {

    return namen = names.zeigeNamen();
}

}

my index.xhtml

<div class="container">
    <div class="row centerAll">
        <div class="col-md-12">
            <h1>Willkommen <h:outputText value="#{managedBean.namen}" /></h1>
        </div>

    </div>

</div>

And at last my stateless session bean:

@Stateless
@LocalBean
public class GetNames implements GetNamesLocal {

public GetNames() {

}

@Override
public String zeigeNamen() {

    return "Ben";
}

}
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
legalizeSINCE88
  • 97
  • 1
  • 11
  • To exclude one and other, what do you see when you print just `#{managedBean}`? – BalusC Jul 24 '19 at 09:52
  • If the value is null, I think I know what to do! It's probably the `@SessionScoped` because you included the wrong `@SessionScoped` . For help see this question: [link](https://stackoverflow.com/questions/9470440/sessionscoped-bean-looses-scope-and-gets-recreated-all-the-time-fields-become) @legalizesince88 – fuggerjaki61 Jul 24 '19 at 12:20
  • @fuggerjaki61: the OP isn't submitting any form so this doesn't apply. – BalusC Jul 25 '19 at 09:58

0 Answers0