I've created a very basic portlet, which displays a String
on-screen.
I have another web application hosted on separate VM which offers a REST
api that I'd like to consume.
Understand I cannot make AJAX
calls to remote web app (without some effort e.g proxy etc).
But what would be best approach to submitting HTTP GET
requests to this remote web app?
I've considered both JSP
and Servlets
but not sure how to invoke the servlet from inside TestPortletView.xhtml
and then display results?
Contents of TestPortletView.html
..
<%@page session="false" contentType="text/html" pageEncoding="ISO-8859-1" import="java.util.*,javax.portlet.*,com.ibm.test.*" %>
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet"%>
<%@taglib uri="http://www.ibm.com/xmlns/prod/websphere/portal/v6.1/portlet-client-model" prefix="portlet-client-model" %>
<portlet:defineObjects/>
<portlet-client-model:init>
<portlet-client-model:require module="ibm.portal.xml.*"/>
<portlet-client-model:require module="ibm.portal.portlet.*"/>
</portlet-client-model:init>
<DIV style="margin: 6px">
<H3 style="margin-bottom: 3px">Welcome!</H3>
This is my basic view mode page.<BR>
</DIV>
Project setup ..