no access to init-params with module servlet declaration

classic Classic list List threaded Threaded
3 messages Options
hablutzel1 hablutzel1
Reply | Threaded
Open this post in threaded view
|

no access to init-params with module servlet declaration

Hi, I was trying to create a servlet for an openmrs module, then I placed something like this in config.xml

    <servlet>
        <servlet-name>Flux</servlet-name>
        <servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class>
        <init-param>
            <param-name>debug</param-name>
            <param-value>true</param-value>
        </init-param>
    </servlet>

Expecting to have access access to servlet parameters from DwrServlet, but after I realized that the openmrs modules implementation of ServletConfig, SimpleServletConfig isn't considering init-params

        // not implemented in a module's config.xml yet
        public String getInitParameter(String paramName) {
            return null;
        }
       
        // not implemented in a module's config.xml yet
        @SuppressWarnings("unchecked")
        public Enumeration getInitParameterNames() {
            return null;
        }

Is there a reason to avoid this? is it safe for me to modify it to support params?


--
Jaime Hablutzel

(tildes omitidas intencionalmente)

[hidden email] from OpenMRS Developers' mailing list
Ben Wolfe Ben Wolfe
Reply | Threaded
Open this post in threaded view
|

Re: no access to init-params with module servlet declaration

init-param support was never implemented.

If you're just wanting to add some dwr methods, modules can do so with
the current setup.  See the dwr section here:
http://openmrs.org/wiki/Module_Config_File

And an example of it in use in the formentry module config.xml.

Ben

On 05/12/2010 01:04 PM, Jaime Hablutzel Egoavil wrote:

> Hi, I was trying to create a servlet for an openmrs module, then I
> placed something like this in config.xml
>
> <servlet>
> <servlet-name>Flux</servlet-name>
> <servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class>
> <init-param>
> <param-name>debug</param-name>
> <param-value>true</param-value>
> </init-param>
> </servlet>
>
> Expecting to have access access to servlet parameters from DwrServlet,
> but after I realized that the openmrs modules implementation of
> ServletConfig, SimpleServletConfig isn't considering init-params
>
>          // not implemented in a module's config.xml yet
>          public String getInitParameter(String paramName) {
>              return null;
>          }
>
>          // not implemented in a module's config.xml yet
>          @SuppressWarnings("unchecked")
>          public Enumeration getInitParameterNames() {
>              return null;
>          }
>
> Is there a reason to avoid this? is it safe for me to modify it to
> support params?
>
>
> --
> Jaime Hablutzel
>
> (tildes omitidas intencionalmente)
> ------------------------------------------------------------------------
> Click here to unsubscribe
> <mailto:[hidden email]?body=SIGNOFF%20openmrs-devel-l> from
> OpenMRS Developers' mailing list

_________________________________________

To unsubscribe from OpenMRS Developers' mailing list, send an e-mail to [hidden email] with "SIGNOFF openmrs-devel-l" in the  body (not the subject) of your e-mail.

[mailto:[hidden email]?body=SIGNOFF%20openmrs-devel-l]
hablutzel1 hablutzel1
Reply | Threaded
Open this post in threaded view
|

Re: no access to init-params with module servlet declaration

Yes, it got it working with dwr extensions for openmrs instead of a custom servlet. Thank you Ben.

On Thu, May 13, 2010 at 8:14 AM, Ben Wolfe <[hidden email]> wrote:
init-param support was never implemented.

If you're just wanting to add some dwr methods, modules can do so with the current setup.  See the dwr section here:
http://openmrs.org/wiki/Module_Config_File

And an example of it in use in the formentry module config.xml.

Ben


On 05/12/2010 01:04 PM, Jaime Hablutzel Egoavil wrote:
Hi, I was trying to create a servlet for an openmrs module, then I
placed something like this in config.xml

<servlet>
<servlet-name>Flux</servlet-name>
<servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>true</param-value>
</init-param>
</servlet>

Expecting to have access access to servlet parameters from DwrServlet,
but after I realized that the openmrs modules implementation of
ServletConfig, SimpleServletConfig isn't considering init-params

        // not implemented in a module's config.xml yet
        public String getInitParameter(String paramName) {
            return null;
        }

        // not implemented in a module's config.xml yet
        @SuppressWarnings("unchecked")
        public Enumeration getInitParameterNames() {
            return null;
        }

Is there a reason to avoid this? is it safe for me to modify it to
support params?


--
Jaime Hablutzel

(tildes omitidas intencionalmente)
------------------------------------------------------------------------
Click here to unsubscribe
<mailto:[hidden email]?body=SIGNOFF%20openmrs-devel-l> from
OpenMRS Developers' mailing list

_________________________________________

To unsubscribe from OpenMRS Developers' mailing list, send an e-mail to [hidden email] with "SIGNOFF openmrs-devel-l" in the  body (not the subject) of your e-mail.

[mailto:[hidden email]?body=SIGNOFF%20openmrs-devel-l]



--
Jaime Hablutzel

(tildes omitidas intencionalmente)

[hidden email] from OpenMRS Developers' mailing list