Skip to main content

Posts

How to use Global Transactions and Data Sources with Spring Framework 2.0.8 in SAP Netweaver Aplication Server 7.0, Part 1

For this part, we will create, build and deploy a J2EE Application on SAP AS 7.0 with J2SE 1.4, and the version of Spring Framework is 2.0.8 because it is the last one that can be supported by J2SE 1.4. For the Spring XML configuration we will use the XML configuration syntax based on XML Schema, also we could use syntax based on XML DTD for backward compatibility. Because of we are using J2SE 1.4, we will need a parser that supports XML Schema like Xerces. We need to remind that when you create an application with transaction support, we could use 2 type of transaction: Local Transaction are resource-specific (by example when only we work with one resource that needs transaction support like jdbc connection). Global Transaction are managed by the application server using JTA, it provide the ability to work with multiple transactional resources (by example when we work atleast two resources that need transaction support like jdbc connection, and jca connection). Now, we must fo...

Convert HTML Content to PDF format using Java

I have researched about to convert HTML to PDF. I got 2 approaches. 1. Using Tidy and XSL-FO. 2. Using the project xhtmlrenderer Basically the 1st approach is : 1. Your HTML will need to be validate in according to XHTML, for this you could use Tidy . 2. After you will need to transform this new XHTML document in XLS-FO, you can review this link to find the stylesheet resource ( XHMTL to XLS-FO ). 3. Finally, convert your XLS-FO document in a PDF document. There are 2 links that could help with this approach: http://www.onjava.com/lpt/a/3924 http://www.javaworld.com/javaworld/jw-04-2006/jw-0410-html.html The 2nd approach is using the project xhtmlrenderer (https://xhtmlrenderer.dev.java.net/) This is easier than 1st approach. This tool hides the steps mentioned in the 1st approach and use CSS. This project uses a CSS parser (http://sourceforge.net/projects/cssparser/). the unique problem the I found out was when you want to use external CSS file in your HTML file. In the example use...

How to use Static resource in shale for remoting access enhanced with AJAX

Yesterday I have found out how to use static resource in Shale framework. I wanted to enhance the Use Case example of Shale using Prototype for AJAX support. Then I found out my problem with static resources in Shale framework was resolved with the next steps 1. In the web file descriptor (web.xml) <context-param> <param-name> org.apache.shale.remoting.CLASS_RESOURCES </param-name> <param-value> /static/*:org.apache.shale.remoting.impl.ClassResourceProcessor </param-value> </context-param> <context-param> <param-name> org.apache.shale.remoting.DYNAMIC_RESOURCES </param-name> <param-value> /dynamic/*:org.apache.shale.remoting.impl.MethodBindingProcessor </param-value> </context-param> <context-param> <param-name> org.apache.shale.remoting.WEBAPP_RESOURCES </param-name> <param-value> /webapp/*:org.apache.shale.remoting.impl.WebResourceProcessor </param-value> </context-param> 2. I...