Results 1 to 7 of 7
- 04-27-2010, 03:18 PM #1
Member
- Join Date
- Apr 2010
- Posts
- 2
- Rep Power
- 0
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. I´m 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
- 04-27-2010, 03:26 PM #2
Could you explain in a better way.Bit confusing and paste the code till you tried.
Ramya:cool:
- 04-27-2010, 03:32 PM #3
Member
- Join Date
- Apr 2010
- Posts
- 2
- Rep Power
- 0
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
- 04-27-2010, 03:49 PM #4
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:
- 04-27-2010, 04:02 PM #5
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
I'm assuming by "external URL" they mean another server, consequently you can't forward.
- 04-27-2010, 04:07 PM #6
Yes Tolls.Ur assumption is right.Is it a external URL?
Ramya:cool:
- 04-27-2010, 04:19 PM #7
Go thru the below thread
Sending a POST Request with Parameters From a Java Class - A Java Code ExampleRamya:cool:
Similar Threads
-
DOnt know if 1st post if did, I am VERY sorry for duplicate post. I have error messg
By afisher300 in forum New To JavaReplies: 3Last Post: 05-04-2009, 03:15 AM -
Backing Up Mysql
By Robert_85 in forum JDBCReplies: 3Last Post: 04-04-2009, 04:34 PM -
my first post
By kaviyasivashanmugham in forum New To JavaReplies: 2Last Post: 03-13-2009, 09:50 AM -
First post out of the way..
By sirwiggles in forum IntroductionsReplies: 0Last Post: 02-06-2009, 10:44 PM -
First post ever
By pbpersson in forum IntroductionsReplies: 4Last Post: 08-16-2008, 05:30 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks