[jboss-user] [JBoss Portal] - Question on portlet
rbreault
do-not-reply at jboss.com
Mon Aug 14 13:25:50 EDT 2006
I built a portlet using the Hellow World as the example. Here is my code
import java.io.PrintWriter;
import java.io.IOException;
import javax.portlet.GenericPortlet;
import javax.portlet.PortletConfig;
import javax.portlet.PortletSecurityException;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
import javax.portlet.PortletException;
import com.ibm.as400.access.AS400;
import com.ibm.as400.access.AS400SecurityException;
import com.ibm.as400.access.ErrorCompletingRequestException;
import com.ibm.as400.access.ObjectDoesNotExistException;
import com.ibm.as400.access.SystemStatus;
public class SimpleaspPortlet extends GenericPortlet
{
public void init(PortletConfig config) throws PortletException
{
// TODO Auto-generated method stub
super.init(config);
}
protected void doView(RenderRequest rRequest, RenderResponse rResponse) throws PortletException, PortletSecurityException, IOException
{
// TODO Auto-generated method stub
rResponse.setContentType("text/html");
PrintWriter writer = rResponse.getWriter();
AS400 as400 = new AS400("*", "*", "*");
SystemStatus status = new SystemStatus(as400);
try {
writer.write(status.getBatchJobsRunning());
// writer.write(status.getPercentProcessingUnitUsed());
writer.write(status.getUsersCurrentSignedOn());
// writer.write(status.getPercentSystemASPUsed());
writer.close();
} catch (AS400SecurityException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ErrorCompletingRequestException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ObjectDoesNotExistException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} finally {
as400.disconnectAllServices();
}
}
}
When I go to the portal and look at the portlet I get the page but no information is it. Except random Chars.
Any help would be great
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3965051#3965051
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3965051
More information about the jboss-user
mailing list