Created
December 16, 2011 19:23
-
-
Save metasyntax/1487521 to your computer and use it in GitHub Desktop.
Servlet Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dec 16, 2011 2:22:45 PM org.apache.catalina.core.ApplicationContext log | |
INFO: HTMLManager: start: Starting web application '/test-servlet' | |
Dec 16, 2011 2:22:45 PM org.apache.catalina.core.ApplicationContext log | |
INFO: HTMLManager: list: Listing contexts for virtual host 'localhost' | |
Dec 16, 2011 2:22:50 PM org.apache.catalina.core.ApplicationContext log | |
INFO: HTMLManager: stop: Stopping web application '/test-servlet' | |
Dec 16, 2011 2:22:50 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks | |
SEVERE: The web application [/test-servlet] created a ThreadLocal with key of type [java.lang.ThreadLocal] (value [java.lang.ThreadLocal@2c8e2a4]) and a value of type [gnu.mapping.CallContext] (value [gnu.mapping.CallContext@52977e69]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak. | |
Dec 16, 2011 2:22:50 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks | |
SEVERE: The web application [/test-servlet] created a ThreadLocal with key of type [gnu.mapping.ThreadLocation.InheritingLocation] (value [gnu.mapping.ThreadLocation$InheritingLocation@57ec49db]) and a value of type [gnu.mapping.SharedLocation] (value [gnu.mapping.SharedLocation[line-length/(dynamic)]]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak. | |
Dec 16, 2011 2:22:50 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks | |
SEVERE: The web application [/test-servlet] created a ThreadLocal with key of type [gnu.mapping.ThreadLocation.InheritingLocation] (value [gnu.mapping.ThreadLocation$InheritingLocation@59e4f5f5]) and a value of type [gnu.mapping.SharedLocation] (value [gnu.mapping.SharedLocation[line-length/(dynamic)]]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak. | |
Dec 16, 2011 2:22:50 PM org.apache.catalina.core.ApplicationContext log | |
INFO: HTMLManager: list: Listing contexts for virtual host 'localhost' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(module-name "TestServlet") | |
(module-static 'init-run) | |
(define-alias HttpServlet javax.servlet.http.HttpServlet) | |
(define-alias HttpServletRequest javax.servlet.http.HttpServletRequest) | |
(define-alias HttpServletResponse javax.servlet.http.HttpServletResponse) | |
;; Send a regular response to the client. | |
(define (send-ok req ::HttpServletRequest resp ::HttpServletResponse | |
#!key (content-type ::string "text/plain") | |
(message "OK") | |
(width ::int 0) | |
(write? ::boolean #f)) | |
(let ((output (gnu.mapping.OutPort (resp:getWriter)))) | |
(resp:setContentType content-type) | |
(resp:setStatus 200) | |
(fluid-let ((*print-right-margin* width)) | |
(if write? | |
(write message output) | |
(display message output))) | |
(force-output output))) | |
(define-class Dispatcher | |
(javax.servlet.http.HttpServlet) | |
((doGet req ::HttpServletRequest resp ::HttpServletResponse) | |
(send-ok req resp))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment