How can I run a servlet (UploadAction from GWTUpload project) under grails? I’ve successfully added the servlet and use it from the web.xml file. However, I really want to wrap some logic around the doPost/doGet methods using the grails framework (gorm).
Can I just subclass the servlet as a Controller, maybe just instantiate the servlet in the controller and call init()? I’m not sure how to do this properly.
The simplest thing that comes to my mind is:
UrlMappings.groovy) to the url that your servlet would be mappedservlet.service(request, response).It’s a bit of a hack though. Another way is to get ahold of a spring (grails) bean in a filter applied to the servlet, with
WebApplicationContextUtils.getRequiredWebApplicationContext(getServletContext())and invoke the custom logic there.