How can I open a URL in an applet?

Hi:
All I want to do is webcrawl through the pages on a website, and extract some indexing information. Now, I have a java class that does this just fine -- for http sites. Except my site is https, and asks for username and password, which my java class cannot handle.
So I figured one easy solution would be to simply convert my java application into an applet, and then just pass through the username/password authentication, then run the applet. The problem is, after I've converted my application into an applet, i get the following exception (I was using www.yahoo.com just to test the applet before running it on my https site):
java.security.AccessControlException: access denied (java.net.SocketPermission www.yahoo.com resolve)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkConnect(Unknown Source)
at sun.plugin.net.protocol.http.HttpURLConnection.checkPermission(Unknown Source)
at sun.plugin.net.protocol.http.HttpURLConnection.connect(Unknown Source)
at sun.plugin.net.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at java.net.URL.openStream(Unknown Source)
at Crawler.robotSafe(OgiCrawler.java:77)
at Crawler.start(OgiCrawler.java:224)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
What am I leaving out? I've pored through much sample code, including the code on the forums, but my code seems the same (though the code on the forums is usually for applications, not applets.) I know there are other webcrawling java applets... how do they successfully connect to a URL?
Here is my connection code:
HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
System.out.println("Downloading " + url.toString());
urlConnection.setAllowUserInteraction(false);
InputStream urlStream = url.openStream();
I'm very new to Java programming, so if I need to include some applet-specific package, please let me know! Thank you very much for your help!!
Ogi

... So I figured one easy solution would be to simply
convert my java application into an applet...i dont know the solution for ur problem, but you shouldnt convert ur app into an applet, cuz applet has more restrictions...

