Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6758191
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:45:04+00:00 2026-05-26T13:45:04+00:00

How can I run a servlet (UploadAction from GWTUpload project) under grails? I’ve successfully

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T13:45:04+00:00Added an answer on May 26, 2026 at 1:45 pm

    The simplest thing that comes to my mind is:

    • write a grails controller, instantiate the servlet (once, in the contstructor or in @PostConstruct) and call init()`
    • map the controller method (via UrlMappings.groovy) to the url that your servlet would be mapped
    • call servlet.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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to run two Servlet-class in a single web.xml but its not
I can't get my Junit tests to run from my build.xml script. I feel
In Informix I can run SQL statement that use other database: INSERT INTO other_db:mytable
I've developed a web application using servlet and tomcat. When I try to use
I am trying to run a jsp page from my browser, but why can't
I am having a servlet which is reading images from database, how can i
I'm trying to write a servlet, that can upload a file from client to
Have a servlet and it can run inside TomCat. However, I am not sure
High Level Goal: Create a single Maven Web Application project that can be used
How can I configure a Tapestry5 project to run standalone (via java -jar) with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.