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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T09:14:37+00:00 2026-06-01T09:14:37+00:00

I have multiple filters in my application, with one at the root. <filter> <filter-name>root</filter-name>

  • 0

I have multiple filters in my application, with one at the root.

<filter>
    <filter-name>root</filter-name>
    <filter-class>
        my.own.classpath.RootFilter
    </filter-class>
</filter>

<filter>
    <filter-name>root</filter-name>
    <filter-class>
        my.own.classpath.SubFilter
    </filter-class>
</filter>

<filter-mapping>
    <filter-name>root</filter-name>
    <url-pattern>/</url-pattern>
</filter-mapping>

<filter-mapping>
    <filter-name>sub</filter-name>
    <url-pattern>/sub/*</url-pattern>
</filter-mapping>

In Scalatra 2.0.0 this worked fine. If RootFilter (which extends ScalatraFilter) had a binding for a url it would handle it, otherwise it would pass on to the other filters. However, in later versions of Scalatra it does not work the same. When I supply a url handled by SubFilter, the correct filter is still called, but the resulting text is not displayed. Instead, a blank page (with no HTML) is returned.

Is this a bug in Scalatra, or am I doing something wrong?

  • 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-06-01T09:14:38+00:00Added an answer on June 1, 2026 at 9:14 am

    I’m not sure, Scalatra does not move at Java pace, so things change.

    Here’s an a snippet from the Scalatra Book v2.0 on ScalatraServlet vs. ScalatraFilter; there may be some clue here as to where the problem lies, particularly in regard to Not Found and ScalatraFilter delegating to the next filter in the chain (in your case, there is no next filter after sub)

    The main difference is the default behavior when a route is not found.
    A ScalatraFilter will delegate to the next filter or servlet in the
    chain (as configured by web.xml), whereas a ScalatraServlet will
    return a 404 response.

    Another difference is that ScalatraFilter matches routes relative to
    the WAR’s context path. ScalatraServlet matches routes relative to the
    servlet path. This allows you to mount multiple servlets under in
    different namespaces in the same WAR.

    Use ScalatraFilter if:

    You are migrating a legacy application inside the same URL space
    You want to serve static content from the WAR rather than a dedicated web server    
    

    Use ScalatraServlet if:

    You want to match routes with a prefix deeper than the context path.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a django model as following class Project(models.Model) name=models.CharField(max_length=200) class Application(models.Model) proj=models.ForeignKey(Project, null=True,
We have multiple log files like database log, weblog, quartzlog in our application. Any
I want to filter and search through Json using multiple keywords. I have it
I have a pretty simple JSP/Servlet 3.0/Spring MVC 3.1 application. On one of my
in my application, I have a User model. Each user can have multiple (email)
I have a web application with lots of data, and a search/filter function with
Within my application, I have a set of filters that can be applied when
I have a RESTful web application that supports multiple sort fields on a collection
Here is the scenario: We have multiple clients,dealers and staff in our application. this
I want to have multiple launcher icons for my application. I can get this

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.