URL Connection with redirects

I got a scenario where it directs multiple times (less than 4 times) and finally renders the output.
I want to get the final output. I tried this but what I get is 302 status code with no content.
How to get the final content.
Is there any redirect attribute I should set in HttpURLConnection class.
I was under the impression redirects happens automatically and eventually shows the final output if the redirects are less than 5, should I programatically handle this with 'location' header field
Following is my code sample
URL hcURL = new URL("http://localhost:8080/test/index.xml");
HttpURLConnection.setFollowRedirects(true);
HttpURLConnection hcConnection = (HttpURLConnection)hcURL.openConnection();
BufferedReader in = new BufferedReader(new InputStreamReader(hcConnection.getInputStream()));
Log.debug("Value of the response code is "+hcConnection.getResponseCode());
Log.debug("Value of the response Message is "+hcConnection.getResponseMessage());
while ((inputLine=in.readLine()) != null) {
Log.debug("The fetched line in the HC is "+inputLine);
}

how can I set the cookie informationSetting cookie is a server's functionality. From a client, for which java.net.HttpURLConnection class can be used, you only set the policy for cookies.
In all situations, however, I'd recommend to use http://jakarta.apache.org/httpcomponents/index.html (*) for manual development of an HTTP client side.
(* Among them modules, HttpClient is a complete and popular API. For cookies, see http://jakarta.apache.org/commons/httpclient/cookies.html )
Message was edited by:
hiwa

Similar Messages

  • Big headache with URL connection

    Hi, guys.
    i wrote an applet that measures response time of some html components, like gifs! The applet should return this wasted time by the actionperform method be executed, since this method opens a url connection with a html component. So it might return the final response time, but the result is always 0 !!! Please, could anybody help me?
    Regards Euclides.
    public void actionPerformed(java.awt.event.ActionEvent actionEvent) {
    long valor;
    Integer valornovo;
    String valor1,tam1,tarefa1;
    JTextField aux;
    tam1 = (String)ivjJComboBox1.getSelectedItem();
    tarefa1 = (String)ivjJComboBox2.getSelectedItem();
    valor = mandabala(tam1,tarefa1);
    valor1 = Long.toString(valor);
    //delayField = new JTextField(Long.toString(delay), 6);
    //valor1 = Long.toString(valor);
    ivjJTextField1.setEnabled( true );
    ivjJTextField1.setText(valor1);
    validate();
    public long mandabala(String param, String param1) {
    long time;
    long time1;
    BufferedInputStream in;
    java.net.HttpURLConnection conn;
    java.net.URL url;
    url = null;
    if (param == "100")
    byte[] buffer = new byte[99990000];
    try {
    url = new java.net.URL("http://10.0.135.15/teste.gif");
    // url = constructURL("http://10.0.135.15/performance/teste.gif");
    conn = (HttpURLConnection)url.openConnection();
    time = System.currentTimeMillis();
    //conn("http://www.dataprev.gov.br/performance/teste.gif");
    //conn("http://10.0.135.15/performance/teste.gif");
    conn.connect();
    time1 = System.currentTimeMillis();
    in = new BufferedInputStream(conn.getInputStream());
    int x = 0;
    while((x = in.read(buffer))!=-1)
    timedif = System.currentTimeMillis() - time;
    in.close();
    catch(Exception e) {
    System.out.println("Erro de conexao");

    I read it really quickly, so I apologize if you've checked this already...
    Your while loop is not executing the statement you are using to compute the timediff variable. The while loop in.read() method returns with a value of say '63000' when the .gif file is read. Since 63000!=-1 the loop exits immediately without executing the statement (System.currentTime()) in the middle.
    To correct this, you should do the following.
    long timediff=0;
    long starttime=System.currentTimeInMillis();
    int character=0;
    while( (character=in.read()) != -1 );
    timediff = System.currentTimeINMillis() - starttime;
    //return timediff;

  • HttpsURLConnection URL connection issue

    Hi All,
    I need to create URL connection with HTTPS URL. I can run Main java class successfully in machine which hosted in SAP Java server, but fail to run integrate it with e-commence application. When depployed in to SAP Java server cannot open HttpsURLConnection and always return CalssCastexception. However same code run as Java Main class
    Is this can be a (SSL) Handshake? or is this SSL issue?
    MyCode:
    String httpsURL = "https://encrypted.google.com/";
        URL myurl = new URL(httpsURL);
        HttpsURLConnection con = (HttpsURLConnection)myurl.openConnection();
        InputStream ins = con.getInputStream();
        InputStreamReader isr = new InputStreamReader(ins);
        BufferedReader in = new BufferedReader(isr);
        String inputLine;
        while ((inputLine = in.readLine()) != null) {
          System.out.println(inputLine);
        in.close();
    Thank You

    This is purely ssl issue. You can try adding the below logic first.. This code basically sets ssl properties for us.
    import java.security.Security;
    Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
    Properties properties = System.getProperties();
    String handlers = System.getProperty("java.protocol.handler.pkgs");
    if (handlers == null) {
        // nothing specified yet (expected case)
        properties.put("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol");
    else {
        // something already there, put ourselves out front
        properties.put("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol|".concat(handlers));     
    System.setProperties(properties);
    Below you start your code....

  • SQL Server Reporting services. failed to establish connection with project server. verify the url is correct.

    Dear All,
    I'm working on reporting of Project Server 2010, while configuring SQL SERVER REPORTING SERVICES faced issue after two complete days of troubleshooting along with this gone through plenty of forums, unable to figure out any solution. So finally posting on
    technet in order to find solution.
    ISSUE/PROBLEM:
    At initial configured the SQL REPORTING CONFIGURATION to sharepoint integrated database (SQL SERVER is installed on seperate machine), change the service to Domain Account and also installed sharepoint add in on server story was fine at this point. Furthur
    moving to SHAREPOINT ADMIN console and while configuring the Sharepoint Integrated Reporting continuously facing this error:
    Failed to establish connection with report server. . . . (Snapshot is attached for your further reference).
    My point of concern is that whenerver i try to open the REPORT SERVER URL on project server machine it prompts me to enter username and password but whenever i insert the domain credentails it didnt accept though it can be accesible by using the credentials
    of Local Admin of sql server machine. So i wana come to know whether its permission issue if yes then where i should mention the domain credentials.? 
    REGARDS DANISH DANIE

    Dear Paul,
    I am able to open the URL (http://psdb/ReportServer )using
    domian credential and page open with these contents
    Reporting Services Error
    The configuration parameter SharePointIntegrated is set to True but Share Point Object Model cannot be loaded
    Second,
    Configured the SPN on domain controller , performed the steps required to change the AUTHENTICATION in rsreportserver.config
    file also done the registry settings to disable the loop back settings.
    Same error still ! .... what should i do now ??? 
    REGARDS DANISH DANIE

  • Subversion - a repository connection with the supplied URL already exists

    Hi all!
    OS: SuSe 9.3
    jdeveloper:jdevstudiobase10131
    I need to create three repository connection to the same URL, with different user but jdeveloper doesn't give me any chance to do it. Returning the following error:
    Could Not Create Connection
    A repository connection with the supplied URL already exists.
    Any idea here?
    Thanks
    Gilberto
    Message was edited by:
    gilbertoca

    You might be dealing with orphaned site. Go through the following blog post and see if it helps you delete the orphaned sites.
    http://www.cjvandyk.com/blog/Lists/Posts/Post.aspx?ID=299
    Amit

  • Connection with Advanced - custom JDBC URL fails with some valid JDBC-URLs

    Hi,
    I am trying to create a connection with a custom JDBC connection string, but SQL*Developer throws the error message:
    Status : Failure -Test failed: Required property 'hostname' is not set on the DatabaseProvider my tests are:
    <li> with connection via Connection Type set to TNS and a proper alias - it works fine
    <li> with connection via Connection Type set to Advanced and exactly the same values from tns in the url: jdbc:oracle:thin:@(DESCRIPTION=(enable=broken)(ADDRESS=(PROTOCOL=tcp)(HOST=172.24.32.113)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=RESTSVP_SITE1))) - it fails with Status : Failure -Test failed: Required property 'hostname' is not set on the DatabaseProvider<li> with JDBC URL set to jdbc:oracle:thin:@172.24.32.113:1521/RESTSVP_SITE1 - it works fine
    As my jdbc url is quite close to the example in [url http://docs.oracle.com/cd/E11882_01/java.112/e16548/apxtblsh.htm#CHDBBDDA]Using JDBC with Firewalls maybe someone can help me to fix it?
    Martin
    Edited by: berx on Oct 12, 2012 11:32 AM - fixed typos

    Hi Martin,
    1/oci/thick
    2/RAC options
    3/TNS connection
    1/oci/thick
    OCI driver has a slightly different set of features than thin:
    -try oci/thick (requires Oracle Client, server or instant client) (It requires SQLDeveloper java and .dll, .so libraries to match)Re: SQL developer 3.1 shows error Incompatible version of libocijdbc
    jdbc:oracle:oci:@(DESCRIPTION=(enable=broken)(ADDRESS=(PROTOCOL=tcp)(HOST=your_host_name)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=your_service_name)))
    2/RAC options
    More speculatively:
    -Try sid instead of service name (will disable some networking features on that connection), try switching load balancing off.
    From: Unable to access RAC from SQL Developer!
    In general and especially for RAC database you should use SERVICE_NAME to connect and not SID (because only SERVICE_NAME can use load balancing and failover features):
    3/TNS connection
    with connection via Connection Type set to TNS and a proper alias - it works fine(Which Connection Type TNS did you use? TNS Connect Identifier = oci/thick, TNS Network alias (can be thin (I should check, might depend on oci/thick checkbox))
    Is this issue stopping your work i.e. is this workaround unacceptable?
    -Turloch
    SQLDeveloper team

  • URL-rewriting not working with redirect/

    I couldn't find an answer to the following problem in any of the threads:
    When navigating between pages via internal forwards, I can safely turn off cookies in my browser; the session id will be written into the requested URL, and so session state is being maintained properly. But when I use <redirect/> in a navigation rule in faces-config.xml to force Faces to redirect the request to the target page via an HTTP redirect, the URL is not being rewritten properly - the session id is missing, and so session state is not being maintained. This results in the loss of all user/session specific data for the current browser session.
    I suspect that using <redirect/> results in the Faces Lifecycle being terminated by calling responseComplete() before rendering the view, and that at this point, instead of calling encodeRedirectURL() before redirecting, the URL is being redirected without being rewritten to contain the session id.
    My question thus are: Is my suspicion correct? And is there any solution to this problem?

    What I forgot to mention: I'm using Sun's RI of JSF running on Tomcat 5.0.19.
    Any help is appreciated!
    Wolfgang

  • The URLs mapped as Internal Url of AAM redirects to Public Url while accessing

    Hi All,
    I have created a web application in Internet Zone with the url "http://new.site.com". Then used that url as public url and mapped 10 internal url to it. The internal urls are like http://new.site1.com,http://new.site2.com,http://new.site3.com,http://new.site4.com,http://new.site5.com,http://new.site6.com
    etc., 
    The host headers has been added to those URLs in IIS also. When I tried to hit the http://new.site1.com, the address bar shows the url as http://new.site.com. The same case when i tried to hit all the other 9 urls. 
    But I need the internal urls to be displayed in address bar if the user types it. Kindly help me to resolve this issue.
    Thanks
    Sowmiya S

    hi,
    refrence from the article 
    http://blog.blksthl.com/2012/12/03/a-guide-to-alternate-access-mappings-basics-in-sharepoint-2013/
    Left area            Internal
    URL’s
    Right area          Public
    URL’s with a zone
    Middle area        Zones,
    is what connects Internal URL’s to Public URL’s, many to one.
    Internal URL redirects or transforms to a Public URL, from left, to right. The URL on the left, is what you
    enter in the address field in your browser, the Public URL on the right is what you will see once there, this goes for visible and invisible links as well.
    Internal URL format: Protocol + URL (+non default port)
    Public URL is the address of the Web Application for one of the five zones available. The ‘Default’ must be filled out and has some special properties/uses,
    the other four are optional. You can only have five Public URL’s per Web Application.
    This is the URL that the browser will be redirected to in the end.
    Public URL format: Protocol + URL (+non default port)
    Zone is a label representing a Public URL, the zone is used to ‘connect’ an Internal
    URL to a Public URL. The zone names has no relation what so ever with the four Internet Explorer security zones (Internet,
    Local Intranet, Trusted sites and Restricted sites) and could just as easily been named 1,2,3,4 and 5. A zone can also represent an authentication provider.
    Zones: Default, Intranet, Internet, Custom, Extranet
    so it clearly says that Internal url will not be shown in browser only public URL will be shown.
    So in your case i suppose what you want to try is not possible.
    Whenever you see a reply and if you think is helpful,Vote As Helpful! And whenever you see a reply being an answer to the question of the thread, click Mark As Answer

  • Error while Test Connection with Connector

    hi all:
         there is an error while  Test Connection with Connector , I also test it through sys administration->sys configuration->
    suport -> sap transaction, I got all errors, I put these two errors as folows, could you please tell me how to sovle it
    ***************ERROR 1 while *error while Test Connection with Connector ******************************************************
    Test Details:
    The test consists of the following steps:
    1. Retrieve the default alias of the system
    2. Check the connection to the backend application using the connector defined in this
    system object
      Results
    Retrieval of default alias successful
    Connection failed. Make sure that Single Sign-On is configured correctly
    ************error sys administration->sys configuration-> suport -> sap transaction        ********************** 1.5 #0025B3E02892006100000A0800001798000487530FB0122E#1274690722265#com.sap.portal.prt.runtime#sap.com/irj#com.sap.portal.prt
    .runtime#guodongdong#47472##n/a##690347f0670e11df98cc0025b3e02892#SAPEngine_Application_Thread[impl:3]
    9##0#0#Error##Java###04:4524/05/10_0077_6087550
    [EXCEPTION]
    #1#com.sapportals.portal.prt.runtime.PortalRuntimeException: Exception in SAP Application Integrator occured: Application URL
    &\#39;:///sap(ZT1KVXBWektldldTeV9QQXBXRjNaWTRBLS1OZmRvZzBRWWY2QmN0WThNUmgqdUlRLS0=)/bc/gui/sap/its/webgui&\#39; is not valid!
    Please check the protocol and host entries for system &\#39;sapdev&\#39;.
         at com.sapportals.portal.appintegrator.AbstractIntegratorComponent.doContentPass
    (AbstractIntegratorComponent.java:123)
         at com.sapportals.portal.appintegrator.AbstractIntegratorComponent.doContent(AbstractIntegratorComponent.java:98)
         at com.sapportals.portal.prt.component.AbstractPortalComponent.serviceDeprecated(AbstractPortalComponent.java:209)
         at com.sapportals.portal.prt.component.AbstractPortalComponent.service(AbstractPortalComponent.java:114)
         at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)
         at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)
         at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:189)
         at com.sapportals.portal.prt.component.PortalComponentResponse.include(PortalComponentResponse.java:215)
         at com.sapportals.portal.prt.pom.PortalNode.service(PortalNode.java:645)
         at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)
         at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)
         at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:189)
         at com.sapportals.portal.prt.core.PortalRequestManager.runRequestCycle(PortalRequestManager.java:753)
         at com.sapportals.portal.prt.connection.ServletConnection.handleRequest(ServletConnection.java:240)
         at com.sapportals.portal.prt.dispatcher.Dispatcher$doService.run(Dispatcher.java:523)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sapportals.portal.prt.dispatcher.Dispatcher.service(Dispatcher.java:412)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.servlet.InvokerServlet.service(InvokerServlet.java:156)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:386)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:364)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:1039)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:265)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process
    (ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:104)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:176)

    Hi,
    As per this part of the trace:
    Exception in SAP Application Integrator occured: Application URL &\#39;:///sap(ZT1KVXBWektldldTeV9QQXBXRjNaWTRBLS1OZmRvZzBRWWY2QmN0WThNUmgqdUlRLS0=)/bc/gui/sap/its/webgui&\#39; is not valid! Please check the protocol and host entries for system &\#39;sapdev&\#39;. at ...
    You can clearly see that the system object 'sapdev' is not configured correctly/at all - you are trying to launch transaction iView
    (WEBGUI) and in order to do so you should configure the 'internet transaction server' category of the system  object
    with the hostname of the ITS server.
    Generally the template is
    <System.Access.ITS.protocol>://<System.Access.ITS.hostname>/sap<ESID>/bc/gui/sap/its/webgui?\....
    So that's why you got
    Please check the protocol and host entries for system ..

  • Cannot connect to local network while connected with EasyVPN

    Hi All,
    I'm looking on many forums for an answer, but I cannot get it working.
    I have configured EasyVPN with CCP and also with CLI. I had it both working perfect, except the most important thing.
    I can connect with the Cisco VPN client to the router, but i'm not able to connect or even ping a system inside the remote network. My laptop gets an IP address from the address pool of the router.
    I really hope someone can help me before my manager is losing his patience :-)
    Here is my config. (before someone is mentioning it, i have to clean up my config a bit...I mean, look at the acl's )
    Current configuration : 13939 bytes
    ! Last configuration change at 12:26:53 UTC Thu Jan 9 2014 by admin
    version 15.2
    no service pad
    service tcp-keepalives-in
    service tcp-keepalives-out
    service timestamps debug datetime msec localtime show-timezone
    service timestamps log datetime msec localtime show-timezone
    service password-encryption
    service sequence-numbers
    hostname Router
    boot-start-marker
    boot-end-marker
    security authentication failure rate 3 log
    security passwords min-length 6
    logging buffered 10240
    logging console critical
    enable secret 4 ********
    aaa new-model
    aaa authentication login local_authen local
    aaa authentication login ciscocp_vpn_xauth_ml_1 local
    aaa authorization exec local_author local
    aaa authorization network ciscocp_vpn_group_ml_1 local
    aaa session-id common
    no process cpu extended history
    crypto pki trustpoint TP-self-signed-********
    enrollment selfsigned
    subject-name cn=IOS-Self-Signed-Certificate-********
    revocation-check none
    rsakeypair TP-self-signed-********
    crypto pki certificate chain TP-self-signed-********
    certificate self-signed 01
      3082022B 30820194 A0030201 02020101 300D0609 2A864886 F70D0101 05050030
      31312F30 2D060355 04031326 494F532D 53656C66 2D536967 6E65642D 43657274
      69666963 6174652D 33303239 34303934 3438301E 170D3133 30343032 30353436
      31345A17 0D323030 31303130 30303030 305A3031 312F302D 06035504 03132649
      4F532D53 656C662D 5369676E 65642D43 65727469 66696361 74652D33 30323934
      30393434 3830819F 300D0609 2A864886 F70D0101 01050003 818D0030 81890281
      8100B9C3 F8E6BD43 3351D861 68398114 D31AACC1 CE16CDDA 7F0876BC 6E55EA3C
      5F258D90 20FC882D 42C90257 92DB9113 B461DD81 4080153F 6AE041AD E5BDDF7E
      7C21BD1B 35F05CCB F6D34A4D 6B04C309 F39D8426 865E2BFE 9E8051F2 6F411A49
      D71FBF0C 1AC85BEE 355563FB 2353D0C7 28D49071 840AF99B AF59D768 FCDCDF03
      94FF0203 010001A3 53305130 0F060355 1D130101 FF040530 030101FF 301F0603
      551D2304 18301680 145ACD47 89D51095 70BE5400 595E826A 6A9E5E95 71301D06
      03551D0E 04160414 5ACD4789 D5109570 BE540059 5E826A6A 9E5E9571 300D0609
      2A864886 F70D0101 05050003 8181003B 1988FFCD 93112A99 707B7AD8 B56A08C0
      C274B974 B076AA19 BAFCC868 F118AE7D 4D8A55E2 42D8F9A9 9D617093 7EF6D459
      6BC0A990 BF5AF3E8 8E7F2787 41F4BFE2 65A1A3B0 D726033A 47A24D29 159ABF92
      16DBCF5C EC6602C2 E6137C0B C1FC7125 37E9CE49 82B45E18 FAB31A36 990BB3BC
      30D9EE8E 8B0A9F7C DC0B6C2B FA2740
                quit
    no ip source-route
    ip cef
    no ip bootp server
    ip name-server ********
    ip name-server ********
    no ipv6 cef
    parameter-map type protocol-info yahoo-servers
    server name scs.msg.yahoo.com
    server name scsa.msg.yahoo.com
    server name scsb.msg.yahoo.com
    server name scsc.msg.yahoo.com
    server name scsd.msg.yahoo.com
    server name cs16.msg.dcn.yahoo.com
    server name cs19.msg.dcn.yahoo.com
    server name cs42.msg.dcn.yahoo.com
    server name cs53.msg.dcn.yahoo.com
    server name cs54.msg.dcn.yahoo.com
    server name ads1.vip.scd.yahoo.com
    server name radio1.launch.vip.dal.yahoo.com
    server name in1.msg.vip.re2.yahoo.com
    server name data1.my.vip.sc5.yahoo.com
    server name address1.pim.vip.mud.yahoo.com
    server name edit.messenger.yahoo.com
    server name messenger.yahoo.com
    server name http.pager.yahoo.com
    server name privacy.yahoo.com
    server name csa.yahoo.com
    server name csb.yahoo.com
    server name csc.yahoo.com
    parameter-map type protocol-info msn-servers
    server name messenger.hotmail.com
    server name gateway.messenger.hotmail.com
    server name webmessenger.msn.com
    parameter-map type protocol-info aol-servers
    server name login.oscar.aol.com
    server name toc.oscar.aol.com
    server name oam-d09a.blue.aol.com
    multilink bundle-name authenticated
    license udi pid C3900-SPE100/K9 sn ********
    username admin privilege 15 secret 4 ********
    username guido privilege 15 secret 4 ********
    redundancy
    ip tcp synwait-time 10
    ip ssh time-out 60
    ip ssh authentication-retries 2
    class-map type inspect imap match-any ccp-app-imap
    match invalid-command
    class-map type inspect match-any ccp-cls-protocol-p2p
    match protocol edonkey signature
    match protocol gnutella signature
    match protocol kazaa2 signature
    match protocol fasttrack signature
    match protocol bittorrent signature
    class-map type inspect match-all sdm-nat-http-1
    match access-group 101
    match protocol http
    class-map type inspect match-all sdm-nat-user-protocol--1-2
    match access-group 102
    class-map type inspect match-all sdm-nat-user-protocol--1-1
    match access-group 101
    class-map type inspect smtp match-any ccp-app-smtp
    match data-length gt 5000000
    class-map type inspect match-any ccp-skinny-inspect
    match protocol skinny
    class-map type inspect match-any ccp-h323nxg-inspect
    match protocol h323-nxg
    class-map type inspect match-any ccp-cls-icmp-access
    match protocol icmp
    match protocol tcp
    match protocol udp
    class-map type inspect match-any ccp-cls-protocol-im
    match protocol ymsgr yahoo-servers
    match protocol msnmsgr msn-servers
    match protocol aol aol-servers
    class-map type inspect match-all ccp-protocol-pop3
    match protocol pop3
    class-map type inspect match-any ccp-h225ras-inspect
    match protocol h225ras
    class-map type inspect match-any ccp-h323annexe-inspect
    match protocol h323-annexe
    class-map type inspect match-any ccp-cls-insp-traffic
    match protocol pptp
    match protocol dns
    match protocol https
    match protocol icmp
    match protocol imap
    match protocol pop3
    match protocol tcp
    match protocol udp
    class-map type inspect pop3 match-any ccp-app-pop3
    match invalid-command
    class-map type inspect match-all SDM_GRE
    match access-group name SDM_GRE
    class-map type inspect match-any ccp-h323-inspect
    match protocol h323
    class-map type inspect match-all ccp-invalid-src
    match access-group 100
    class-map type inspect match-any ccp-sip-inspect
    match protocol sip
    class-map type inspect match-all ccp-protocol-imap
    match protocol imap
    class-map type inspect match-all sdm-nat-https-1
    match access-group 101
    match protocol https
    class-map type inspect match-all ccp-protocol-smtp
    match protocol smtp
    class-map type inspect match-all ccp-protocol-http
    match protocol http
    class-map type inspect match-any CCP_PPTP
    match class-map SDM_GRE
    class-map type inspect match-all ccp-insp-traffic
    match class-map ccp-cls-insp-traffic
    class-map type inspect match-all ccp-protocol-p2p
    match class-map ccp-cls-protocol-p2p
    class-map type inspect match-all ccp-protocol-im
    match class-map ccp-cls-protocol-im
    class-map type inspect match-all ccp-icmp-access
    match class-map ccp-cls-icmp-access
    policy-map type inspect pop3 ccp-action-pop3
    class type inspect pop3 ccp-app-pop3
      log
      reset
    policy-map type inspect smtp ccp-action-smtp
    class type inspect smtp ccp-app-smtp
      reset
    policy-map type inspect ccp-pol-outToIn
    class type inspect ccp-protocol-http
      inspect
    class type inspect CCP_PPTP
      pass
    class type inspect sdm-nat-http-1
      inspect
    class type inspect sdm-nat-https-1
      inspect
    class type inspect sdm-nat-user-protocol--1-1
      inspect
    class type inspect sdm-nat-user-protocol--1-2
      inspect
    class class-default
      drop log
    policy-map type inspect imap ccp-action-imap
    class type inspect imap ccp-app-imap
      log
      reset
    policy-map type inspect ccp-inspect
    class type inspect ccp-invalid-src
      drop log
    class type inspect ccp-protocol-http
      inspect
    class type inspect ccp-protocol-smtp
      inspect
      service-policy smtp ccp-action-smtp
    class type inspect ccp-protocol-imap
      inspect
      service-policy imap ccp-action-imap
    class type inspect ccp-protocol-pop3
      inspect
      service-policy pop3 ccp-action-pop3
    class type inspect ccp-protocol-p2p
      drop log
    class type inspect ccp-protocol-im
      drop log
    class type inspect ccp-insp-traffic
      inspect
    class type inspect ccp-sip-inspect
      inspect
    class type inspect ccp-h323-inspect
      inspect
    class type inspect ccp-h323annexe-inspect
      inspect
    class type inspect ccp-h225ras-inspect
      inspect
    class type inspect ccp-h323nxg-inspect
      inspect
    class type inspect ccp-skinny-inspect
      inspect
    class class-default
      drop
    policy-map type inspect ccp-permit
    class class-default
      pass
    policy-map type inspect ccp-permit-icmpreply
    class type inspect ccp-icmp-access
      inspect
    class class-default
      pass
    zone security in-zone
    zone security out-zone
    zone-pair security ccp-zp-self-out source self destination out-zone
    service-policy type inspect ccp-permit-icmpreply
    zone-pair security ccp-zp-in-out source in-zone destination out-zone
    service-policy type inspect ccp-inspect
    zone-pair security ccp-zp-out-self source out-zone destination self
    service-policy type inspect ccp-permit
    zone-pair security ccp-zp-out-zone-To-in-zone source out-zone destination in-zone
    service-policy type inspect ccp-pol-outToIn
    crypto isakmp policy 1
    encr 3des
    authentication pre-share
    group 2
    crypto isakmp client configuration group jmgvpn
    key ****
    pool SDM_POOL_1
    include-local-lan
    max-users 10
    netmask 255.255.255.0
    crypto isakmp profile ciscocp-ike-profile-1
       match identity group jmgvpn
       client authentication list ciscocp_vpn_xauth_ml_1
       isakmp authorization list ciscocp_vpn_group_ml_1
       client configuration address respond
       virtual-template 1
    crypto ipsec transform-set ESP-3DES-SHA esp-3des esp-sha-hmac
    mode tunnel
    crypto ipsec profile CiscoCP_Profile1
    set transform-set ESP-3DES-SHA
    set isakmp-profile ciscocp-ike-profile-1
    interface Null0
    no ip unreachables
    interface Embedded-Service-Engine0/0
    no ip address
    no ip redirects
    no ip unreachables
    no ip proxy-arp
    ip flow ingress
    shutdown
    interface GigabitEthernet0/0
    description JMG$FW_INSIDE$
    ip address 10.0.14.*** 255.255.255.0
    no ip redirects
    no ip unreachables
    no ip proxy-arp
    ip flow ingress
    ip nat inside
    ip virtual-reassembly in
    zone-member security in-zone
    glbp 10 ip 10.0.14.***
    glbp 10 authentication text JMG
    glbp 10 forwarder preempt delay minimum 100
    duplex auto
    speed auto
    no mop enabled
    interface GigabitEthernet0/1
    description Cloud$ETH-LAN$$FW_INSIDE$
    ip address 10.3.15.*** 255.255.255.252
    no ip redirects
    no ip unreachables
    no ip proxy-arp
    ip flow ingress
    zone-member security in-zone
    duplex auto
    speed auto
    no mop enabled
    interface GigabitEthernet0/2
    description Internet (Only in use on R01)$FW_OUTSIDE$$ETH-WAN$
    ip address 46.144.***.*** 255.255.255.240
    no ip redirects
    no ip proxy-arp
    ip verify unicast reverse-path
    ip flow ingress
    ip flow egress
    ip nat outside
    ip virtual-reassembly in
    zone-member security out-zone
    duplex auto
    speed auto
    media-type rj45
    no mop enabled
    interface Virtual-Template1 type tunnel
    ip unnumbered GigabitEthernet0/0
    tunnel mode ipsec ipv4
    tunnel protection ipsec profile CiscoCP_Profile1
    ip local pool SDM_POOL_1 192.168.1.1 192.168.1.10
    ip forward-protocol nd
    ip http server
    ip http authentication local
    ip http secure-server
    ip http timeout-policy idle 60 life 86400 requests 10000
    ip nat inside source list 10 interface GigabitEthernet0/2 overload
    ip nat inside source list 11 interface GigabitEthernet0/2 overload
    ip nat inside source static tcp 10.0.14.*** 443 interface GigabitEthernet0/2 443
    ip nat inside source static tcp 10.0.14.*** 80 interface GigabitEthernet0/2 80
    ip route 0.0.0.0 0.0.0.0 GigabitEthernet0/2 permanent
    ip route 10.0.0.0 255.0.0.0 GigabitEthernet0/1 permanent
    ip route 10.1.14.*** 255.255.255.0 10.0.14.*** permanent
    ip access-list extended SDM_GRE
    remark CCP_ACL Category=1
    permit gre any any
    logging trap debugging
    access-list 1 remark HTTP Access-class list
    access-list 1 remark CCP_ACL Category=1
    access-list 1 permit 10.3.15.24 0.0.0.3
    access-list 1 permit 10.0.14.0 0.0.0.255
    access-list 1 deny   any
    access-list 3 remark CCP_ACL Category=2
    access-list 3 permit 10.5.14.0 0.0.0.255
    access-list 3 permit 10.0.14.0 0.0.0.255
    access-list 5 remark CCP_ACL Category=2
    access-list 5 permit 10.0.14.0 0.0.0.255
    access-list 6 remark CCP_ACL Category=2
    access-list 6 permit 10.0.14.0 0.0.0.255
    access-list 7 remark CCP_ACL Category=2
    access-list 7 permit 10.0.14.0 0.0.0.255
    access-list 8 remark CCP_ACL Category=2
    access-list 8 permit 10.0.14.0 0.0.0.255
    access-list 9 remark CCP_ACL Category=2
    access-list 9 permit 10.0.14.0 0.0.0.255
    access-list 10 remark CCP_ACL Category=2
    access-list 10 permit 10.0.14.0 0.0.0.255
    access-list 11 remark CCP_ACL Category=2
    access-list 11 permit 10.0.14.0 0.0.0.255
    access-list 100 remark CCP_ACL Category=128
    access-list 100 permit ip host 255.255.255.255 any
    access-list 100 permit ip 127.0.0.0 0.255.255.255 any
    access-list 100 permit ip 192.168.253.0 0.0.0.255 any
    access-list 101 remark CCP_ACL Category=0
    access-list 101 permit ip any host 10.0.14.153
    access-list 102 remark CCP_ACL Category=0
    access-list 102 permit ip any host 10.0.14.173
    no cdp run
    control-plane
    banner login ^CCCPlease login. Or leave if you have no right to be here.^C
    line con 0
    login authentication local_authen
    transport output telnet
    line aux 0
    login authentication local_authen
    transport output telnet
    line 2
    no activation-character
    no exec
    transport preferred none
    transport input all
    transport output pad telnet rlogin lapb-ta mop udptn v120 ssh
    stopbits 1
    line vty 0 4
    access-class 23 in
    authorization exec local_author
    login authentication local_authen
    transport input telnet ssh
    line vty 5 15
    access-class 23 in
    authorization exec local_author
    login authentication local_authen
    transport input telnet ssh
    scheduler allocate 20000 1000
    scheduler interval 500
    end

    Remove the ip nat outside command for a moment during a permitted downtime.
    I have a feeling you should do some NAT excemption for the VPN traffic (deny vpn traffic for nat policies).

  • Solved. Travel router WTR54GS sharing one wireless hotspot connection with multiple devices

    Hi, Passing on info I've learned.
    The manual for the WTR54GS mentions being able to "...use multiple devices on a single hotspot account in a coffee shop or airport lounge...". See my original posting, "How to set up a wireless private bubble at paid hotspot? WTR54GS?", which ended in a dead end. I subsequently had a Linksys live chat session and the representative provided the solution. Perhaps worthy to be included in the Wireless FAQ?
    Situation: you have access to a paid hotspot (hotel room, meeting room, etc.) and you want to share the connection with several devices, also wirelessly.
    Solution: the WTR54GS can accept an incoming Internet connection wirelessely and re-broadcast that connection to form your own private bubble or network. (Note the WTR54GS can also accept an incoming Internet connection via Ethernet cable).
    Linksys Live Chat pointed me to these web pages.
    Go to the Linksys Easy Answers page: For a schematic of the concept of "associating the travel router to a hotspot (wirelessly)" search for Easy Answer ID# 4831
    URL for above is http://linksys.custhelp.com/cgi-bin/linksys.cfg/php/enduser/std_adp.php?p_faqid=4831&p_created=1167963305&p_sid=GmLnq3Zi&p_accessibility=0&p_lva=&p_sp=cF9zcmNoPTEmcF9zb3J0X2J5PSZwX2dyaWRzb3J0PSZwX3Jvd19jbnQ9NjImcF9wcm9kcz0wJnBfY2F0cz0xNzIxLDE3MjMmcF9wdj0mcF9jdj0yLjE3MjMmcF9zY2ZfbGFuZz0xJnBfcGFnZT0xJnBfc2VhcmNoX3RleHQ9V1RSNTRHUw**&p_li=&p_topview=1
    There is a "configuration simulator" that shows the options for selecting a wired or wireless incoming Internet Type.
    http://linksys.com/ui/files/WTR54GS/1.0_15/Setup-Wireless.htm
    The hotspot has to be "open", that is transmitting an SSID and with no WEP or WPA key. It may have a log-in page accessible via a web browser, this is okay as this will be passed onto the connected device.
    My personal application is to be able to connect a PDA that has a 801.2b wifi to a 801.2g wireless network. I haven't tried it but if this works, it will extend the useful life of my PDA in a "g" environment. Will report back once I find a "g" only environment. Comments?
    -Tony
    Dang, the long URL is making for a really wide message. Is there a fix?
    Message Edited by tony_vancouver on 02-28-2008 02:08 PM
    Message Edited by tony_vancouver on 02-28-2008 02:12 PM

    There are two conditions which must be met in order to use your WTR54GS to "extend" an incoming, wireless internet connection:
    The incoming connection must be unsecured.  You have already covered this point;
    The security settings on your WTR54GS can only be set to "WEP," or to "Disabled."  If you choose "WEP," then you can use either a 40/64-bit, or a 128-bit key.
    If those two conditions have been met, then it works fine -- says the guy who is sharing one paid internet conneciton in his hotel amongst three devices, and with co-workers in nearby rooms.  

  • How do you keep the same URL connection connected continuously?

    I am trying to extract information from a web page, but it puts a cust_id in the middle of the URL. It generates the cust_id randomly everytime you use the site. I connect to the initial URL to find the cust_id, I substring that to the new URL and then make a new connection to extract the information, but the web page gives me an error saying that it doesn't recognise the cust_id. As if it was a new connection with the wrong cust_id.
    How can I keep the first connection open and with the same cust_id information and then jump to another web page but using the initial connection. Using IE6 I can just cut and paste the second URL and get to the page, but with my java application it doesn?t work. Please have a look at my code and let me know if I am doing anything wrong.
    URL inputURL;
         String inputLine;
         URLConnection connection;
         String page = "";
         int x;
         String cust_id1 = "";
         String cust_id2 = "";
         String site;
         File outputFile = new File("web.txt");
         FileWriter out = new FileWriter(outputFile);
       try
         inputURL = new URL("http://www-ets.woolworths.com.au/ets/owa/login?topage=search");
         connection = inputURL.openConnection();
         BufferedReader inputStream = new BufferedReader(new InputStreamReader(connection.getInputStream()));
         while ((inputLine = inputStream.readLine()) != null)
              page = page + inputLine;
              System.out.println(inputLine);
              x = inputLine.indexOf("cust_id=");
              if (x != -1)
              cust_id1 = inputLine.substring(x, x + 14);
              PrintWriter file = new PrintWriter(new FileOutputStream("web.txt"));
              out.write(page);
              out.close();
              System.out.println("1st time successful");
              System.out.println(cust_id1);
              //inputStream.close();
              //extracted the customer id, now able to search for the product
              //test for milk
         site = "http://www-ets.woolworths.com.au/ets/owa/items?search_pattern=milk&";
         site = site + cust_id1;
         site = site + "&imode=search&search_option=";
         System.out.println(site);     
         inputURL = new URL(site);
         BufferedReader inagain = new BufferedReader(new InputStreamReader(inputURL.openStream()));
         //tried the connection way
         //connection = inputURL.openConnection();          
         //BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
         while ((inputLine = inagain.readLine()) != null)
              //System.out.println(inputLine);          
              x = inputLine.indexOf("cust_id=");
              if (x != -1)
              cust_id2 = inputLine.substring(x, x + 14);
              System.out.println(cust_id1);
              System.out.println(cust_id2);
              System.out.println("2nd time completed");
              inputStream.close();
       catch(ArrayIndexOutOfBoundsException obe)
                System.out.println("Usage: FetchURL url");
       catch(IOException ioe)
                System.out.println("IO Exception");

    Please have a quick look at my code and see if I am doing anything wrong. I havent been able to set the correct cookies and the output html page comes up with an error saying that it could not retrieve my request. This time there is no mention of invalid cust_id.
              try
                   URL inputURL = new URL("http://www-ets.woolworths.com.au/ets/owa/login?topage=search");
                   connection = inputURL.openConnection();
                   System.out.println("filename = " + inputURL.getFile());
                   BufferedReader inputStream = new BufferedReader(new InputStreamReader(connection.getInputStream()));
                   while ((inputLine = inputStream.readLine()) != null)
                        //System.out.println(inputLine);
                        page = page + inputLine;     
                        x = inputLine.indexOf("cust_id=");
                        if (x != -1)
                             cust_id = inputLine.substring(x + 8, x + 14);
                   out.write(page);
                   out.close();
                   System.out.println("extracted cust_id: " + cust_id);
                   for (int i = 1; i <= 30; ++i)
                        System.out.println("    Header " + i + ":  " + connection.getHeaderFieldKey(i) + ": " + connection.getHeaderField(i));
                        header = header + connection.getHeaderFieldKey(i);
                        header = header + ": ";
                        header = header + connection.getHeaderField(i);
                   outcookie.write(header);
                   outcookie.close();           
                   inputStream.close();          
                   //extracted the customer id, now able to search for the product
                   //test for milk
                   String url2 = "http://www-ets.woolworths.com.au/ets/owa/items";
                   //String url2 = "http://www-ets.woolworths.com.au/ets/owa/login?topage=search";
                   inputURL = new URL(url2);     
                   connection = inputURL.openConnection();     
                   connection.setDoOutput(true);
                   //connection.setUseCaches(false);
                   System.out.println("filename = " + inputURL.getFile());
                   String date = "; expires=Mon, 28 Jan 2002 02:53:17GMT; path/;";     
                   String date1 = "expires=Sun, 31 Dec 1989 14:00:00 GMT; path/;";
                   connection.setRequestProperty("cookie", "qwc=" + cust_id + date);
                   connection.setRequestProperty("cookie", "cust_id=" + cust_id + "; path=/;");
                   connection.setRequestProperty("cookie", "cd=2%40142%40%40%40%40N%40; path=/;");
                   connection.setRequestProperty("cookie", "state=NSW; path=/;");
                   connection.setRequestProperty("cookie", "dsd=1; path=/;");
                   connection.setRequestProperty("cookie", "sb1=0%2A%2D645746%2D0%2A; path=/;");
                   connection.setRequestProperty("cookie", "sb2=0; " + date1);
                   connection.setRequestProperty("cookie", "sb3=0; " + date1);
                   connection.setRequestProperty("cookie", "sb4=0; " + date1);
                   connection.setRequestProperty("cookie", "sb5=0; " + date1);
                   connection.setRequestProperty("cookie", "sb6=0; " + date1);
                   connection.setRequestProperty("cookie", "sb7=0; " + date1);
                   connection.setRequestProperty("cookie", "sb8=0; " + date1);
                   connection.setRequestProperty("cookie", "sb9=0; " + date1);
                   connection.setRequestProperty("cookie", "sb10=0; " + date1);
                   connection.setRequestProperty("cookie", "sbn=; path=/");
                   connection.setRequestProperty("cookie", "search=milk; " + date1);               
                   //connection.setRequestProperty("Content-type", "application/octet-stram");
                   //connection.setRequestProperty("Content-type", "application/x-www-form-urlencoded");
                   //String parms = "?search_pattern=" + URLEncoder.encode("milk") + "&cust_id=";
                   //parms = parms + URLEncoder.encode(cust_id);
                   //parms = parms + "&imode=" + URLEncoder.encode("search") + "&search_option=";
                   //System.out.println("parms : " + parms);
                   String parms = "?search_pattern=milk&cust_id=";
                   parms = parms + cust_id;
                   parms = parms + "&imode=search&search_option=";
                   System.out.println("parms : " + parms);
                   PrintWriter outStream = new PrintWriter(connection.getOutputStream());
                   outStream.println("parms");
                   outStream.close();               
                   BufferedReader inputStream1 = new BufferedReader(new InputStreamReader(connection.getInputStream()));     
                   //BufferedReader inagain = new BufferedReader(new InputStreamReader(connection.getInputStream()));
                   while ((inputLine = inputStream1.readLine()) != null)
                        //System.out.println(inputLine);
                        page2 = page2 + inputLine;
                        x = inputLine.indexOf("cust_id=");
                        if (x != -1)
                             cust_id2 = inputLine.substring(x + 8, x + 14);
                   out2.write(page2);
                   out2.close();
                   System.out.println("2nd attempt cust_id" + cust_id2);
                   for (int i = 1; i <= 30; ++i)
                        System.out.println("    Header " + i + ":  " + connection.getHeaderFieldKey(i) + ": " + connection.getHeaderField(i));
                        header2 = header2 + connection.getHeaderFieldKey(i);
                        header2 = header2 + ": ";
                        header2 = header2 + connection.getHeaderField(i);
                   outcookie2.write(header2);
                   outcookie2.close();      
                   inputStream.close();
              }The original web page to get the cookie is
    http://www-ets.woolworths.com.au/ets/owa/login?topage=search
    Enter a search product eg milk and that is the second page I am trying to extract.
    You will notice in the middle of the url is cust_id.
    Am I going about this 2 pages completely wrong?

  • Airport Express connectivity with a remote server

    I have gone to our ISP already with this question, but they cannot assist me. I am hoping someone here will be able to assist me in solving this problem. My boss wishes to connect to our server at our company from his home using an Airport Express. The company's server is housed on our work site and connected to an internal network. This network is in turn connected to our ISP via a DSL modem. We opened the ports needed in order to connect with the server in house and redirected incoming traffic to the server's internal ip address. We had our boss test connecting to the server from his home. He could not do so. We were asked to have him try connecting directly to his DSL (also from the same ISP as what our company has). He will be doing that this evening. However, this does not help the fact that this diminishes the whole idea of him having wireless capability in his home or when he is traveling. We had our ISP test accessing our server remotely using Telnet, and it was successful. They were connected directly, however, not using a wireless network.
    Is there something that we are missing here involving some sort of setting? Or is this something I need our ISP to dig into further? Please let us know if you have any ideas or suggestions. Thank you.
    Apple iBook   Mac OS X (10.4.7)  

    To combat the issue, enable an HLB port on your FE servers (or any other pool you are using HLB on) and configure the health checks for the load balancer to use that port instead of the port used for TLS traffic.
    Start by configuring the pool in Topology Builder, right click the pool, and choose Edit Properties>General.  Place a check in the “Enable Hardware Load Balancer monitoring port” and specify a port.
    Also you can refer below link
    http://ocsguy.com/2011/11/02/lync-hardware-load-balancer-monitoring-port/
    Please remember, if you see a post that helped you please click "Vote As Helpful" and if it answered your question, please click "Mark As Answer"

  • Problem in establishing connection with mysql 5.0

    Hi,
    I am using JCAPS 5.1. I tried to insert data to mysql database table.
    But i got following error
    java.sql.SQLException: Error in allocating a connection. Cause:
    Physical Connection doesn't exist.
    My intention is to read file in which data are comma seperated and to
    populate those values to a mysql 5.0 database table.
    Sample DATA in file [test.txt]
    111,gg,23,MFG
    112,hh,24,MFG
    113,ii,25,RETAIL
    114,jj,26,IT
    Database table: employee
    eno,ename,eage,edept
    While creating JDBC OTD there is no problem in establishing connection with database. But after deploying i got above error.
    I have used Mysql 5.0 Connector/J JDBC driver. Added JDBC driver jar files to following directories as required.
    1) C:\JavaCAPS51\logicalhost\is\lib
    2)C:\JavaCAPS51\logicalhost\is\domains\test\lib
    Steps i have followed as per JDBC-ODBC -eway user guide doc.
    1) Created USerDefined OTD and added necessary fields
    2) Created JDBC OTD.
    3) Created JAVA collaboration and do business process for inserting
    4) Mapped all components by creating in Connectivity MAp
    5) created necessary external systems in envrionment explorer.[JDBC External System and File External System]
    6)Created Deployment profile
    5) Deployed it.
    After deploying it gives error as
    java.sql.SQLException: Error in allocating a connection. Cause: Physical Connection doesn't exist
    Please let me know the solution for problem.
    Message was edited by:
    VenkateshSampoornam

    In the environment definition,
    -> External Application JDBC
    -> Properties
    -> Outbound JDBC Connection
    You have the database URL in the "DriverProperties" field
    Valid URL would be : jdbc:mysql://localhost:3306/caps
    !! The doc says that this field is optional !! Seems to be an error in the doc:
    Hope this helps
    Seb

  • How to send two request in the same connection with HttpURLConnection?

    As the title, I want to send two or more requests in the same connection with HttpsURLConnection..I wish all requests are in the same session.
    My code is as following:
    package test1;
    //import javax.net.ssl.*;
    import java.net.*;
    import java.io.*;
    public class httptest {
    public httptest() {
    public void test() {
    HttpURLConnection uc = null;
    String urlStr="";
    urlStr="http://172.16.245.151/test/page1.jsp";
    try {
    URL u = new URL(urlStr);
    uc = (HttpURLConnection) u.openConnection();
    uc.setRequestMethod("GET");
    uc.setDoOutput(true);
    // uc.connect();
    OutputStream out = uc.getOutputStream();
    out.flush();
    out.close();
    catch (Exception ex) {
    System.out.println(ex.getMessage());
    public static void main(String[] args) {
    httptest tt = new httptest();
    tt.test();
    The sample class just can send a request..Now we think of the sentence :uc = (HttpURLConnection) u.openConnection();
    Obviousely, a HttpURLConnection can just have a Object of the Class URL, and the Class URL have no setURL mothed. So I can't use a HttpURLConnection to send two request.
    I just want the HttpURLConnect is the same to IE...Do you understand what I mean?
    Any helps will be appreciated...

    As the title, I want to send two or more requests in the same connection with HttpsURLConnection..I wish all requests are in the same session.
    My code is as following:
    package test1;
    //import javax.net.ssl.*;
    import java.net.*;
    import java.io.*;
    public class httptest {
    public httptest() {
    public void test() {
    HttpURLConnection uc = null;
    String urlStr="";
    urlStr="http://172.16.245.151/test/page1.jsp";
    try {
    URL u = new URL(urlStr);
    uc = (HttpURLConnection) u.openConnection();
    uc.setRequestMethod("GET");
    uc.setDoOutput(true);
    // uc.connect();
    OutputStream out = uc.getOutputStream();
    out.flush();
    out.close();
    catch (Exception ex) {
    System.out.println(ex.getMessage());
    public static void main(String[] args) {
    httptest tt = new httptest();
    tt.test();
    The sample class just can send a request..Now we think of the sentence :uc = (HttpURLConnection) u.openConnection();
    Obviousely, a HttpURLConnection can just have a Object of the Class URL, and the Class URL have no setURL mothed. So I can't use a HttpURLConnection to send two request.
    I just want the HttpURLConnect is the same to IE...Do you understand what I mean?
    Any helps will be appreciated...

Maybe you are looking for

  • Questions on my dock bar

    On several of my program icons like microsoft powerpoint and entourage there is a question mark that appears when I click on it, I can't do anything with the application because that is all that happens.  It also happens on a open file from micosoft

  • Error while restarting the Oracle BI

    Hi, Getting an error while trying to restart the Oracle BI. This was happened when appending the new Repository file. Below is the error msg: <Mar 30, 2012 3:19:12 PM IST> <Error> <oracle.bi.management.sysmancommon> <BEA-0 00000> <Operation Failed: s

  • Auto flagging of low resolution links

    Hello again In a large document with many links, is there an indesign trick to detect or flag all the image blocks which are below a specific effective dpi (not actual dpi) resolution? That would be great as a reminder for the pages which are not pro

  • Selection of Filter Values for Query Execution -Only Values in InfoProvider

    I created a query based on an ODS. For the query charateristic 0NFCAT_CODE a variable was created by me. To the time of query execution F4 shows all values available in the charateristic, but only values available in the ODS are expected. The charact

  • Not comitting database after the update query in jdbc

    Hi all, This is the first time I am posting this. I have query excuting on racle DB. This is update query. after executing the i have called commint using con.commit(). But still it is not showing the modifications in oracle db. What could be went wr