Parameters not preseverd:

Splash Forums Rewrite Users Parameters not preseverd:

This topic contains 4 replies, has 3 voices, and was last updated by  Christian Kaltepoth 2 years, 5 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #25957

    Roland
    Participant

    Why are the params “organization” not preserved here?

    
    @Override
    public Configuration getConfiguration(ServletContext context)
    {
     
        return ConfigurationBuilder.begin()
    
            .addRule()
            .when(Direction.isInbound().and(Response.isCommitted()))
            .perform(Lifecycle.abort())
            
             .addRule()
            .when(Domain.matches("{organization}.{domain}.{toplevelname}")) 
            .perform(Log.message(Level.TRACE, "organization = {organization}"))
            .where("domain").matches(".*");
            
    }
    
    #25958

    What do you mean with “preserved”. Doesn’t it show up in the log?

    #25959

    Roland
    Participant

    preserved as that it becomes a query parameter as you described in your last answer to me. {variable} should become automagically request parameters right??

    #25961

    No, that’s not entirely correct; Request parameter binding is not automatic in most cases. In order for that to be the case, you need to bind these parameters to the request map using the RequestBinding object.

    
            .addRule()
            .when(Domain.matches("{organization}.{domain}.{toplevelname}")) 
            .perform(Log.message(Level.TRACE, "organization = {organization}"))
            .where("domain").matches(".*")
    
            .bindsTo(RequestBinding.parameter("domain"))
    
    #25963

    AFAIK only Join (and Path?) do the binding to a request parameter automatically. For all other cases, you will have to do this manually like Lincoln pointed out.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.

Comments are closed.