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

  • Home
  • SEARCH
  • 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

Ask A Question

Stats

  • Questions 333k
  • Answers 333k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The best thing I can suggest would be to use… May 14, 2026 at 3:14 am
  • Editorial Team
    Editorial Team added an answer This MSDN article explains the operation of the message queueing… May 14, 2026 at 3:14 am
  • Editorial Team
    Editorial Team added an answer In general you should separate the "guess the missing parameters"… May 14, 2026 at 3:14 am

Related Questions

I haven't been able to figure out how to deploy multiple grails applications with
I'm a full time Java developer of around 4 years, professionally. I'm a GWT
Per an answer to a previous question (answer here: SQL/Database Views in Grails ),
I am a newbie in Grails and I am struggling with many simple issues.
I have been using Grails for the past few months and I really like

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.