문제

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

도움이 되었습니까?

해결책

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();
        }
    }
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top