skip to main content

Development : Developing an hello world application from scratch : Building the HTML interface and the web application

Building the HTML interface and the web application
Using isCOBOL IDE
1.
2.
Choose New > Other...
3.
Choose Web > HTML File...
4.
Click on the Next button
5.
6.
At this point you can test the HTML application in the Eclipse to have a clue on how it will look on Android. So far you’ve produced a web application that can run on a web server and be used by any browser enabled device.
Note - Veryant suggests to run an external browser for the test. You can instruct the IDE to launch an external browser by following these simple steps:
1.
Click on the Window menu
2.
Choose Preferences
3.
Expand General and select Web Browser in the tree
4.
5.
To test the application, proceed as follow:
1.
2.
Choose Run As > isCOBOL EIS Application
 
If you wish to debug the COBOL program, choose Debug As > isCOBOL EIS Application, instead
 
Note - The debug of an 'EIS Application' consists in a remote debug session of the 'Jetty' application server included in the IDE. The first time the Debugger server suspends itself because it is waiting for a connection from the client; when the debugged program ends, the Debugger session doesn’t terminate as it would happen in a stand alone Debugger session. The connection with the client part is still active. So the Debugger server goes in a 'continue' state, it means that it will suspend only when a breakpoint is reached. Hence, in order to debug the program another time, it is necessary to set some breakpoints.
Before going to the next step, that will make you run the simple hello world application on Android, it’s necessary to provide a valid isCOBOL Mobile license key in the file iscobol.properties under the resources folder.
Edit the file iscobol.properties under the html folder and insert your license key. At the end, the file should look like this:
iscobol.mobile.license.2017=<your license code>
Without isCOBOL IDE
1.
2.
3.
iscobol.mobile.license.2017=<your license code>
4.
At this point you can test the application in a servelet container. The following steps show how to test in Tomcat.
1.
2.
o
o
o
o
3.
4.
o
o
o
5.
6.
o
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
  <display-name>testHTML</display-name>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>default.html</welcome-file>
    <welcome-file>default.htm</welcome-file>
    <welcome-file>default.jsp</welcome-file>
        <filter-name>isCOBOL filter</filter-name>
        <filter-class>com.iscobol.web.IscobolFilter</filter-class>
        <filter-name>isCOBOL filter</filter-name>
        <url-pattern>/servlet/*</url-pattern>
        <servlet-name>isCobol</servlet-name>
        <servlet-class>com.iscobol.web.IscobolServletCall</servlet-class>
        <servlet-name>isCobol</servlet-name>
        <url-pattern>/servlet/*</url-pattern>
  <listener>
   <listener-class>com.iscobol.web.IscobolSessionListener</listener-class>
Content of Index.html
    <head>
    <title>Test Mobile </title>
   <link href="jquery.mobile-1.3.0.min.css" rel="stylesheet" type="text/css" />
   <script src="jquery-1.8.2.min.js"></script>
   <script src="jquery.mobile-1.3.0.min.js"></script>
   <script>
   function handleError (jqXHR, textStatus, errorThrown) {
      alert (textStatus +" "+ jqXHR.status + " "+jqXHR.statusText +
                   "\n" + jqXHR.responseText);
   function handleSuccess (data, textStatus, jqXHR) {
      } catch (err) {
         return false;
      jQuery("#hello_div").html(_hello.text());
      return true;
   function callServer (cobolProg) {
      var url = "servlet/isCobol(" + cobolProg + ")";
      return false;
   </script>
<div data-role="page">
    <div data-role="header" data-theme="a">
        <h1>isCOBOL MOBILE</h1>
    </div><!-- /header -->
    <div data-role="content" data-fullscreen="true">
        <div id="hello_div" align="center"></div> 
    </div><!-- /content -->
</div><!-- /page -->
Where to find JQuery files
JQuery script and css files used by Index.html can be downloaded from the following sites:

Copyright (c) 2017 Veryant
Contact us
Please share your comments on this manual or on any
Veryant product documentation with the email button at the top left