How to make http post in the Webcenter Portal Application?

Hi all

We have a requirement in which we must train to an external URL.

We have created a Taskflow bounded with page fragment. Added a button on the page fragment and had to form POST to an external URL the button click. Expected features, the URL of the external site will open in the same tab.

But we can not directly use html form tag in the page jspx because it cannot have two form elements.

Example code snippet that we use:

" < form id ="meetingPost"action =" http://XYZ/reg.aspx "

method = "POST" >

< input type = "hidden" name = "userId" value = "12345" / >

< / make >


We have tried to do this programmatically as below. But it does not work.

JSPX code:

<? XML version = "1.0" encoding = "UTF - 8"? >

" < = xmlns:jsp jsp:root ' http://Java.Sun.com/JSP/page "version ="2.1" "

          xmlns:f=" http://Java.Sun.com/JSF/core "

          xmlns:h=" http://Java.Sun.com/JSF/HTML "

' xmlns:af = ' http://xmlns.Oracle.com/ADF/faces/rich "> "

< jsp:directive.page contentType = text/html"; Charset = UTF - 8 "/ >

< f: view >

< af:document id = "d1" >

< af:form id = "f1" >

< af:region value = "#{bindings." TestTF1.regionModel}"id ="r1"/ >

< / af:form >

< / af:document >

< / f: view >

< / jsp:root >

JSFF code:

<? XML version = "1.0" encoding = "UTF - 8"? >

" < = xmlns:jsp jsp:root ' http://Java.Sun.com/JSP/page "version ="2.1" "

' xmlns:af = ' http://xmlns.Oracle.com/ADF/faces/rich "" "

          xmlns:f=" http://Java.Sun.com/JSF/core ">

< af:resource type = "javascript" >

function postToURL (url) {}

var form = createElement ('form');

form.setAttribute ("method", "POST");

form.setAttribute ("action", url);

Form._submit_function = form.submit;

form.appendChild (document.createElement ("input", {type: "hidden", name: "userId", value: "12345"}));

document.body.appendChild (form);

Form._submit_function ();

}

< / af:resource >

< af:panelGroupLayout id = "pgl1" layout = "horizontal" >

< af:commandButton text = "Submit" id = "cb1".

actionListener = "#{pageFlowScope.SampleBean.postToCvent}" > < / af:commandButton >

< / af:panelGroupLayout >

< / jsp:root >

Managed Bean Code:

{} public void postToCvent (ActionEvent actionEvent)
FacesContext fctx = FacesContext.getCurrentInstance ();
String url = " " http://XYZ/reg.aspx ";
ExtendedRenderKitService service = Service.getRenderKitService (fctx, ExtendedRenderKitService.class);
StringBuffer script = new StringBuffer();
script. Append ("postToURL('");
script. Append (URL);
script. Append("')"); "
service.addScript (fctx, script.toString ());

}

Thank you

Bharat

Abhijit salvation,

sendRedirect don't GET, POST.

in any case I solved the problem by substituting the attribute action for af:form using java script and adds input fields on the fly and able to reach the POST form to an external URL.

JavaScript (test.js file):

function postToCvent (event) {}

If (event! = null) {}

Get the source Customer attribute

var url = event.getSource () .getProperty ('url');

var userId = event.getSource () .getProperty ("userId");

Get the form by Id element, it will be af:form Id

var form = AdfPage.PAGE.findComponentByAbsoluteId ("mform");

If (form! = null) {}

formId var = form.getClientId ();

document.getElementById (formId) .setAttribute ("method", "POST");

document.getElementById (formId) .setAttribute ("action", url);

Create and add the input field to your

var hiddenField1 = document.createElement ("input");

hiddenField1.setAttribute ("type", "hidden");

hiddenField1.setAttribute ("name", "userId");

hiddenField1.setAttribute ("value", username);

document.getElementById (formId) .appendChild (hiddenField1);

SubmitForm

document.getElementById (formId) .submit ();

}

}

JSFF code:


http://XYZ/reg.aspx"/ >

JSPX code:


source="/resources/test.js"/ >

Thank you

Bharat

Tags: Fusion Middleware

