Problem in Redirecting

Hi All,
I am not sure why I cannot redirect to another with this code.
I have added a listener on my managed bean and upon click of the button, I wanted it to call a web service.
If there's no error, user should be redirected to another page.
<af:commandButton actionListener="#{pageFlowScope.myBean.handleClick}"
                      text="Commit" />
public void handleClick(ActionEvent actionEvent) {
     List errors = getBindings().getOperationBinding("WebServiceCall").execute();
     if(errors.size == 0){
          // redirect to a other url
          ExternalContext ectx =
               FacesContext.getCurrentInstance().getExternalContext();
          HttpServletResponse response = (HttpServletResponse)ectx.getResponse();
          try {
               //sample url www.google.com
               response.sendRedirect(getURL());
          } catch (Exception ex) {
               ex.printStackTrace();
}Upon click I just remain on the same page instead of being redirected to another url. Any hints? Thanks

Hi,
I actually need to do a redirect into a new url. Say "www.google.com" with my initial code.
But I am noticing that the controller is just appending my new url when I call a redirect.
Just like this
http://127.0.0.1:7101/MyApp/faces/com/test/www.google.com
Any idea please?? How can I perform proper redirection in a managed bean. I want it to redirect on a different
page and not any views within the context path of my application

Similar Messages

  • Bought the starter pack iap on the game 'Injustice: God Among Us', but it didn't give me what it said it would so I want a refund but finding it diffcult to request one, as reporting a problem just redirects me to this website. How to submit for a refund?

    Bought the starter pack iap on the game 'Injustice: God Among Us', but it didn't give me what it said it would so I want a refund but finding it diffcult to request one, as reporting a problem just redirects me to this website. How to submit for a refund?

    Try going to https://expresslane.apple.com ; select 'All Products and Services' in the first column, 'iTunes' in the second column and then 'iTunes Store' in the third column.

  • Problem with redirection and google analytics

    Hello,
    I created my professional website with iweb and bought a domain name for it can be simplest to remember, so this professional domain name (www.julienchabot.com) redirect to the iweb url (web.mac.com/julienchabot/iweb/com/home.html). Now I subscribed to Google Analytics to know the statistics of my website, but it seems that when people visit www.julienchabot.com, google analytics doesn't register any visit on my website, it only registers something when the iweb url (web.mac.com/julienchabot...) is visited, so only when I visit my website as a webmaster because I'm the only one to know this url.
    So it's very frustrating for I can't know the statistics even if Google analytics seems to provide fantastics results !!!
    However, when we're on julienchabot.com and that we read the source code, the correct code and iweb url appear on the top of the window... Does the problem come from the redirection company I subscribed to ?
    Has someone a solution to this problem ?
    Thank you very much for your help !!
    Julien

    Dear Gretsch,
    Thank you for this website, I just registered but unfortunately the problem is still the same ! I think it's due to the redirect company I subscribed to, they use "frames" for the redirection.
    Do you use frames as well for your website ? StatCounter asks if it's the case before providing the code and I replied "yes", they specify to put the code in the main page where there's not the "frame" code, but I don't know where this "frame" code is written, so I put the StatCounter code on the homepage one, but it's the same than with Google.
    Would you mind provide me the url of your website for I can compare your code to mine ?
    Thank you very much for your help !
    Julien

  • Windows 7 pro problem with redirected folder for 1 computer in the domain only.

    Hi.
    We have a computer in the domain we have that started to behave strangely.
    We have redirected folder on the GPO for the Desktop, favorites, and my documents folder.
    The server is 2012 essentials
    Sometimes the customer want to save it's document and the computer refuse to save the file saying that the folder doesn't exist (path unknow). Mostly restarting the machine solve the problem.I verified the synchro between the server and the computer and
    everything seem fine. What I have seen is that went I unplug the system from local network this specific folder disapear. So what I fear is that somethimes the machine can't connect to the server and then the problem start to appear.
    I have tested other account on the domain and they run fine.
    Any idea where I might look?
    Thanks you.

    Hi  MD Info,
    Do you mean that only one account have this issue?
    What policy do you set?
    Please take the following steps for troubleshooting:
    1. Use this account to log in other computers and check if this issue still exists
    2. When this issue occurs, ping the IP address and server name of the server 2012, and share us the result
    3. As you mentioned in the post ‘Mostly restarting the machine solve the problem’, please run the command
    gpupdate /force in powershell and check if this issue still exists.
    Best regards,
    Fangzhou CHEN
    Fangzhou CHEN
    TechNet Community Support

  • Strange Problem when Redirect to other Servlet using dispatch. Please help!

    I've a servlet which will check login session first, if not logged in, it will redirect to LOGIN servlet using "req.getRequestDispatcher(forwardTo).forward(req, resp);", it works fine. For eg, if I press ServletA it will redirect to LoginServlet. It works fine IF I DON'T RESTART TOMCAT.
    However, if I restart tomcat OR restart tomcat and close browser, then request ServletA again, it will display error:
    Apache Tomcat/4.0.1 - HTTP Status 404 - /sun.userlogin
    type Status report
    message /sun.userlogin
    description The requested resource (/sun.userlogin) is not available.
    BUT if I press RELOAD, it will become normal and REDIRECT me to LoginServlet. It's very strange and it troubles my development. The following is a part of my code, do you have any idea what's going wrong?Thanks.
    public class viewMyAcct extends HttpServlet
    public void doGet(HttpServletRequest req,
    HttpServletResponse resp)
    throws ServletException, java.io.IOException
    // Set the content type of the response
    resp.setContentType("text/html");
    // Create a PrintWriter to write the response
    java.io.PrintWriter out = resp.getWriter();
    HttpSession session = req.getSession(true);
    if (session == null) {
    out.println("ERROR: Internal servlet problem - no session");
    out.flush();
    out.close();
    return;
    UserLog ulog = (UserLog) session.getAttribute(USER);
    cmd = new sqlcmd();
    String uri = req.getRequestURI();
    if (ulog == null) {         
    String forwardTo = "sun.userlogin?where=RegForm"; //return to login page           
    //String forwardTo = "../"+uri.substring(0,uri.indexOf(".")) + ".userlogin?where=RegForm"; //return to login page      
         req.getRequestDispatcher(forwardTo).forward(req, resp);
         //http://127.0.0.1:8080/user/servlet/student.userlogin
         //here sure have login,get user loginid
         else{
    ...

    I got a reply why this problem occurs but do anyone of you know how to solve it? The reason is listed below:
    Hi Ken,
    The trouble starts when u restart tomcat,the servelet which is there in memory gets removed so the next time it has to cater to a request it has to go through init(), before getting into the service(), so when u restart and press for Re-login page,it has still not compiled, which it does on getting the first request and hence when u reload it, it responds

  • Intermittent problems on redirect

    Hi,
    I have a JSP form (test.jsp) for my users to upload a file, and another JSP file (testHelper.jsp) to work in the background, both JSP's are under the same directory (http://www.domain.com:8080/AppName/). After work is done, I send users back to the form (with parameters to determine which status message to show), with the following call:
    response.sendRedirect("test.jsp?message=a");Most of the users get redirected back to the form just fine, however a few users received error messages. On IE7, they will see "Internet Explorer cannot display the webpage", while on Firefox they'll see "This document contains no data."
    I checked their browser settings, cleared their browser cache, made sure it's set to always get the latest version of the webpage. The file they're trying to upload seems fine too.
    I have tried using the absolute path in the sendRedirect call, but that did not help:
    response.sendRedirect("/AppName/test.jsp?message=a");When they saw the error messages, their browser showed the address as "http://www.domain.com:8080/AppName/testHelper.jsp".
    I am new in JSP - Is there something else that I should check to diagnose this problem?
    Any help will be appreciated, thanks!

    It could be a timeout issue? Are they uploading larger files?
    Is this problem always reproducible on certain systems, or just intermittent everywhere?
    Any errors in the server log?
    Do you actually receive the file they are meant to be uploading, even if they get an error response?
    How long does it take before the error message shows up? Is it even trying to upload the file?

  • Problem with redirect script when calling from external - UCCX

    Hi,
    I have a problem with external calls not being redirected when the call comes from an external that begins with a certain prefix on teh ANI.
    The call path goes PSTN - VGW - UCM SUB - UCCX.
    To give you info this should be redirected to a auto attendant on unity but it just hits the fourth option unsuccessful.
    If i change it to match an internal ANI and test it works.
    What trace and log do i look at to see the call coming in from the UCM and what is happening with it why this is failing when it trys to redirect a call coming from external?
    I have also attached my script.
    Thanks for the help.
    Kev

    Hi Martin Braun,
    Go to GUI status which you set in the PBO of your screen,
    and open "Function Keys" part.
    You should have set function key F4 for a button on your GUI status,
    delete this button and create with another function key again.
    I hope it helps.

  • Nightly gives problems with redirection to gmail

    I decided to try Nightly, and had Firefox and Nightly both installed. After I did and tried to log onto my gmail account, Firefox (and Nightly) had problems with the redirection to the gmail web site.
    I have now uninstalled Nightly, and the problem disappeared. I, therefore, suspect there is some sort of bug in Nightly.
    Roy

    Thanks. It was meant more as a bug report to the developers than a request for help, but I could not find any better place than here to do so.
    Roy

  • Problem with redirecting from one screen to another screen.

    Hi All,
    I have a region as form with having two buttons as "submit" and update". Once data is inserted into tables i m acalling a model dialog box with two buttons as "Continue" and "key" buttons.
    when i click on view i will be redirecting to the same page by clearing the session as path mentioned below
    document.location.href='f?p=&APP_ID.:1:&SESSION.::&DEBUG.:1:P1_CHECK,P1_BUTTONHIDD:N,';
    bUt when i click on View button i wil be redirecting to same page with updat ebutton as
    document.location.href='f?p=&APP_ID.:1:&SESSION.::&DEBUG.::P1_CHECK,P1_BUTTONHIDD:N,UpdateMode';
    Now i have aonther region as Search and under serch report i have provided link for one of the column, Now when we click on that link i need to redirect the page to update mode screen, so that users can update the records.
    For this i have tried like this but that i snot wroking for me
    Under region two
    Column Link#Colo2#
    Target page in this application#1
    Item1:-P1_BUTTONHIDD
    set thi svalue:UpdateMode
    Thanks,
    Anoo..

    Anoo wrote:
    Hi All,
    I have a region as form with having two buttons as "submit" and update". Once data is inserted into tables i m acalling a model dialog box with two buttons as "Continue" and "key" buttons.
    when i click on view i will be redirecting to the same page by clearing the session as path mentioned below
    document.location.href='f?p=&APP_ID.:1:&SESSION.::&DEBUG.:1:P1_CHECK,P1_BUTTONHIDD:N,';
    bUt when i click on View button i wil be redirecting to same page with updat ebutton as
    document.location.href='f?p=&APP_ID.:1:&SESSION.::&DEBUG.::P1_CHECK,P1_BUTTONHIDD:N,UpdateMode';
    Now i have aonther region as Search and under serch report i have provided link for one of the column, Now when we click on that link i need to redirect the page to update mode screen, so that users can update the records.
    For this i have tried like this but that i snot wroking for me What do you mean by not working?

  • Problem whith redirect = "true" and portal

    Hi!
    I was trying to use a @jpf:forward with redirect="true" in a pageflow of my portal,      
    nevertheless, when it makes redirect, it opens outside the Portal, in a new page, I I need that I make everything within he himself Portal. How I can do this? thanks.
    [email protected]

    I think the redirect attribute only works when used in non portal pageflows. you will have to generate the (portal friendly) URL's yourself and redirect using the response object.
    I believe you can use the url templates defined in url-template-config and a BEA class called GenericURL i think but ive never tried it
    regards
    deepak

  • Problem with Redirecting URL

    Hi All
    First let me tell you guys my scenario.
    I got a production server in which two web servers are installed (iPlanet 4.1 and JRun).
    jrun url: http://jrun.com
    iplanet prod url: [http://iplanet.com/]
    I also got a test server in which only one web server iPlanet is installed.
    iplanet test url: [http://iplanett.com/]
    The problem is
    I got a jsp file which runs on Jrun and in the jsp file it calls the pdf links at the runtime -->http://jrun.com/example.jsp
    In the iPlanet server I got an html page in which I am calling this jsp file which is on the other server.
    eg:
    abc.html in iPlanet server.
    In this html page, I got 3 frames.
    frameset 1=getting the css file
    frameset 2=getting the navigation file.
    the problem is with the 3 rd one...
    frameset 3=http://jrun.com/example.jsp
    +_{color:#0000ff}Is it possible to hide the URL--> {color:#ff0000}[http://jrun.com/example.jsp]{color}_+*
    and display+*
    *[{color:#800000}http://iplanet.com/example.jsp|http://iplanet.com/example.jsp]---> in prod server*
    +[http://iplanetT.com/example.jsp--->in|http://iplanett.com/example.jsp---%3Ein]+* test server
    Thanks

    the user has the right to know where the data is coming from. Who are you to mask the truth from him/her? You might as well point to a dangerous malware website and the user wouldn't be able to know it because you changed the url.

  • Problem in redirect( JSF) onTomcat

    Hi All,
    I am trying to run a JSF application on Tomcat 5.0.25 , which is already working fine on Websphere. The application uses frames and I am redirecting to a JSF page from a Servlet :
    Code:
    response.sendRedirect(url);
    return;
    I am getting a
    java.lang.IllegalStateException :cannot forward after response has been committed
    error on Tomcat, but it works fine on Websphere..
    I am not writing anything to this Servlet's response, and the response.isCommitted() method returns false.
    Thanks in advance!!

    hi,
    Are you using WSAD to develop your JSF app using Tomcat as a server ?
    I am trying to do the same and running into issue.
    I have WSAD 6.0 and tomcat 5. Are these compatible?
    thanks
    Ru

  • SSO problem when redirecting from a JSP page to an external application

    Hi,
    I try to make a redirect from a JSP page (that is under a SSO protected application on iAS) to another page from another application, on an external iAS server, also protected by (a different) SSO. After the redirection is done, the login window appears, I enter the login name and the password and after that I obtain the followin error:
    "Oracle SSO Failure - Unable to process request
    Either the requested URL was not specified in terms of a fully-qualified host name or OHS single sign-on is incorrectly configured.
    Please notify your administrator."
    In the logs og the server I found the following:
    [OSSO] W05: Requested URL is not specified in terms of fully-qualified host name or invalid SSO partner configuration. Host from request
    mycompany.com:7777, registered host 144.147.147.200:7778.
    (the ip address being the address of the mycompany.com host).
    Any clue about this? Thanks a lot in advance!
    Regards,
    Marinel

    Hi Carlo,
    Thanks for your answer.
    The JSP original page is not added as a partner application to the second SSO server.
    The idea was that the user should insert first the login name/passwd for the first server, after being logged in, then redirected to the second application (on a different server), insert the login name/password for the second application and then load the 2nd application page. It seems that is not working after inserting the password for the 2nd application.
    Coming to a more general question that could help me to avoid this complicated approach: is it possible to have two different applications deployed on two different iAS servers and the two applications to use the same SSO (let's say the one from the first iAS server)? I have to mention that the process scenario is the following: the user load a page from the first application (protected by SSO), then, after successfull login and some processing in the first app, he will be automatically redirected by the first app to the second application, on the second server. I want to have also the second application, on the 2nd server, protected by SSO (ideally would be the same SSO as the first one!). Ideally the scenario would be: if it is redirected from the first app and the user is already authenticated, the automatic redirection should be done transparently for the user (without enetring the password again). If the user goes directly from the browser to a page of the second app, the SSO login window should be displayed and the user should provide his password.
    Is such a scenario possible on two apps deployed on two different servers?!
    Thanks a lot again!
    Regards,
    Marinel

  • How do I overcome this problem of redirecting

    I have done all the cookie stuff, enabling deleting allowing inc 3rd party etc.
    I have cleared histories etc.
    I have substituted the entire Firefox folder from another computer, no difference.
    I CAN run any page from bookmarks.
    Any other computer on the same LAN works OK.
    I have checked pref network.http.redirection-limit....it's 20

    No I haven't.  Adobe customer services are useless, they just refer me to the forums from which no-one has offered a solution.

  • Problem while redirecting from servlet to wml page

    Hello everybody
    I am developing a WAP site but I am a begnner in wml and servlet. So I need some help from you ppl.
    I have made a wml page whch redirects to a Login servlet now from that LoginServlet I want to gain redirect to a wml page. I have written the following code so that when the user clicks on Login he is redirected to emailreaderwap/Login.wml page
    PrintWriter out = response.getWriter();
    String url="/emailreaderswap/login.wml";
    response.addHeader("Content-Location:", Double.toStringMath.random()));
    response.setContentType("text/vnd.wap.wml");     
    out.println("<?xml version=\"1.0\" encoding=\"utf-8\"?> ");
    out.println("<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.3//EN\" ");
    out.println("\"http://www.wapforum.org/DTD/wml13.dtd\"> ");
    out.println("<wml>");
    out.println("<card>");
    out.println("<p>"+ "Email Address or Password are wrong Please Try Again!\r\nClick On The Link Below to go back to Login Page"+
                                "<a href=\""+url+"\">Login</a>");               
    out.println("</p>"+"</card>"+"</wml>");But when I run this in my Nokia Mobile Browser4.0 I get "malformed output" as output whereas I want to see the /emailreaderwap/Login.wml page as the output.
    Please tell me whether this is the right way to go abt it or is there any other way i can accomplish my task.
    I hope you ppl reply as soon as possible as I have a deadlne to meet.
    Eagerly waiting for your reply.
    Thankyou
    Heti Shah

    hi ,
    u forgot to give the slash ("/") before jsp file when u r creating the RequestDispatcher object. I tried the following example. Its working fine.
    check this code:
    import java.io.IOException;
    import java.io.PrintWriter;
    import javax.servlet.GenericServlet;
    import javax.servlet.RequestDispatcher;
    import javax.servlet.ServletException;
    import javax.servlet.ServletRequest;
    import javax.servlet.ServletResponse;
    * @author sivakumar
    public class TestServlet extends GenericServlet  {
          public void service(ServletRequest request,ServletResponse response)throws ServletException,IOException{
                   PrintWriter out=response.getWriter();
                   response.setContentType("text/html");
                   out.println("Hi this is first servlet");
                   RequestDispatcher requestDispatcher=getServletContext().getRequestDispatcher("/test.jsp");
                   requestDispatcher.forward(request,response);
    }test.jsp shows images also.
    try it...
    good luck...

Maybe you are looking for

  • OS specific changes in ABAP program

    Hi guys, I know due to OS migration ABAP program changes are not mostly required. possibly Except few things. 1-External commands check 2-File path or logical path settings check. 3-Native sql check. Apart from this is there any possible that OS spec

  • Macbook Pro 2011 don't recognize Monitor AOC e224eFw, hence not displaying correct resolution

    Two days ago after i put my Macbook Pro 2011 to sleep with the Mini DisplayPort connected (always do the same) stopped identifying my External Monitor, AOC e224eFw showing it as "standard VGA" so i have no the right screen resolutions. I've tried to

  • Why Can't I Export to Quicktime from Garageband?

    Has anyone else experienced this or would know how to fix it... I created a .mov file from Keynote and brought it into Garageband as a Video Track to sync the music to the Keynote presentation. Now I'm ready to Export to Quicktime from Garageband. Wh

  • Check Constraint names aren't synced when engineering to logical

    Just learned about this tool at OOW and ran into an issue involving check constraint names being compared but not synced when engineering from the relational model to the logical model. When I set the constraint names in the logical model (and perfor

  • IDOC Message Type LOIPRO (Production order)

    Hi All,          How I can setup Process code for inbound Production order (Message Type LOIPRO) I receive idoc file from external SAP system I try to use "BAPP" , "ABI_AIDN_IN" , "APLI" it not work for this message type. Idoc error message "Function