Applets embedded in JSP

Hi,
Another newbie question here sorry.
I have the following directory structure in my web app:
root_dir
root_dir/JSP_dir1/JSP_sub_dir1/main.jsp
root_dir/WEB-INF/lib
main.jsp has an embedded apple - the markup looks like this:
<applet
  code="com.somepackage.somesubpackage.Class"
  archive="../WEB-INF/lib/myjar1.jar,
        ../WEB-INF/lib/myjar2.jar,
     ../WEB-INF/lib/myjar3.jar,
     ../WEB-INF/lib/myjar4.jar,
     ../WEB-INF/lib/myjar5.jar"The problem is that when I access main.jsp the applet doesn't show up - instead there are errors and JavaConsole shows the following:
load: class com.somepackage.somesubpackage.Class not found.The relevant JAR's are in the WEB-INF/lib folder. Given the directory structure I mentioned above is it possible that the class could not be found because I am pointing to the location incorrectly? If that is not the case could anyone please suggest what the issue might be?
Thanks.

Thanks, this is very helpful. I guess the other part of my question is, if my JSP's are in the following directory structure:
App-Root/JSP/JSP_subfolder/main.jsp.
And the AppletJars folder is:
App-Root/AppletJars/And the applet is embedded in main.jsp, the libs I reference out of that JSP, does their dir path have to be preceded by../../ or only ../. In other words, JSP's that are located two directories down, do they have to look two directories up?
It may sound like a stupid question, but it is not obvious to me that after the JSP gets compiled into a Servlet it keeps its directory tree. I also think I encountered a situation recently where even though the JSP was nested within 2 folders it had to look only one directory up for something. Am I wrong?

Similar Messages

  • Debug applet embedded in jsp using tomcat and eclipse

    I am trying to debug applet embeded in jsp. I have deployed my application on tomcat.
    The steps I followed
    1. Added JVM rumtime parameters in Java plugin control panel
    -Djava.compiler=NONE -Xnoagent -Xdebug -Xrunjdwp:transport=dt_socket,address=localhost:8000,suspend=n
    2. Added JPDA_ADDRESS = localhost:8000 and JPDA_TRANSPORT=dt_socket to catlina.bat
    3. I start my server from commandline prompt "catalina.bat JPDA start"
    4.I have made a new configuration for remote debug in eclipse debug>new> connection type (socket attach) >port 8000
    5. when I open my application url in browser browser closes and command prompt displays "*Debugger failed to attach , timeout before handshake*"
    Any help on this ?
    Thanks in advance

    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]

  • 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]

  • JAVA Applet embedded in a JSP MI Application.

    Hi
    I am trying to include a Java Applet into a JSP page in my MI application. The code is as follows:
    <jsp:plugin type = "applet"
         code = "com.mycompany.applet.myApplet.class">
    </jsp:plugin>
    It gave me a Class Not Found exception. If I place the class in the same directory that the JSP resides it works properly. It seems that I need to set the codebase and/or archive property to work. But every value I use to set them still gaves me the CLASS NOT FOUND Exception. I am using MI2.5 and the jar file is located at MYAPPS/WEB-INF/lib folder. Any suggestion will be appreciated.

    Hi,
       plz try the following and see whether it can be of any help.
    <jsp:plugin type = "applet"
    code = "com.mycompany.applet.myApplet.class         
    codebase=”http://localhost:4444/*”>
    </jsp:plugin>
    OR
    <jsp:plugin type = "applet"
    code = "com.mycompany.applet.myApplet
    archive="Applet.jar"       -
    > jar  
    codebase=”http://localhost:4444/*”>
    </jsp:plugin>
    The codebase plays an important role as when u r running it relatively on a web server, the path for code base becomes relative as is described above.
    plz try this and let me know.
    regards
    anubhav

  • Applet Focus in JSP.

    I have an applet embeded in a JSP page. In this applet I have some text feilds for data entry. After the each data entry this field get validated . If the entered data is wrong then it popup a message using the JOptionPane.
    Now the problem. :- after message, I want to set back the focus to the respective fields. I had used setfocus(), grabfocus() etc..But nothing get worked.. Please advice ... tanx in advance...........
    Rgds
    Joe

    Did you try requestFocus()? There is no setFocus().
    Although grabFocus() is supposed to do the same thing, I've never used it, probably part of that switch from AWT to Swing some 8 years ago.

  • Virus scan failed Error on deploying a web application having a jar file for calling the applet on the jsp page

    Hi,
    I have an applet application that i want to deploy on the Oracle cloud.
    So i have created a jar file for the applet application and i am using this jar to call the applet on a jsp page.
    But when i am delpoying my application on the java cloud, its giving me the below error:
    2014-10-28 03:16:41 CDT: Starting action "Virus Scan"
    2014-10-28 03:16:41 CDT: Virus Scan started
    2014-10-28 03:16:49 CDT: ----------------------------------------------------------------------
    2014-10-28 03:16:49 CDT: File Scanned: "Application7.ear".
    2014-10-28 03:16:49 CDT: File Size: "106698122".
    2014-10-28 03:16:49 CDT: File Status: "INFECTED".
    2014-10-28 03:16:49 CDT: ----------------------------------------------------------------------
    2014-10-28 03:16:49 CDT: Virus scan failed.
    2014-10-28 03:16:49 CDT: "Virus Scan" complete: status FAILED
    Can't we deploy any application having applet or swing component's onto the cloud?
    Or do we need to request for any extra permissions for the same?
    Thanks,
    Manoj

    I don't see applets mentioned in the supported features nor in the unsupported features so not sure if they are supported you would likely need to contact the operations team to confirm.
    Jani Rautiainen
    Fusion Applications Developer Relations
    https://blogs.oracle.com/fadevrel/

  • Calling applet in a jsp

    Hi
    How do i include an applet in a jsp file.I need to send a parameter to
    the applet as well .
    Thanks

    You use an HTML Applet tag:
    http://java.sun.com/j2se/1.4.1/docs/guide/plugin/developer_guide/using_tags.html

  • 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

  • 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

  • How can i load a applet in a jsp page

    hi ,
    i am chiranjit , i am working in a jsp project . i want to load a applet in a jsp page.previously i had tried this one through <jsp:plugin> but when it goes in cross platform this page unable to load the applet from the serverside.
    if have any solution then pls send the solution in forum.
    thank you.
    chiranjit

    I never tried this... but doesn't the normal html <applet> tag work?

  • 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.
              

  • How do I load an applet in a JSP?

    i have coded an applet in a JSP, the page loads without any errors, but I am not able to view the applet. Any clues? thanks in advance

    I have never seen anyone do this where it turned out to be a good idea. That said...
    1. Application servers usually don't allow extraneous files to be placed in the application root. they will generate a security exception in the app server when trying to load.
    2. Applets can only access the server they were loaded from. If the app server uses the page 10.1.1.2 and you are using www.myserver.com as the codebase, it won't work.

  • 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.

Maybe you are looking for