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 616941
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T18:22:52+00:00 2026-05-13T18:22:52+00:00

How can you have a grails application as well as other servlets defined in

  • 0

How can you have a grails application as well as other servlets defined in your web.xml?

I want to have it so that some url patterns are handled by a servlet while all others are handled by Sitemesh/grails.

The default configuration of web.xml generated by grails is:

<filter-mapping>
    <filter-name>charEncodingFilter</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
    <filter-name>grailsWebRequest</filter-name>
    <url-pattern>/*</url-pattern>
    <dispatcher>FORWARD</dispatcher>
    <dispatcher>REQUEST</dispatcher>
</filter-mapping>
<filter-mapping>
    <filter-name>sitemesh</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
    <filter-name>urlMapping</filter-name>
    <url-pattern>/*</url-pattern>
    <dispatcher>FORWARD</dispatcher>
    <dispatcher>REQUEST</dispatcher>
</filter-mapping>

<servlet>
    <servlet-name>grails</servlet-name>
    <servlet-class>org.codehaus.groovy.grails.web.servlet.GrailsDispatcherServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>

I then added the configuration to web.xml for my 2nd servlet:

<servlet>
    <servlet-name>Tracepoints</servlet-name>
    <servlet-class>com.mydomain.Tracepoints</servlet-class>
    <init-param>
        <param-name>hostName</param-name>
        <param-value>http://www.mydomain.com/</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>Tracepoints</servlet-name>
    <url-pattern>*.tpoints</url-pattern>
</servlet-mapping>

But the above doesn’t allow me to access my non grails servlet (with the url: domain.com/hello.tpoints) and trying it gets me a 404. I do know that the servlet’s class files are deployed with the war because they exist in WEB-INF/classes directory.

  • 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-13T18:22:52+00:00Added an answer on May 13, 2026 at 6:22 pm

    You need to give the Grails servlet a more specific url-pattern in the mapping, e.g. /grails/* or *.grails or so (you’re free to choose), so that only the URL’s matching those patterns invokes the Grails servlet.

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

Sidebar

Related Questions

i have some Orders that can have several Items and these Items have an
Here is the scenario. I have an file outside of my Grails application that
I have developed a grails application that stores a great deal of information. Currently,
I have some controllers in my grails application:- LoginController LogoutController SearchableController cirnele.SearchAllController com.ten.cirnelle.domain.CustomerController com.ten.cirnelle.domain.ProjectController
I have a grails application that attempts to use OpenID4Java to authenticate with our
I already have an grails web application, And our project need CAS, however I
I have an existing grails application that uses spring-security plugin for authentication. I would
I have a Grails application that needs to parse Dates out of strings that
I have a question about a grails application. I have a controller that does
I have a Grails-application that sends emails. The mailserver has no SMTP-authentication, so it

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.