Page redirecting in jsf

Hi all
Could you please tell me how can i redirect from .jspx page to another web application.
regards
sasasa

Hi
I use the following:
FacesContext facesContext = FacesContext.getCurrentInstance();
ExternalContext externalCtx = facesContext.getExternalContext();
externalCtx.redirect( "www.google.com");
Could you pls suggest me what the problem is?
But I get "the resourse not found"
regards
sasasa
Edited by: sasasa on Jul 24, 2009 8:54 AM
Edited by: sasasa on Jul 24, 2009 8:54 AM

Similar Messages

  • Redirect in JSF

    Forum members,
    I have a question about redirecting in JSF.
    In my JSF application in the Help view page I like to redirect to different jsp pages depending in parameter passed to that page. I try different ways of redirecting with no luck any ideas.
    Tnks.

    To make your own custom tag see this articles:
    http://www-128.ibm.com/developerworks/views/java/libraryview.jsp?search_by=nonbelievers:
    in my component i have (comments in Polish ;))
    public class GuardComponent extends UIInput {
        private boolean primaryAuthorise;
        private String primaryRedirect;
        /** Creates a new instance of GuardComponent */
        public GuardComponent() {
        public void encodeBegin(FacesContext context) throws IOException {
            //pobranie wartości
            setPrimaryAuthorise(((Boolean) getData(context, "primaryAuthorise")).booleanValue());
            setPrimaryRedirect((String) getData(context, "primaryRedirect"));
            //przekierowanie na strone jeżeli nie spełniono warunk�w
            if (getPrimaryRedirect() != null && "".compareTo(getPrimaryRedirect()) != 0) {
                if (primaryAuthorise == false) {
    ******* HERE *************
                    context.getExternalContext().redirect(primaryRedirect);
            //wersja if dla JSF
    //        Iterator<UIComponent> children  = getChildren().iterator();
    //        while (children.hasNext()) {
    //            UIComponent child = children.next();
        public boolean getRendersChildren() {
            return false;
         * wczytuje parametr z bindingu lub z propertiesa (automatyczny wyb�r)
         * @param context aktualny kontekst JSF
         * @param name nazwa parametru do pobrania
         * @return warto&#347;c parametru
        public Object getData(FacesContext context, String name) {
            ValueBinding vb = getValueBinding(name);
            Object o;
            if (vb != null) {
                o = vb.getValue(context);
            } else {
                o = getAttributes().get(name);
            return o;
        public String getFamily(){
            return "sevenet.Guard";
        public void encodeEnd(FacesContext context) throws IOException {
            return;
        public void decode(FacesContext context) {
            return;
        public boolean isPrimaryAuthorise() {
            return primaryAuthorise;
        public void setPrimaryAuthorise(boolean primaryAuthorise) {
            this.primaryAuthorise = primaryAuthorise;
        public String getPrimaryRedirect() {
            return primaryRedirect;
        public void setPrimaryRedirect(String primaryRedirect) {
            this.primaryRedirect = primaryRedirect;
    }in tag i have
    public class GuardTag extends UIComponentTag {
        private String primaryAuthorise;
        private String primaryRedirect;
        /** Creates a new instance of GuardTag */
        public GuardTag() {
        public String getComponentType() {
            return "sevenet.Guard";
        public String getRendererType() {
            return null;
        protected void setProperties(UIComponent component) {
         /* you have to call the super class */
         super.setProperties(component);
            setBoolean(component, "primaryAuthorise", primaryAuthorise);
            setString(component, "primaryRedirect", primaryRedirect);
        public void setValueBinding(UIComponent component, String attributeName, String attributeValue) {
            FacesContext context = FacesContext.getCurrentInstance();
            Application app = context.getApplication();
            ValueBinding vb = app.createValueBinding(attributeValue);
            component.setValueBinding(attributeName, vb);
        public void setInteger(UIComponent component, String attributeName, String attributeValue) {
            if (attributeValue == null) return;
            if (isValueReference(attributeValue)) setValueBinding(component, attributeName, attributeValue);
            else component.getAttributes().put(attributeName, new Integer(attributeValue));
        public void setString(UIComponent component, String attributeName, String attributeValue) {
            if (attributeValue == null) return;
            if (isValueReference(attributeValue)) setValueBinding(component, attributeName, attributeValue);
            else component.getAttributes().put(attributeName, attributeValue);
        public void setBoolean(UIComponent component, String attributeName, String attributeValue) {
            if (attributeValue == null) return;
            if (isValueReference(attributeValue)) setValueBinding(component, attributeName, attributeValue);
            else component.getAttributes().put(attributeName, new Boolean(attributeValue));
        public String getPrimaryAuthorise() {
            return primaryAuthorise;
        public void setPrimaryAuthorise(String primaryAuthorise) {
            this.primaryAuthorise = primaryAuthorise;
        public String getPrimaryRedirect() {
            return primaryRedirect;
        public void setPrimaryRedirect(String primaryRedirect) {
            this.primaryRedirect = primaryRedirect;
    }it's my first custom tag so it may not be very good example
    to use it i just put it into jsp page
    <sevenet:guard primaryAuthorise="#{User.logged}" primaryRedirect="./login.jsf" />Piotr Wierzbowski

  • How do I pass input values from a html page to a jsf page

    hi,
    In my project,for front view we have used html pages.how can I get input values from that html page into my jsf page.for back end purpose we have used EJB3.0
    how can I write jsf managed bean for accessing these entities.we have used session facade design pattern and the IDE is netbeans5.5.
    pls,help me,very urgent
    thanx in advance

    Simplest way is to rewrite html page into jsf page.
    You can use session bean in your managed bean like this:
    import javax.naming.Context;
    import javax.naming.InitialContext;
    public class ManagedBean {
    private Context  ctx;
    private Object res;
    // session bean interface
    private Service service;
              public ManagedBean() {
                try{
                     ctx = new InitialContext();
                     res = ctx.lookup("Service");
                     service = (Service) res;
               catch(Exeption e){
    }Message was edited by:
    m00dy

  • Web page redirecting to another page

    Hi,
    I have an issue of web pages redirecting to a specific web page (bad content).
    This issue occurred in safari first and then when i started using google chrome and firefox the same issue arrised.
    When i google something and open it in a new tab it opens into the respective web page but then after all the contents are loaded it redirects into one specific website.
    I cleared all the history and tried blocking that specific page using terminal (used step to step guide through wikihow) and even cleared the DNS by using this command "sudo dscacheutil -flushcache" but nothing works.
    I am using Mac Book Pro Retina and OS Y.
    Please be kind enough to help as soon as possible. Its urgent i am unable to search for anything using google. But it doesn't happen when i open Facebook , youtube or my mail.

    This can happen if adware is installed without your knowledge.
    1. Use  free  AdwareMedic to remove adware
        http://www.adwaremedic.com/index.php
       Install , open,  and run it by clicking “Scan for Adware” button   to remove adware.
       Once done, quit AdwareMedic.
                 or
       Remove the adware manually by following the “HowTo” from Apple.
       http://support.apple.com/en-us/HT203987
    2. Safari > Preferences > Extensions
        Turn those off and relaunch Safari.
        Turn those on one by one and test.
    3. Safari > Preferences >  Search > Search Engine :
        Select your preferred   search engine.

  • Including a JSP page into a JSF page

    Hi !!
    I have read some posts here about <f:subwview>. There says to use:
    <f:subview>
       <jsp:include page="somepage.jsp"/>
    </f:subview>But it does not work.
    How can i include a jsp page into a JSF page?
    Thanks !!!

    Hi,
    Replace <jsp:include page="somepage.jsp">
    with <%@ include file="datasetView.jspf" %>
    See thread: http://forum.java.sun.com/thread.jspa?messageID=3413354&#3413354

  • Wireless web page redirect not woking

    Hi all
    wireless web page redirect not woking 
    software version : 4.2.207.0
    one of the ssid on the controller has web authentication and the authentication page not showing once connected .
    some clients  ( like  laptop) authentication page shows but when we press submit button nothing happen .
    Please help

    Hi
    Tnx again , i beleive i have narrow down the problem , After physically removed the controller from the switch problem experencing only with mobile devices .In your previous reply you mentioned abt DNS .  I  did not understand the role of DNS in it. sorry for that . Once user connected SSID and browse anything , this will redirect to the virtual ip http://1.1.1.1/login.html?........ .we have not registered this virtual ip in the DNS server .
    Please help

  • Can Page Redirect affect caching of .SWZ files?

    Can Page Redirect affect caching of .SWZ files?
    I have two servers:
    Server 1: works perfect it creates cache on client machine (.swz and .heu files) and uses the cache (I can see the change in the .heu files)
    Server 2: is not able to create cache but is able to read the .heu files (I can see the change in the .heu files) from the client machine.
    What could be the issue that server 2 is not able to write .swz files on the client. I have the .swz MIME types on both the servers.
    thanks

    Do you maybe need a crossdomain.xml file on server 2?<br /><br />Matt<br /><br /><br />On 11/6/08 5:48 PM, "alex_stewart" <[email protected]> wrote:<br /><br />A new discussion was started by alex_stewart in<br /><br />Developers --<br />  Can Page Redirect affect caching of .SWZ files?<br /><br />Can Page Redirect affect caching of .SWZ files?<br />I have two servers:<br />Server 1: works perfect it creates cache on client machine (.swz and .heu files) and uses the cache (I can see the change in the .heu files)<br /><br />Server 2: is not able to create cache but is able to read the .heu files (I can see the change in the .heu files) from the client machine.<br /><br />What could be the issue that server 2 is not able to write .swz files on the client. I have the .swz MIME types on both the servers.<br /><br />thanks<br /><br />________________________________<br />View/reply at Can Page Redirect affect caching of .SWZ files? <a href=http://www.adobeforums.com/webx?13@@.59b6f554><br />Replies by email are OK.<br />Use the unsubscribe <a href=http://www.adobeforums.com/webx?280@@.59b6f554!folder=.3c060fa3>  form to cancel your email subscription.

  • Web Page Redirection Messages

    I am urgently trying to send out my newsletter and am receiving "Web Page Redirection Messages" when clicking on any external links from the email. This is my 23rd monthly newsletter and it has never happened before.
    The major problem is I have businesses who are paying for advertising in my newsletter and they will not accept having a message display first before accessing their site.
    Can anyone tell me please WHY this has suddenly occurred. And also what can be done to fix it?
    http://www.shirewomen.com.au/Redirect.aspx?destination=http%3a%2f%2fwww.fitintolifept.com. au%2f

    Hi there:
    http://helpx.adobe.com/business-catalyst/partner/enable-links-external-domain-names.html

  • IOS Content Filtering Using TrendMicro: Can I customize the block-page redirect-url?

    I have IOS content filtering using the Trend Micro subscription service working on a 2911 running 15.1.(3)T3 with the security license option and a 30 day demo Trend subscription.
    Once I figured out that the content filtering for Trend appears to be completely broken in 15.2 (even using docs for 15.2) I went back to 15.1 and it works great.
    Everything seems great so far except I would like to have a more 'fancy' or custom blocked page where a user can have a couple links to either go to the trend micro reporting page http://global.sitesafety.trendmicro.com/result.php or some other page, and maybe some branding so they know the page is coming from our network and is not some fake security thing or phishing attempt or whatever.
    I know I can use the 'parameter-map type urlfpolicy trend ' section to do a tiny bit of customization of the text that appears on the default blocked page display and there is an option for it to go to a simple redirect instead ('block-page redirect-url') but I wonder if anyone has any ideas on how to do more with either the built in page or the redirect-url to keep the information of what page the user was trying to access and why it was blocked (category etc.) while adding more features.
    Thanks!
    Oh, one last thing, this doesn't support any kind of 'user override' or anything like that does it? So that a network can have a filter applied but an admin could override the filtering to allow temporary access to something?

    Hmm... no thoughts over the weekend. Anyone?

  • Whenever I try to log in to my Gmail account, the page redirects for a loooong time, then says that it won't load properly, and that the problem may be caused by not enabling cookies, but I have them enabled. Any idea what the problem might really be?

    Whenever I try to log in to my Gmail account, the page redirects for a loooong time, then says that it won't load properly, and that the problem may be caused by not enabling cookies, but I have them enabled. Any idea what the problem might really be?

    I did think about that and if I have to I will do that, however there are about 50 songs. I have closed and reopened iTunes several times and I am sure that I have the latest version. It fails right away but I can click on the cloud download icon and download the song that it failed on ... therefore it is not that song "or any one song" causing the issue. Any ideas?

  • Display alert hit okay page redirects

    I am having an issue here....When my page is updated I want
    to display an alert that says updated. You must hit okay and then
    the page redirects. The problem I am having with the below code is
    that when you hit save it displays the pop up for about two seconds
    I never click okay and the page redirects. I want the page to stop
    I must click okay for the redirct to occur. Any help would be great
    Alert.show('Updated', 'Alert Box', mx.controls.Alert.OK);
    var u:URLRequest = new URLRequest('
    http://' +
    model.serverName+'/admin.cfm');

    move your URLRequest code to the clickListner function of the
    Alert as described in this example in FB help:
    <?xml version="1.0"?>
    <!-- controls\alert\AlertEvent.mxml -->
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml">
    <mx:Script>
    <![CDATA[
    import mx.controls.Alert;
    import mx.events.CloseEvent;
    private function alertListener(eventObj:CloseEvent):void {
    // Check to see if the OK button was pressed.
    if (eventObj.detail==Alert.OK) {
    myText.text = myInput.text;
    ]]>
    </mx:Script>
    <mx:TextInput id="myInput"
    width="150"
    text="" />
    <mx:Button id="myButton"
    label="Copy Text"
    click='Alert.show("Copy Text?", "Alert",
    Alert.OK | Alert.CANCEL, this,
    alertListener, null, Alert.OK);'/>
    <mx:TextInput id="myText"/>
    </mx:Application>

  • Page Redirects

    We recently changed our website from WordPress to Adobe Muse which changed page headings. For SEO optimization I need to set up page redirects and I've found a widget that will do that for me. The issue I'm finding is that all the muse pages end in .html which prevents me from using the muse platform to set up the redirects. Is there a way to remove the .html form pages?

    Hi,
    check this discussion
    Re: How do I remove .html from the url

  • Problem with history when ther is page redirection after 'go back' button is clicked.

    Recently I was developing some application which requires request redirection from server when the browser's 'go back' button is clicked. At that time while I was testing implemented behaviour i noticed that when i go one page back forward button is disabled and when I want to go back again I am returned one the same page over and over again. It seems that there is a problem with history and how firefox handles a page redirection.
    In other browsers everything goes as it should and there isn't any such problem with history.
    I hope that this problem will be solved in the next version.

    Hi,
    I found this Terminal command here on the discussion board posted bu Sinzu.
    defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2BackspaceKeyNavigationEnable d -bool YES
    Dimaxum
    Sorry, everyting is BOLD tekst.

  • How-to get attributes from one JSF page redirected to another?

    How do I send information from one JSF page when the navigation rule redirects it to another?
    When JSF navigation does a forward I can use request.setAttribute() in the from-page and then use request.getAttribute() in the to-page, but this doesn't work with <redirect/>.
    Regards,
    Al Malin

    The process scope in ADF Faces solves this. See:
    http://www.oracle.com/webapps/online-help/jdeveloper/10.1.3/state/content/navId.4/navSetId._/vtTopicFile.adffacesguide%7Cdevguide%7CcommunicatingBetweenPages%7Ehtml/

  • Problem with page redirection

    Hi,
    I have a navigation rule defined like below :-
    <navigation-rule>
        <from-view-id>/pages/inputname.jsp</from-view-id>
        <navigation-case>
          <from-outcome>sayHello</from-outcome>
          <to-view-id>/pages/greeting.jsp</to-view-id>
        </navigation-case>
    </navigation-rule> The re-direction works, but the link in the address bar does not get updated to "greeting.jsp". Due to this, if we perform, lets say, refresh on the same page, it results in the data to be submitted again.
    We tried explicitly using <redirect/> to avoid this, but this did not work since the session information is lost and the corresponding response messages are lost.
    Is there any other way to get the link updated?
    Thanks.

    It is not a redirect, JSF forwards by default to maintain the current request scope. If you want to redirect you have to force it:
    <navigation-rule>
        <from-view-id>/pages/inputname.jsp</from-view-id>
        <navigation-case>
          <from-outcome>sayHello</from-outcome>
          <to-view-id>/pages/greeting.jsp</to-view-id>
          <redirect/>
        </navigation-case>
    </navigation-rule>

Maybe you are looking for

  • How to print multiple copies of a single report(label) based on a variable

    I have a crystal report v.9 linked to an excel file with multiple rows of information.  Each row contains the label information and one column has the quanity of each label to print.  What feature in crystal do I use and what is the command I will ne

  • How can I have Mail download only 2 years of my Gmail?

    The Mac mailbox for my Gmail account is 30 GB which is too much on a MacBook Air. I do want a two years of my personal and business emails available offline. But I don't need commercial mailinglists or old mail. I do want to keep them on the Gmail se

  • How do I burn a mailbox in Mail to a DVD?

    I'm trying to burn all of my wife's business emails from 2011 to a DVD so we can delte them off the HD.  I did this last year but with the upgrade to Mountain Lion I can't figure it out.  There are approximately 65,000 emails and when I exported it i

  • Client change in r/3

    Hi experts, We have BI dev server which is connected to r/3 quality having client 600 but now quality is refreshed and new client is 500. ryt now data is coming from 600 . please tell me what changes should be done so that now data comes frm 500 not

  • How to delete or rename an object that has been created in IR.

    Dear friends I have transfered a software component from SLD. But if I want to rename this so that I can re-import it from SLD or delet this transfered SWC object, how can i do it. I see a 'delete' option under the menu item Object, but it is grayed