Hi.
I guess by the err log, that you are
trying to use this method in a JSP page.
As by the specs in a JSP to get a
reference to the cotext you should use the "pageContext" object, that is found
in every JSP page.
Why not give it a try?
TRY:
Vector vectorUsuarios =
(Vector)pageContext.getAttribute("vu");
pageContext is an object of type
javax.servlet.jsp.PageContext.
There is also one implicit object:
"application". It should be of type javax.servlet.ServletContext. So you can
also try:
Vector vectorUsuarios =
(Vector)application.getAttribute("vu");
BTW. Your problem is the
getServletContext method, not the getAttribute :)
Hope this helps.
May the shade of the tree strengthen
you.
Lachezar
> Hi all,
> I'm a newbie using Orion and I have a problem.
> I need to get Servlet Context to get an attribute, but when I use
> getServletContext().getAttribute("Attribute") I receive the follow error:
>
> /jsp/adestadoc.jsp.java:35: Method getServletContext() not found in class
> /jsp/adestadoc.jsp. (JSP page line 9)
> Vector vectorUsuarios =
> (Vector)getServletContext().getAttribute("vu");
>
> I've put tools.jar and rt.jar in the Orion directory. I havenīt any other
> problems executing servlets and jsp pages.
> Can anybody help me?
>
> Thanks in advance.
>
> Antonio
> I'm a newbie using Orion and I have a problem.
> I need to get Servlet Context to get an attribute, but when I use
> getServletContext().getAttribute("Attribute") I receive the follow error:
>
> /jsp/adestadoc.jsp.java:35: Method getServletContext() not found in class
> /jsp/adestadoc.jsp. (JSP page line 9)
> Vector vectorUsuarios =
> (Vector)getServletContext().getAttribute("vu");
>
> I've put tools.jar and rt.jar in the Orion directory. I havenīt any other
> problems executing servlets and jsp pages.
> Can anybody help me?
>
> Thanks in advance.
>
> Antonio