JSR315ã®Java Servlet3.0 Specificationããããããã¡ã¤ãã«ãªãªã¼ã¹ãããæ¨å¹´æ«ããå°ãã¥ã¤ä»æ§ãèªãã§ãã¾ãã
ä»æ§æ¸ã¨APIå®è£
ã¯ä»¥ä¸ã®URLã«ããã¾ãã
http://jcp.org/aboutJava/communityprocess/final/jsr315/index.html
ã¢ããã¼ã·ã§ã³å¯¾å¿ãéåæå¦ç対å¿ãããã°ã©ããã«ãªServlet/Listener/Filterã®è¿½å ããã¨ã¯web.xmlã®ãã©ã°ã¡ã³ã辺ããç¹å¾´çã§ããã
ã¾ãæ°ã«ãªãã®ã¯è¿½å å
ServletAPI3.0ã§ã¯ãæ°ããã¯ã©ã¹ãã¤ã³ã¿ã¼ãã§ã¼ã¹ãã¢ããã¼ã·ã§ã³ã追å ããã¦ããã®ã¯å½ç¶ãªãããå¾æ¥ããããã¯ã©ã¹/ã¤ã³ã¿ã¼ãã§ã¼ã¹ã«ãã¡ã½ããã®è¿½å ãããã¾ãã
ã©ããæ°ããã®ãã±ã£ã¨ããããªãã£ãã®ã§ãä¸è¨URLããå®è£
ãè½ã¨ãã¦ãSDLoaderã«å
¥ãã¦ã³ã³ãã¤ã©ã¼ã«æãã¦ãããã¾ããã
ServletAPI2.5ã®Jarãã¡ã¤ã«ã3.0ã«å·®ãæ¿ããã¨ãããHttpServletRequest,HttpServletResponse,ServletContextãããããã¡ã½ããä¸è¶³ã®ã¨ã©ã¼ã«ãªãã¾ããã
ä¸è¶³åï¼3.0ã§ã®è¿½å åãã¨ãããã¨ã§ãEclipseã使ç¨ãã¦ä¸è¶³åãçæããã¨ãã«ãã£ããã£ãåã£ãã®ã§ãé ã«è¦ã¦ããã¾ãã
ServletRequest/HttpServletRequestã®è¿½å å
authenticateãlogin,logoutãããã¯ãã³ã³ããã®èªè¨¼ã¡ã«ããºã ç¨ã§ããã
authenticateã¯å¼æ°ã¯HttpServletResponseã«ãªã£ã¦ãã¦ãå¾®å¦ãªæãããã¾ãã
getPartã¯ããã«ããã¼ãã®åæ±ãã§ãããgetPartã®æ»ãå¤ã¯Partã¨ããã¤ã³ã¿ã¼ãã§ã¼ã¹ã«ãªã£ã¦ãã¾ãã
ããã«ã¯ãgetSize()ããgetName()ããgetInputStream()ããªã©ãå®ç¾©ããã¦ãã¦ãç°¡åã«ãã«ããã¼ããã¼ã¿ãåå¾ã§ãã¾ãã
Asyncã¨ã¤ãã¦ããã®ã¯ãéåæç¨ã®APIã§ããã
éåæã«ã¤ãã¦ã¯ãå¥éã¿ã¦ããããã¨æãã¾ãã
ãã¨ç´°ããã¨ããã ã¨ãgetServletContext()ã追å ã«ãªã£ã¦ã¾ããã
HttpServletResponseã®è¿½å å
ãã¾ãå¤æ´ã¯ãªãã§ãããã¬ã¹ãã³ã¹ãããã¼ã¨ã¹ãã¼ã¿ã¹ã³ã¼ãã®getterã®è¿½å ã ãã§ãã
ããããsetCompression()ã¨ãã追å ãã¦ãããæ°ããããã§ããã©ãã
ServletContextã®è¿½å å
ããªã追å ããã¦ãã¾ããaddç³»ã¯ããã°ã©ããã«ãªè¿½å ç¨APIã§ããã
createFilteãcreateServletã¨ããã®ãããã¾ãããããã¯JSR299ã®Java Contexts and Dependency Injectionï¼CDIï¼ã«å¯¾å¿ããããã®ã¡ã½ããã®ããã§ãã
ãã®ã¡ã½ããçµç±ã§ListenerãServletãçæããã¨ãDIæ¸ã¿ã®ã¤ã³ã¹ã¿ã³ã¹ãæã«å
¥ãããã§ãã
ãã¡ããaddç³»ã§Classã¯ã©ã¹ãã¯ã©ã¹åã渡ãã¦ãããããã®ã¤ã³ã¹ã¿ã³ã¹ã«DIããã¦ããã¾ãããDIæ¸ã¿ã®ã¤ã³ã¹ã¿ã³ã¹ã«ä½ãè¨å®ããã¦ããaddãããå ´åã¯ãããã使ã£ã¦ã¤ã³ã¹ã¿ã³ã¹ãåå¾ãã¦ãã¨JavaDocã«ã¯æ¸ãã¦ããã¾ãã
addç³»ã®ã¡ã½ããã«ã¯ã¯ã©ã¹åãæååãã¤ã³ã¹ã¿ã³ã¹ã®ããããã渡ãã ãããã§ãããåæãã©ã¡ã¼ã¿ããã¹ãªã©ã®å®ç¾©ã¯æ¸¡ãã¾ããã
ãããã¯ãaddç³»ã®ã¡ã½ãããå¼ã³åºããæ»ãå¤ã¨ãã¦åå¾ã§ãããRegistrationã¤ã³ã¿ã¼ãã§ã¼ã¹ã®ã¤ã³ã¹ã¿ã³ã¹ã«å¯¾ãã¦ã»ãããã¾ãã
ä¾ãã°addServletãå¼ã¶ã¨ãæ»ãå¤ã¨ãã¦ServletRegistration.Dynamicãè¿ã£ã¦ãã¾ãã
ãã®ã¤ã³ã¿ã¼ãã§ã¼ã¹ã«ã¯ãaddMapping()ãããsetInitParameter()ããªã©ãå®ç¾©ããã¦ããããããã使ã£ã¦å®ç¾©ãè¡ãã¾ãã
declareRoles()ã¯ããã¼ã«ã®å®ç¾©ã§ããã
SessionTrackingç³»ã¨ãã¦ãgetDefaultSessionTrackingModes(),getEffectiveSessionTrackingModes(),setSessionTrackingModes()ã追å ããã¦ãã¾ãã
SessionTrackingModeã¯ãCOOKIEããSSLããURLãã®3種é¡ããããããã¯SessionTrackingModeã¨ããEnumã«å®ç¾©ããã¦ãã¾ãã
SessionTrackingModeãéä¸ã§ã»ããããã±ã¼ã¹ãã¡ãã£ã¨åãããªã®ã§ã使ãã©ãããé£ããã¨æãã¾ãã
getEffectiveMajorVersion()ã¨getEffectiveMinorVersion()ã¯ãããããServletAPIã®ã¡ã¸ã£ã¼ãã¼ã¸ã§ã³ã¨ãã¤ãã¼ãã¼ã¸ã§ã³ãè¿ãã¾ãã
以åããããgetMajorVersion()ã¨getMinorVersion()ã¨ä½ãéãã®ãã¨è¨ãã¨ãåè
ãã¢ããªã±ã¼ã·ã§ã³ãåä½åæã¨ãã¦ããServletAPIã®ãã¼ã¸ã§ã³ï¼ã¤ã¾ãweb.xmlãã©ã®ãã¼ã¸ã§ã³ã§æ¸ããã¦ãããï¼ãè¿ãã®ã«å¯¾ãã¦ãå¾è
ã¯Servletã³ã³ããèªä½ããµãã¼ããã¦ããServletAPIã®ãã¼ã¸ã§ã³ãè¿ããã¨ãããã¨ã®ããã§ãã
ãã¬ã¼ã ã¯ã¼ã¯ãä½ãã¨ãã«ã¯ä½¿ãããã®ããããã¾ããã
getJspConfigDescriptor()ã¯ãweb.xmlã®
getFilterRegistration()ã¨getServletRegistration()ã¯ãFilterã¨Servletã®ç»é²ç¶æ³ãåå¾ã§ããã¡ã½ãããªã£ã¦ãã¾ãã
web.xmlã®å®ç¾©ã¨ãããã°ã©ããã«ã«è¿½å ããFilter/Servletãã©ããããããã³ã°ã«ãªã£ã¦ããããåå¾ã§ãã¾ãã
èµ·åæã«ãããã³ã°ããã°ã«åºãã¨ããããããç¨éã«ã¯ä½¿ãããã§ãã
getSessionCookieConfig()ã¯ãã»ãã·ã§ã³ãã¼ãã«å©ç¨ããCookieã®ç´°ããæ å ±ï¼ã¯ããã¼åã¨ãããã¹ã¨ãï¼ãåå¾åºæ¥ã¾ãã
setInitParameter()ã¯ãåæãã©ã¡ã¼ã¿ã®è¿½å ã¡ã½ããã§ãããã®ã¡ã½ããã¯ãæ»ãå¤ãbooleanã«ãªã£ã¦ãããã»ããã«å¤±æããã¨falseãè¿ã£ã¦æ¥ã¾ãã
ãæ¢ã«ååã®ãã©ã¡ã¼ã¿ãã»ãããã¦ãã£ãå ´åã¯å¤±æãããã¨JavaDocã«æ¸ãã¦ããã®ã§ãã©ããããã©ã¡ã¼ã¿ã®ä¸æ¸ãã¯åºæ¥ãªãããã§ãã
ææ
ãã£ã¨ä»æ§ãFixããé 次3.0対å¿ã®ã³ã³ãããåºã¦ããã¨æãã¾ããä»åã¯ç¹ã«ã¢ããã¼ã·ã§ã³ã®å¦çãå¢ãã¦ããã®ã§ãã³ã³ããã®ä½è
ã¯çãã大å¤ã ã¨æãã¾ãã
SDLoaderããã¾ãã¼ã¡ã¼ã¡ããã¾ããå°ãªãã¨ãããã«åºã¦ããã¡ã½ãããããã¯å¯¾å¿ãããã§ããã