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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:31:41+00:00 2026-06-16T00:31:41+00:00

Using Restlet 2.1 for Java EE, I am discovering an interesting problem with its

  • 0

Using Restlet 2.1 for Java EE, I am discovering an interesting problem with its ability to handle attributes.

Suppose you have code like the following:

cmp.getDefaultHost().attach("/testpath/{attr}",SomeServerResource.class);

and on your browser you provide the following URL:

http://localhost:8100/testpath/command

then, of course, the attr attribute gets set to “command”.

Unfortunately, suppose you want the attribute to be something like command/test, as in the following URL:

http://localhost:8100/testpath/command/test

or if you want to dynamically add things with different levels, like:

http://localhost:800/testpath/command/test/subsystems/network/security

in both cases the attr attribute is still set to “command”!

Is there some way in a restlet application to make an attribute that can retain the “slash”, so that one can, for example, make the attr attribute be set to “command/test”? I would like to be able to just grab everything after testpath and have the entire string be the attribute.

Is this possible? 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-16T00:31:41+00:00Added an answer on June 16, 2026 at 12:31 am

    For the same case I usually change the type of the variable :

    Route route = cmp.getDefaultHost().attach("/testpath/{attr}",SomeServerResource.class);
    route.getTemplate().getVariables().get("attr") = new Variable(Variable.TYPE_URI_PATH);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using Restlet I have created a router for my Java application. From using curl,
I am using RESTlet and I have created a resource. I handle POST by
I have developed WebService using Restlet API in Java for iPhone/iPad devices. Our server
I have deployed our Restlet services to a Jetty Java Application server using the
Using restlet, I want to make a post to android's c2dm service. I have
I need to put following rest request using restlet client: GET https://www.xyz.com/resource/blah/ Authorization: Bearer
Where can I embed startup initialization code in a Restlet web application, without using
I'm trying to develop a webapp with Restlet and I have a little problem
Currently we have a Java Restlet API with dependencies controlled via Maven. When we
I am currently working on a small project using RESTlet on Google App Engine/Java.

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.