Created
November 8, 2010 19:05
-
-
Save hakunin/668105 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| def execute(e:RequestEvent) | |
| puts "I am #{self}" | |
| self.action = e.peek | |
| puts "I am #{self}" | |
| self.params = e | |
| this = self | |
| begin | |
| before_action() | |
| not_found = true | |
| getClass().getDeclaredMethods.each { |method| | |
| if method.getName().equals(action) | |
| not_found = false | |
| e.action #remove the action from url | |
| puts "WILL INVOKE #{method} #{method.getName} on #{self}" | |
| e.content = String.valueOf(method.invoke(this, null)) | |
| end | |
| } | |
| if not_found | |
| e.content = String.valueOf(index()) | |
| end | |
| after_action() | |
| rescue ClientException => ex | |
| reply_error(ex.message) | |
| return | |
| rescue EarlyResponse => ex | |
| null | |
| rescue InvocationTargetException => ex | |
| #puts "INVOCATION TARGET" | |
| if ex.getCause.getClass.getName.equals('dubious.ClientException') | |
| reply_error(ClientException(ex.getCause).message) | |
| null | |
| elsif ex.getCause.getClass.getName.endsWith('EarlyResponse') | |
| else | |
| display_exception(ex.getCause) | |
| null | |
| end | |
| rescue Exception => ex | |
| #puts "ANY EXCEPTION" | |
| cause = ex.getCause | |
| display_exception(ex) | |
| end | |
| return | |
| end | |
| def doGet(request, response) | |
| @page_title = "Doluj.cz" | |
| #request.setCharacterEncoding('UTF-16'); | |
| response.setContentType("text/html; charset=UTF-8") | |
| self.params = RequestEvent.new(request, response) | |
| puts "doGet() on #{self}" | |
| puts "params is #{self.params}" | |
| execute(params) | |
| if params.redirected | |
| response.setStatus(303) | |
| response.setHeader('Location', params.redirected_to) | |
| null | |
| else | |
| params.output | |
| null | |
| end | |
| null | |
| end |
This file contains hidden or 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
| doGet() on controllers.SiteController@176086d | |
| params is dubious.RequestEvent@234265 | |
| I am null | |
| 8.11.2010 19:02:38 com.google.apphosting.utils.jetty.JettyLogger warn | |
| WARNING: / | |
| java.lang.NullPointerException | |
| at dubious.Controller.execute(controller.duby:117) | |
| at dubious.Controller.doGet(controller.duby:173) | |
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:693) | |
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:806) | |
| at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511) | |
| at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166) | |
| at com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:51) | |
| at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) | |
| at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43) | |
| at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) | |
| at com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:122) | |
| at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) | |
| at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388) | |
| at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) | |
| at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) | |
| at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) | |
| at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418) | |
| at com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:70) | |
| at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) | |
| at com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:349) | |
| at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) | |
| at org.mortbay.jetty.Server.handle(Server.java:326) | |
| at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) | |
| at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923) | |
| at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547) | |
| at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212) | |
| at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) | |
| at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409) | |
| at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment