tailieunhanh - Quản lý cấu hình web - part 37

Tham khảo tài liệu 'quản lý cấu hình web - part 37', công nghệ thông tin, đồ họa - thiết kế - flash phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Integrating WCM Using Web Scripts Calling web scripts from a JSP page Now we will create a simple JSP page from which we will make a call to our web script to render the news page. This JSP can be a part of any of your web applications. To call a web script from the JSP this will be an HTTP call. Just add the following scriptlet in the JSP file wherever you want to include the HTML output of this web script String resultstring HttpClient client new HttpClient .setCredentials new AuthScope localhost 8080 Alfresco new UsernamePasswordCredentials admin admin GetMethod get new GetMethod http localhost 8080 alfresco service org cignex news storeId wwwcignex newsId newsAlfrescoBookRelease. xml true try int status get resultstring resultString finally Because we are using an HTTP client we also need to import the used classes here in this scriptlet before using it. To import those we can use the page directive of JSP as follows @ page import @ page import . UsernamePasswordCredentials @ page import @ page import This will import all of the required classes. 342 Download from Wow eBook Chapter 10 The source files for the whole JSP page can be downloaded from the Packt website. The following screenshot is the output of that JSP page. This JSP page is part of a sample web application which is outside of Alfresco and deployed on a separate Tomcat web server 0 Browse Sandbox C X - I http localhost 28080 sample cornmon pages TestNews. jsp Jsp pase from a neb application outside of Alfresco T7 Sample Alfresco Web Script call f. iLa Picture CIGNEX CEO Patil Anthony releasing the book in CIGNEX India Office July 16 2009 - Packt and CIGNEX are pleased to announce a .

TỪ KHÓA LIÊN QUAN