I have two systems that I'm trying to integrate. One built on raw servlets, the new built on JSF with IceFaces. I am trying to lighten the cross system sign. The idea is that I have a button in the old system that sends the relevant information to the new site and registers them.
Well, ideally, I would like to use only the regular old servlet to facilitate this on the new site. Go to the new Servlet website, do what it needs and go to the toolbar.
Our security is handled through a managed bean. However, by the time you get to the servlet, there is no context for the faces. So how do I create a new faces interface?
I have a backup plan in which I can always link to the .iface dummy page, which will create a FacesContext for me, and then create a backup bean that will do something when it gets instanciated, and then go to the main page. But this is very similar to a hack.
Any help would be appreciated!
EDIT: I went back. Basically, I am sending a message to this page:
<f:view>
<ice:outputText value="#{EntryPoint}"/>
</f:view
Bean support looks like this ...
public EntryPoint() {
try {
HttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
HttpServletResponse response = (HttpServletResponse) FacesContext.getCurrentInstance().getExternalContext().getResponse();
String loginID = request.getParameter("loginID");
response.sendRedirect(
);
} catch (IOException ex) {
logger.error(null, ex);
} catch (SQLException ex) {
logger.error(null, ex);
}
}
It still looks like a hack, but I'm not sure how to get around this. Ideally, I would POST to the servlet, get the loginID, create a user and put it directly in a managed bean. But in this case, FacesContext does not exist.
Any other ideas?