[JBoss Portal] - Question on portlet
by rbreault
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
19 years, 10 months
[EJB 3.0] - Embedded Objects set to null by entitymanager
by mwoelke
Hi,
We've got a problem with embedded objects. Imagine the following scenario:
@Entity
| class A{
| int id;
| B embedded;
|
| public A(){
| embedded = new B();
| }
|
| @Embedded
| public B getEmbedded(){
| return embedded;
| }
|
| ... other getters and setters ... nothing special ...
| }
|
| @Embeddable
| class B{
| String name;
| String shortName;
| public String getName(){...}
| public String getShortName(){...}
| ... setters ...
| }
If name or shortName of B is set to a value other than null everything works fine, which means A.embedded is set to a non null value when fetching it from the db. BUT, if both properties of B are set to null, A.embedded itself is set to null, too.
This happens although the default constructor which gets called by the entity manager sets it to a non null value.
Does anyone know this behavior? Is it what its is supposed to be? And how to deal with that if its necessary to have A.embedded always set to a non null value.
We are still using JBoss 4.0.4 RC1. Is this a known issue? Should we switch to 4.0.4GA? Any help is appreciated.
Thanx in advance.
Milan Wölke
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3965047#3965047
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3965047
19 years, 10 months