Similar Questions

  • How to make a backup of the drivers and applications

    I have a HP Pavilion Desktop PC all-in-one 23-B115EA, originally with Windows 8 installed which I have updated to 8.1 of the store.  After a problem, I was advised to create a System Image on an external hard drive, what I've done.  I also have a recovery disk including the recovery on a USB Partition and a new Restore Point.

    The reason why I write, is that what follows has been also sugested "Furthermore, make a backup of the drivers and Applications.» Still, if the hard drive needs to be replaced, you will need to install all the drivers and perhaps some applications again for which you have this backup. "I don't know how to do on the PC and I was wondering if it was possible.

    Best regards, Mike-01

    Mike, you're welcome.

    I know that in the past, there are third-party programs that could back up the drivers, but I could not find one to win 8.1.  With respect to applications, the CD recovery and Image will be all you need.

  • How can I put two pictures together so that I could make a poster, including the two photos?

    Original title: Photo

    How can I put two pictures together so that I could make a poster, including the two photos?

    Hello

    What operating system do you use?

    You can do this by using paint or Windows Photo Gallery or Windows live photo gallery. See the following articles that might help you.

    With the help of paint
    http://Windows.Microsoft.com/en-us/Windows-Vista/using-paint
    With the help of paint
    http://Windows.Microsoft.com/en-us/Windows7/using-paint
    Overview of Microsoft Paint
    http://www.Microsoft.com/resources/documentation/Windows/XP/all/proddocs/en-us/mspaint_overview.mspx?mfr=true
    Open Windows Photo Gallery
    http://Windows.Microsoft.com/en-us/Windows-Vista/open-Windows-Photo-Gallery
    Windows Live Photo Gallery
    http://Windows.Microsoft.com/en-us/Windows7/products/features/photo-gallery

  • How to communicate with a remote application that uses http post to the connection request

    OK, I'll try to make this simple to avoid any

    confusion.

    I am getting requests for connection of remote applications on the user pc.

    The application uses the POST method to send the request to connect to my database and possibly updating some tables.

    The application is not a Web page. I don't have access to the internals of the application nor do I have any specific information on how it sends its MESSAGE. I'm sure of the following:

    The application performs the VALIDATION on my .cfm page

    "IsConnectionAllowed" = 'yes '.

    Is ask my cfm page if its ok for you to connect. I would need to use a < cfif > to check the first part of the POST is in fact

    "IsConnectionAllowed" = 'yes '.

    If this returns true, (the application uses also at the STATION to spend 'username' and 'password') my .cfm page will then perform a query and check the user name and password on the database. If a matching record is found, the application waits for my page to answer with

    "#Answer # OK - bound;

    Once the answer is given the application will then respond with the data to insert or update my tables.

    Now I know how to make queries and update the tables etc, but I never received a prior application data.

    I tried using the < cfform > tag with a breeding to GET and then you're trying to send my response with < cfoutput >, but that did not work. The application gives no feedback or error messages. It connects or not.

    I also tried the < cfhttp > tag, but that no longer works. I'm not very experinced with coldfusion. I used years ago and am just getting back to it.

    I'm sure it's a fairly easy thing to do, but my methods do not work.

    Using the information above, can somone please show me how I would accomplish this communication? I can then use the same method to retrieve the data for my queries and updates to the table.

    Here is a sample of what I have already tried:

    < cfform method = "get" >

    < cfif >

    "IsConnectionAllowed" = 'yes '.

    <!-I need to ask a user name or password. But for testing I will just give the OK to connect->

    < cfoutput > #Answer # Ok - connected; < / cfoutput >

    < cfelse >

    <!-when I ask user name and password, if the query returns no records I refuse the connection->

    < cfoutput > #Answer # not connected; < / cfoutput >

    < / cfif >

    < / cfform >

    BTW, I have some examples of this fact using .php and .asp. I need to do it using .cfm. I can post the .php or.asp code if it will be useful in the conversion of the function in a .cfm page.

    Just as I speculated, you just send plain text - that is just like a normal web page generation.

    The code below vaguely mimics your PHP code. I did not test it, so it may contain errors. I used labels instead of cfscript, because you might be working with ColdFusion 8 and not 9. I disable all outputs of coldfusion and wrap everything which is at the exit, between the two . This way without extra line breaks or spaces are never sent. syntax ed would of course take care of that, which I use more happy when working with CF9.



       
       
            ##Answer # error - could not connect to the mySQL database.
           
       


    SELECT * FROM profil_utilisateur
    WHERE UserName =
    AND password =
       

       
       
            ##Answer # error - user name does not exist or wrong password;
           
       

    ##Answer # OK - connected;

    What still intrigues me is; the client application makes separate connections to your server or not - first to check if the connection can be established and then to the name of user and password? Of course not, even if the first time he could. In your sample code, user name and password can be checked if isConnectionAllowed is displayed on the same application.

    I guess that the application client messages these three areas (isConnectionAllowed, username, password) each time as it brings the following calls to update data in the query, because there is no no manipulation session implemented in PHP code.

    I hope this helps. * shrug *.

    --

    -Fernis - fernis.net - developer ColdFusion for hire

  • How to make a backup of the system files?

    I want to just back up the filesystem in the case where.

    Hello

    You can save your own personal files (documents, photos, etc.) or do a complete PC backup that contains the system files.

    If you want to make a complete PC Backup or a backup file only, buy an external hard drive.

    Only Vista professional, comprehensive and company have the opportunity to make complete backups of PC.

    All editions of Vista can do backups of files.

    Here's how to back up and restore your files:

    "How to back up your data.

    http://www.wintuts.com/how-to-backup-your-data

    http://www.home-PC-help.com/windowsvistabackup.html

    "How to restore your files.

    http://www.wintuts.com/how-to-restore-files

    This is how to do a full backup of the computer and how to restore it (for Vista Business, Ultimate and Enterprise only):

    «How to make a backup of the computer in Vista»

    http://www.bleepingcomputer.com/tutorials/how-to-use-Vista-complete-PC-Backup/

    "How to restore a full backup of the computer.

    http://www.bleepingcomputer.com/tutorials/Windows-Vista-complete-PC-Restore/

    FAQ from Microsoft about backup and restore:

    "Back up and restore: frequently asked questions.

    http://Windows.Microsoft.com/en-us/Windows-Vista/back-up-and-restore-frequently-asked-questions

    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

    There are a number of 3rd party programs available for a full backup of the computer; others, you must pay for, some are free.

    This program must be purchased:

    "Acronis True Image".

    http://www.Acronis.com/homecomputing/products/TrueImage/index_gwo.html?utm_expid=4274314-6

    These are free programs for the protection of the computer:

    "EaseUS Todo Backup free"

    http://www.TODO-backup.com/products/home/free-backup-software.htm

    "Download Backup & Recovery 2012 free FREE!

    http://www.Paragon-Software.com/home/BR-free/download.html

    «Macrium Reflect FREE Edition»

    http://www.Macrium.com/reflectfree.aspx

    ___________________________________________________

    And if you do not score a manufacturer of recovery on your hard drive, you should be able to make your own recovery discs that are system files in order to reinstall the operating system.

    Go to programs > name of the manufacturer of your computer > then their system or recovery tools software topics for them, depending on how it is formulated.

    If you can't find any reference to it, contact the manufacturer for advice on how to make these recovery disks.

    See you soon.

  • How to install messaging to the Webcenter Portal Services?

    I want to activate the messaging on the webcenter portal service. But the messaging service does not appear in the services and suppliers page. How can I bring up the mail service? How do we install the mail service?

    Sory for my bad language.

    webcenter-mail.png

    Hello

    Please see the document below to configure the configuration of mail service.

    17 the mailroom management

    https://docs.Oracle.com/CD/E28280_01/WebCenter.1111/e12405/wcadm_mail.htm#WCADM235

    and also check the document below to create a mail connection.

    How to create a SMTP of Mail connection only? [1182383.1]

    Concerning

    Françoise

  • How to make a CC off the power of a laptop so I can put it on a second desktop computer

    How to make a CC off the power of a laptop so I can put it on a second desktop computer

    You can simply disconnect from the Adobe Creative cloud to disable subscription:

    https://helpx.Adobe.com/creative-cloud/help/sign-in-out-activate-apps.html

    No need to uninstall to disable CC apps on a particular computer, but if you want you can uninstall it.

  • How to make someone to sign the document within my documents in the tasks that I specify?

    How to make someone to sign the document within my documents in the tasks that I specify?

    Hello form signature,.

    Yes, you can place the signature to a particular position field in the document as follows:

    1. connect to EchoSign account.

    2. Enter the e-mail address of the recipient.

    3. download the document.

    4. check "Preview, the Signatures of Position or add form fields" and click Next.

    5. in the preview page, drag and drop the signature and other fields of the form if necessary in the document.

    6. once the fields are placed, press Send.

    Here is the link:

    http://helpx.Adobe.com/EchoSign/KB/hub7.html

    Let me know if you need more information.

    Kind regards

    -Usman

  • Make a poster of the step

    19112012-3.jpg

    I want to make a poster of the step as above. Unfortunately, I don't know where can I get/make the design of the 1 to 3 as described above. What I mean is how to compile the no. step and the description box. TQ...

    Type tool to create a large "2".

    The layer > Type > convert to shape.

    Target vector mask shape.

    Activate the Rectangle tool and make sure that it is in shape or path mode and add mode shape box.

    Draw a rectangle inside the vector mask targeted, with the same height as '2'.

    The path Selection tool tool to align the rectangle and '2'. Snapping to guides dragged out of the rule can help with that.

    Switch to the direct Selection tool, right-click on the left edge of the outline of the rectangle and choose Add an anchor Point from the context menu. Drag this new anchor and anchor down-left to make the shape below.

  • How to make a link in the scene as an anchor?

    How to make a link in the scene as an anchor?

    I mean, for example, create a button with a link to go to the top or the bottom or other parts of the page. Thank you

    In the same example I have on this page illustrates this functionaility

    http://forums.Adobe.com/thread/1084037

    Darrell

  • How to make a folder shows the number of files in there?

    How to make a folder shows the number of files in there?

    You have not indicated what OS you are using.

    Yosemite

    Action > View Options: Select to display the item of information

  • I'm trying to connect on Apple TV.  It keeps generating a 6-digit verification code, sent to another device.  I need a 4 digit or need to know how to make a space on the verification code entry screen

    I'm trying to connect on Apple TV.  It keeps generating a 6-digit verification code, sent to another device.  I need a 4 digit or need to know how to make a space on the verification code entry screen

    Read this noting the last two paragraphs:

    For Apple ID - Apple Support two-factor authentication

    You can try to add on your suggested such password or disable the service and then connect.

  • How to make an arch on the topic title?

    How to make an arch on the topic title?

    You can do the following entirely in any version of Pages because the text on a path is not supported. The News Gothic 'gate' in one area of text Pages. The arc of text was done in HTML5 Canvas with Javascript, then saved as a .png image, which was dragged/dropped into Pages v5.6.1. Normal means to create text curvilinear (CRA) is done by an application chart non-Apple.

  • How to make a lock off the internet so I can have another WiFi computer using the internet

    How to make a lock off the internet so I can have another WiFi computer using the internet

    you do not take the lock itself.

    Instead, you configure another computer with security information to access the connection Wireless secure.

    Unfortunately, we cannot help you with this, because we cannot tell if you are the owner of the wireless connection or someone trying to hack it via another computer.

    However, what you can try is to contact technical support that provides your internet service.  they will be well to validate your identity and then provide help or more detailed instructions.

  • the friends hyii UA HUD need help how to make a backup of the files from his deleted with (shift + delete) memory card

    the friends hyii UA HUD need help how to make a backup of the files from his deleted with (shift + delete) memory card

    Hello

    It seems that you want to restore the files removed from the memory card.

    I will definitely help you with this.

    I would say you can search the Internet for data recovery software by using your favorite search engine.

    Warning: Using third-party software, including hardware drivers can cause serious problems that may prevent your computer from starting properly. Microsoft cannot guarantee that problems resulting from the use of third-party software can be solved. Software using third party is at your own risk.

    It will be useful. If you have any other questions, feel free to let us know. We will be happy to help you.

    Thank you.

