[Dspace-general] Communities list in navigation bar

Héctor Garcia Peris hector.garcia at ivie.es
Wed Sep 30 08:59:28 EDT 2009


I don't know how store it in request or in page scope. I tried to use 
request.setAttribute("communities", communities) but obviously it 
doesn't work. There isn't a setAttribute in the response object. How can 
I pass this object to other page without session?

Thnaks.

Mark Diggory escribió:
> Hardik,
>
> I would recommend storing them in the request or page scope.  Session 
> is meant to be stored across requests rather and retaining these 
> object across request will impact the performance of DSpace.
>
> Mark
>
> -- 
> Mark R. Diggory
> @mire - http://www.atmire.com
>
>
>
>
> 2009/9/29 hardik mishra <hardik_hunt at yahoo.com 
> <mailto:hardik_hunt at yahoo.com>>
>
>     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 <hector.garcia at ivie.es
>     <mailto:hector.garcia at ivie.es>>
>     *To:* dspace-general at mit.edu <mailto:dspace-general at mit.edu>
>     *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: hector.garcia at ivie.es <mailto:hector.garcia at ivie.es>
>     Web: http://www.ivie.es
>     ----------------------------------------------------------------------
>
>     _______________________________________________
>     Dspace-general mailing list
>     Dspace-general at mit.edu <mailto:Dspace-general at mit.edu>
>     http://mailman.mit.edu/mailman/listinfo/dspace-general
>
>
>     _______________________________________________
>     Dspace-general mailing list
>     Dspace-general at mit.edu <mailto:Dspace-general at mit.edu>
>     http://mailman.mit.edu/mailman/listinfo/dspace-general
>
>

-- 

---------------------------------------------------------------------
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: hector.garcia at ivie.es 
Web: http://www.ivie.es
----------------------------------------------------------------------




More information about the Dspace-general mailing list