Results 1 to 7 of 7
  1. #1
    kaamos is offline Member
    Join Date
    Apr 2010
    Posts
    2
    Rep Power
    0

    Default Call an url from a backing using post

    Hi everybody:

    I have a little problem i have a backing bean, where i have a method, last line of method must redirect to an external URL, but must use POST. Im using externalcontext.redirect(myUrl) after forming url with parameters, when i make a call link is sent by GET and external link is loaded but for GET. Does anybody know how can i make to redirect using POST from inside a bacKing bean?

    THANKS IN ADVANCE

  2. #2
    RamyaSivakanth's Avatar
    RamyaSivakanth is offline Senior Member
    Join Date
    Apr 2009
    Location
    Chennai
    Posts
    836
    Rep Power
    6

    Default

    Could you explain in a better way.Bit confusing and paste the code till you tried.
    Ramya:cool:

  3. #3
    kaamos is offline Member
    Join Date
    Apr 2010
    Posts
    2
    Rep Power
    0

    Default This is the code

    Hi:

    FacesContext facesContext = FacesContext.getCurrentInstance();
    ExternalContext externalCtx = facesContext.getExternalContext();
    String urlChat="http://www.pepitoperez.com?nombre=nombre1&apellido=apelli do";
    externalCtx.redirect(urlChat);

    Using url is loaded but by GET.

    Thanks in advance

  4. #4
    RamyaSivakanth's Avatar
    RamyaSivakanth is offline Senior Member
    Join Date
    Apr 2009
    Location
    Chennai
    Posts
    836
    Rep Power
    6

    Default

    ur classes are totally different.But,I will give generic solution.
    Use setAttribute method of HttpServletRequest and set the values like this

    ex: request.setAttribute("nombre","nombre1")
    and finally request.getRequestDispatcher(Replace with forward url).forward(request,response);

    so whatever u set will be forwarded to the target url you have mentioned above.
    Ramya:cool:

  5. #5
    Tolls is online now Moderator
    Join Date
    Apr 2009
    Posts
    12,015
    Rep Power
    20

    Default

    I'm assuming by "external URL" they mean another server, consequently you can't forward.

  6. #6
    RamyaSivakanth's Avatar
    RamyaSivakanth is offline Senior Member
    Join Date
    Apr 2009
    Location
    Chennai
    Posts
    836
    Rep Power
    6

    Default

    Yes Tolls.Ur assumption is right.Is it a external URL?
    Ramya:cool:

  7. #7
    RamyaSivakanth's Avatar
    RamyaSivakanth is offline Senior Member
    Join Date
    Apr 2009
    Location
    Chennai
    Posts
    836
    Rep Power
    6

Similar Threads

  1. Replies: 3
    Last Post: 05-04-2009, 03:15 AM
  2. Backing Up Mysql
    By Robert_85 in forum JDBC
    Replies: 3
    Last Post: 04-04-2009, 04:34 PM
  3. my first post
    By kaviyasivashanmugham in forum New To Java
    Replies: 2
    Last Post: 03-13-2009, 09:50 AM
  4. First post out of the way..
    By sirwiggles in forum Introductions
    Replies: 0
    Last Post: 02-06-2009, 10:44 PM
  5. First post ever
    By pbpersson in forum Introductions
    Replies: 4
    Last Post: 08-16-2008, 05:30 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •