Running the web example

You can run the web example to understand how Java™ programs can use CICS® web support to interact with web browsers.

Before you begin

Before you run the web sample, follow the instructions in Configuring CICS web support components. Use the sample programs DFH$WB1A (Assembler) or DFH$WB1C (C) to confirm that CICS web support is configured correctly.

About this task

This example demonstrates how to use the JCICS web and document classes. You access this example application from a web browser. The example obtains information about the inbound client request, the HTTP headers, and the TCP/IP characteristics of the transaction. This information is written to the standard output stream System.out and inserted into a response document. Information about the document is also obtained and written to System.out and inserted into the response document. The response document is then sent to the client.

The example uses the following Java class and program:

Program Java class
DFJ$JWB1 examples.Web.Sample1

Procedure

  1. Start your web browser and enter a URL that connects to CICS with the absolute path /CICS/CWBA/DFJ$JWB1.
    CICS returns the following response document to the web browser:
    examples.Web Sample1
    
    Inbound Client Request Information:
    
    Method: GET
    
    Version: HTTP/1.1
    
    Path: /cics/cwba/jcicxsa1
    
    Request Type: HTTPYES
    
    Query String: null
    
    HTTP headers:
    
    Value for HTTP header User-Agent is 'Mozilla/4.75 €en€ (WinNT; U)'
    
    Browse of HTTP Headers started
    
    Name: Host Value: winmvs2d.hursley.ibm.com:27361
    
    Name: Connection Value: Keep-Alive, TE
    
    Name: Accept Value: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, 
          image/png, */*
    
    Name: Accept-Encoding Value: gzip
    
    Name: Accept-Language Value: en
    
    Name: Accept-Charset Value: iso-8859-1,*,utf-8
    
    Name: Cookie Value: PBC_NLSP=en_US
    
    Name: TE Value: chunked
    
    Name: Via Value: HTTP/1.0 sp15ce18.hursley.ibm.com (IBM-PROXY-WTE-US)
    
    Name: User-Agent Value: Mozilla/4.75 €en€ (WinNT; U)
    
    Browse of HTTP Headers completed
    
    TCPIP Information:
    
    Client Name: sp15ce18.hursley.ibm.com
    
    Server Name: winmvs2d.hursley.ibm.com
    
    Client Address: 9.20.136.28
    
    ClientAddrNu: 9.20.136.28
    
    Server Address: 9.20.101.8
    
    ServerAddrNu: 9.20.101.8
    
    Clientauth: NO
    
    SSL: NO
    
    TcpipService: HTTPNSSL
    
    PortNumber: 27361
    
    Document Information:
    
    Doctoken: 33 92 112 0 0 0 0 1 64 64 64 64 64 64 64 64
    
    Docsize: 2762  
    
  2. Check the standard output stream in zFS.
    The example writes information messages to the standard output stream System.out and error messages to the standard output stream System.err. Here is an example of the output written to the System.out output stream:
    Sample1 started                                                                 
    Method: GET (3)                                                                 
    Version: HTTP/1.1 (8)                                                           
    Path: /cics/cwba/jcicxsa1 (19)                                                  
    Request Type: HTTPYES                                                           
    Value for HTTP header User-Agent is 'Mozilla/4.75  en  (WinNT; U)'              
    HTTP headers:                                                                   
    Name: Host (4)                                                                  
    Value: winmvs2d.hursley.ibm.com:27361 (30)                                      
    Name: Connection (10)                                                           
    Value: Keep-Alive, TE (14)                                                      
    Name: Accept (6)                                                                
    Value: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */* (67) 
    Name: Accept-Encoding (15)                                                      
    Value: gzip (4)                                                                 
    Name: Accept-Language (15)                                                      
    Value: en (2)                                                                   
    Name: Accept-Charset (14)                                                       
    Value: iso-8859-1,*,utf-8 (18)                                                  
    Name: Cookie (6)                                                                
    Value: PBC_NLSP=en_US (14)                                                      
    Name: TE (2)                                                                    
    Value: chunked (7)                                                              
    Name: Via (3)                                                                   
    Value: HTTP/1.0 sp15ce18.hursley.ibm.com (IBM-PROXY-WTE-US) (52)                
    Name: User-Agent (10)                                                           
    Value: Mozilla/4.75  en  (WinNT; U) (28)                                        
    Client Name: sp15ce18.hursley.ibm.com (24)                                      
    Server Name: winmvs2d.hursley.ibm.com (24)                                      
    Client Address: 9.20.136.28 (11)                                                
    ClientAddrNu: 9.20.136.28                                                       
    Server Address: 9.20.101.8 (10)                                                 
    ServerAddrNu: 9.20.101.8 
    Clientauth: NO                                                    
    SSL: NO                                                           
    TcpipService: HTTPNSSL                                            
    PortNumber: 27361                                                 
    Doctoken: Doctoken: 33 92 112 0 0 0 0 1 64 64 64 64 64 64 64 64   
    Docsize: 2762                                                     
    Sample1 complete