How to use "URLConnection" in sessions with more than one screen??

Hi,
Requests can be sent to http servers using "URLConnection" objects. The responses can be parsed via their InputStream; so far so good...
Question is:
What can I do when I want to send a request to a server where there is first a log-in screen and only then there is the desired screen where the real request should be sent?
Since the REAL request cannot be directly sent without the authentication check first, I need some kind of "context" or session in which I may make some consequent actions... Sending an independent request using a diferent URLConnection just won't do since I'm unauthorized via the second connection!!
Generally, I need a way to send consequent requests where the second request may be sent only if the first request authenticated me...
How can I do that? (Hope my question is clear...)
--Amir.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Well, you will have to deal with the cookies or however the server knows you are authenticated. Personally I prefer to use something like Apache HttpClient rather than dealing with icky details like that on my own.

Similar Messages

  • How to read an internal table with more than  one (2 or 3) key field(s).

    how to read an internal table with more than  one (2 or 3) key field(s). in ecc 6.0 version

    hi ,
    check this..
    report.
    tables: marc,mard.
    data: begin of itab occurs 0,
          matnr like marc-matnr,
          werks like marc-werks,
          pstat like marc-pstat,
          end of itab.
    data: begin of itab1 occurs 0,
          matnr like mard-matnr,
          werks like mard-werks,
          lgort like mard-lgort,
          end of itab1.
    parameters:p_matnr like marc-matnr.
    select matnr
           werks
           pstat
           from marc
           into table itab
           where matnr = p_matnr.
    sort itab by matnr werks.
    select matnr
           werks
           lgort
           from mard
           into table itab1
           for all entries in itab
           where matnr = itab-matnr
           and werks = itab-werks.
    sort itab1 by matnr werks.
    loop at itab.
    read table itab1 with key matnr = itab-matnr
                              werks = itab-werks.
    endloop.
    regards,
    venkat.

  • How do I share my contacts with more than one group? I really don't want to have re-type them into a different group. Help!

    How do I share my contacts with more than one group without having to re-type them into each group?

    Without "pretending" to be yourself on the other phone (change settings) there's nothing else you can do.
    iOS devices are meant to be single user and can't view iCloud.com the same way a Mac or PC can do.
    You need to find a desktop or laptop machine (Mac or PC) to log in at iCloud.

  • How to generate a certificate request with more than one OU?

    We're using Sun Java System Web Server 6.1 SP4. The Corp. has it's own CA and organize their certificates in a hierarchical rule with more then one organization unit (OU) in a chain.
    So what we need is generate a certificate requeste with more than one OU, but the Web Server wizard has only one text field for it. We've already tried to fill in this field the complete chain of OUs like "ou=orgX, ou=deptY, ou=secZ" and didn't work either.
    Thank's in advance,
    Jeff!

    Do you have tried with the command line "certutil" ?
    #<SERVER-ROOT>/bin/https/admin/bin/certutil

  • Can I use a magic trackpad with more than one Mac at a time?

    I am attempting to pair a MTP with a second MacBook Pro.  So far I can't get system preferences to find the MTP.
    I am wondering whether the MTP can be paired with only one Mac at a time, and that this is why my MBP won't find it.
    The reason I am thinking this is because the little booklet that comes with the MTP says 'after you pair your MTP with a Mac, you can pair it again with a different Mac.  To do this, you first remove the existing pairing and then pair the trackpad again'.
    Can anyone advise, please?
    If it can be paired with more than one MBP at a time, any suggestions why my system preferences search for the MTP is not producing any results?
    Thanks

    Yes, your keyboard, mouse or trackpad can be paired with multiple Macs.  You can even have multiple keyboards, mice or trackpads paired with one Mac.  The caveat is that the device can only be connected to one Mac at a time.  The device can't be paired or connected with a Mac while it's currently connected to another.
    Pairing a device with 2 Macs will be troublesome if the Macs are located within 33 ft of each other.  The device will connect with the first available paired Mac and then unavailable to the second.   If the Macs are located outside the 10meter range, it's quite easy to power off the keyboard (forcing a disconnect) then walking the keyboard to Mac 2 and powering the keyboard on.   I do this with a keyboard from my iMac to a Mac Mini in another room.
    Captfred

  • How can I search for files with more than one keyword?

    I´ve created some keywords, and some files in my folder are tagged with two, three or more keywords.
    Is there a way to search for files using more than one keyword on the search field?
    Thanks!

    Use the Find command (menu Edit) and in criteria at the right side is a plus sign to add another criteria and set it to your custom wishes.
    make a choice in results and you should be OK

  • How to use left outer join on more than one table (source)

    Hi all,
    In our project we are converting the Unix shell & SQL scripts into OWB mappings. We are facing problem converting left outer join in OWB. here is one of the example. i have just pasted the FROM and where condition.
    FROM ym_scr t1, branch_finmonth t3
    LEFT OUTER JOIN item_image t2
    ON (t1.branch_no = t2.branch_no
    AND t1.item_no = t2.item_no
    AND t3.to_date between t2.tran_dt and t2.to_dt
    AND t2.to_dt >= '$start_images' ) <<<========= '$start_images' THIS COMES FROM THE UNIX VARAIBLE ,
    We converts the same when we are putting it in OWB join Operator
    INGRP1.branch_no = INGRP2.branch_no(+)
    AND INGRP1.item_no = INGRP2.item_no(+)
    AND INGRP3.to_date between t2.tran_dt and t2.to_dt
    AND INGRP2.to_dt >= INGRP2.start_images
    But as you see in the OWB opreator we can put left join with INGRP1 with INGRP2.
    We can not make same join with INGRP3 & INGRP4 , becoz it failed saying "you cannot left outer join on more than one table/source".
    so overall this OWB code makes incomplete left outer join as per the above ANSI SQL join in Oracle.
    Bcoz of the problem we are getting less number of rows...........
    SO please please help me on this
    Regards
    Ashok

    Hi.
    I know this topic is here for a while now, but I had the same problem today, searched for help and didn´t find anything.
    Later I figured out how to do this.
    You just have to put the (+) one time, and the OWB converts in an LEFT OUTER JOIN statement.
    For this case, all you have to do is:
    ( INGRP1.branch_no = INGRP2.branch_no(+) AND INGRP1.item_no = INGRP2.item_no AND INGRP2.to_dt >= INGRP2.start_images )
    Regards,
    Godoy

  • Using Portable Home Directories with more than one client

    Hi, I've got a general question about Portable Home Directories (PHD) that I'm hoping someone with more experience can help me with. I've only ever tied used PHDs to tie a Network Home to a single laptop in the past. But now I'd like to sync the home directories of a user that uses both an iMac (in the office) and a MacBook Air (on the road).
    Any caveats to watch out for if we do this?
    What if the user is logged into both machines at the same time?
    What if the home directory on the iMac is larger than the entire SSD on the MacBook?
    Appreciate any advice before heading down this path…

    well... my english is not so good but i will try to explain it to you...
    iTunes have a funcion that put the music in the iPod automaticaly and it will put the music of THAT computer in your iPod.
    so when you conect your iPod go to options and select put the music manually or something like that (i have it in spanish XD)
    or go to the "help" in iTunes > "help iTunes" then... charge iPod > charge iPod manually
    this is dificult to explain in english im from argentina XD i hope you understand me XD

  • How to use the same BSA with more than an operating unit ?

    we have three operating units, sometimes a sales agreement is released from the three operating units, is there a way i can use the same sales agreemnet with the three operating units?

    We had the same issue recently.
    Users wanted same locator in the same org under different subinventories.
    We suggested 2 solutions
    1) Make the 1st locator segment=subinventory name (e.g. East.A.3.10, West.A.3.10)
    2) Add a character to the first locator (e.g. EA.3.10, WA.3.10)
    They picked up the 2nd option.
    Hope this helps
    Sandeep Gandhi
    Omkar Technologies Inc.
    Independent Techno-functional Consultant
    513-325-9026

  • How to use inbound exit class for more than one workflow step

    Hi All,
    In Offline Workflow Approval Scenarios where the work items are sent to outlook of non sap users inbox through workitem exit of the respective workflow item. Based on the user reply from outlook email(either approve or reject) which sends an auto reply to Offline user . We configure an inbound exit class and assign the same in the SMICM transaction. Based on the code written using SAP_WAPI function modules in inbound class exit offline user gets the user approval result and performs the action in SAP.
    My question now Is how can we use this inbound exit class for all the steps of a workflow.
    For ex: In a workflow I have a decision step followed by an activity step. First I will write the work item exit for the user decision step and inbound exit code for the user decision step and offline user executed the user decision step with approve action.
    followed by that I have an activity step for that I will code a work item exit for that activity level but how can I user the same inbound exit class for the activity step as well .
    Quick reply  would be of great  help for me.
    With Best Regards,
    Veni

    For the outbound processing you have the option of replacing the workflow exit by chancing the bsp application of the extended notification (see note 1448241 solution as an example of how to do the change) and replacing the standard links with a "mailto:...".
    As far as the inbound processing, that depends on what should be done in the activity step, if for example you have a bapi which executes what the user does you can call it in the inbound class instead of the user and then the relevant wapi (complete the workitem/raise event etc.).

  • How to use the stock locators for more than one subinventory

    Hi,
    We are working in Oracle Applications 11i.
    We have 4 different inventory organizations. Each with one main subinventory. One of those inventory organizations MWN has a subinventory defined with stock locators. The other three have their subinventories not defined with stock locators.
    Now, correct me if I'm wrong please, I cannot define a stock locator for an existing subinventory while there are onhand items in that subinventory.
    So, We will define new subinventory(for each inv org) with stock locators and then do a subinventory transfer to the new relevant new subinventory organization.
    The next point is: the user requests to use the same stock locators for the 4 inventory organizations. is this possible?
    thank you...

    We had the same issue recently.
    Users wanted same locator in the same org under different subinventories.
    We suggested 2 solutions
    1) Make the 1st locator segment=subinventory name (e.g. East.A.3.10, West.A.3.10)
    2) Add a character to the first locator (e.g. EA.3.10, WA.3.10)
    They picked up the 2nd option.
    Hope this helps
    Sandeep Gandhi
    Omkar Technologies Inc.
    Independent Techno-functional Consultant
    513-325-9026

  • How to read a excel file with more than one worksheet.

    Hi,
    I wanna read a sheet (anyone of it,not the first) in a excel.Who can help me!
    best wishes,
    Grant Chen

    Dear All,
    Thank you all for your reply!
    I modified SAP FM ZALSM_EXCEL_TO_INTERNAL_TABLE.
    I add an IMPORTING parameter 'I_SHEET' 
    which stands for the sequence number of worksheet  in the FM.
    FUNCTION ZALSM_EXCEL_TO_INTERNAL_TABLE .
    *"*"Local Interface:
    *"  IMPORTING
    *"     VALUE(FILENAME) LIKE  RLGRAP-FILENAME
    *"     REFERENCE(I_SHEET) TYPE  I
    *"     VALUE(I_BEGIN_COL) TYPE  I
    *"     VALUE(I_BEGIN_ROW) TYPE  I
    *"     VALUE(I_END_COL) TYPE  I
    *"     VALUE(I_END_ROW) TYPE  I
    *"  TABLES
    *"      INTERN STRUCTURE  ALSMEX_TABLINE
    *"  EXCEPTIONS
    *"      INCONSISTENT_PARAMETERS
    *"      UPLOAD_OLE
    *{   INSERT         EC6K900099                                        1
      DATA: excel_tab     TYPE  ty_t_sender.
      DATA: ld_separator  TYPE  c.
      DATA: application   TYPE  ole2_object,
            workbook      TYPE  ole2_object,
            range         TYPE  ole2_object,
            worksheet     TYPE  ole2_object.
      DATA: h_cell        TYPE  ole2_object,
            h_cell1       TYPE  ole2_object.
      DATA:
        ld_rc             TYPE i.
    *   Rückgabewert der Methode "clipboard_export     "
    * Makro für Fehlerbehandlung der Methods
      DEFINE m_message.
        case sy-subrc.
          when 0.
          when 1.
            message id sy-msgid type sy-msgty number sy-msgno
                    with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          when others. raise upload_ole.
        endcase.
      END-OF-DEFINITION.
    * check parameters
      IF i_begin_row > i_end_row. RAISE inconsistent_parameters. ENDIF.
      IF i_begin_col > i_end_col. RAISE inconsistent_parameters. ENDIF.
    * Get TAB-sign for separation of fields
      CLASS cl_abap_char_utilities DEFINITION LOAD.
      ld_separator = cl_abap_char_utilities=>horizontal_tab.
    * open file in Excel
      IF application-header = space OR application-handle = -1.
        CREATE OBJECT application 'Excel.Application'.
        m_message.
      ENDIF.
      CALL METHOD  OF application    'Workbooks' = workbook.
      m_message.
      CALL METHOD  OF workbook 'Open'    EXPORTING #1 = filename.
      m_message.
    *  set property of application 'Visible' = 1.
    *  m_message.
    ********************Modified by Grant 20080717************
      call METHOD of application 'Worksheets' = worksheet
      exporting
        #1 = I_SHEET.
      m_message.
      call method of worksheet 'Activate'.
    *  GET PROPERTY OF  application 'ACTIVESHEET' = worksheet.
      m_message.
    * mark whole spread sheet
      CALL METHOD OF worksheet 'Cells' = h_cell
          EXPORTING #1 = i_begin_row #2 = i_begin_col.
      m_message.
      CALL METHOD OF worksheet 'Cells' = h_cell1
          EXPORTING #1 = i_end_row #2 = i_end_col.
      m_message.
      CALL METHOD  OF worksheet 'RANGE' = range
                     EXPORTING #1 = h_cell #2 = h_cell1.
      m_message.
      CALL METHOD OF range 'SELECT'.
      m_message.
    * copy marked area (whole spread sheet) into Clippboard
      CALL METHOD OF range 'COPY'.
      m_message.
    * read clipboard into ABAP
      CALL METHOD cl_gui_frontend_services=>clipboard_import
        IMPORTING
          data                 = excel_tab
        EXCEPTIONS
          cntl_error           = 1
    *      ERROR_NO_GUI         = 2
    *      NOT_SUPPORTED_BY_GUI = 3
          OTHERS               = 4
      IF sy-subrc <> 0.
         MESSAGE a037(alsmex).
      ENDIF.
      PERFORM separated_to_intern_convert TABLES excel_tab intern
                                          USING  ld_separator.
    * clear clipboard
      REFRESH excel_tab.
      CALL METHOD cl_gui_frontend_services=>clipboard_export
         IMPORTING
            data                 = excel_tab
         CHANGING
            rc                   = ld_rc
         EXCEPTIONS
            cntl_error           = 1
    *       ERROR_NO_GUI         = 2
    *       NOT_SUPPORTED_BY_GUI = 3
            OTHERS               = 4
    * quit Excel and free ABAP Object - unfortunately, this does not kill
    * the Excel process
      CALL METHOD OF application 'QUIT'.
      m_message.
    * >>>>> Begin of change note 575877
    * to kill the Excel process it's necessary to free all used objects
      FREE OBJECT h_cell.       m_message.
      FREE OBJECT h_cell1.      m_message.
      FREE OBJECT range.        m_message.
      FREE OBJECT worksheet.    m_message.
      FREE OBJECT workbook.     m_message.
      FREE OBJECT application.  m_message.
    * <<<<< End of change note 575877
    *}   INSERT
    ENDFUNCTION.
    Edited by: Grant Chen on Jul 17, 2008 7:45 AM
    Edited by: Grant Chen on Jul 17, 2008 7:46 AM

  • Can I use my apple tv with more than one computer

    If my computer isn't handy can I use my daughter's macbook pro 13?

    appletv access the shared lib of a computer running itunes
    it can be many shared libs it access as long as they are on the same wifi network and turned on it should work

  • How to use iPhone 3G S in more than one iTunes.

    It keeps telling me when I hit "manually manage music" that I need to erase and sync my whole iPhone all over again. I have my own separate iTunes with all my files backed up from my iPod Nano and my iPhone is hooked up to that one, but if I go on the other Library on my computer, or my friend's library, it tells me I have to "erase and sync" but I don't want to have to do this, I just want to download some music.

    Sorry but to help fight the theft of copyright data, you can only sync with one library at a time.

  • How to find all generated profiles (with more than one nomenclature)

    Hello all,
    I have an Solution Manager 4.0 system and I want to find out:
    a. all sap profiles created via SU02 (not generated profiles)
    b. all generated profiles
    b. all generated profiles with user assignment
    Initially I extracted values from tables UST10C and UST10S for single and comp. profile information. For profile assignment, I searched UST04. But then I realized that generated profiles don't follow a standard nomenclature. Some start with T-54, some with T-56, then T-AA, T-MW [now there some T_MW profiles created via SU02 ]
    Can anyone help me here please?
    Thanks and regards,
    Sundar.

    Hi Sundar,
    please check table USR10.
    The interesting field for you is USR10-Typ.
    Field value meanings:
    C    Composite Profile 
    G    Generated Profile 
    S    Single profile   
    b.rgds, Bernhard

Maybe you are looking for

  • How do i delete my old apple id account?

    i dont need it and dont want it how do i delete it? thanks.

  • I can not open a crw image in photoshop camera Raw.

    When I go to open a CRW Image in CS5,Bridge It will not open.It says Could not complite your request because it is not the right kind of document.Need help bad. PS How do I tell what version of Camera Raw I have.By the way I have a Canon EOS 10D came

  • Can horizontal scroll bar be removed?

    The listbox controls have horizontal scroll bar that can not be removed by property notes. Is there a way to change it to invisible? Also how do I change the controls from raised or recessed to flat? Thank you for your help.

  • Retriving data from database

    i want to match the value in request.getParameter("sort") to retrive my databse infromation. i did it like dat : rs = st.executeQuery("select * from cust_info where Acc_Name LIKE ''"+request.getParameter("sort")+"'%'"); but tis doesnt seem to work. c

  • I cannot see all html elements

    I have worked on a file in Dreamweaver. When I open it in Edge Animate and look at the Elements panel I can see all the html elements BUT I cannot see them on stage. I can only see the Edge Animation stage. How can I see the entire html page?