Applet comunicate with JSP

how can an applet send variables to a JSP??

how can an applet send variables to a JSP??you can use javascript in your jsp page that calls public functions in the applet that returns some value.

Similar Messages

  • Not able to run Applet after calling JSP with a Servlet

    Dear Java-Community :)
    At first I want to say, that my English isn't the best.. so I hope you'll understand my problem ;)
    I'm running a J2EE-Application, packed in a EAR-File, on my JBoss with following directory-structur:
    /jaw6c/bin
    /jaw6c/build
    /jaw6c/common
    /jaw6c/ejb
    /jaw6c/sql
    /jaw6c/src
    /jaw6c/webapp
    /jaw6c/webapp/build
    /jaw6c/webapp/build/classes
    /jaw6c/webapp/build/classes/com
    /jaw6c/webapp/build/classes/com/jbossatwork
    /jaw6c/webapp/build/classes/com/jbossatwork/ControllerServlet.class<<<<<<<<
    /jaw6c/webapp/build/distribution
    /jaw6c/webapp/build/distribution/webapp.war
    /jaw6c/webapp/build/gensrc
    /jaw6c/webapp/compile-lib
    /jaw6c/webapp/lib
    /jaw6c/webapp/src
    /jaw6c/webapp/src/com
    /jaw6c/webapp/src/com/jbossatwork
    /jaw6c/webapp/src/com/jbossatwork/ControllerServlet.java
    /jaw6c/webapp/web
    /jaw6c/webapp/web/WEB-INF
    /jaw6c/webapp/web/WEB-INF/classes
    /jaw6c/webapp/web/buyCarForm.jsp
    /jaw6c/webapp/web/carForm.jsp
    /jaw6c/webapp/web/carList.jsp
    /jaw6c/webapp/web/copy_darstellungErgebnisse.jsp
    /jaw6c/webapp/web/darstellungErgebnisse.jsp<<<<<<<<<<<<<<
    /jaw6c/webapp/web/default.css
    /jaw6c/webapp/web/diag.jar
    /jaw6c/webapp/web/diagram.class<<<<<<<<<<<<<<<<<<<<<<<<
    /jaw6c/webapp/web/error.jsp
    /jaw6c/webapp/web/index.jsp
    /jaw6c/webapp/web/selectBewertungslaeufeList.jsp
    /jaw6c/webapp/build.xml
    /jaw6c/build.xmlThe applet should be loaded in my "darstellungErgebnisse.jsp"-File.
    Now the strange situation:
    When I access "darstellungErgebnisse.jsp" DIRECTLY by entering a URL like "localhost:8080/jaw/darstellungErgebnisse.jsp" , the applet is loading perfectly !
    But when my server is forwarding me to the JSP-Site with
    RequestDispatcher dispatcher =  getServletContext().getRequestDispatcher(destinationPage);
    dispatcher.forward(request, response);
    . . . . . . . ..I'll get a ""java.lang.ClassFormatError: Incompatible magic value 1008813135 in class file diagram
    " -Error what means (referenced on the articles I've read here), that the diagram.class Is not found !
    I have tried to put the class file in a JAR, in different locations... using the codebase and archive tag but NOTHING solved my problem.
    So my question:
    Why I'm able to access the JSP-File directly and seeing the applet but after forwarding to the JSP-File via the Servlet, I'm not able to see anything.
    Would appreciate your help
    Thank you and best regards
    Edit:
    1) I'm able to download the diag.jar and diagram.class file from different locations
    2)I recognized, that after using the servlet, my url is changing from
    localhost:8080/jaw
    to
    localhost:8080/jaw/controller
    I tried added the class file to the position, where the controller-class file is, but without sucess.
    3)Opening the class-file with a hex-editor shows me, that
    the first bytes are
    "CAFEBABE0000002E02B9070002010007"
    (http://forum.java.sun.com/thread.jspa?threadID=648990&messageID=3820701)
    Message was edited by:
    Khaled01

    Hello everybody,
    I finaly have found the solution (after 16 hours).
    Like I mentioned before, I recognized (maybe a little to late), that my path is changing when I'm using the servlet :
    localhost:8080/jaw
    to
    localhost:8080/jaw/controller
    (made by url-pattern in my web.xml).
    So when my JSP tries to acces the class file, It's looking at:
    localhost:8080/jaw/controller/applet/diagram.class
    but the file is in:
    localhost:8080/jaw/applet/diagram.class
    So the solution is, to but a codebase-tag in my applet-declaration with following delcaration "basedir="../applet"
    I hope I'll help somebody with the same problems. It took me a day to find out, that the solution was two points and a slash..... lol
    Regards to everybody

  • Deploying an applet with jsp

    Hi,
    I am trying to make an applet accessible within a JSP, but it won't load, I have the following error in my browser's Java console:
    java.lang.ClassFormatError: Incompatible magic value 1013461310 in class file MyApplet
    The applet is in the same directory of the JSP that calls it wich is the root of the project. Here's the code in the JSP:
    <jsp:plugin type="applet" codebase="." code="MyApplet.class" width="408" height="410" >
    <jsp:fallback>
    Plugin tag OBJECT or EMBED not supported by browser.
    </jsp:fallback>
    </jsp:plugin>
    There are no preblems when I call the applet from a usual html file with the applet tag.
    What am I doing wrong?

    in order to pass information from your applet to the JSP page, you could call your JSP page from applet.
    you may for example open a new browser window whitch is redirected to your JSP page, and user responses are sent as parameter concatanated to the URL
    or you could use post instead of get, anyhow, the idea is that you try to connect to your JSP's url and send these user responses as well...
    but if you would like the page, on which the applet is, to change according to user response, then you cannot do that (if you are not changing content of forms -- that can be done with LiveConnect <- calling javascript from java applet)
    i hope you get some ideas.
    L.

  • Trouble with an applet on  a jsp page

    hi, thanx for readin it!
    im developing a webapp tha have some swing applets , the problem is that the applets dont work, they appear but dont play anything, i use the jsp:plugin to load the applets on the jsp, i also have instaled the java plugin on my win xp pc, i use tomcat 5. well i hope you can help me

    were are the applet classes? under WEB-INF? If so, then they shouldn't be as the server won't server files under that directory and the browser needs them

  • Applet embedded in JSP doesn't run on browser with older than JRE-1.6

    I have embeded an Applet in my JSP Page which used JDK1.6's getHardwareAddress() method to get user's physical address.
    I have embeeded this into a JAR file and used it in my JSP where this applet run on onload() event of the form --> runs the applet --> and gets physical address of user machine and prints it in one of the text boxes on the form.
    Now, the issue is that the applet doesn't run on browser that doesn't support JRE 1.6
    My concern is that how can I run this (if at all possible) in browsers that support lower versions of JRE or is it possible to check that if the browser doesn't support JRE 1.6 then load the basic version of form without running the applet. Can i actually check the version of browser JRE somehow and stop to execute the applet. Because what happens as of now is that if the applet doesn't execute, the complete form fails to load.
    The last option is that I give a message on my web page that redirects user to Sun Java site and asks them to update their browsers.

    Personally, I have no knowledge about Applet but have you checked this link?
    [http://blogs.sun.com/thejavatutorials/entry/deployment_toolkit_101|http://blogs.sun.com/thejavatutorials/entry/deployment_toolkit_101]

  • How to transfer the http request from applet to servlet/jsp

    I use the JTree component to create a navigation of a website,but i don't
    know how to connect the tree's nodes with the jsp/servlet.
    I mean how to transfer the http request from the applet to a jsp.
    I use the "<frameset>" mark which will divide the web browse into 2 blocks.
    The left side is Applet,and the right side is the linked jsp page.
    what I say is as the weblogic console layout.
    who can help me!!!
    Thank You!

    I use the JTree component to create a navigation of a website,but i don't
    know how to connect the tree's nodes with the jsp/servlet.
    I mean how to transfer the http request from the applet to a jsp.
    I use the "<frameset>" mark which will divide the web browse into 2 blocks.
    The left side is Applet,and the right side is the linked jsp page.
    what I say is as the weblogic console layout.
    who can help me!!!
    Thank You!

  • How can I use a applet in a JSP file?

    hi
    I failed to use applet in a jsp file.My workspace is a BC4J type. I put the applet's source file in business component project.the jsp is in JSP project.
    The jsp file calls applet by <jsp:plugin></jsp:plugin> style.
    The error is can't find the applet class.
    why? Thank someone for give me help.

    Actually using jsp applet tags does not mean that it is taking care of that the classes are available. It simply renders the Applet tag tothe JSP page. If e.g. teh codebase is specified as /java/, then there should be a mapping to the Java class location with thename of /java/. If codebase is not provided, then the Java class must be in the classpath of the JSp servlet.
    Frank

  • Calling an Applet from a JSP

              Hi,
              I need help with this, I want to invoke an applet from a JSP page. The applet code
              is compiled and resides in a separate jar file. The question is, how do I deploy
              this applet in weblogic 6.1 and then have a JSP call this applet.
              --Krish.
              

    To call an applet from a jsp use the <jsp:plugin> tag
              <jsp:plugin
              type="applet"
              code="classFileName"
              codebase="classFileDirectoryName"
              [ align="bottom|top|middle|left|right" ]
              [ height="{displayPixels |  <%= expression %>}"]
              [ width="{displayPixels |  <%= expression %>}"]
              [ hspace="leftRightPixels" ]
              [ vspace="topBottomPixels" ]
              </jsp:plugin>
              Krish Khambadkone wrote:
              > Hi,
              >
              > I need help with this, I want to invoke an applet from a JSP page. The applet code
              > is compiled and resides in a separate jar file. The question is, how do I deploy
              > this applet in weblogic 6.1 and then have a JSP call this applet.
              >
              > --Krish.
              

  • Use an applet in a Jsp to display data from Oracle DB

    Hi everyone, I'm very new to java my question is:
    Is there a way to display an applet like a table within a Jsp to display data from a Oracle DB? The thing is that I would be able to show this applet only at the click of the submit button in my html form.
    Please help me any sample code are welcome
    Thank you in advance
    Fabry

    Hi,
    Why can't you use a Java Bean which takes the data from the database. Then call this bean from the JSP page using <jsp:useBean> tag.
    Ok,if you dont want a Java Bean and if you want to use an applet in a JSP file, you will have to use <jsp:plugin>tag. Here is an example
    <html><head><title> Demo Applet</title></head>
    <body bgcolor="rd">
    <% if (request.getParameter("SUBMIT") != null) {%>
    <jsp:plugin type="applet" code="DemoApplet.java" codebase="." name="Demo" height="400 with="300>
    <jsp:fallback> Plug in not supported by your browser</jsp:fallback>
    </jsp:plugin>
    </body></html>
    Hope this will help you.
    Rgds,
    Ravi Shankar

  • Passing input parameters from an applet to a JSP page

    Hello all,
    Yes, its one of these questions which I have tried to find a solution from the already large number of postings but with no luck. I'm still a novice to Java/JSP so bear with me.
    Consider this scenario.
    1. An applet which has two input boxes (say First name and surname). 2. These parameters will be passed to a JSP page (so the applet will call a JSP page).
    3. The JSP will have have the necessary logic (or actually a JavaBean will) to connect to a database and add a new record with these parameters (first name and surname).
    I also need to consider editing/updating the record in the database. So a JSP page will connect to the database, retrieving the required record from the database and then display the parameters back in an applet in two input boxes (first name and surname) to be edited and saved again.
    I have been able to develop a similar application using simple HTML forms to add and update records in a database so I'm not worried about the database connectivity simply the issue of passing parameters from the applet to the JSP page and vice versa (for edit/update).
    Once i've managed to do this with input boxes, I can experiment with the other input types radios, checkboxes, select etc.
    Many thanks in advance,
    Assad

    create an URL object with u'r specified link of the java class and send the parameters..write trhis action in any buttonclick event in u'r applet.

  • Problem on Applet - Reloading with eixsting Components

    Hi All,
    I have developed one application for chatting purpose.. I have embeted with JSP. that application contains Login/logout based.. suppose if i try to login two windows in sample browser am getting previouse window applet components with current applet window.
    plz give me some tips..
    Thanks and regards

    hi
    Actually in my application it has 3 buttons.. if am try to login in same application in same browser. it will show 3x2 = 6 buttons.. how to remove the existing components.. am using single tone pattern..

  • Applet problem in JSP

    Hi,
    I display an Applet from a jsp with this code :
              <jsp:plugin type="applet" code="client/ui/ClientApplet.class"
                   archive="Client.jar" name="LeHall"
                   height="100%" width="100%">
    It works perfectly in Internet Explorer,
    But not in Mozilla :
    It asks me to install a plugin : and there it searches for a plugin,
    then it says that it can't find one.
    I tested the same applet in PHP pages on the same computer,
    it works in Internet Explroer and in Mozilla too, without the need of a plugin for Mozilla,
    Could someone Help me with this please ???

    This isn't a "problem" so much as a different interpretation of what "height" represents. "Height" in the context of Mozilla is the height of the rendered document, not the height of the window.
    For example, if your page only has one line of text, then the "height" of your document would be that one line.
    To play with this idea even further, let's assume your document is so long, that it extends past the viewing area (i.e. you have a scroll bar on the side). If you specify a height of 100%, theoretically Mozilla would assume the entire height of the document. What would IE do?

  • Applet communication with DLL

    Hi,
    Can an applet communicate with Microsoft DLL.
    I want to save the content of an applet to database at server side.
    Problem is there is no java envirnoment at server side (it has dlls).
    What is the best way to do this. The content of the applet has to be savea at sever side not at client.
    Thanx

    deepakshettyk,
    Two options that come to mind are:
    1) have the applet use JDBC to connect to its host server's database directly. Typically this entails having type4 JDBC drivers installed and available.
    2) have the applet itself connect back to its host server's webserver (IIS?), and have a server-side agent (ASP?) record data sent back to a database. See Marty Hall's book, 'Servlets & JSP', from Prentice Hall, for code examples.
    --A                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Applet client with DataForms using dial-up

    Jdeveloper 3.2, IAS9i
    Hello,
    Somebody knows if the DataForms are efficient via dial-up?
    For example in the Online Orders sample,with an applet client (with DataForms, using dialup to connect to app. server). What happens when an user insert a new employee record. When an user navigate around the fields ocurrs a validation inside the Business Object Tier. What happens with the remote round trips?, It's faster?.
    Jdeveloper 3.2.2
    IAS9i
    Thanks a lot.
    null

    Any application designed to run over a dial -up connection must be extremely sensitive to the fact that dial-up connection is very slow due to it's bandwidth.
    Applets by default require downloading a lot of files to the browser. So you must download your app code, the jdbc drivers and any other required classses.
    Applets using BC4J components then must also download the BC4J code. BC4J uses a data cache, so data is also downloaded.
    Avoid using applets in this design.
    Use JavaServerPages(JSP's) (or servlets) which are a much "thinner" version of the "Thin client" group of tools(applets, servlets jsp's)
    WHY JSP's over servlets ??
    They are quicker to write than servlets

  • How to get applets running with Java Plug-in on Win but also on Mac OS X???

    I've converted to the use of Java Plug-in for my applets, but I need to have those same applets executable from browsers on Mac OS X platform. Surely this has been done, but I don't see how. The browsers I've tried on Mac OS X (Netscape, IE) don't seem to recognize the <OBJECT> tag used for the java plug-in. I've seen no news about the Java plug-in being ported to Macs. How can one get the same applet to run with the Java plug-in on Windows browsers, and also to run with at least one of the common browsers on Mac OS X? Any help would be SO much appreciated!

    Those ten dukes look good to me. But the passing of fifteen months has me thinking you've probably moved on. In any case, here's my effort.
    I've been through a trial trying to get my applet, developed with 1.4.1_03, to run on my Mac OS X v.10.2.6 in multiple browsers. I'm posting my results here. Comments and feedback are welcome.
    JVM support for 1.4.1 is limited to the Safari browser. All other browsers running in Mac OS X that I've tried ( Camino, Opera, Internet Explorer, Mozilla ) are using the 1.3.1 plugin. According to a bug report by Mozilla on this topic ( see Bugzilla Bug # 197813 http://bugzilla.mozilla.org/show_bug.cgi?id=197813 )
    with the release of Apple's version of Sun's Java 1.4.1 the applet programming model has changed, and only Safari has adapted with this change. Other browsers, according to the report, could not because of a lack of documentation. The use of the MRJCarbon plugin offered by Mozilla (here - http://www.mozilla.org/oji/MRJPluginCarbon.html) only allows Mozilla to use the J 1.3.1. And I have not found any information on the Microsoft site about how to get IE 5.2 to recognize the newer version of Java.
    Regarding the use of the OBJECT tag in Safari, it is a matter of debate. A current post on this topic exists in the Applet Development forum:
    http://forum.java.sun.com/thread.jsp?forum=421&thread=441002
    In my experience, I have not been able to determine that Safari v1.0 recognizes the OBJECT tag. My experience is that the APPLET tag is required to run applets in Safari. The Bugzilla report echoes the problem with the BadMagicNumber error that can arise in Safari. Nonetheless, I enjoy Safari and I enjoy Mac OS X.

Maybe you are looking for

  • What should I do when my iPhone is in recovery mode, I'm trying to restore, and it's stuck at the "Waiting For iPhone" stage??

    I dropped my iPhone on the ground, and as I went to pick it up, I started to swear under my breath as I realized my iPhone was in recovery mode. I'm like "how would an iPhone be this sensitive -_-," and so as my iPhone's docked unto my laptop, and wi

  • Warranty of iPhone 5

    I have purchased iphone 5 a month back. Now as Apple has launched new models and discontinued iphone 5, what about it's 1 year warranty? What if I have to replace my iphone 5 which is well within the warranty?

  • Accents on a mac

    I'm like 2 days new to macs, and on my PC I was used to keyboard shortcuts (ctrl ' e, ctrl ^ e, etc) that helped me type accents on MSN. How do I perform such an outlandish function on a mac? Macbook   Mac OS X (10.4.10)  

  • Duplication

    Hi i have some duplication problems with macbook. It has some duplication such as Shut Down, Restart and many more. And when i use or select something, a black outline box will appear. How do i get rid of this problem ?

  • Data transfer from version enabled schema to non-version enabled schema

    Hi, This is Kumar and I have two identical schemas on different databases. One which is version enabled and having data in it *(mainschema)* and other one is brand new schema which is not version enabled and empty *(newschema)*. I need to transfer da