Generate a HTML POST url and open the page.

Hello,
I need to generate a HTML POST url with 4 parameters.
I tried like this.
String URLtobeOpened = "<url>?param1=val1&param2=val2&param3=val3&param4=val4";
          HttpServletResponse resp = request.getServletResponse(true);
          try {
               resp. sendRedirect(URLtobeOpened);
          } catch (IOException e1) {
               // TODO Auto-generated catch block
               e1.printStackTrace();
This is showing me a login prompt, instead of directly logging me in.
Also when I checked using HTTPWatch, the request is showing as a GET, but I need it as a POST.
How to code it in the right way.
Thanks
Srinivas

Here is what I tried sofar
I am using this jar commons-httpclient-3.1.jar
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.methods.PostMethod;
          String url = "https://www.independentinc.com/scripts/insupport.exe/db_connect";
            try {
             HttpClient client = new HttpClient();
             PostMethod method = new PostMethod( url );
               // Configure the form parameters
               method.addParameter( "param1", "val1" );
               method.addParameter( "param2", "val2" );
               method.addParameter( "param3", "val3" );
               method.addParameter( "param4", "val4" );
               // Execute the POST method
             int statusCode = client.executeMethod( method );
             if( statusCode != -1 ) {
                String contents = method.getResponseBodyAsString();
                method.releaseConnection();
//                System.out.println( contents );
            catch( Exception e ) {
             e.printStackTrace();
            }I am getting a weird exception
java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory at
HttpClient client = new HttpClient();How to fix this exception...
Is this the right approach at all...

Similar Messages

  • I wont to use IE for some pages and Firefox for others, but when I enter a url in IE, Firefox loads and opens the page

    I use IE 8 and the latest version of Firefox in XP.
    I'm a web designer and I want to test pages in both explorers but sometime i enter a URL in IE and Firefox opens and loads the page. How can I stop this happening?

    See http://kb.mozillazine.org/Website_colors_are_wrong
    Start Firefox in [[Safe Mode]] to check if one of your add-ons is causing your problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    See [[Troubleshooting extensions and themes]] and [[Troubleshooting plugins]]

  • I have Mac OS X version 10.7.5 and I need to open a secure website to look at DA forms and army regulations but every time I try and open the page it says safari cannot open the page. What do I need to do to open the page?

    Cannot open some sites. Need help!!!

    Have you tried Firefox? That usually is an alternative to Internet Explorer (some web sites are still Windows-centric).
    I've also had success with Opera to access some sites where other browsers have had issues.

  • Is there a way I can right-click on an email address on a page and open the url associated with that email

    I'd like an easy way to right-click on an email address on a page and open the URL of that email. Ie ([email protected] and open up mozzilla.org in a new tab or window). Is there a way of doing this or an add-on that does it without having to highlight and cut and past into the address bar?

    You can't delete the address, but you can set up a Rule to move messages to that address to the Trash or another folder. Go to http://icloud.com and go to the Mail page, click the cogwheel icon at top right and choose 'Rules'.
    It's a bad idea to post your email address - it's an invitation to spam - even though in fact you haven't posted them in full; I've asked the hosts to remove them.

  • Posting Period to close and open the New Posting Period

    Hi,
    I am trying to do MIGO, it is not allowing to post in the current period.
    Pls let me know, How to close the current period (AUg) and Open the posting for Sep. Pls provide the steps.
    Thanks

    Thanks for the quick response,
    I did MMPV and Gave the company code and enter period as 08 and selected check and close period and executed. It gives the response as
    It gives period closing terminated
    Can you tell me what should i do
    thanks

  • How to open an URL and close the URL window, using adobe javascript

    Hi,
      Is it possible to open an URL and close the URL back again(without allowing the user to perform any other operation)? I was able to acheive the opening of the URL, using the app.launchURL("address". true); - But here it lauches in new window, and how do i close the window using the javascript. Is it possible?
    Thanks.

    Hi all
    In addition to what Bobby W - Adobe TS added, you might find
    the following useful as a bypass or workaround to the pesky prompt.
    var pw=window.parent;pw.opener=window.self;window.open("
    http://www.adobe.com");
    pw.close();
    I think this will only work for IE browsers. Actually, I
    think the whole window.close() only works for IE, but could be
    wrong about that.
    Cheers... Rick

  • My ipad2  appears to be connected to the internet, but I cannot connect..I keep getting Safari cannot open the page because it is not connected to the internet....I restarted the router and the ipad still no connection...my service is working properly

    My ipad 2 appears to be connected to the internet(all bars are up in the left hand corner).....yet I cannot connect to the internet(Safari cannot connect open the page because it is not connected to the internet)
    I unplugged my router for 30 seconds and restarted my ipad...still nothing
    I really don't think it is my service because my laptop works fine...as I am using the internet right now
    I only had this ipad for 2 days
    Are there any suggestions that can help solve this problem?

    Usually it's because you are not making internet connection via wifi.
    Look at iOS Troubleshooting Wi-Fi networks and connections  http://support.apple.com/kb/TS1398
    iPad: Issues connecting to Wi-Fi networks  http://support.apple.com/kb/ts3304
    Additional things to try.
    Try this first. Turn Off your iPad. Then turn Off (disconnect power cord) the wireless router & then back On. Now boot your iPad. Hopefully it will see the WiFi.
    Change the channel on your wireless router. Instructions at http://macintoshhowto.com/advanced/how-to-get-a-good-range-on-your-wireless-netw ork.html
    How to Quickly Fix iPad 3 Wi-Fi Reception Problems
    http://osxdaily.com/2012/03/21/fix-new-ipad-3-wi-fi-reception-problems/
    If none of the above suggestions work, look at this link.
    iPad Wi-Fi Problems: Comprehensive List of Fixes
    http://appletoolbox.com/2010/04/ipad-wi-fi-problems-comprehensive-list-of-fixes/
    Fix iPad Wifi Connection and Signal Issues  http://www.youtube.com/watch?v=uwWtIG5jUxE
     Cheers, Tom

  • When i try to open a web page, a blue screen appears and it is telling me " safari cannot open the page because i am not connected to the internet. i have an iphone, no problem and a laptop with connection - no problem - not sure what the trouble is.

    when i try to open a web page, a blue screen appears - message says - sarfari cannot open the page because it is not connected to the internet. i have an iphone - no proble and a laptop - no problem as well.
    what is wrong?

    There are other things that need attention:
    Your above posted system details show outdated plugin(s) with known security and stability risks that you should update.
    *Shockwave Flash 10.0 r32
    Update the [[Managing the Flash plugin|Flash]] plugin to the latest version.
    *http://www.adobe.com/software/flash/about/

  • Executing a sql in web.show_document before opening the page with URL

    Hi,
    I have a function that returns a varchar2 into web.show_document in the form. Is there a way that web.show_document executes the varchar2 and get the output and open the URL. The result of the varchar2 execution is a URL.
    CREATE TABLE MIS_TBL (MIS_COD VARCHAR2(10), MIS_VAL VARCHAR2(100) );
    insert into MIS_TBL(MIS_COD,MIS_VAL) values ('RPTURL','/print');
    Create or replace FUNCTION Get_String_MIS
    in_v_MIS_Cod IN MIS_Tbl.MIS_Cod%TYPE ) RETURN VARCHAR2     
    IS
    l_v_String          MIS_Tbl.MIS_val%TYPE;
    BEGIN
    SELECT MIS_Val INTO l_v_String
    FROM MIS_Tbl
    WHERE MIS_Cod = in_v_MIS_Cod;
    RETURN l_v_String;
    END;
    In the forms I have the following code in a trigger, uniform across many forms.
    web.show_document(Get_String_MIS('RPTURL') || '/' || l_v_File_Name);
    I can set any value to RPTURL from a reference data form. I want the above statement to execute the varchar returned by Get_String_MIS('RPTURL') and send the result of the execution to show_document.
    The result of get_string_mis should be 'http://'||sys_context('userenv','host')||':9999/print' and this when executed gets the actual servername from sys_context('userenv','host')
    At this time, I cannot change the function and many forms. I only have control of changing the value in MIS_TBL.
    Any solution to my problem is greatly appreciated.
    Thanks,
    Ravi

    Maybe you could rename your table and use a view pointing to that table instead? Then you could do the resolution directly in the database.
    Something like
    SELECT MIS_COD, MIS_VAL FROM MIS_TBL_NEW WHERE MIS_COD!='RPTURL'
    UNION ALL
    SELECT 'RPTURL',  'http://'||sys_context('userenv','host')||':9999/print' MIS_VAL FROM DUAL

  • I have a MacBook Pro and tried to download and open the torbundle package.

    I have a MacBook Pro and tried to download and open the torbundle package. I get a message that reads "A copy of firefox is already running. Only one copy of firefox can be open at a time."
    1. I do not seem to have firefox anywhere of my computer. Ive been using safari and as far as my computers library is concerned there is no firefox.
    2. I have tried shutting down and restarting.
    3. I tried making a new user account.
    I believe the torbundle package is trying to open itself twice. Has anyone had this problem when trying to use tor on OS X?
    This is getting very frustrating! Help please!

    If you open Activity Monitor do you see a FireFox running? If so delete it.
    Have you tried deleting and redownloading/installing?
    Next:
    How can I get support?
    Your best bet is to first try the following:
    Read through this FAQ.
    Read through the documentation.
    Read through the tor-talk archives and see if your question is already answered.
    Join our irc channel and state the issue and wait for help.
    Send an email to [email protected]
    If all else fails, try contacting us directly.
    If you find your answer, please stick around on the IRC channel or the mailing list to help others who were once in your position.
    From:
    https://www.torproject.org/docs/faq.html.en

  • Want to switch off the general search and open the advanced search

    Hi All,
    I want to switch off the general search and open the advanced search when i load my application. For this I have followed the steps previously posted in the forum.
    I have created a version(0001)  and for that version i have checked the open advance search. If i do this way it works perfectly but when i click on the result list the detail tab does not come. But when i remove this settings and go through general search both the advance search and the general search works properly. I am able to get the details tab.
    Why am I not getting the details tab if i open the advanced search directly. Please give your inputs.
    Thanks & Regards,
    Anuradha.P

    Hi Anuradha.
    Please check the following thread:
    URGENT!!! Show Advance Search in INIT event
    Best regards.
    Armando Rodriguez.

  • Since upgrading to Yosemite I am getting frequently "safari can't open the page (blank) because the server unexpectedly dropped the connection this sometimes occurs when the server is busy. wait and then try again"

    Since upgrading to Yosemite on my iMac I am frequently getting "safari can't open the page (blank) because the server unexpectedly dropped the connection this sometimes occurs when the server is busy. wait and then try again". This is with both a WiFi and Ethernet connection. The server is working fine from other devices using WiFi onto it such as iPhones, iPads, MacBook (which is also on Yosemite) so don't believe its an issue with the server.
    I am also noticing page load very slowly when this problem is not occurring.

    Please read this whole message before doing anything.
    This procedure is a test, not a solution. Don’t be disappointed when you find that nothing has changed after you complete it.
    Step 1
    The purpose of this step is to determine whether the problem is localized to your user account.
    Enable guest logins* and log in as Guest. Don't use the Safari-only “Guest User” login created by “Find My Mac.”
    While logged in as Guest, you won’t have access to any of your documents or settings. Applications will behave as if you were running them for the first time. Don’t be alarmed by this behavior; it’s normal. If you need any passwords or other personal data in order to complete the test, memorize, print, or write them down before you begin.
    Test while logged in as Guest. Same problem?
    After testing, log out of the guest account and, in your own account, disable it if you wish. Any files you created in the guest account will be deleted automatically when you log out of it.
    *Note: If you’ve activated “Find My Mac” or FileVault, then you can’t enable the Guest account. The “Guest User” login created by “Find My Mac” is not the same. Create a new account in which to test, and delete it, including its home folder, after testing.
    Step 2
    The purpose of this step is to determine whether the problem is caused by third-party system modifications that load automatically at startup or login, by a peripheral device, by a font conflict, or by corruption of the file system or of certain system caches.
    Please take this step regardless of the results of Step 1.
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards, if applicable. Start up in safe mode and log in to the account with the problem. You must hold down the shift key twice: once when you turn on the computer, and again when you log in.
    Note: If FileVault is enabled in OS X 10.9 or earlier, or if a firmware password is set, or if the startup volume is a software RAID, you can’t do this. Ask for further instructions.
    Safe mode is much slower to start up and run than normal, with limited graphics performance, and some things won’t work at all, including sound output and Wi-Fi on certain models. The next normal startup may also be somewhat slow.
    The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    Test while in safe mode. Same problem?
    After testing, restart as usual (not in safe mode) and verify that you still have the problem. Post the results of Steps 1 and 2.

  • Hello, my friend's ipad locked and need the apple id and password to unlock the setup and open the ipad but he don't remember any one of them nor his email and security questions what can we do about that please solution?

    hello, my friend's i pad locked and need the apple id and password to unlock the setup and open the i pad but he don't remember any one of them nor his email and security questions the serial number of tha i pad is DYT*******PH and the part number is MC979ZP/A what can we do about that please solution?
    <Edited by Host>

    Your friend will have to remember or find his account id and password, without them he won't be able to re-activate the iPad.
    Does he have any of the account's downloads in his computer's iTunes library : Recovering a forgotten iTunes Store account name.
    Or has he tried finding it via http://appleid.apple.com : Apple ID: How to find your Apple ID.
    If he can find the account id he can then get its password reset via http://iforgot.apple.com
    (As these are user-to-user forums, you're not talking to iTunes Support nor Apple, I've asked the hosts to remove the serial number from your post.)

  • X201 display rotates after undock and opening the lid

    Hi,
    I'm supporting some guys here in my company. One of them is using a X201 with Win XP and Presentation Manager.
    When he undocks the notebook and opens the lid afterwards the screen is turned upside down after a few seconds without hitting a key or anything. He says that this doesn't happen every time,  but almost.
    I can bring the correct view back with Strg+Alt+ Arrow Up.
    Is there a way to avoid this behavior?
    Thanks
    Mith
    Solved!
    Go to Solution.

    hey Mithrandir,
    try removing Presentation Manager and check if there is any new driver for that unit's graphic card. Install if there is and try again.
    WW Social Media
    Important Note: If you need help, post your question in the forum, and include your system type, model number and OS. Do not post your serial number.
    Did someone help you today? Press the star on the left to thank them with a Kudo!
    If you find a post helpful and it answers your question, please mark it as an "Accepted Solution"!
    Follow @LenovoForums on Twitter!
    Have you checked out the Community Knowledgebase yet?!
    How to send a private message? --> Check out this article.

  • What do i do if my internet is wep and i need it to be wpa2 because my ipod touch 4th gen connects to the internet but when i click on safari or itunes it says safari cannot open the page because its not connected to the internet

    what do i do if my internet is wep and i need it to be wpa2 because my ipod touch 4th gen connects to the internet but when i click on safari or itunes it says safari cannot open the page because its not connected to the internet. i have contacted apple support and they said to change from wep to wpa2 but when i change it to wpa2 and type in password and connect on my laptop it says the saved setting on this computer for the network do not match the require ments of the network

    My 2nd gen works fine with WPA2 and AES encryption.
    You may need to go back and start over.  Reset the router back to factory defaults, log on as the admin, set up security, DHCP, and make sure the IP address pool has enough IP addresses to lease to ALL of the computers/devices that will connect to that the router.

Maybe you are looking for