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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T09:26:11+00:00 2026-06-07T09:26:11+00:00

I have to filter urls like this : http://www.mysite.com/708e93 where 708e93 is a unique

  • 0

I have to filter urls like this :

http://www.mysite.com/708e93

where 708e93 is a unique id, based on this id i have to create dynamic pages in jsp.

Now the problem is – what do i put in url-pattern under filter-mapping

<filter-mapping>
<filter-name>foo.bar.MyFilter</filter-name>
<url-pattern> ?? </url-pattern>
</filter-mapping>

if i put root (/) in url-pattern ..every request to mysite will be filtered ,then in that case how can i get unique id ?

Any solution ?

EDIT:

I dont want to add a directory in url like this :http://www.mysite.com/dynamicpages/708e93

  • 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-07T09:26:12+00:00Added an answer on June 7, 2026 at 9:26 am

    For dynamic url’s such as use case you have. you should be have all the dynamic pages inside a directory, lets say dynamicpages folder. And you should be mapping a directory url pattern like below :

    <filter-mapping>
      <filter-name>foo.bar.MyFilter</filter-name>  
      <url-pattern>/dynmaicpages/*</url-pattern>
    </filter-mapping>
    
    <servlet-mapping>
      <servlet-name>foo.bar.MyServlet</servlet-name>  
      <url-pattern>/dynmaicpages/*</url-pattern>
    </servlet-mapping>
    

    You can get the Unique id using the following methods:

    • HttpServletRequest.getPathInfo() If you have servlet mapping like above, this will give you the unique id value directly.

    For ex, if the request uri is /dynamicpages/708e93
    it will return 708e93.

    • HttpServletRequest.getRequestURI() This will give you the entire request url. And you need to parse the unique id properly.

    For ex, if the request uri is /dynamicpages/708e93
    it will return /dynamicpages/708e93.

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

Sidebar

Related Questions

i have an asp.net-mvc site and one of the pages is http://www.mysite.com/Report users can
I have urls that look like this ~\articles\energy\topweek ~\articles\metals\latestpopular where second url string is
Consider the following list of URLs: 1 http://www.cnn.com/international/stories/423423532 2 http://www.traderscreener.com/blah 3 http://is.gd/fsdaGdfd3 4 http://goo.gl/23V534
I have some filter and one grid.And grid have some buttons like modify/edit.I am
I have to filter a text file filter.tmp containing two types of lines, this
I've seen somewhere a urls.py construct like this: from project.f import SomeClass urlpatterns =
Sometimes my application generates URLs that look like http://localhost/?Area= or http://localhost/SomeController?Area= I don't currently
Im currently using Code Igniter to have pretty URLs, and I have this system
I have multiple objects that I'd like to be accessible via human-readable URLs, so
I have a GeoDjango project that has a manager model like this; class AdvertManager(models.GeoManager):

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.