Viewing the Source Code of Wink-based Feed Sample application
The source code of the Feed Sample application is provided within the SampleFeedApp_Wink.war file.
Locating the application WAR file
Locate the Feed Sample application web archive (WAR) file that is provided with this documentation.
-
If you have installed IBM® WebSphere® Application Server Feature Pack for Web 2.0 and Mobile,
Version 1.1.0, then you can find the WAR file in your installation tree; for example, if you installed the feature pack in
the following location:
Linux and UNIX: /opt/WebSphere/AppServer
|
Windows: c:\WebSphere\AppServer
|
Then, you can find the WAR and library files in the following location:
Linux and UNIX: /opt/WebSphere/AppServer/web2mobilefep_1.1/samples/Feed/SampleFeedApp_Wink.war
|
Windows: c:\WebSphere\AppServer\web2mobilefep_1.1\samples\Feed\SampleFeedApp_Wink.war
|
Viewing the source code in an Eclipse-based IDE
An Eclipse-based IDE is the simplest approach to examining the source code of the
WAR file. Use any Eclipse 3.2.X or 3.3.X with the Web Tools Project 2.5 or higher, or Rational Application Developer,
Version 7.0 or higher, and import the WAR file according to the following steps:
-
From the Eclipse IDE menu, select File >Import.
-
In the displayed panel, expand the Web option, then select WAR file. Click Next.
-
In the WAR File entry field, click Browse, and select the file you located earlier. This action populates the other two fields.
-
Accept defaults for the project name, if they are acceptable, and click Next.
-
Click Finish.
When the import process completes, a new project, SampleFeedApp_Wink, is created. The application source
code can be accessed from this project. You must add the Wink libraries in the
build path of the project.
Adding the Wink libraries to build path
- Create a folder for the shared library option; for example,
"jaxrs-library".
- Copy the following JAR files into that folder: ibm-wink-jaxrs*.jar, jsr311-api*.jar, ibm-jaxb*.jar, JSON4J.jar,
slf4j*.jar, jcl-over-slf4j*.jar, httpclient*.jar, httpcore*.jar, commons-codec*.jar and commons-lang*.jar. Refer to the Overview section to locate these files. For IBM® WebSphere® Application Server version 8.0 only JSON4J is needed.
-
From Eclipse IDE, right-click the project, and select Properties > Java Build Path > Libraries.
-
Click Add External JARs
-
Select all the previously mentioned JAR files, and click OK.
-
Click OK to complete the process.