I'm trying access to Tiles context attributes from an TilesAction. I've a definition where I put a list of SimpleMenuItems:
... <putList name="portlets">
<item value="1" link=".portlet.noticias" tooltip="Noticias"
classtype="org.apache.struts.tiles.beans.SimpleMenuItem"/> ...
In the execute method of the TilesAction
...
ArrayList lportlets = (ArrayList) context.getAttribute("portlets");
Iterator it = lportlets.iterator();
while( it.hasNext() ) {
SimpleMenuItem plt = (SimpleMenuItem) it.next() ;
....
}
Just in the last line (SimpleMenuItem plt = (SimpleMenuItem) it.next() ;) an java.lang.NullPointerException ocurs.
But I write the value of it.next() before (System.out.println(it.next();) , I get
SimpleMenuItem[value=1, link=.portlet.noticias, tooltip=Noticias, ]
¿What's wrong?
Thank you.
Miguel Angel Martin. Malaga (Spain) -------------------------------------------------- Amplia tus posibilidades de ganar más con el nuevo Depósito 5% http://ingdirect.ozu.es/ -------------------------------------------------- Correo enviado desde http://www.ozu.es
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]