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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T15:54:04+00:00 2026-06-18T15:54:04+00:00

I have a nice restlet application whose component attaches the following: cmp.getDefaultHost().attach(/mycmd,ProcessReq.class); And when

  • 0

I have a nice restlet application whose component attaches the following:

      cmp.getDefaultHost().attach("/mycmd",ProcessReq.class);

And when the request URL is http: //<my-host>/mycmd/, the ProcessReq class returns an index.html that has links to other pages. These pages are in the same directory as index.html, and are referenced in my index.html as relative pages like in the example below:

<a href="otherpage.html">Other Page</a>

What I am finding, however, is that users tend to expect to use a URL without the trailing “/”, for example: http: //<my-host>/mycmd . Unfortunately, when they do that, all links to the relative pages get screwed up.

When you use http: //<my-host>/mycmd/ to display index.html, then click on the “Other Page” link, the browser (correctly) goes to http: //<my-host>/mycmd/otherhost.html. Unfortunately, when you do http: //<my-host>/mycmd (without the trailing slash), the link to Other Page sends the browser to http: //<my-host>/otherpage.html, which of course returns a 404 error.

I have searched the Internet and discovered that the Restlet libraries have been designed to require a trailing slash after the kinds of URLs I am doing by default. Requiring that, however, will drive my users crazy.

Is there some way to configure or manipulate the request (or response) so that I can send this type of URL request without requiring a trailing slash, and have the relative links in the returned page point to the correct place?

Someone please advise…

  • 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-18T15:54:05+00:00Added an answer on June 18, 2026 at 3:54 pm

    The solution I would recommend is to automatically redirect the client browser to the URI with a slash if the user forgets to type it. Therefore, you relative URIs will stay simple.

    Otherwise, you need to add the directory name again to each relative URI such as “mycmd/otherhost.html”

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

Sidebar

Related Questions

I am working for Qr generator application and for that I have nice kyupay
I want to replace some headers by images, so I would have nice font.For
have a nice day. I got problem when trying to create an image from
Have a nice day everyone, I have something to ask your hel, to better
I have a nice dataset loop working, but I need to run another loop
I have a nice question about the loop-expression of a for-loop in C#. I
I have a nice clean domain layer in my app that was developed in
I have a nice DataGridView showing what is basically some kind of log data
I have a nice page that does everything I need. However one of the
I have this nice little MSBuild-based daily build setup that I use on my

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.