0

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

czetsuya
  • 4,773
  • 13
  • 53
  • 99

1 Answers1

-1

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();
        }
    }
}
czetsuya
  • 4,773
  • 13
  • 53
  • 99
  • That is not the solution to "How to access conversation scope from a servlet".......this is a solution to your own personal problem. you should not have considered it as an answer, as you are not accessing conversation scoped beans from a servlet. – Ikthiander Sep 15 '15 at 09:05
  • This was an old solution: http://stackoverflow.com/questions/4828504/how-to-inject-conversationscoped-beans-in-a-servlet – Ikthiander Sep 15 '15 at 09:07