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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T16:11:30+00:00 2026-06-10T16:11:30+00:00

When the user of my application creates a new page, she is asked to

  • 0

When the user of my application creates a new page, she is asked to enter a ‘Page Title’ among other details. (e.g. she entered: “Page Title by Megan”)
The application saves the instance into db.

Now my requirement is that when anyone tries to access that page, the URL should be like:

http://www.websitename.com/pages/page-title-by-megan

I understand that with Spring MVC I can easily get the part “page-title-by-megan” by using something like:

@RequestMapping("/pages/{pageTitle}")
public String getPage(@PathVariable String pageTitle, Model model) {
    List<Pages> pages = pageService.getPages(pageTitle);
    model.addAttribute("pages", pages);
    return "pages";
}

But the problem is

Q1: To retrieve the relevant page, I need to store pageTitle “page-title-by-megan” along with the actual data in the DB? Is that the only trick to do this? Or there’s a better way?

Q2: If that’s the only way, how to effectively form a string like “page-title-by-megan” from “Page Title by Megan”? Again, is there a better approach?

Kindly guide. I would be very thankful.

  • 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-10T16:11:32+00:00Added an answer on June 10, 2026 at 4:11 pm

    Q1:
    I think the only way is to store url to database as you said, with a unique restriction.

    Q2:
    Assuming pageTitle contains the title entered by user, use this in your controller when submit is done:

    String transformedPageTitle = pageTitle.toLowerCase().replace(" ", "-");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have written insert query for my application to create new user with password,
I am creating an ASPX application that collects data from the user can creates
I have a basic application with a user model. When the user creates an
I'm using devise in my rails 3.2 application. I have a users/new page where
I've an application where a user creates events. The user need to retrieve a
In VS 2010 the ASP.Net Web Application template creates a master page with two
In my application user can create post,however only the creator of the post can
Currently I have this code var App = Ember.Application.create(); App.user = Ember.Object.create({ people: customers
i have created an application which show data from user current location. I want
I have created an application that uses settings.settings to store some user specific settings

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.