How to tRetrieving a web page after login

I have a requirement to connect to a site and get an html content. This need to be implemented using URLConnection.
But the problem is that I need to sucessfully complete a login form first, inorder to reach that page. so how I can do this login programatically?
Can I first connect to the login url to submit the data and use the same connection object to go to the next page. Is it the way I should do it? I mean this will take care of all the cookies, headers etc that the remote server needs for the second time?
TIA,
dw

By login page, do you mean an actualy web page that contains login information or a basic authentication popup. If it is basic authentication, then you can just pass the user name and password as part of the header.

Similar Messages

  • How to redirect to different page after login in APEX 4.1

    Dear All,
    Here my Requirement is,When the users login,
    when they entered their username and password and pressed login button,
    they have to redirected to different pages based on the type of user.
    Here my LOGIN_TABLE has following 3 columns,
    1.Username
    2.Password
    3.Type.
    The TYPE has 2 values, employee and admin.
    when the type is admin they should be redirected to page 2,
    reaining i.e employee users has to be redirected to page 3.
    How can I do this? please give some suggestion.
    Thank you.
    regards,
    Gurujothi

    Dear Christian,
    Thank you for your reply,
    I would like to explain something,
    When I using the following function,
    *create or replace FUNCTION custom_auth_g (
    p_username IN VARCHAR2,
    p_password IN VARCHAR2)
    RETURN BOOLEAN IS
    BEGIN
    FOR c1 IN (SELECT 1
    FROM login_table
    WHERE upper(username) = upper(p_username)
    AND upper(password) = upper(p_password))
    LOOP
    RETURN TRUE;
    END LOOP;
    RETURN FALSE;
    END;*
    When login, It checks in the login_table table and if the username is exist with the pass word it successfully entered inside the application.
    for all users only one page which we set.
    My Login_table also contains type which has 2 type as I mentined above.
    But As I mentioned earliar based on the user type it has to be redirected to 2 different page.
    I found this Package but I cant understand,Can you please Explain?
    *create or replace PACKAGE app_security_pkg
    AS
    PROCEDURE add_user
    p_username IN VARCHAR2
    ,p_password IN VARCHAR2
    PROCEDURE login
    p_uname IN VARCHAR2
    ,p_password IN VARCHAR2
    ,p_session_id IN VARCHAR2
    ,p_flow_page IN VARCHAR2
    FUNCTION get_hash
    p_username IN VARCHAR2
    ,p_password IN VARCHAR2
    RETURN VARCHAR2;
    PROCEDURE valid_user2
    p_username IN VARCHAR2
    ,p_password IN VARCHAR2
    FUNCTION valid_user
    p_username IN VARCHAR2
    ,p_password IN VARCHAR2
    RETURN BOOLEAN;
    END app_security_pkg;*
    *create or replace PACKAGE BODY app_security_pkg
    AS
    PROCEDURE login
    p_uname IN VARCHAR2
    ,p_password IN VARCHAR2
    ,p_session_id IN VARCHAR2
    ,p_flow_page IN VARCHAR2
    IS
    lv_goto_page NUMBER DEFAULT 1;
    BEGIN
    -- This logic is a demonstration of how to redirect
    -- to different pages depending on who successfully
    -- authenticates. In my example, it simply demonstrates
    -- the ADMIN user going to page 1 and all other users going
    -- to page 2. Add you own logic here to detrmin which page
    -- a user should be directed to post authentication.
    IF UPPER(p_uname) = 'ADMIN'
    THEN
    lv_goto_page := 1;
    ELSE
    lv_goto_page := 2;
    END IF;
    APEX_UTIL.SET_SESSION_STATE('FSP_AFTER_LOGIN_URL');
    wwv_flow_custom_auth_std.login
    p_uname => p_uname,
    p_password => p_password,
    p_session_id => p_session_id,
    p_flow_page => p_flow_page || ':' || lv_goto_page
    EXCEPTION
    WHEN OTHERS
    THEN
    RAISE;
    END login;
    PROCEDURE add_user
    p_username IN VARCHAR2
    ,p_password IN VARCHAR2
    AS
    BEGIN
    INSERT INTO app_users (username, PASSWORD)
    VALUES (UPPER (p_username),
    get_hash (TRIM (p_username), p_password));
    COMMIT;
    EXCEPTION
    WHEN OTHERS
    THEN
    ROLLBACK;
    RAISE;
    END add_user;
    -- Function to Perform a oneway hash of the users
    -- passwords. This cannot be reversed. This exmaple
    -- is a very week hash and if been used on a production
    -- system, you may want to use a stronger hash algorithm.
    -- Read the Documentation for more info on DBMS_CRYPTO as
    -- this is the supported package from Oracle and
    -- DBMS_OBFUSCATION_TOOLKIT is now depricated.
    FUNCTION get_hash (p_username IN VARCHAR2, p_password IN VARCHAR2)
    RETURN VARCHAR2
    AS
    BEGIN
    RETURN DBMS_OBFUSCATION_TOOLKIT.md5 (
    input_string => UPPER (p_username)
    || '/'
    || UPPER (p_password));
    END get_hash;
    PROCEDURE valid_user2 (p_username IN VARCHAR2, p_password IN VARCHAR2)
    AS
    v_dummy VARCHAR2 (1);
    BEGIN
    SELECT '1'
    INTO v_dummy
    FROM app_users
    WHERE UPPER (username) = UPPER (p_username)
    AND PASSWORD = get_hash (p_username, p_password);
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN raise_application_error (-20000, 'Invalid username / password.');
    END valid_user2;
    FUNCTION valid_user (p_username IN VARCHAR2, p_password IN VARCHAR2)
    RETURN BOOLEAN
    AS
    BEGIN
    valid_user2 (UPPER (p_username), p_password);
    RETURN TRUE;
    EXCEPTION
    WHEN OTHERS
    THEN RETURN FALSE;
    END valid_user;
    END app_security_pkg;*
    And you said "assign an URL to FSP_AFTER_LOGIN_URL, depending on the Type column",
    Where to assign,Could you please Explain?
    Thank you.

  • How to redirect to a page after login fails?

    Since I am working on an automated login from Forms I would like the login page to redirect to an error page if the login fails. I can't seem to find an option for this.
    I am using a public page that branches to 101 with BRANCH_TO_PAGE_ACCEPT, but when login fails I see this login page.
    Instead of that I would like to redirect to a public page that shows a message.
    How can I do this?
    Wendy

    A login failure is when the user and/or pass is not correct. I do not want to show page 101 but a different page when this happens.
    I am using the default login page but I am calling it with BRANCH_TO_PAGE_ACCEPT so the user never sees it and I want to keep it that way....

  • I can't print any web page. after the print command, it wants to save xps files. on cannon printer. vista system

    can't print any web page. after the print command, it wants to save as a xps file.
    == This happened ==
    Every time Firefox opened
    == after up grade to 3.6.6 ==
    == User Agent ==
    Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 1.1.4322; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C)

    I found that Firefox/XPS had deleted all printer driver setups except for the XPS connection. I had to reinstall my printer connection in order to have that selection present in the printer dialogue box.

  • How to open a web page in JFrame.

    Please let me know how to open a web page in the Java Frame.

    HTML code can be viewed in any Swing component you want.

  • How to redirect a JSP page after the session is killed

    Hello!
    I am quite new to JSP. I have a question about how to redirect a jsp page after the session is killed. Could anyone help?
    thanks a lot in advance!

    You can't, directly. There's no connection betweenthe server and browser.
    even after invalidating the session. we can do it
    directly using the statement
    response.sendRedirect("....");
    or we can use the meta refresh tag.if session is invalidated and if we try to do response.sendRedirect(".. ") it throws IllegalStateException

  • Safari still remembers web pages after RESET.

    Safari still remembers web pages after RESET.
    Is this a bug in new safari alot of people are having issues !!

    Ah found it, after reset it will still show purple links like they have been visited. To stop it reset then Quit safari and re-open.
    also new great Cleaner for windows is now avalible for MAC cool
    http://www.piriform.com/mac/ccleaner

  • Adobe air how do links between web pages

    Hello!
    I try to use adobe air with dreamweaver : The tutorial shows how to package a web page but I can not integrate multiple pages. The html code <a href="page2.html"> test link </ a> is incorrect? Should I add something in the xml file?
    Thanks for help.

    It's just basic page for test :
    <html>
    <head>
    <title>AIRHelloWorld</title>
    <script>
    function init()
    runtime.trace("init function called");
    </script>
    </head>
    <body onload="init()">
    <div align="center">Hello World</div>
    <div><a href="page2.html">test de lien</a></div>
    </body>
    </html>

  • How to prevent duplicate web pages from loading

    <blockquote>Locking duplicate thread.<br>
    Please continue here: [[/questions/930219]]</blockquote>
    how to prevent duplicate web pages from loading

    <s>Hi berternie, can you describe this in more detail?
    Are you saying the identical page loads in two different tabs? When does that happen -- when you click a link? or when you use a bookmark?
    Or do you have multiple tabs open every time you see your home page (i.e., when you start up, open a new window, or click the home icon)?</s>
    I see, you have more info in this thread: https://support.mozilla.org/en-US/questions/930219

  • How tall is a web page?

    So we're doing pages 900+ pixels wide these days, but I'm wondering how much vertical content we can use before the user has to start scrolling - what he/she first sees when the page loads. Is there a rule of thumb (or mouse finger) for this?

    It's true that you need to make an educated guess about the people who will be viewing the site.
    For instance, if you know for a (relative) fact that they all use 12 inch monitors and IE6, that gives you an idea of what to shoot for.
    If you have a sense that they all have wraparound monitors (surely someone will invent them) that are 36 inches on the diagonal and the latest, greatest Browsers, that tells you something else.
    You can get general statistics about Monitor usage from w3c http://www.w3schools.com/browsers/browsers_display.asp Allowing for a vertical scrollbar and top of the Monitor screen material (toolbars, etc.), you can kind of guess at the actual Viewport sizes.
    If you want to keep people on your page, and not scrolling to kingdom come (how tall is a web page? how high is the sky?), there are strategies:
    Make the header stable and the container below it scrollable within a container so it looks like it's all on the screen...
    Make the page short
    Make the page liquid, so it doesn't hang off the page on small monitors or cower in the corner of larger monitors
    Use Spry Tabbed Panels, or Spry Accordions, or other Spry content techniques
    You can imitate Browser/Monitor Viewport sizes by doing Window > Cascade and adjusting the size of the floating window manually (drag the right bottom corner). The size of the Viewport will show at the right side of the Tag Selector at the bottom of the Document Window (1038 x 628, for instance).
    Beth

  • Get the subsequent page after login

    I would like to retrieve the content of site that required the login using userid and password via post method. I am able to login using HttpUrlConnection by setting method to POST providing the id and password. However when I tried to access the subsequent pages (after login) by issuing new HttpUrlConnection, it said I've not login. I believe this is something to do with cookies setting which is done internal by browser. If we login using browser, and type in the subsequent page, the browser will direct to the correct page. But in actual Java program environment, it does seem to be working this way. Can anyone help?
    thx.

    Show us the code, please.

  • How do you return to web page after executing servlet?

    When I submit some values to my servlet from a page, using a from, how do I get back into the web page directory? When you call the servlet, the url turns to "./servlet", and if I click on submit again, it tries to find "./servlet/servlet" so obviously it kicks up an error.
    Basically I want the servlet to accept answers in a form, rebuild that form using the answers submitted, and go back to that rebuild. Hopefully, the user shouldn't notice anything changing, which is the idea, excepth his/her answers have been stored by the servlet.
    ANY help would be much appreciated.
    Thanks,
    Miles

    Could you briefly explain how this works joshman. Are you saying use send.redirect or something else I have not found? if so, could you elborate a bit (some method names would be usefull too). I have no idea about headers, which probably doesn't help.
    The problem is I either have to out.println the modified html (with the answers in the values in the input tags), which means I must get the web server to look in the directory where the original page came from, otherwise pictures and other stuff dont show. Then just outputting the html would be as if the original html file was given with inserted values.
    OR
    I have to save modified html files in the same directory under different names, give these to the client and delete them after a while to save spacew. I'd rather not have to do this as it complicates stuff.
    Cheers again.

  • How to make it go to a designated page after login

    Hello Experts,
    I have a simple problem but i havent been able to figure it out. I have a simple application that has several public pages and only one "reports" page that requires login.
    When I am in the "reports" page, I click login and after entering my credentials, the application takes me to page 1. (I actually want to to go to page 5 "the reports page")
    I tried creating a branch in the login page so that after the login button is presed that it will take me to the reports page... but it didnt work...
    Any idea how to make it go to the "reports" page and not the default page after I log in?
    Thanks a lot!!

    The login process on the login page contains the following plsql:
    wwv_flow_custom_auth_std.login(
    P_UNAME => v('P101_USERNAME'),
    P_PASSWORD => :P101_PASSWORD,
    P_SESSION_ID => v('APP_SESSION'),
    P_FLOW_PAGE => :APP_ID||':36'
    in this case after login page 36 is started.
    change the number in the desired page.
    Fred.

  • How to print any web page to PDF in Windows 7 after Firefox version 8?

    Some web pages do not print to PDF after Firefox Version 8. The result is either incomplete PDF or the print progress stops at some point and Firefox is stuck. For example the following web page http://en.wikipedia.org/wiki/Abraham_Lincoln prints to PDF with Firefox Version 8, but it does not print with any version of Firefox newer than 8. Note that the latest version of Acrobat Professional produced the same results as well as other PDF generating tools such as "FreePDF XP" and "Bullzip". Also the same web page on this same machine does print from within Internet Explorer. However using Internet Explorer is not a solution for our needs.
    Thank you for looking into this.
    Plamen Djambazov
    ''edited to remove email address''

    Graphics driver support seems to be a difficult area to get right...
    I'd just be guessing as to any specific differences between Fx8 and Fx17 that affect the Adobe Acrobat plugin.

  • Banking web site after login fails to display properly and says I need to have CSS enabled. Can't find how to do that.

    Running FF 5.0 on Win XP Pro. Several web sites stopped displaying properly overnight without a computer shutdown or FF shutdown. One of the sites is a banking site which displayed normally until after login when it failed to display and there was a message saying best viewed with CSS turned on. I've restarted both FF and then the computer and FF to no avail. Tried both No Style and Basic Style Views with no change. Did not do a power off full computer shutdown and restart yet. Has only happened in FF 5.0. Never happened in previous versions.

    Click here, follow the instructions, and choose Transfer Purchases in the File menu.
    (79456)

Maybe you are looking for

  • Connection Problem with MIFI 1451

    I have purchased a MIFI 1451 HotSpot device and it works fine with my laptop. It is suppose to allow up to 5 devices at one time.  I have attempted several times to connect an older desktop Dell computer to the system but it will not work. The comput

  • How to verify existence/absence of debug information in a jar file

    Given a jar, how can I tell if it contains debug information or not? Is there a tool for this? (e.g, like the 'file' utility on linux, which outputs whether an ELF executable is stripped or not) Amit

  • SC-Multiline container

    Hi, have an SC for approval. In one of the Std.Task 10008126, there is a multiline container &REQREQ.MATERIALGROUPLIST& which displays the material group. Also I am displaying a Total value, so the content is something like this: Total value is 100 a

  • How to install Exaprom PDF 1.0?

    Hi, I'm having problems to see the "Free PDF Report with ItextSharp" from Exaprom PDF. When I put it in the folder user.lib, the links not appears! Please, see the images below! Thks!  Solved! Go to Solution. Attachments: image1.JPG ‏19 KB image2.JP

  • Is 1.3 Bios really better than 1.52B?? Neo2 Board and Some Observations!

    Hi All... I read this post on the forums and it got me thinking and i did some fiddling and made some observations.. This is whith regard to the 1.3Bios being better than the 1.52B Bios.. because it would let you run in turbo mode... Ok i've spent th