Пример JSP



Пример JSP

Obtain the List of Applications ClearTextCredentials credentials = new ClearTextCredentials(); credentials.initialize("user", "domain", "password"); CitrixWireGateway gateway = new CitrixWireGateway(); gateway.initialize(credentials); AppDataList appList = gateway.getAppDataList(); Locate the Published Application Using File Type Association App contentApp = appList.findAppByExtension("http://mywebsite/spec.doc"); Launch the Application with the Content // Create a TemplateParser object (to generate the ICA file) TemplateParser parser = new TemplateParser(); // Set up the launching credentials String CookStr = "NFuse_User=user&NFuse_Domain=domain&NFuse_LogonMode=Explicit&NFuse_Password=password"; // Set these as cookie session fields parser.setCookieSessionFields(CookStr); // Set the published application to use for launching the content urlSessionFields = "NFuse_Application=" + contentApp.getNameUrlEncoded + "&NFuse_AppFriendlyNameURLEncoded=" + contentApp.getFriendlyNameUrlEncoded; // Set these as URL session fields parser.setUrlSessionFields(UrlSessionFields); // Set the address of the content to use as a command line argument parser.setSingleSessionField("NFuse_AppCommandLine", "http://mywebsite/spec.doc"); // Specify the template ICA file to use parser.setSingleSessionField("NFuse_Template", "template.ica"); // Generate the content of the ICA file and return as MIME type "x-ica" // This will cause the browser to launch the ICA file and hence the // published application. if (parser.Parse()) { String contentType = parser.getContentType(); response.setContentType(contentType); boolean continue = True; while (continue) { String HtmlString = parser.getNextDataBlock(); If (HtmlString.length() == 0) { continue = False; } else { out.println(HtmlString); } } } else { // Parser failed. Attempt to display the published content using // local (client side) application. response.sendRedirect(docURL); }

Содержание раздела