Hi Dell,
Please refer to my custom jsp as follows:
<%@ page
import="com.crystaldecisions.sdk.occa.infostore.*,
com.crystaldecisions.sdk.framework.*,
com.crystaldecisions.sdk.exception.*"%>
<%@ page import="java.lang.Exception"%>
//=======================================================================
// Enterprise Logon credentials - customize for your environment.
//=======================================================================
username = <username>;
String cmsname = "xxx.xxx.xxx.xxx";
String sharedSecret = "xxxxxx";
//=======================================================================
// Java OpenDocument URL
//=======================================================================
String port = "8080";
String OpenDocURL = "http://" + cmsname + ":" + port
+ "/BOE/OpenDocument/opendoc/openDocument.jsp";
//=======================================================================
// Logon to Enterprise, create Token, and redirect to OpenDocument
//=======================================================================
try {
ITrustedPrincipal trusted = CrystalEnterprise
.getSessionMgr()
.createTrustedPrincipal(username, cmsname, sharedSecret);
IEnterpriseSession ceSession = CrystalEnterprise
.getSessionMgr().logon(trusted);
String logonToken = ceSession.getLogonTokenMgr()
.createLogonToken("", 10, 5);
ceSession.logoff();
response.sendRedirect(OpenDocURL + "?token=" + logonToken + "&"
+ request.getQueryString());
} catch (Exception e) {
System.out.println("Caught inner: " + e);
response.sendRedirect("loginerror.html");
return;
}
Best regards,
Sciano