Hi all I have a startlink on a test page, when user trigger that link, i want to redirect to another startlink in other project (because in that project we have to hide all startlink). I saw we can use

FacesContext.getCurrentInstance().getExternalContext().redirect("startlink url");

but in case i don't open any HtmlDialog, FacesContext will not exist. Is there any other ivy API could help me? for the moment, i need to open new HTML dialog then when i click to button, it will redirect to other page by FacesContext.

Thanks

asked 21.10.2016 at 04:08

trungdv's gravatar image

trungdv
(suspended)
accept rate: 52%


You can access the ivy response, cast it manually and then send the redirect:

import ch.ivyteam.ivy.environment.Ivy;
import ch.ivyteam.ivy.request.IHttpResponse;

public class RequestUtil {
    public static void redirect(String uri) throws java.io.IOException{
        IHttpResponse httpResponse = (IHttpResponse)Ivy.response();
        httpResponse.sendRedirect(uri);
    }
}
link

answered 24.10.2016 at 10:05

Reguel%20Wermelinger's gravatar image

Reguel Werme... ♦♦
9.4k31958
accept rate: 70%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×35

Asked: 21.10.2016 at 04:08

Seen: 7,776 times

Last updated: 24.10.2016 at 10:05