Skip to content

Commit decc161

Browse files
committed
print output message to terminal
1 parent 333763b commit decc161

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ If you are building and deploying with Gradle or Maven then you don't necessaril
7070
> In Eclipse, Gradle (buildship) is able to fully refresh and resolve the local classpath even if the project was previously updated by Maven. However, Maven (m2e) does not currently reciprocate that capability. If you previously refreshed the project with Gradle, you'll need to manually remove the 'Project Dependencies' entry on the Java build-path of your Project Properties to avoid duplication errors when performing a Maven Project Update.
7171
7272

73-
### Building with Eclipse
73+
### Option 1: Building with Eclipse
7474

7575
If you are using the Egit client to clone the repo, remember to tick the button to import all projects. Otherwise, you should manually Import the projects into CICS Explorer using File → Import → General → Existing projects into workspace, then follow the error resolution advice above.
7676

77-
### Building with Gradle
77+
### Option 2: Building with Gradle
7878

7979
For a complete build you should run the settings.gradle file in the top-level 'cics-java-liberty-link' directory which is designed to invoke the individual build.gradle files for each project.
8080

@@ -102,7 +102,7 @@ gradle clean build
102102
gradle clean build -Pcics.jvmserver=MYJVM
103103
```
104104

105-
### Building with Apache Maven
105+
### Option 3: Building with Apache Maven
106106

107107
For a complete build you should run the pom.xml file in the top-level 'cics-java-liberty-link' directory. A WAR file is created inside the `cics-java-liberty-link-app/target` directory and a CICS bundle ZIP file inside the `cics-java-liberty-link-bundle/target` directory.
108108

cics-java-liberty-link-app/src/main/java/com/ibm/cics/server/examples/wlp/link/HelloLiberty.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
/* */
1010
package com.ibm.cics.server.examples.wlp.link;
1111

12+
import java.io.PrintWriter;
13+
1214
import com.ibm.cics.server.Channel;
1315
import com.ibm.cics.server.CicsException;
1416
import com.ibm.cics.server.Container;
@@ -66,15 +68,18 @@ public HelloLiberty()
6668
@CICSProgram(PROGRAM_NAME) // This method can be invoked by EXEC CICS LINK PROGRAM(HELLOWLP)
6769
public void printMessage()
6870
{
69-
try
71+
// Direct access to the 'out' stream should be replaced with the getter method at higher versions of JCICS
72+
try (PrintWriter out = currentTask.out)
7073
{
74+
out.println();
7175
StringBuilder sb = new StringBuilder();
7276
final String name = getName();
7377
sb.append("Hello ")
7478
.append(name)
7579
.append(" from Liberty server ")
7680
.append(JVMSERVER_NAME);
7781

82+
out.println(sb.toString());
7883
System.out.println(sb.toString());
7984
} catch (CicsException e)
8085
{

0 commit comments

Comments
 (0)