Hi all,
I was trying to see which attributes and properties my portlet views
when clicking a button in a form.
So I put this code in the "processAction(req,resp)" method:
--------------------------------------------------------------------------------------
private String atributos;
private String propiedades;
public void processAction (ActionRequest request, ActionResponse
response)
throws PortletException, IOException{
String at1 =
request.getAttributeNames().nextElement().toString();
atributos = at1 + ": " +
request.getAttribute(at1).toString()+"<br>";
while (request.getAttributeNames().hasMoreElements()){
String at =
request.getAttributeNames().nextElement().toString();
atributos = atributos + at + ": " +
request.getAttribute(at).toString()+"<br>";
}
String prop1 =
request.getPropertyNames().nextElement().toString();
propiedades = prop1 + ": " +
request.getProperty(prop1).toString()+"<br>";
while (request.getPropertyNames().hasMoreElements()){
String prop =
request.getPropertyNames().nextElement().toString();
propiedades = propiedades + prop + ": " +
request.getProperty(prop).toString()+"<br>";
}
}
--------------------------------------------------------------------------------------
and show the result ("atributos" and "propiedades" strings) when
rendering content in doView() method.
But both loops seem to have no end =/
I've tried just with two properties (or attributes); that is to say,
removing the loops, and what I guess is that it's always picking the
same property (or attribute).
Is that something to do with my code? "nextElement()" is supposed to
place the pointer in the next element of the Enumeration object, isn't it?
Thanks,
Enrique
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]