Skip to content

init param tag reference

novalexei edited this page Nov 10, 2016 · 1 revision

#####<init-param>

This tag provides parameters to a single servlet or filter.

To access the values from your code, use the following syntax:

optional_ref<const std::string> value = get_servlet_config().get_init_parameter("parameterName");

A single <init-param> tag is used for each parameter.

The actual parameter name and value are set using <param-name> and <param-value>.

Example usage in web.xml, for providing parameters to a servlet:

<servlet>
    <servlet-name>My Servlet</servlet-name>
    <servlet-factory>libmy.so:myServlet</servlet-factory>
    <init-param> 
        <param-name>debugUsers</param-name> 
        <param-value>true</param-value> 
    </init-param> 
</servlet>

See Also:

To web.xml reference page