Index: src/main/java/javax/servlet/ServletContext.java =================================================================== --- src/main/java/javax/servlet/ServletContext.java (revision 64437) +++ src/main/java/javax/servlet/ServletContext.java (working copy) @@ -117,6 +117,19 @@ public static final String ORDERED_LIBS = "javax.servlet.context.orderedLibs"; + /** + *

If this constant is used as the value of the {@code className} + * argument to {@link #addServlet(java.lang.String, java.lang.String)}, the + * container must take the necessary actions to have this servlet perform + * equivalently to a {@code <servlet />}; with a {@code <jsp-file />}; + * instead of a {@code <servlet-class />};. Note, this assumes a + * resolvable JSP file will have been set with a call to + * {@link javax.servlet.ServletRegistration.Dynamic}.setJspFile(), before the + * context for this web-app has been initialized.

+ * + * @since 4.0 + */ + public static final String JSP_SERVLET_CLASS_REFERENCE = "javax.servlet.jsp.JspServlet"; /** * Returns the context path of the web application. Index: src/main/java/javax/servlet/ServletRegistration.java =================================================================== --- src/main/java/javax/servlet/ServletRegistration.java (revision 64437) +++ src/main/java/javax/servlet/ServletRegistration.java (working copy) @@ -101,6 +101,19 @@ interface Dynamic extends ServletRegistration, Registration.Dynamic { /** + *

Allow programmatic configuration of the JSP file for this + * {@link Servlet}.

+ * + * @param jspFile The context root relative path to the JSP file that is + * to be compiled as this {@link Servlet}. + * + * @since 4.0 + */ + + default public void setJspFile(String jspFile) { + } + + /** * Sets the loadOnStartup priority on the Servlet * represented by this dynamic ServletRegistration. *