Lincoln Baxter III

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 1,275 total)
  • Author
  • in reply to: URL Params from action method #27452


    To do this, you’ll need to create a “mapped query-parameter” in your pretty-config.xml file (or your class configuration if you are using annotations.)

    <url-mapping id="store"> 
       <pattern value="/store/" /> 
       <view-id value="/faces/shop/store.jsf" />
       <query-param name="section"> #{bean.section} </query-param>

    Then you just need to set the value of the bean before navigating to the page:

    public String onCommandButton() {
       return "pretty:store";

    PrettyFaces will extract the parameter value and use it when creating the URL.

    I hope this helps.

    in reply to: rewrite-annotations-impl included twice #27447

    Rewrite version 3.4.0.Final has been released and includes this fix.

    Hi There,

    I believe your issue is related to the fact that you are likely using the JSF Page Navigation system — You need to issue a page redirect in order to change the URL after navigation using the language picker you’ve implemented.

    This page has a good explanation of the difference between Forward (the default) and Redirect (what you need).

    Hope this helps.

    Additionally, consider using Rewrite (the library PrettyFaces is built on) for internationalization:


    in reply to: 301 permanent Redirect #27285

    Without too much commentary from me on why your code didn’t work, I’ll just say that can’t run code after you return from a function. Just assign the builder you are already using to a variable named “builder”. This should fix your code:

    public Configuration getConfiguration(final ServletContext context) {
           ConfigurationBuilder builder = ConfigurationBuilder.begin()     
            for (Map.Entry pair : linkName.entrySet()) {
            return builder;
    in reply to: 301 permanent Redirect #27280

    Just iterate like you normally would, and call the builder.addRule() method from within your loop:

    loop ( over stuff )
    in reply to: Rewrite Websphere configuration #27269

    Hm. Good question. This is the first I’ve heard of trouble since that screenshot was created.

    Have you configured your web.xml?

    in reply to: 301 permanent Redirect #27255

    Sure, absolutely:

    Map<String, String> urlMap = ...
    for( String oldPath : oldPaths )

    Or however you want to implement the loop. Remember you can use {params} to simplify many mappings if your URL structure has patterns and repetition.

    in reply to: 301 permanent Redirect #27252

    Hi Banifou,

    Try something like:

    in reply to: Rewrite Rules when using with ADF/Webcenter #27031

    Hi Siddharth,

    Without seeing what is in your view.PrettyFacesAdfProcessor, I can’t really suggest what your problem might be. There could be a bug in that. However, for the type of large-scale configuration you are using, I would recommend using Rewrite directly (PrettyFaces is a configuration extension for Rewrite):

    An example rule that would do what you want:



    in reply to: Multiple rewrite url value from database #27028

    Christian is right, you probably want to either trigger a purge of the the ServletContext configuration cache:

    context.put(ServletContextConfigurationCacheProvider.class.getName() + "_cachedConfig", null)

    Or… you can implement your own HttpConfigurationCacheProvider and register it as documented here:

    (Just make sure the priority is set to a lower number than the existing ServletContext cache provider’s priority (to override it.)

    However, in order for this to work, you will also need to disable the ServletContext cache entirely:



    in reply to: Cannot forward after response has been committed #27006

    I’m a glassfish noob and eclipse isn’t letting me actually set up a GlassFish server, so I may not get to try this soon. Will need to revisit.

    in reply to: Cannot forward after response has been committed #27005

    I see another problem with your rule. Currently it will match on ALL urls, and “excluded” will always be empty. The reason is this:


    The problem here is that the above regex is always going to be 0-width, (because the lookahead is zero width, and the regular expression has no character groups.) It should probably be:


    But this leads to another problem, where I think that will cause “excluded” to match more than what you want. In reality, I think you are trying to improperly use two parameters to match one thing. That won’t work. You should just do this all with the parameter for “url”.

    ConfigurationBuilder config = ConfigurationBuilder.begin();
             .perform("/123/123/test?url={url}" ) )

    I am about to try this myself.

    in reply to: Cannot forward after response has been committed #27003

    I was trying to figure out what might cause this problem last night, but I have to admit that I don’t really understand what happened. Could you perhaps upload a sample application that reproduces this so that I can see what is going on?

    Is this a problem with Rewrite that is incompatible with GlassFish? Or was there an error encountered during servlet processing (after rewrite forwarded, then rewrite triggered again on the error dispatch.)

    I think this configuration might solve your problem (and allow you to keep your web.xml error config.)

    ConfigurationBuilder config = ConfigurationBuilder.begin();
             .perform("/123/123/test?url={url}" ) )

    Note the exclusion of the ERROR dispatch type:


    Let me know if this works. Thanks!

    in reply to: The value of required parameter [page] was null. #26997

    What I see wrong with the regex is this:

              ^           ^

    Because the regex is going to get compiled into a larger regular expression for the entire path, you can’t use start & end matches in the regex. You could either remove them (they aren’t necessary) To be honest I think you just want to use .* based on what I see your pattern does (matches / and anything any number of times).

    Or you could remove the leading slash in your Join path:


    That might work as well.

    in reply to: The value of required parameter [page] was null. #26996

    Is that right? It matches the encoded URL? Are you sure?

Viewing 15 posts - 1 through 15 (of 1,275 total)

« Previous Entries