Page 2 of 3 FirstFirst 123 LastLast
Results 21 to 40 of 42
  1. #21
    Navigateur is offline Member
    Join Date
    Aug 2010
    Posts
    13
    Rep Power
    0

    Default

    Norm these are good questions.

    If the "http://localhost" trick works, it means that third-party website developers can make web games and apps that support my user-interface device when somebody visits their website, seamlessly.

    Also, it means that I can include a web server as part of the hardware installation (with the user's knowledge) so they can use the hardware device seamlessly with websites that want to support it.

    If it does work, I hope it works forever too. There's surely a balance between security and user-convenience!

  2. #22
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,903
    Rep Power
    25

    Default

    the "http://localhost" trick
    Sorry I missed what that trick is and how you are using it?

    Again: why not have an application do this?

  3. #23
    Navigateur is offline Member
    Join Date
    Aug 2010
    Posts
    13
    Rep Power
    0

    Default

    I'll try and explain clearer.

    I haven't set anything up yet. I'm trying to make a hardware user-interface device, that third-party web applications can use.

    In order for the third-party websites to interact with the user-interface device, it needs to allow the website code to communicate with the device.

    The problem with a purely "standalone" application is that it would have no way of talking to the third-party websites that want to support the device.

    One idea I have is a locally-residing applet that the user voluntarily installs when they install the hardware (having it local is the only thing it can talk to the hardware without security questions every time the applet is run). Since the third-party web pages can't access it via "file:///", I was wondering if I additionaly get the user of the harware device to voluntarily set up a local web server as part of the hardware installation, and host the applet on "http://localhost" (on their own local drive) if this would allow the applet to be launched from the third-party websites that want to support the device. (replacing "file:///..." with "http://localhost/...").

    Please don't go to any trouble if you don't already know. But does anyone know if it would work?
    Last edited by Navigateur; 08-15-2010 at 03:25 PM.

  4. #24
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,903
    Rep Power
    25

    Default

    problem with a purely "standalone" application is that it would have no way of talking to the third-party websites that want to support the device.
    An application can connect to any site on the internet.

    Not sure why you'd want an applet loaded from a local server? That applet can only talk to the server it was loaded from (ie the local server). It would NOT be able to communicate with any other site on the internet without permission. The PC with the local server and applet would NOT have to be connected to the internet for the applet to run normally.

  5. #25
    Navigateur is offline Member
    Join Date
    Aug 2010
    Posts
    13
    Rep Power
    0

    Default

    I'm not sure I've explained what I'm trying to set up.

    Let's say a web developer wants to make a web game that supports my hardware device. Every time my hardware device issues, for example, a "move forward" event, they want the character in their web game to move forward. So they need to be able to receive this event in their JavaScript (like a "mouse click", or "mouse up" event, for example).

    I'm trying to set up an applet as an "intermediary" between the user's hardware process and the web application, so that the web application starts the applet on its page, but it's actually a local applet which can then talk to the hardware process.

    (the local applet can't be "file:///..." so I was wondering if it could work if it was "http://localhost/..." on a user-installed local webserver).

  6. #26
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,903
    Rep Power
    25

    Default

    make a web game that supports my hardware device. Every time my hardware device issues, for example, a "move forward" event, they want the character in their web game
    That sounds like the contents of a page loaded from the internet can see something on the user's PC. That looks like a security problem.
    It reminds me of the kind of thing MS does in its web pages with activeX and that only works in the IE browser.

  7. #27
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,903
    Rep Power
    25

    Default

    Just had a thought at dinner.
    Is your hardware device something like a keyboard or mouse?
    By that I mean, a program could read the input from your device and use it to control the GUI.

    You still have not given a reason for not using an application. Why do you need html pages loaded into a user's browser?

  8. #28
    Navigateur is offline Member
    Join Date
    Aug 2010
    Posts
    13
    Rep Power
    0

    Default

    It's a sensor-based device.

    I need html loaded into the user's browser because I want them to be able to play web games (including WebGL etc. etc.) with the device. For example, when they go to "www.thisawesomegame.com" (which I just made up) which is compatible with my device, they can start playing that game straight away with the device, as long as the device is connected to their computer.
    Last edited by Navigateur; 08-16-2010 at 10:48 AM.

  9. #29
    Join Date
    Aug 2010
    Posts
    13
    Rep Power
    0

    Default

    Hi,

    Stop the presses!

    Navigateur, look into RMI. Basically applets are confined to the browser. No hope of escape. That IS the beauty of applets: safety.
    A good starter is this page:
    Java RMI Tutorial

    RMI means you need to have the user install something locally - thus knowingly allowing hardware access...

    Applets are not the right approach for this...

    Wellness

    Thor

  10. #30
    Navigateur is offline Member
    Join Date
    Aug 2010
    Posts
    13
    Rep Power
    0

    Default

    Applets are not the right approach for this...
    But for the user to play the web game, one of the components HAS to be an applet, right?

  11. #31
    Join Date
    Aug 2010
    Posts
    13
    Rep Power
    0

    Default

    Ooooooooooooooooooooooooooooooooo, gotit!

    You want to make a Runescape-like game. Oooo, now I get it...didn't get that from the thread.
    And, yes, an applet is (for this) the right (and best) way to go, but...what hardware do you need to invoke? Sound? Already possible. I don't see any other hardware a game might need...

    Thor
    PS forget RMI for this - you may not even need that. And, RMI is way too complex for this...

  12. #32
    Navigateur is offline Member
    Join Date
    Aug 2010
    Posts
    13
    Rep Power
    0

    Default

    No it's a sensor-based hardware device. And I'm not making a game, I'm just making the device. I need it to plug-in to any browser-based game that wants to support it. For the plug-in, I was thinking of making a locally-residing applet (which can access the hardware because it's local) which can be launched by those web apps.

    Since "file:///..." is not allowed by the browser to launch the applet, I was thinking of making the user install a local webserver which hosts the applet, then get the web apps to launch the applet via "http://localhost/...". I'm not sure if this would work yet.

    Also, somebody said that even if this works now, it might break in the future. I just hope none of the browser manufacturers do break it (if it works). There's got to be a balance between security and user-convenience.

  13. #33
    Join Date
    Aug 2010
    Posts
    13
    Rep Power
    0

    Default

    Hmmmm...lemme meditate...I don't promise any thing, ...

  14. #34
    Navigateur is offline Member
    Join Date
    Aug 2010
    Posts
    13
    Rep Power
    0

    Default

    Hang on!!!! "file:///C:/" DOES work!

    I've tested it on two computers, XP and Vista, using the latest Firefox AND Internet Explorer AND Google Chrome where the remote website does NOT contain the applet, the applet is on their local drive! It starts that applet just fine within the browser.

    I'm glad this isn't security restricted since the user VOLUNTARILY puts the applet on their computer. Thank goodness. Please don't change this Mozilla/Microsoft/Google! It makes browsers much more flexible and doesn't compromise security, save from outright user-stupidity!

    My HTML code was simply:

    <html>
    <head>
    </head>
    <body>
    <applet code="com.test.TestApplet"
    archive="file:///C:/TestApplet.jar" />
    </body>
    </html>

  15. #35
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,903
    Rep Power
    25

    Default

    Yes it works!!! I guess the extra / in file:/// is what I left out.

    Thanks for the info.

  16. #36
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,903
    Rep Power
    25

    Default

    Now to the next problem.
    What will the applet code do? What local things will it attempt to look at?
    Have you tested that yet?

  17. #37
    Webuser is offline Senior Member
    Join Date
    Dec 2008
    Posts
    526
    Rep Power
    0

    Exclamation

    Quote Originally Posted by Norm View Post
    Sorry, you are not making any sense for me.
    How is a local html file a web page???
    What is a "knot" page?
    Oh, my... :)

    Author justs can create a host html page which contains file:// refs for a suggested client html page which starts applet :)
    That's why I say it is more easy thing.
    If my answer helped you. Please click my "REP" button and add a comment
    Have a Good Java Coding :)

  18. #38
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,903
    Rep Power
    25

    Default

    It is a knot web page effect as I can remember ...
    Can you explain what a "knot" page is?

  19. #39
    Webuser is offline Senior Member
    Join Date
    Dec 2008
    Posts
    526
    Rep Power
    0

    Lightbulb

    Quote Originally Posted by Norm View Post
    Can you explain what a "knot" page is?
    knot page is a web page which contains refs list to other html pages :)

    <html>
    <a href="file://C:/AppletPage.html">Go to game page</a>
    </html>

    file: protocol info
    file Protocol

    I am not sure the way can be strictly useful here but I hope it can be handy ;)
    If my answer helped you. Please click my "REP" button and add a comment
    Have a Good Java Coding :)

  20. #40
    Webuser is offline Senior Member
    Join Date
    Dec 2008
    Posts
    526
    Rep Power
    0

    Lightbulb

    Or the way can be used just to ref applet... author can simply do this applet ref with file: protocol

    Java Code:
    <html>
    <head>
    </head>
    <body>
    <applet code="gui.MainPanel"
    archive="file://X:/Applet.jar" />
    </body>
    </html>
    Some browsers don't support file: protocol but as a rule that should work :)
    Last edited by Webuser; 08-22-2010 at 05:45 AM.
    If my answer helped you. Please click my "REP" button and add a comment
    Have a Good Java Coding :)

Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. Internet Explorer not update applet
    By billlin in forum New To Java
    Replies: 24
    Last Post: 07-18-2010, 01:45 AM
  2. Replies: 0
    Last Post: 02-16-2009, 09:05 AM
  3. Replies: 8
    Last Post: 02-09-2009, 12:58 AM
  4. Invoke Applet
    By chankokchern in forum Java Applets
    Replies: 1
    Last Post: 07-29-2008, 05:35 PM
  5. Getting url of page applet is running on
    By damounh in forum Java Applets
    Replies: 1
    Last Post: 05-09-2008, 06:49 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •