<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:verdana, helvetica, sans-serif;font-size:10pt"><DIV></DIV>
<DIV>Hi Hector</DIV>
<DIV>&nbsp;</DIV>
<DIV>In home.jsp , you can save communities attribute in session and can use in any page.</DIV>
<DIV>&nbsp;</DIV>
<DIV>session.setAttribute("communities",communities);<BR></DIV>
<DIV>Then&nbsp;in navbar-default.jsp</DIV>
<DIV>&nbsp;</DIV>
<DIV>Use&nbsp; : Community[] communities = (Community[]) session.getAttribute("communities"); </DIV>
<DIV>any where in declare section &lt;% ......%&gt;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV><STRONG>Best Regards<BR>Hardik Mishra<BR>Software Engineer</STRONG>
<DIV></DIV>
<P><STRONG>Webinito Networks</STRONG></P>
<P><STRONG><BR><FONT color=#80c0ff>http://bit.ly/uJ60P - Join Us on Facebook<BR>http://www.twitter.com/webinito - Follow us on Twitter<BR></FONT><BR></P></STRONG>
<DIV><STRONG>Give a man a fish, and you feed him for a day. Teach a man to catch fish and you feed him for a lifetime.</STRONG>
<DIV><BR></DIV>
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: verdana, helvetica, sans-serif"><BR>
<DIV style="FONT-SIZE: 13px; FONT-FAMILY: arial, helvetica, sans-serif"><FONT face=Tahoma size=2>
<HR SIZE=1>
<B><SPAN style="FONT-WEIGHT: bold">From:</SPAN></B> Héctor Garcia Peris &lt;hector.garcia@ivie.es&gt;<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> dspace-general@mit.edu<BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> Tuesday, September 29, 2009 12:24:33 PM<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B> [Dspace-general] Communities list in navigation bar<BR></FONT><BR>Hello,<BR><BR>I want to have a list of communities in my navigator bar in the same way <BR>that I have in the home page. I tried to reuse the code in home.jsp page <BR>in the navbar-default.jsp file. But the problem is that when I try to <BR>get the communities attribute with this commands:<BR><BR>140: &lt;%@ page import="org.dspace.content.Community" %&gt;<BR>141: &lt;%<BR>142:&nbsp; &nbsp; Community[] communities = (Community[]) <BR>request.getAttribute("communities");<BR>143:&nbsp; &nbsp; if (communities.length != 0)<BR>144:&nbsp; &nbsp; {<BR>145:%&gt;<BR><BR>I
 get a java.lang.NullPointerException in line 143. That is because the <BR>communities attribute is not instanced in this file, but it's instanced <BR>in the home.jsp page. Is there any way to get the communities in the <BR>navbar-default.jsp file?<BR><BR>Thanks.<BR><BR>-- <BR><BR>---------------------------------------------------------------------<BR>Héctor Garcia Peris<BR>Dpto. Informática<BR>Instituto Valenciano de Investigaciones Económicas S.A. (Ivie) <BR>C/ Guardia Civil, 22 esc-2 1º 46020 - Valencia (Spain) <BR>Tfno.: +34 - 963190050 / +34 - 963930816 <BR>Fax.: +34 - 963190055 / +34 - 963930856 <BR>e-mail: <A href="mailto:hector.garcia@ivie.es" ymailto="mailto:hector.garcia@ivie.es">hector.garcia@ivie.es</A> <BR>Web: http://www.ivie.es<BR>----------------------------------------------------------------------<BR><BR>_______________________________________________<BR>Dspace-general mailing list<BR><A href="mailto:Dspace-general@mit.edu"
 ymailto="mailto:Dspace-general@mit.edu">Dspace-general@mit.edu</A><BR>http://mailman.mit.edu/mailman/listinfo/dspace-general<BR></DIV></DIV></DIV></div><br>

      </body></html>