Can you give me an example showing how to call the method
public void setAttribute(java.lang.String name,
java.lang.Object object)
Gives an attribute a name in this servlet context. If the name specified is
already used for an attribute, this method will overwrite the old attribute and
bind the name to the new attribute.
Attribute names should follow the same convention as package names. The Java
Servlet API specification reserves names matching java.*, javax.*, and sun.*.
Parameters:
name - a String specifying the name of the attribute
object - an Object representing the attribute to be given the name
Should it be something like setAttribute("javax.servlet.http.HttpServlet",
myServlet)?
setAttribute("javax.servlet.http.HttpServlet", myServlet)
Thanx.
Daniel
Cezar Totth <[EMAIL PROTECTED]> on 05/28/99 03:24:05 AM
Please respond to "A mailing list for discussion about Sun Microsystem's Java
Servlet API Technology." <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
cc: (bcc: Daniel Liu/APHELION)
Subject: Re: Is there any solution for this?
Hi,
You can use now ServletContext's setAttribute() and getAttribute()
to register servlets themselves as ServletContext's attributes.
Cezar
On Thu, 27 May 1999, Daniel Liu wrote:
> Hi All:
> I am running an example servlet written by jsdk2.0 under jsdk2.1.
> Because some methods have been deprecated in 2.1 with no
> replacement, how can I modify the code so that the example
> still works.
>
> For example, in 2.0, there is the method
>
> public Servlet getServlet(java.lang.String name)
>
> in Interface ServletContext,
>
> But in 2.1, it always return null.
>
> Is there any solution for this?
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html