Interview Questions

How to configure JSP in web.xml?

A JSP page can be configured in web.xml using the following code

<servlet>
        <servlet-name>common</servlet-name>
        <jsp-file>/tdd/common.jsp</jsp-file>
        <init-param>
                <param-name>test</param-name>
                <param-value>jsp</param-value>
        </init-param>
</servlet>
       
<servlet-mapping>
        <servlet-name>common</servlet-name>
        <url-pattern>/tdd/common.jsp</url-pattern>
</servlet-mapping>