Something like this:
ForwardAction faction = new ContextRedirectForwardAction("some/relative/url", false);
ForwardAction myController(RequestContext context){ // Do something if needed // Notify the flow that you would like a redirect return ContextRedirectForwardAction("/some/url.html", false);}
Does anyone konw how to write the relative URL, if i want to forward from a.page to b.page?
Usually $URL_PREFIX/sites/site-name/some/path/my.page tends to do it. That doesn't work for you?
// myController is included in a component on a.pageForwardAction myController(RequestContext context){ // Do something if needed // context redirect return ContextRedirectForwardAction("$URL_PREFIX/sites/appname/b.page", false);}
It doesn't work. I got 404 error: HTTP 404 Not Found // myController is included in a component on a.pageForwardAction myController(RequestContext context){// Do something if needed// context redirectreturn ContextRedirectForwardAction("$URL_PREFIX/sites/appname/b.page", false);}
// myController is included in a component on a.pageForwardAction myController(RequestContext context){// Do something if needed// context redirectreturn ContextRedirectForwardAction("$URL_PREFIX/sites/appname/b.page", false);}
Don't you need *new* in that return statement? Try with that. Also try URLRedirectForwardAction for redirects from one .page to another.
RequestDispatcher rd = context.getRequest().getRequestDispatcher("home.page");rd.forward(context.getRequest(), context.getResponse());
sorry, it did have "new". and I tried URLRedirectForwardAction, the redirect is working. But I want to forward, so that i can keep the parameters in the request and pass them to next page, one of my bussiness logic need two pages have the same request. Like: RequestDispatcher rd = context.getRequest().getRequestDispatcher("home.page");rd.forward(context.getRequest(), context.getResponse());
Ok if you want to forward from one page to another in this case then you don't need the URL_PREFIX.This works just fine for me: [color=#7f0055]new[/color] ContextRedirectForwardAction("/sites/site-name/some/path/my.page", [color=#7f0055]false[/color]);If it is not working you then I would say increase your logging and use some additional tool to interrogate your request -- firefox has quite a few extensions that allow you to do some of that.
new ContextRedirectForwardAction("/sites/site-name/some/path/my.page", false);
There are some positive change. 404 error is gone, but the source code of "my.page" (the original xml format) is displayed in the browser, not the html output transformed by LiveSite.
Is happening on the TS Preview side or on the LS Runtime end?
There are some positive change. 404 error is gone, but the source code of "my.page" (the original xml format) is displayed in the browser, not the html output transformed by LiveSite. My LiveSite Runtime is version 3.1, do you have any idea?
This seems to be a misconfigration or some custom change that is interfering with livesite. Have you made any custom filter/mapping changes? What is listening on port 80?
Did anybody find a way to forward a request so the URL stays the same?