Giter Site home page Giter Site logo

Comments (16)

glassfishrobot avatar glassfishrobot commented on June 27, 2024

from servlet.

glassfishrobot avatar glassfishrobot commented on June 27, 2024

@glassfishrobot Commented
Reported by markt_asf

from servlet.

glassfishrobot avatar glassfishrobot commented on June 27, 2024

@glassfishrobot Commented
mode said:
Not everything defined in the web.xml can be done via ServletRegistration.

from servlet.

glassfishrobot avatar glassfishrobot commented on June 27, 2024

@glassfishrobot Commented
markt_asf said:
Indeed, but is there a reason not to add jsp-file that I have missed?

from servlet.

glassfishrobot avatar glassfishrobot commented on June 27, 2024

@glassfishrobot Commented
mode said:
There was no specific discussion about jsp-file, however the main goal of the APIs for adding Servlet, Filters and Listeners was for pluggability of frameworks. Not sure how many frameworks will really need to the jsp-file for pluggability.

from servlet.

glassfishrobot avatar glassfishrobot commented on June 27, 2024

@glassfishrobot Commented
markt_asf said:
Here is the Tomcat discussion that triggered this request:
http://tomcat.markmail.org/thread/pg65fgqhfra7czy5

from servlet.

glassfishrobot avatar glassfishrobot commented on June 27, 2024

@glassfishrobot Commented
@edburns said:
Here is a proposal that implements this.

@WebListener()
public class NewServletListener  implements ServletContextListener {

    @Override
    public void contextInitialized(ServletContextEvent sce) {

        final ServletContext servletContext = sce.getServletContext();
        final ServletRegistration.Dynamic dynamic = servletContext.addServlet("newjsp",
ServletContext.JSP_SERVLET_CLASS_REFERENCE);
        dynamic.setJspFile("/newjsp.jsp");
        dynamic.addMapping("/newjsp");

    }

}

from servlet.

glassfishrobot avatar glassfishrobot commented on June 27, 2024

@glassfishrobot Commented
@edburns said:
The use of the constant JSP_SERVLET_CLASS_REFERENCE enables the implementation to take the necessary actions to ensure this is equivalent to the implementation private JspServlet.

from servlet.

glassfishrobot avatar glassfishrobot commented on June 27, 2024

@glassfishrobot Commented
@shingwaichan said:
is a deployment descriptor. If the API is to set , do we need to introduce the constant JSP_SERVLET_CLASS_REFERENCE?

from servlet.

glassfishrobot avatar glassfishrobot commented on June 27, 2024

@glassfishrobot Commented
@edburns said:
I chose adding the constant to minimize impact on the existing API for programmatic servlet registration, which is:

@WebListener()
public class NewServletListener  implements ServletContextListener {

    @Override
    public void contextInitialized(ServletContextEvent sce) {

        final ServletContext servletContext = sce.getServletContext();
        final ServletRegistration.Dynamic dynamic = servletContext.addServlet("newjsp",
[String, Class or Servlet]);
        dynamic.addMapping("/newjsp");

    }

}

As far as I know, and I could be wrong about this, but the existing API does require the use of one of the addServlet() variants on ServletContext. Given that assumption, neither the Class nor the Servlet variants are appropriate for a Servlet that is a JSP page. That leaves String. We have a private constant that is used internally for such things, but that is implementation specific. So, I judged the easiest and most minimal impact would be achieved by introducing a new constant whose meaning is as I've documented in the patch.

from servlet.

glassfishrobot avatar glassfishrobot commented on June 27, 2024

@glassfishrobot Commented
markt_asf said:
I originally thought of using null. Looking at the addSevlet() Javadoc that looks legal. However, a specific constant strikes me as a better idea than giving null a special meaning.

from servlet.

glassfishrobot avatar glassfishrobot commented on June 27, 2024

@glassfishrobot Commented
@shingwaichan said:
Revisions:

64485

Modified Paths:

trunk/api/javaee-api/javax.servlet/src/main/java/javax/servlet/ServletContext.java

from servlet.

glassfishrobot avatar glassfishrobot commented on June 27, 2024

@glassfishrobot Commented
@shingwaichan said:
add ServletContext#addJspFile()

from servlet.

glassfishrobot avatar glassfishrobot commented on June 27, 2024

@glassfishrobot Commented
Issue-Links:
is related to
GLASSFISH-21666

from servlet.

glassfishrobot avatar glassfishrobot commented on June 27, 2024

@glassfishrobot Commented
This issue was imported from java.net JIRA SERVLET_SPEC-16

from servlet.

glassfishrobot avatar glassfishrobot commented on June 27, 2024

@glassfishrobot Commented
Marked as fixed on Thursday, February 9th 2017, 3:52:46 pm

from servlet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.