Figure 4: Here's the HTML code for CGIDEV2/DEMOHTML MBR(GETCUS2).

The markers /$top, /$tabrow, and /$bottom are not HTML tags, but markers for the CGIDEV2 tool to use to identify sections of the HTML code. The variable /%cname%/ is also not HTML; it's only a marker that the CGI program replaces with real data. The CGI program mixes the HTML code and the live data from the database into a text string in a buffer that is then sent to the remote user. In this case, it builds the Web page displayed in Figure 5.

http://www.mcpressonline.com/articles/images/2002/My%20First%20Web%20Page%20with%20RPG%20and%20CGIDEV2--V4--07010501.png

Figure 5: Here's your second Web page.

This is just the simplest of examples, showing you how to code your own CGI programs using RPGLE and CGIDEV2. IBM provides plenty of examples to help you expand into increasingly sophisticated Web pages.

That Was Then, and This Is Now

No RPG programmer has any excuse for not developing effective and exciting browser-based applications. Best of all, you can easily adapt existing program logic from your current applications to work with Web-based applications.

Just as an added bonus, CGIDEV2 shows off the real power of ILE programming by delivering this great and complex tool all neatly bundled inside ILE service programs. I may have disliked the clunky interface of the original CGIDEV product, but that was then, and this is now! I love the slick new interface provided by CGIDEV2.

Kevin Forsythe is the author of the new book SQL for eServer i5 and iSeries. He has over 18 years of experience working with the iSeries platform and its predecessors. He has been a member of the DMC team for the past nine years. Kevin's primary responsibility is providing iSeries education, but he also provides customers with project management, system design, analysis, and technical construction. In addition to his technical skills (RPG IV, CL, OS/400, SQL, FTP, Query, VB, Net.Data), Kevin possesses the ability to communicate new and complex concepts to his students. He has been the primary instructor for DMC's iSeries-based AS/Credentials training courses since 1997 and has authored courses such as Advanced ILE, SQL, Embedded SQL, Operations Navigator, and Intro to WebSphere Studio. An award-winning speaker, he has spoken at every COMMON Conference since the spring of 2000.


Gina Whitney
About the Author:

Gina Whitney is a staff software engineer at IBM in SQL development for DB2 for i5/OS. She is responsible for the SQL precompilers. Gina is located in Rochester, Minnesota and can be reached at whitneyg@us.ibm.com.

Read More >>
Last Updated on Tuesday, 05 June 2007 18:00
 
R.Daugherty
That\'s true, Dave and Chris, but questioner should at least be aware we\'re in a thread about a service program which does require ILE. rd
Please login to make comments.
User Rating: / 2
PoorBest 

Related Articles:

WHITE PAPERS

The following White Papers can be found at the MC White Paper Center

 

 


   MC-STORE.COM