Applet interaction questions

Howdy.
I'm generating a map in an applet using a library based on swing classes.
I need to be able to:
-- query the db on the host server from within the applet to alter the map;
-- save a snapshot of the map to the server (I've got code that saves a snapshot, but I need to be able to save that on the host server);
-- if possible, receive messages from javascript controls on the browser page where the applet resides, and respond to them.
It seems like I may need to sign the applet, but I'm not trying to do anything on the client machine; just to interact with the host server.
Can someone point me in the right direction? I've been out of the java world for a bit, so all the details are slow coming back...
Thanks much.

Hi,
I have some questions regarding to the
HttpURLConnection implementation used in Applet.
1. Is the connection made when I do
URL.openConnection or when I flush/close the
OutputStream?The local resources are taken when the openCOnnection is called. The request is made to the server when the getInputStream getContent getResponseCode or the one of the other input methods is called.
2. Will the binaray data in content be chunked if I
set the Content-Type to application/octet-stream
along with Content-Length?Don't know.
>
3. After the OutputStream been closed can I still use
the Connection for read?Yup (note you will have to do this to actually send the request to the server...)
>
4. Is it possible for me to lose any data in the Http
request I send through the HttpURLConnection?Not sure, but my thought has always been any data sent across HTTP can be lost en route. There will be some effort from the server to recover lost packets, but I do not know the details...
>
Thanks,
Michael

Similar Messages

  • Interactive questions using IP/TV

    I am interested in how users can post questions using IP/TV while the presentation is ongoing. What is the process behind this as I don't really see how it works, any kind of insight would be useful.
    Many thanks Alex

    When you set up the program, you can (or not) enable interactive "from the field" questions.
    The client provide a button that can be pressed to flag the presenter that a field question is pending.
    The presenter can then address the questions as possible.
    Depending on the scope and location of the audience, you may also consider bringing up a conference bridge for voice-based questions.
    Good Luck
    Scott

  • Simple applet jar question

    I'm sure this is an easy question, but how do you access subdirectories in your applet's jar file?
    For instance the contents of MyApplet.jar jar would be:
    * META-INF
    * images
    * net
    Say the main class is MyApplet.class in net/mydomain/myproject
    How in the main class would I get at images/MyImage.jpg?
    Obviously I did not get this code to work:
    ImageIcon upIcon = new ImageIcon("images/MyImage.jpg");
    Thanks alot!

    Actually now I am using:
    ImageIcon upIcon = new ImageIcon(MyApplet.class.getResource("/images/MyImage.jpg"));
    This way the 'absolute' resource is found (becuase the resource name starts with a '/').
    This seems to be the best way to do it.

  • JSF Backing bean / JSP interaction questions

    A few questions about JSF beans and JSP page interactions. Bear in mind that I'm new to both JSP and JSF, so a solution that might be obvious to the rest of the world may be new to me.
    1. Can I pass a parameter to the backing bean method from an "action" attribute:
    <h:commandLink action="#{TableData.SortRec}">
    <h:outputText value="#{msgs.selectedHeader}"/>
    </h:commandLink>
    I'd like to call the same method from several controls, but pass it a parameter to determine which field to sort on.
    2) Is there a way for a backing bean method to determine which control invoked it?
    3) Is there a way to access JSF backing bean methods from JSP tags. I'd like to do some conditional page assembly based on a JSF bean property... JSF doesn't appear to have a conditional like JSP's <c:if>, but I could use JSP's if it could access the JSF bean.

    Could you pl tell me how to pass parameter thru CommandButton
    I have the following situation
    1) greetingList.faces which list the Ids & greeting Text
    Id Text
    1 Hello World
    2 Hello World
    2) Pl note Ids are h:commandLink. A click on the Id will render greetingForm.faces with data pertaining to that Id and with Update h:CommandButton
    3) When i click Update button it results in the following error
    javax.faces.FacesException: Error calling action method of component with id greetingForm:_id4
    Caused by: javax.faces.el.EvaluationException: Exception while invoking expression #{greetingForm.update}
    Caused by: java.lang.NullPointerException
    So i verified with h:message that Id is passed as Null when click on Update button. I also checked greetingForm.faces has a not null value by printing <h:outputText value="#{greetingForm.message.id}"/>
    So i guess the Id value is overwriteen with null. Also i have defined Id as property in managed bean
    <managed-bean-name>greetingForm</managed-bean-name>
    <managed-bean-class>com.mycompany.GreetingForm</managed-bean-class>
    <managed-bean-scope>request</managed-bean-scope>
    <managed-property>
    <property-name>id</property-name>
    <value>#{param.id}</value>
    </managed-property>
    Any pointers/suggestions at the earliest on how to pass the value of Id on a click of update button from greetingForm.faces to greetingForm.java will be highly appreciated
    I am willing to upload my war file
    Regards
    Bansi

  • Interactive question DVD creation?

    My client wants an interactive dvd produced ie: who wants to be a millionaire - for training use.
    Part of the DVD will be a multiple question session with say 3 answer choices - you choose an answer nd it tells you - say a tick with correct and a happy sound or wrong and a unhappy bong!... then advance to the next question.
    Can this be done in DVDSP or would it have to be created in a another program such as director (is it still around?) then brought in as a separate part?
    Many thanks

    quick and easy way (if there isnt hundreds of questions) is have the question in text with the three answer choices as buttons each linked to a separate menu, one for correct answer another for the inncorect answer. A next button will navigate to the next question menu.
    Director and Authorware is still very much around, not as popular as Flash these days but you would create a CD ROM not a DVD-Video. Computer based systems provide far better control and authoring opportunities than DVD-Video; point displayed at each stage, final scores given tracking system allows more that one playe and logging in to multiple sessions.

  • Applet security question

    Hi,
    I was given the following instructions by a company when I contacted their tech support to ask why their applet was giving me warning dialog boxes saying that their certification had expired:
    +++ BEGIN QUOTE +++
    Go to c:\program files\javasoft\jre\1.3\lib\security\java.policy and open with Notepad.
    Insert the following at the top of this file:
    grant {permission java.security.AllPermission;};
    // Standard extensions get all permissions by default
    This comment line above should already be in the file and should be used as a reference point. Save the file and try the web client again.
    +++ END QUOTE +++
    Can anyone tell me what this actually does?
    I'm concerned that it will affect more than just my interaction with the company's applet (i.e., other company's applets).
    Thanks.

    Wow that's scary and BAD BAD advice. If you do that, then ANY and ALL applets can get access to your local system (including ones with nefarious plans to delete operating system files, etc.)
    The correct way is this:
    grant codeBase "file:c:/somepath/dir/-" {
    permission java.security.AllPermission;
    (assuming it's a file path)
    If its an applet from a specific domain:
    grant codeBase "http://www.somedomain.com/-" {
    permission java.security.AllPermission;
    NEVER ever do what they said.

  • Applet installation question

    I am trying to install an applet using a non default
    applet AID. I am using the:
    register(buffer, aid_offset, length);
    Questions:
    Is the java card OS made so you can istall a base applet (package and applet download). Then later install
    more applets with just an applet create apdu command sent to the applet manger?
    [Applet package mask]
    [Applet1] (register())
    [Applet2] installed using above register function
    Constuctor for test applet:
    private TesApplet(byte buffer[],short offset,byte length) {
    if (buffer[offset] == (byte)0) {
    register();
    }else {
         register(buffer, (short)(offset+1) ,
    (byte)(buffer [offset]));
    } // end of the constructor

    In order to answer the original question:
    Yes, you can load a package and install several applets from it which means to create and register applet instances based on one or more applet classes in the package.
    Each applet instance needs a unique AID. If you do not provide AID data to the register method the applet class AID is used. Therefore you can only use the "register()" call once. But your code shows that you got that point already.

  • Applet POSTing Question

    Is there anyway to make an Applet do a POST command to my Servlet on the server?
    I'm trying to create a pretty GUI (with an Applet) where upon completion of the user's interaction, the GUI will send some parameters to my Servlet which will return a dynamically generated Web page (using the Servlet method).
    Any advise will be greatly appreciated.
    Regards,
    Richard
    [email protected]

    I recommend using netscape.javascript.JSObject.
    You can obtain this by downloading Netscape.
    In your applet do something like this:
    m_window JSObject;
    m_window = (JSObject) JSObject.getWindow(this);
    m_window.eval("parent.frameName.someJSVar=1");
    m_window.eval("parent.frameName.someJSFunction();");
    This is a good method for submitting forms in some
    seperate frame without reloading your applet.
    Good luck,
    Gil

  • Applet viewer question

    Well here is my first question of what promises to be many. Nice to meet you all. Here goes:
    While doing the first applet in "Your first cup of Java", I run the applet by typing:
    appletviewer Hello.html
    The applet runs in the applet viewer and looks just like the picure says it should. But I also get this warning in the command prompt:
    Warning: Can't read AppletViewer properties file: C:\WINNT\Profiles\PURCHASER\.h
    otjava\properties Using defaults.
    Anybody know what the problem is there?
    Thanks.

    I wouldn't worry about it, I get the same errors using the computers at Uni. It's never stopped me anyway. I'm not sure what causes it, something to do with WinNT/2000 and profiles/users.
    Cheers,
    Radish21

  • Security Issues with Javascript, Java Applet interaction

    First the main idea of the project. I have a system where I need to use an applet to process an image and display it on a web page.
    I have written the applet that does the image processing and it saves the finished image on the users disc. It then uses the showDocument(url) method to pass the URL of the local file to a java script function on the html page.
    This is where the problem occurs. Firefox won't display that image and complains about a security error because the remote page is linking to a local file. Interestingly enough IE6 on windows has no issue displaying the generated image.
    I really have two questions.
    1)Is there a quick/dirty fix that just simply gets around the security barrier Firefox has?
    2)Is there some other, more elegant, way of getting an image from an applet to the webpage. It doesn't matter if it requires writing to disc or not.
    Thanks! Any suggestions out there will help me.

    First the main idea of the project. I have a system where I need to use an applet to process an image and display it on a web page.
    I have written the applet that does the image processing and it saves the finished image on the users disc. It then uses the showDocument(url) method to pass the URL of the local file to a java script function on the html page.
    This is where the problem occurs. Firefox won't display that image and complains about a security error because the remote page is linking to a local file. Interestingly enough IE6 on windows has no issue displaying the generated image.
    I really have two questions.
    1)Is there a quick/dirty fix that just simply gets around the security barrier Firefox has?
    2)Is there some other, more elegant, way of getting an image from an applet to the webpage. It doesn't matter if it requires writing to disc or not.
    Thanks! Any suggestions out there will help me.

  • Captivate 8 - Slide timing & interaction questions

    I used to work somewhat with Captivate 3 & 4, and now just got access to Captivate 8 and am currently in the process of evaluating it.  I am hoping someone in the community could help me with the following questions:
    1. Is there a way to add more than 1 action to an interaction?  In other words, I have a button which, when clicked, changes a graphic on the slide using the "Show" action on success.  However, I want to repeat that action to also show a video.  Is this possible?
    2. On the same slide above, I have a total of 5 buttons.  4 of the buttons do what I mentioned in #1, but the fifth button acts more as a navigation button to move to the next slide.  I have a click box inserted for this 5th button with the option "Pause project until user clicks".  However, if any of the 5 buttons are clicked, the slide advances.  Any advice?
    3. I've noticed that "Allow Mouse Click" is greyed out on all actions I've reviewed.  How can I enable this option?
    Thanks!

    Thank you, Lilybiri!  Regarding #1, the actions should execute at the same time, rather than in a timed sequence.
    Regarding my question 3, I figured it out.  I just have to click into the text field and then hit the key I want on my keyboard (the "Allow Mouse Click" option is no longer greyed out following that).
    I see what you mean regarding executing more than one action under Advanced Actions, but I'm having a slight issue.  When I select "Show" for my action and then go to choose what I want to display, I am not seeing the images I want as options (the images are both in the Library and currently on the slide, themselves).  Alternatively, perhaps I am seeing them, but I see options like "Image_15", "Image_16", etc... but I'm not finding those image names anywhere else, including the library.
    Am I missing something?

  • Four Java Applet signing questions

    hi all;
    I'd like to ask a few quick questions about applet signing. As you know there is a "Security Warning" Gray Alert box that appears when the user tries to load your signed applet.
    1. When the alert window asks someone to accept the signed applet, is it possible to some how capture the Yes or No button click event by javascript or something like that ? I noticed that the Yes and No Response seems to be saved in an in-memory cookie? Is it possible to figure out wht the person clicked ?
    2. Is it possible to keep that "Security Warning" Alert box on top so that the user will not be able to accidentally ignore it (it goes under the browser and stays there).
    3. Is there some way to inspect the PC to determine weather your applet loaded properly - apart from seeing a properly working applet ? For example , If I want to make sure it is being cached properly.
    4. When a new version of the applet is available on the server ? how does the browser know to download something ? is that something I would code for manually or would is this automatically handled behind the scenes.
    Thanks in advance
    Stephen

    I can only reply to nr 1 but looking at java.security.AccessControl there is a method called checkPermission() you can use.

  • Applet persistance question (basic?)

    All:
    Forgive the ignorance, but I am not a Java programmer at all... but am looking for some info.
    What is the scope of a (untrusted) java applet in regards to IE browser sessions? For instance, if a web page initiates an applet load, does the applet stay in memory and continue to run after the user navigates away from the original page?
    We are trying to find out if it is possible for a page to load a particular applet that records the URL string of IE browser windows, and have this applet persist throughout the user's browser session, even if they leave the original page, and if they open new browser windows. Is this possible, or is it just crazy?
    Thanks for any help!
    phong

    We are trying to find out if it is possible for a page
    to load a particular applet that records the URL
    string of IE browser windows, and have this applet
    persist throughout the user's browser session, even if
    they leave the original page, and if they open new
    browser windows. Is this possible, or is it just
    crazy?And then make the user crazy trying to download anti spyware and adware and stuff. The question is why do you want the applet to be running once the user has left the page and would you ask for his permission to do so. Just as there is a law for the telemarketing guys there should be another one for these spyware guys who want to run there own agenda on the clients machine without his concent.

  • Applet tag question

    I am working with applets and have been getting the classdefnotfounderror exception and a wrong name error.
    After pouring over the archives and messing around, I have found a
    solution to my problem, but I don't know why it works. I think it has to do with packages, but I'm not sure.
    I have two versions of Asteroids, one which has "package Asteroids" at the top
    of each file, and one that has no package.
    First with the version that is in a package: If I have the html file in the
    same directory as the class files, I cannot get the applet tag to work
    properly. If I back it up a directory (just outside the Asteroids directory), this works:
    <applet
      codebase = "."
      code     = "Asteroids/Asteroids.class"
      width    = "640"
      height   = "480"
    </applet>
    {code}
    One old post I found said that the wrong name error indicates that the qualified name is incorrect ( so my incorrect name would be Asteroids.class) and that the full name should include the package, so mine would be Asteroids/Asteroids.class, I think. Is that correct? If so, why wouldn't this code work inside the same directory as the class files?
    For the version that is not in a package, the opposite seems to work.
    {code:java}
    <applet
      codebase = "Asteroids/"
      code     = "Asteroids.class"
      width    = "640"
      height   = "480"
    </applet>
    {code}
    This code works for the version which is not in a package, but does not work for the version in a package, ( and vice versa for the code above). It seems like either code should work in either case. What am I missing?
    Thanks,
    Matt                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    I don't know what your understanding of packages and applet codebase is. These 2 tutorial sections should clarify your understanding, though.
    http://java.sun.com/docs/books/tutorial/java/package/index.html
    http://java.sun.com/docs/books/tutorial/deployment/applet/html.html

  • InDesign interactive question...

    I have encountered a problem recently with InDesign interactive that I wasn't aware of up till now. When I position objects on the screen, that have motion applied, if they are placed in the same position on another page with no motion applied, they preview out of position... i.e they look visually different. Up or down a few pixels. I've even noticed that images and items are positioned where I want them in the X and Y coordinates – then when exporting they look out of position??? This is really causing me a lot of vexation at this point as I was working on a project for months when I just noticed some of this. Why does an item that is placed exactly where I want it, appear different when exported out as a swf and previewed. Is this something I wasn't aware of with pixel preview or something??? Anyone encountered this, and is there a way around it.
    Thanks!

    CreateSmart wrote:
    Basically if you create 4 objects, say squares... and turn them into buttons and position them on a page. Then apply motion to them, say fly in from right. If you take those same 4 buttons and position them on another page in the exact same position with no motion applied... when you export the 2 pages out, the page with the buttons that have motion applied is shifted 2-3 pixels up! So say you want the buttons to fly in from the right initially but on subsequent pages you want them to be fixed in their position. The buttons with motion applied after exporting are shifting or not exactly in the same position as the non - moving buttons. Needless to say that's not acceptable for presentation purposes. It's visible! Apparently I never noticed it because I was applying motion to all pages... Very disturbing as I use InDesign a lot for interactive stuff. Maybe a bug... not sure but I'd love to figure out what the problem is and or ask Adobe about it. Too bad you can't just call em' up on the phone anymore...
    As Peter S said, it's also completely outside my workflow. However, a thought popped up: have you tried creating the objects on a master page that's applied to the particular document pages involved, then releasing (aka "override them locally") them on the page where you'll apply animation? If not, give it a try and let the forum know the results.
    HTH
    Regards,
    Peter Gold
    KnowHow ProServices

Maybe you are looking for

  • My MacBook Pro is not able to detect Toshiba LCD TV using HDMI Cable

    Hello, I am recently having an issue of connecting my MacBook Pro with Toshiba LCD 32 Inch i tried many troubleshooting scenarios but nothing came up on my LCD, My Mac OS 10.6.6 with the latest updates from Apple, i tried to connect my Mac to Sony Pr

  • Powerbook 520c PCMCIA module

    I recently came into possession of one of these units. Does anyone know where I can get my hands on the software for it?

  • Lost my mac hd

    I have a Mac mini (late 2012) 1TB I recently tried to use EaseUs Partition Master and accidentally deleted or "wiped" my Mac HD. It now doesn't show at all at startup. I see the Mac recovery volume 10.8.1, but even when I try to install that (knowing

  • SR: Calling Web Services from PL/SQL gives http 500 errors

    Hi, people from Oracle Support sent me to this forum. I'm trying to call the Calendar Web Services from PL/SQL using the utl_http package, but I'm getting http-500 errors. I'm using the example from http://www.oracle.com/technology/tech/webservices/h

  • Updater for Intel Mac

    Hi all, There are new updaters available, QT 7.1.6 and security update http://www.apple.com/support/downloads/securityupdate2007004v11universal.html http://www.apple.com/support/downloads/quicktime716formac.html http://www.apple.com/support/downloads