Maybe you are looking for

  • iMessage sign

    Hello I know it's a common problem and I tried a few solutions, but none worked for now. I've just updated to 10.11.6 and when I tried to send a Message, none were received, but iMessage shows no errors. Then I open settings and saw that my service p

  • HP Pavilion Notebook - 15-p206: Windows 8.1 backup

    My HP pavilion Nooteboom knows the windows 8.1 operating system. This laptop is to have pre defined 24.4 GB as recovery partition. Now, I want to take backup of the operating system windows 8.1 in USB key. So I can copy this recovery disk and paste i

  • I need help regarding one of the apps in the AppStore :(

    BEFORE YOU DO NOT OBSERVE THIS, YOU SHOULD READ IT. I NEED QUICK ASSISTANCE. Hi, I do not know where to start. It was so annoying for days. Recently, I have re-uploaded the app re-launched "ElGard. Basically, I am not new to this game so I tried to c

  • You can install realflight g4on a computer running w7hp and how

    I am running w7hp upgrade now, I can't reinstall realflight g4 Igive it by I tell him to install without success I am running vista thank you pahrump grump

  • All C4400 by mistake a single installation

    We are trying to install C 4400 all-in-one. During installation, it displays an error message. Error 1935. Some MSI-related message. SCAN. We are not able to install the printer. Need help with installation.