Comments (16)
- Issue Imported From: https://github.com/javaee/servlet-spec/issues/16
- Original Issue Raised By:@glassfishrobot
- Original Issue Assigned To: @shingwaichan
- Original Issue Closed By:@glassfishrobot
from servlet.
@glassfishrobot Commented
Reported by markt_asf
from servlet.
@glassfishrobot Commented
mode said:
Not everything defined in the web.xml can be done via ServletRegistration.
from servlet.
@glassfishrobot Commented
markt_asf said:
Indeed, but is there a reason not to add jsp-file that I have missed?
from servlet.
@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 Commented
markt_asf said:
Here is the Tomcat discussion that triggered this request:
http://tomcat.markmail.org/thread/pg65fgqhfra7czy5
from servlet.
@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 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 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 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 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 Commented
@shingwaichan said:
Revisions:
64485
Modified Paths:
trunk/api/javaee-api/javax.servlet/src/main/java/javax/servlet/ServletContext.java
from servlet.
@glassfishrobot Commented
@shingwaichan said:
add ServletContext#addJspFile()
from servlet.
@glassfishrobot Commented
Issue-Links:
is related to
GLASSFISH-21666
from servlet.
@glassfishrobot Commented
This issue was imported from java.net JIRA SERVLET_SPEC-16
from servlet.
@glassfishrobot Commented
Marked as fixed on Thursday, February 9th 2017, 3:52:46 pm
from servlet.
Related Issues (20)
- Clarify '13.8.4 Uncovered HTTP Protocol Methods' and 13.8.4.2 HOT 1
- Regarding url-pattern in security constraints: is there a difference between "/" and "/*"? HOT 3
- Proposal: add getCompleteRequestURI() and getCompleteRequestURL()
- Clarify size unit for `MultipartConfigElement` and `MultipartConfig`
- Compatibility certification request for EE4J implementation of Jakarta Servlet 6 HOT 9
- Add SameSite attribute to Cookie class HOT 2
- Update HTTP spec references to RFC 9110 to RFC 9113 and review changes for impact on Servlet API
- As per RFC 9110 (and earlier) HTTP TRACE response MUST NOT include sensitive headers HOT 2
- Some ServletContext getters still throw UnsupportedOperationException HOT 1
- TCK Challenge: Cookie setMaxAgePositiveTest using incorrect CookiePolicy for Date parsing HOT 7
- TCK Challenge: doHeadTest shouldn't validate optional payload header fields HOT 7
- TCK Challenge: isTrailerFields JavaDoc and default implementation inconsistent HOT 7
- Add read/write from/to ByteBuffer HOT 1
- [TCK Challenge] invalidateHttpSessionxTest HOT 4
- [TCK Challenge] A number of cross context HTTP session tests are failing HOT 14
- [TCK Challenge] dispatchAfterCommitTest4 HOT 2
- [TCK Challenge] dispatchAfterCommitTest5 HOT 2
- [TCK Challenge] object identity test on ServletRequests in listeners vs servlets HOT 6
- [TCK Challenge] inconsistent testing of cookies HOT 7
- Is the maintenance plan updated for jakarta servlet-4.0.x? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from servlet.