Just after having posted the previous article I got some mail asking me for small detail about the way of connecting and in addition about JSF from SAS programmer.
In that sample, I just connected a Java Method "string btConnect_action() {...}" into my jsp BackBean, meaning that if I create a JSP named login.jsp, JSCreator will create for me a backbean named login.java wich extends AbstractPageBean. The method will be "linked" for me by Creator customizing JSF tag like :
___________
<h:commandButton action="#{login.btConnect_action}" binding="#{login.btConnect}" id="btConnect"
style="left: 432px; top: 240px; position: absolute" value="Connect"/>
Into that method, I connect to my SAS Metadata Server (I don't chek user ... because I'm just prototyping, but I'll take time to go back on that topic):
___________
Try {
uib.setIOMI( workspace.makeOMRConnection(serverName,serverPort,serverUser,serverPass));
...
}
If I get anykind of Exception, I catch it and send for a message visualisation page, or the next page returning the appropriate value :
___________
....
catch (MdException e)
{
String msg = e.getSASMessageSeverity() + " / " + e.getSASMessage()
+ " / " + e.getLocalizedMessage();
getErrorManagementBean().setMessage(msg);
return "notlogged";
} catch (Exception e)
{
String msg = e.getLocalizedMessage();
this.getErrorManagementBean().setMessage(msg);
return "notlogged";
}
return "logged";
The message is loaded into a bean for my convinience. Then, this makes the navigation flow works...

If the "page" returns a "logged", the JSF process it and transfer the user to "CubeSelector.jsp". If the message is "notlogges", the engine tranfers us to messageViewer.jsp that displays the messageBean contents.
This is very comfortable for the navigation flow management, gives more flexibility for java dev avoiding some very long stream of If () else if ()... So I let you discover. I'll post other story about those experiment ;)