Friday, June 17, 2016

Using ZXing in the SAP HANA Cloud Platform to generate QRcodes

Using ZXing in the SAPHCP to generate QRcodes
By Robert Russell

Download my EAR file from this link

My SCN blog with background information about the EAR file.


Unzip the downloaded ear file

unzip QRplutusEA.ear     

Archive:  QRplutusEA.ear
 inflating: META-INF/MANIFEST.MF    
 inflating: META-INF/SAP_MANIFEST.MF  
 inflating: META-INF/sda-dd.xml     
warning:  stripped absolute path spec from /
mapname:  conversion of  failed
 inflating: META-INF/application-j2ee-engine.xml  
 inflating: META-INF/application.xml  
 inflating: QRplutus.war            

The QRplutus.war file will be in the same directory.

Start Eclipse and import the QRplutus.war file

I changed the Web project name & chose Java Web Tomcat 7 runtime

Left core.jar unselected as it is only required in the WEB-INF/lib directory in my use case

Updated the QRcode.jsp file to reflect the new web project name.

Before
After
Updated the QRcodeHCP as my chosen project name

Update the web.xml file to map the servlet

Before

Add the following lines after the last </servlet> tag

<servlet-mapping>
<servlet-name>QRimg</servlet-name>
<url-pattern>/servlet/QRimg</url-pattern>
</servlet-mapping>

Should look like the following


Deploy to a local server



Finish,
In the web browser enter the following (changing the project name if required)



Deploy to HCP




Finish





No comments:

Post a Comment

Google +