Hi,

David Sierra Fernandez wrote:

> I'm creating a complete web app and I know how to access from my code to
> <env-entry>, <ejb-ref> and <resource-ref> but I want to know how to access
> to a:
>
> <init-param> and <context-param> an the differnces in code between them.

init-param is just for the JSP or servlet and accessed via

String ServletConfig.getInitParameter(String)
Enumeration ServletConfig.getInitParameterNames(String)

HttpServlet extends GenericServlet so you could use in a servlet
the methods from GenericServlet the method with the same signature as the
methods above.

These are in relation to this servlet only.

context-param is for the whole web application and is accessed via
String ServletContext.getInitParameter(String)
Enumeration ServletContext.getInitParameterNames(String)

this in JSP is the "application" implicit variable.

Let us know if this is correct.

Eric :-)


>
>
> I haven't found any reference in J2EE spec nor Servlets esp.
>
> Is there any difference between accessing from a servlets or JSP,  or
> accessing from an EJB
>
> I would appreciate your help. Thanks.
>
>         -------------------------------------------------------------
>         David Sierra Fern ndez
>         Ingeniero Tecnico de Telecomunicaci¢n
>         AULA RETECAL (CEDETEL)   Universidad de Valladolid
>         Campus Miguel Delibes   E-Mail: [EMAIL PROTECTED]
>         47011 Valladolid (SPAIN)
>         --------------------------------------------------------------
>
>  -- Sierr@ --


Reply via email to