Looks like correct code, but there is no attribute there.... And you also can use pageContext.getAttribute(<NAME HERE>, PageContext.APPLICATION_SCOPE) to get an attribute.
On Jul 24, 9:15 am, John Joseph <jjk_s...@yahoo.com> wrote: > Hi > I am trying out small JSP programs > In my JSP programs I intent to get value of config.getServletContext() of > some method > I did try but it is getting result as "null" > I was wondering why it it displaying "null" and why I cannot get some values > I am posting my JSP code (in my JSP I have imported java.utl.*) I am using > Netbeans 6.5.1 with JDK 5 > Please do guide me > > ############## > <%...@page contentType="text/html" import="java.util.*" > pageEncoding="ISO-8859-1"%> > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" > "http://www.w3.org/TR/html4/loose.dtd"> > > <% > Collection collect = > (Collection)config.getServletContext().getAttribute(Collection.class.getNam > e()); > out.println("<br>"); > out.println(collect); > out.println("<br>"); > out.println(config.getServletContext().getAttribute(Collection.class.getNam > e())); > > %> > > <html> > <head> > <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> > <title>JSP Page</title> > </head> > <body> > > </body> > </html> > > See the Web's breaking stories, chosen by people like you. Check out > Yahoo! Buzz.http://in.buzz.yahoo.com/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Java EE (J2EE) Programming with Passion!" group. To post to this group, send email to java-ee-j2ee-programming-with-passion@googlegroups.com To unsubscribe from this group, send email to java-ee-j2ee-programming-with-passion-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en?hl=en -~----------~----~----~----~------~----~------~--~---