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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:02:15+00:00 2026-05-22T15:02:15+00:00

I have a spring app with one servlet that has url-mapping of *.html. Everything

  • 0

I have a spring app with one servlet that has url-mapping of *.html. Everything is working great with my annotated controllers.

My question is how can I setup my servlet and annotated mappings to mimic the urls like StackOverflow?

I would like to go to a no extension url and if possible add a description after the final /.

Example:

I currently have:

/appName/parm1/parm2/pageName.html

I would like to have

/appName/parm1/parm2/pageName/description

Is this possible and what do I need to do to my annotated controllers?

Thanks

  • 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-22T15:02:16+00:00Added an answer on May 22, 2026 at 3:02 pm

    You should be able to map the dispatcher servlet to /* or something like that, and then use @PathVariables to get the needed information from the URI. Have a look at http://static.springsource.org/spring/docs/current/spring-framework-reference/html/mvc.html and search for @PathVariable. Here’s an example from that page

    @RequestMapping(value="/owners/{ownerId}/pets/{petId}", method=RequestMethod.GET)
    public String findPet(@PathVariable String ownerId, @PathVariable String petId, Model model) {
      Owner owner = ownerService.findOwner(ownerId);  
      Pet pet = owner.getPet(petId);  
      model.addAttribute("pet", pet);  
      return "displayPet"; 
    }
    

    which reads the ownerId and the petId from the request uri.

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

Sidebar

Related Questions

We have a (non-web app) Spring application that throws a NoSuchBeanDefinitionException when running tests
We have a Spring application that uses Apache DBCP for connection pooling. Our app
I recently switched one of my static html files to a Spring controller that
I have a Spring MVC/3.0 app using tiles as it's view, this is working
I have a Spring MVC app where I am using a singleton bean that
We have a Hibernate/Spring application that have the following Spring beans: <bean id=transactionManager class=org.springframework.orm.hibernate3.HibernateTransactionManager
I have a JSP that is using Spring:form tags to bind controls to a
I'm building a JSF+Facelets web app, one piece of which is a method that
I have a web app consisting of some JSPs that were previously running on
I've got an app in Google App Engine that was working fine. I realized

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.