Hi Hector
In home.jsp , you can save communities attribute in session and can use in any
page.
session.setAttribute("communities",communities);
Then in navbar-default.jsp
Use : Community[] communities = (Community[])
session.getAttribute("communities");
any where in declare section <% ......%>
Best Regards
Hardik Mishra
Software Engineer
Webinito Networks
http://bit.ly/uJ60P - Join Us on Facebook
http://www.twitter.com/webinito - Follow us on Twitter
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.
________________________________
From: Héctor Garcia Peris <[email protected]>
To: [email protected]
Sent: Tuesday, September 29, 2009 12:24:33 PM
Subject: [Dspace-general] Communities list in navigation bar
Hello,
I want to have a list of communities in my navigator bar in the same way
that I have in the home page. I tried to reuse the code in home.jsp page
in the navbar-default.jsp file. But the problem is that when I try to
get the communities attribute with this commands:
140: <%@ page import="org.dspace.content.Community" %>
141: <%
142: Community[] communities = (Community[])
request.getAttribute("communities");
143: if (communities.length != 0)
144: {
145:%>
I get a java.lang.NullPointerException in line 143. That is because the
communities attribute is not instanced in this file, but it's instanced
in the home.jsp page. Is there any way to get the communities in the
navbar-default.jsp file?
Thanks.
--
---------------------------------------------------------------------
Héctor Garcia Peris
Dpto. Informática
Instituto Valenciano de Investigaciones Económicas S.A. (Ivie)
C/ Guardia Civil, 22 esc-2 1º 46020 - Valencia (Spain)
Tfno.: +34 - 963190050 / +34 - 963930816
Fax.: +34 - 963190055 / +34 - 963930856
e-mail: [email protected]
Web: http://www.ivie.es
----------------------------------------------------------------------
_______________________________________________
Dspace-general mailing list
[email protected]
http://mailman.mit.edu/mailman/listinfo/dspace-general
_______________________________________________
Dspace-general mailing list
[email protected]
http://mailman.mit.edu/mailman/listinfo/dspace-general