Similar Messages

  • How can I open a URL from a Custom Button in a second help window?

    I have a custom button, which currently opens a URL in a web
    browser, using a redirect page. How can I change this so that it
    opens in a second help window instead? If I understand some of the
    posts I've read, it is possible by linking the button to a related
    topics function but I've no idea how this is done.
    As usual, your help is most appreciated. Thanks a lot.

    Hi, ecoulyn,
    You need to make a topic file like the one below the target
    of the Jump button.
    The onLoad function on the Body start-tag causes the Related
    Topics command to fire when the topic file is loaded in the topic
    pane. When specifying the file name of the topic to display in the
    secondary window, you must always prepend it with the name of your
    .chm file, followed by "::/". Otherwise, an error message appears
    when the Jump button is clicked.
    Pete

  • URGENT!!!!!!!how can i open a url in forms (plataform client/server)

    I have a item that is a url and I want that when the user click
    in this item open the coresponding ulr.
    Can you help me?
    Thank you

    if you use win 32 and you have no information of which browser
    is a default one in your computer and where it is located.
    1.Attach D2KWUTIL.PLL library to your form <br>
    2.Try to use win_api_shell.startfile(document =>
    'c:\start_page.html'); <br>
    3.in start_page.html you automatic connect to the whatever site
    you want <br>
    regards,

  • How can I open a url in oracle form 9i without toolbar and menubar

    I want to create a button in my form. When I click on the button it should open url without toolbar and menubar.
    I tried with web.show_document. but I am not able to remove the toolbar and menubar. plus not able to specify width and height. Any way to achieve this.
    Thanks,
    Mansoor

    Dear Frank,
    I have done as follows
    created a form with a button, and in my button pressed event I wrote
    WEB.SHOW_DOCUMENT('javascript:openMyURL("http://192.168.1.34/HELP/ADMF0005.html");', '_Self');
    and in my formsweb.cfg I have the following
    HTMLbeforeForm=<script> function OpenMyURL(page){window.open(page,"myURL","width=700,width=400,top=0,left=0,toolbar=no,menubar=no"); } </script>
    When I click on the button it is coming with toolbar , etc as well as no page found is coming with the following in the address bar.
    javascript:openMyURL("http://192.168.1.34/HELP/ADMF0005.html");
    My html view source comes as below for the form
    <HEAD><TITLE>Oracle9iAS Forms Services</TITLE></HEAD>
    <BODY >
    <script> function OpenMyURL(page){window.open(page,"myURL","width=700,width=400,top=0,left=0,toolbar=no,menubar=no"); } </script>
    <!-- Forms applet definition (start) -->
    <OBJECT classid="clsid:CAFECAFE-0013-0001-0009-ABCDEFABCDEF"
    codebase="/forms90/jinitiator/jinit.exe#Version=1,3,1,9"
    WIDTH="1000"
    HEIGHT="660"
    HSPACE="0"
    VSPACE="0">
    <PARAM NAME="TYPE" VALUE="application/x-jinit-applet;version=1.3.1.9">
    <PARAM NAME="CODEBASE" VALUE="/forms90/java">
    <PARAM NAME="CODE" VALUE="oracle.forms.engine.Main" >
    I am using Forms [32 Bit] Version 9.0.2.7.0

  • How do I open a url from an applet?

    is it done the same way with HTTPUrlConnection as with an application or is it done in a different way? I'm getting a "ClassCastException"

    Now I'm trying to call a CGI script and past things in through the post method... I still get a ClassCastException. This exact same code worked in the applet, once again. here is the code I am using:
                   URL url = new URL ("http://address.pl");
                   HttpURLConnection cxn = (HttpURLConnection) url.openConnection();
                   cxn.setRequestMethod("POST");;
                   cxn.setUseCaches(false);
                   cxn.setDoOutput(true);
                   cxn.setDoInput(true);
                   ByteArrayOutputStream bytes = new ByteArrayOutputStream(400);
                   PrintWriter writer = new PrintWriter (bytes,true);
                   writer.print("hello=world&food=good");
                   writer.flush();
                   cxn.setRequestProperty("Content-Length",String.valueOf(bytes.size()));
                   cxn.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
                   bytes.writeTo(cxn.getOutputStream());

  • How can I open and close private browsing using an IPAD mini in IOS 7?

    How can I open and close private browsing using an iPad mini in ios7?

    Tap the '+' to the right of the URL field to open a new tab, and at the bottom left of the screen there should be a 'Private' button - tap that and you can then go to the site that you want to go to

  • How can we provide 2 URLs in the HR personalization form, so that users can

    We are not able to open the PDF report from the external node which is placed under the OA_HTML. Nvaigation is Employee Self Service for US -> Update or Add Direct Deposit Account
    Internal urll ----"http://tech.com:8000/OA_HTML/TTEC_Benefits_Docs/Branded/DebitCrdholderBrochureSignature.pdf"
    However, the external users from internet need to access the pdf document and this fails for them because they have no access to above URL from public internet. They need to get to above pdf document for e.g. as:
    "https://publicerptech.com:443/OA_HTML/TTEC_Benefits_Docs/Branded/DebitCrdholderBrochureSignature.pdf"
    How can we provide 2 URLs in the HR personalization form, so that users can access the pdf document?

    Hello David,
    Sorry for not getting back to you sooner. You can provide feedback on Transport agents by using this site:
    http://officespdev.uservoice.com/.
    With regards,
    Michael | Microsoft Exchange Developer Content
    The
    Exchange Development Forum Guide has useful information for using the Exchange Development Forum.
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • How can I open the EP login page in the same pop-up window?

    is it possible for me to using / only one window(Browser) pop-up to EP Page(Login or iView...).
    In the firs general html page I create a EP login page link action[eg. "window.open('url', 'target_name')"],
    but always launching new pop-up window(Browser).
    How can I open the EP login page in the only one window(pop-up)?
    Could anybody help me by giving suggestion and codding?
    Thanks,
    jin.

    Hi,
    if you want to redirect the root of portal system (http://portal/) to the login page, edit the
    file and change the body tag as follow:
    \usr\sap\J2E\JC00\j2ee\cluster\server0\apps\sap.com\com.sap.engine.docs.examples\servlet_jsp\_default\root\index.html
    <body onload="location.replace('irj/portal' + document.location.search)"></body>

  • How can I open the links on the TreeItem treeItem1 = new TreeItem("Fish", "

    JDeveloper 11g, Windows 7(64 bit), ADF Faces
    package view.backing;
    import java.beans.IntrospectionException;
    import java.util.ArrayList;
    import java.util.List;
    import org.apache.myfaces.trinidad.model.ChildPropertyTreeModel;
    import org.apache.myfaces.trinidad.model.TreeModel;
    public class TreeModelAdapter {
    private Object _instance = null;
    private transient TreeModel _model = null;
    public TreeModelAdapter() {
    ArrayList<TreeItem> rootTreeItems = new ArrayList<TreeItem>();
    TreeItem treeItem1 = new TreeItem("Fish", "http://www.someurl1.com");
    TreeItem treeItem2 = new TreeItem("Dog", "http://www.someurl2.com");
    TreeItem treeItem3 = new TreeItem("Cat", "http://www.someurl3.com");
    TreeItem treeItem2_1 = new TreeItem("Blue Heeler", "http://www.someurl4.com");
    TreeItem treeItem2_1_1 = new TreeItem("Rover", "http://www.someurl5.com");
    TreeItem treeItem2_1_2 = new TreeItem("Ruffus", "http://www.someurl6.com");
    rootTreeItems.add(treeItem1);
    rootTreeItems.add(treeItem2);
    rootTreeItems.add(treeItem3);
    ArrayList<TreeItem> treeItem2Children = new ArrayList<TreeItem>();
    ArrayList<TreeItem> treeItem2_1Children = new ArrayList<TreeItem>();
    treeItem2Children.add(treeItem2_1);
    treeItem2.setChildren(treeItem2Children);
    treeItem2_1Children.add(treeItem2_1_1);
    treeItem2_1Children.add(treeItem2_1_2);
    treeItem2_1.setChildren(treeItem2_1Children);
    this.setListInstance(rootTreeItems);
    public TreeModel getModel() throws IntrospectionException {
    if (_model == null) {
    model = new ChildPropertyTreeModel(instance, "children");
    return _model;
    public void setListInstance(List instance) {
    _instance = instance;
    _model = null;
    How can I open the links on the TreeItem treeItem1 = new TreeItem("Fish", "http://www.someurl1.com"); on a new page?

    In your af:tree nodeStamp facet you have access to the node (TreeItem in your case). If your TreeItem has a getter method for the url (you did not provide the TreeItem code) you can put an af:goLink in the nodeStamp and set the destination attribute to #{node.url} and set the TargetFrame of the golink to '_blank':
    <af:tree ...>
      <f:facet name="nodeStamp">
        <af:goLink text="goLink 1" id="gl3" destination="#{node.url}" targetFrame="_blank"/>Timo

  • How can I open the WD iView within the same pop-up window?

    I have created a Web Dynpro(for ABAP) iView direct link that a hyperlink action.
    (From different Web page)
    And I used window.open(appointment to target) of javascript for opening only one window.
    However When I click the link it opens in a new window every time.
    (Also iview of different type is same)
    How can I open the WD iView within the same pop-up window?
    Could anybody help me by giving suggestion and codding?
    Regards
    Jin

    Hi JinKyu,
    Have you tried <b>window.location()</b> in place of window.open() something like
    <b>window.location = 'URL'</b>
    Rgds,
    Vivek

  • How can I open the browser on clicking a item in my JMenu

    How can I open the IE with a webpage on clicking a item in my "Help" context menu in my application.
    *. I have a Help menu with different help topics
    *. In one of the item of the menu I want to provide a URL link which should open in the Default browser (IE/ Mozilla)
    Any solution would be appreciated.
    Thanks

    try these:
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=718184
    http://www.croftsoft.com/library/tutorials/browser/
    Message was edited by:
    dberansky

  • How can I open a relative path

    Does somebody knows how can I open a relative URL from an applet by the
    getAppletContext().showDocument(new URL("http://java.sun.com"), "_blank");
    instruction?
    I mean, I want to open a html page stored in my hard drive but if I change the "http://java.sun.com" to, for example, "Mi documents/index.html" it doesn't works.
    Could sombody help me with this please?

    Well, in fact you can in a special case :
    - The file you want to access is in the same directory than the applet (or in a sub-directory)
    If this condition is OK, you can open the file using :
    java.io.InputStream MyInputStream = <YourAppletClassName>.class.getResourceAsStream("sidira_interactif2.svg")
    With this stream, its easy to read the file content.

  • How can I open Adobe Bridge CS6 in high resolution on my MacBook Pro Retina display?

    How can I open Adobe Bridge CS6 in high resolution on my MacBook Pro Retina display? When I click Get Info, the "Open in Low Resolution" box is marked and locked. How can I unmark this box? I currently run 10.9.1. I can open Adobe Photoshop CS6 in high resolution without any problem. Any advice would be much appreciated. Thanks.

    There is no such thing. In CS6 only PS itself is Retina compatible. You would have to use CC for full Retina support.
    Mylenium

  • How can i open file from adobe reader..i already have adobe read

    how can i open file from adobe reader..i already have adobe reader installed and cannot open a
    file and i cannot convert my file into pdf..

    Is the file really a PDF? Where is it? Have you tried opening it from within Reader?

  • HT202879 how can I open a Word document in Pages 09?

    How can I open a Word document using Pages 09 please? I am trying to open Word documents from a CD using both trying to open in Pages, nd dragging and dropping into the Pages icon in the dock. It tells me, every time, thast the document cannot be opened.

    What happens if you open it in TextEdit or LibreOffice [free]?
    Does it open where you got it from?
    Peter

Maybe you are looking for

  • Multiple account for 2 devices

    My boyfriend just got an iPhone 4S yesterday, and I set him up an iTunes account.  However this is all being done on my computer, since he doesn't have one.  How can I download songs to his iPhone from CD's on my computer so they will go directly to

  • Urgent help with BPEL process

    Hello there, I need help with BPEL project. i have created a table Employee in Database. I did create application, BPEL project and connection to the database properly using Database Adapter. I need to read the records from the database and convert i

  • Ideas For Final Year Project

    Hi everyone, I'm new here. In fact this is my first ever post in the SDN coummunity. I'm studying BIS and majoring in knowledge management. I'm also very very interested in enterprise 2.0 I started learning about SAP 4 months ago and since then I've

  • HT1212 Forgot my IPad unlock password

    My IPad has been disabled because I (embarrassingly) forgot my unlock password.  When I sign in to ITunes my IPad does not appear because I did not sync it with Tunes originally.  In order to interact with ITunes and "restore" my IPad, In order to tu

  • Alpha/Transparency-Handling in Aperture

    I am new to this forum, so first off: Hello! Recently i switched my workflow to Aperture, and the product really feels well to use so far! But there is one thing, which unfortunately is pretty much a show stopper for me. Let me explain, and please gi