Question

The scenario, I have a client website that needs to post data to the server website. During the post, the server open a login page to authenticate the client and after successful authentication store the data in the database.

I'm using javaee6, jsf, ejb.

Questions: 1.) I'm posting on a servlet but can't get a hold of the conversation scope bean, so that I can show the posted data on the login screen at the same time store in the conversation scope bean. After successful login get the data from the bean and store in the database.

2.) Can I post directly to a page, with a conversation scope backing bean?

3.) A friend of mine mentioned jaas, but doesn't have time to explain well. Can I use this tech?

Thanks,
czetsuya

Was it helpful?

Solution

The solution I come up with this, is to read the posted parameters in the managed bean's post construct method:

@PostConstruct
public void init() {
    if (FacesContext.getCurrentInstance() != null) {
        ExternalContext context = FacesContext.getCurrentInstance().getExternalContext();
        Map<String, String> requestParameters = context.getRequestParameterMap();
        if (requestParameters != null) {
            beginConversation();
        }
    }
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top