Request isn't Redirecting

Splash Forums Rewrite Users Request isn't Redirecting

This topic contains 3 replies, has 3 voices, and was last updated by  Lincoln Baxter III 8 years ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #25655


    Hello All,

    I am facing an issue with redirecting my request. I’m having an URL req:

    <a href="/12/12/tutorial/java"> Tutorial </a>

    So when this anchor is clicked the Request should invoke a Servlet “/MyServlet” ,
    which after some processing forwards the request to a JSP using RequestDispatcher.

    My URL Rewrite is:

         .perform(Log.message(Level.INFO,"Config File Loaded...."))    

    but when I’m clicking on the anchor I get a 404 Error stating that the Request Resource could not be found..
    Note: The config file is loaded as the Log msg “Config File Loaded….” gets printed.

    Can someone plz tell me where am I making the error .

    • This topic was modified 8 years ago by  rahulsoni.
    • This topic was modified 8 years ago by  rahulsoni.


    you cannot use regular expressions within the path. You will have to use a parameter instead. Something like this:


    If you are not interested in the value of something, you can also use:


    Please also note, that you may have to add the context path to your link if you are not deploying to the root context path of your app server:

    <a href="/myapp/12/12/tutorial/java"> Tutorial </a>


    Thanx Christain Sir,

    I don’t get the last point , why we have to add the context path to our link ?????

    When I tried <a href="/clickme"> Tutorial </a> with URL-Rewrite: .addRule(Join.path("/clickme").to("/My_home.jsp"))
    It never worked.

    But when I tried <a href="/My_App/clickme"> Tutorial </a> with same URL-Rewrite, it WORKED.

    And when I put my APP name in the URL it gets appended to the localhost (as I’m deploying it locally now).
    So when I’ll deploy my app on the web,
    my APP’s name will always be appended to the domain name like: Is it so ??????

    If yes, then How can I get rid of my APP name after my Domain name ????


    To prevent the Application Context-Root from displaying in the URL, your application must be deployed as the “ROOT” context. Typically this can be done by renaming the .war file to ROOT.war; however, some application servers require XML configuration to enable or set the ROOT context. This is different for each application server.

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

The forum ‘Rewrite Users’ is closed to new topics and replies.

Comments are closed.