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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T16:57:33+00:00 2026-06-16T16:57:33+00:00

I want to use a normal spring mvc controler and request mapping using path

  • 0

I want to use a normal spring mvc controler and request mapping using path variables.

I do not want to forward or redirect, just change the string that user sees.

@RequestMapping(value = "/Foo/{id}/*", method = RequestMethod.GET)
public ModelAndView getFoo(@PathVariable final String friendlyUrl) {
//how can I rewite the url that user sees ?
}

(the same behaviour as when you change the title of an existing question on stackoverflow)

  • 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-16T16:57:34+00:00Added an answer on June 16, 2026 at 4:57 pm

    If you watch the traffic in wireshark, firebug or something you see, that stackoverflow sends a HTTP 301 Moved Permanently to the final URL.
    You could do the same.

    For this you need the HttpServletResponse, you can add it to the method signature to get it injected.
    Set the permanent redirect:

    String rightUrl = urlCompleter.complete(friendlyUrl);
    response.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY);
    response.setHeader("Location", rightUrl);
    

    Where you need to implement urlCompleter on your own, eg. look in the database table of entries and locate the right url component.

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

Sidebar

Related Questions

I want to use a MVC HtmlHelper similar to LabelFor. When using reflector on
I want to use a particular string found in the Values folder into normal
I have normal sqlite database and want to use fts3. As mentioned in http://www.sqlite.org/fts3.html
I want use this 1 for using Bar code or QR code scanner. I
Just some architectural question: I use ASP.net MVC and exclusively rely on Strongly-Typed Views
I am currently trying to use HandlerExceptionResolver for exception handling in a Spring MVC
i want to store some data in my neo4j database. i use spring-data-neo4j for
I have question,I want to redirect page using javascript which the code is to
I cannot find find FragmentPagerAdapter within Android.App. I do not want to use the
I'm using OpenCV 2.3.2 library downloaded from OpenCV trunk. I want to use setOpenGlDrawCallback

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.