Probem with applet and servlets

subject "not able to invoke applet from servlets"
i have attached files also..
Respected sir,
I am thomas from prateek techologies ,referred by madam Pratibha.
Actually i have to plot point marks on a image(it is a Banglore map) in an applet(Uploadimg3.java).so, for doing so, iam getting values from database in my servlet file named Mapuser_sev.java
which is in the directory
WEB-INF/classes.
now after fetching the values ,i am not able invoke the Applet (Uploadimg3.java)which is in the directory
WEB-INF/classes/mapuser.
i have used the api ,response.sendredirect("/prakash/jspfiles/displaymap1.jsp");-->up to here it's ok..
I have used the plugin tag as follows:-
displaymap1.jsp
<html>
<body>
<jsp:plugin type="applet" code="Uploadimg3.class" codebase="WEB-INF/classes/mapuser" width="400" height="400">
</jsp:plugin>
</body>
</html>
if the plugin tag is wrong then please send me the correct coding for "jsp: plugin" with explaination.
this is my directory hierarchy..
jspfiles-->directory(folder)
Prakash/jspfiles/displaymap1.jsp ----->this file has the plugin tags as mentioned above..
Prakash is my context..
WEB-INF/
classes/Mapuser_serv.class -----> this is a servlet file
mapuser/
Uploadimg3.java -----> this is a Applet file
Uploadimg3.class
Mapuser1.java ---> i used this file to fetchdata from db ,please forget this file ..
Mapuser1.class
with regards,
Thomas..

It might be the restrictions java has about opening files in a web browser. I don' t know if it's allowed or not..

Similar Messages

  • Different things on Applets and Servlets

    I use Eclipse. I create two projects: applet and servlet (deploy on Tomcat). One is with the function main, the other has doGet. In these functions I write the same string:
    Mac.getInstance("HmacSHA1");
    But when I run applet - it's ok, when I deploy servlet and run on Tomcat - there are exception: java.security.NoSuchAlgorithmException: Algorithm HmacSHA1 not available
    How to make it availible at servlet?
    Message was edited by:
    AntonVatchenko

    The 2 apps (applet versus servlet) are likely using different versions of the Java runtime (and / or security extensions to them). And on one version that security algorithm exists (is built-in, or added as an extension in your JRE's lib/ext folder or something like that); while on the other the algorithm does not exist.
    Make the J2EE container (the one running the servlet) use the same version of Java as the applet is. I suppose that's just a hint though, that your next question will be something like "Ok, how do I do that?". My job was just to point you in the right direction. Hopefully I've done that.

  • I need help with Applets and Multithreading

    [hello all.  first time poster. big fan of java.]
    now to the important matter: Applets and Threads
    =======================================
    1) I have an applet with that implements the runnable interface, and has one thread (and a simple animation). If I try to view this applet in the applet viewer with JGrasp, it spits an insane error telling me
    "java.security.AccessControlException: access denied (java.lang.RuntimePermission modifyThreadGroup)"
    but, if I run the applet through a web browser, by putting it in an html document, it runs correctly, without error
    What on earth is wrong, and how do I fix it?!?
    2) I want to put 2 threads in my applet?
    If I implement the Runnable interface, I can only have one Run() method in my applet, right?
    So how do I define behaviour for 2 threads when I only have one run method in which to define the behaviour? Can I use two threads with the runnable interface, or do I have to make objects of my own defined thread classes?
    3) I tried to make 2 threads in my applet by creating my own thread classes, and instantiating them in my applet (instead of implementing the runnable interface).
    I still get the same insane error as I mentioned in my first point (which I expected), except now, the applet won't work even when viewed through a web browser!!
    Please please help me. I am frustrated beyond belief (at what is probably a very simple problem)
    I have searched and searched all over and found no answers on this

    If I try to view this applet in the applet viewer with JGrasp, it spits an insane error telling me
    "java.security.AccessControlException: access denied (java.lang.RuntimePermission modifyThreadGroup)"Don't know anything about JGrasp, but it runs with pretty tight security - thats what this insane error is all about. Use the appletviewer or a browser.
    If I implement the Runnable interface, I can only have one Run() method in my applet, right?Correct
    So how do I define behaviour for 2 threads when I only have one run method in which to define the behaviour?
    Can I use two threads with the runnable interface, or do I have to make objects of my own defined thread classes?You can create two Runnable implementations (classes) in your applet.
    example (missing code)
    class MyApplet extends Applet {
      void doSomething() {
      void doSomethingElse() {
      void startThreads() {
        Thread t = new Thread(new Runnable() { public void run() { doSomething();}});
        t.start();
        t = new Thread(new Runnable2());
        t.start();
      class Runnable2 implements Runnable {
         public void run() {
           doSomethingElse();
    }If the above seems confusing, read up on anonymous and inner classes.
    3) I tried to make 2 threads in my applet by creating my own thread classesTry not subclassing thread - this causes a security check

  • Security issues with applets and windows Vista when printing to file

    Hi, everyone
    I am currently developing an application that prints out the result of some calculations.
    from a Javascript file, the output finally ends up in a java applet that should print the file in a special printer.
    For debugging purposes I have created a File printer that creates a file from the output comming to the printer; this way I can debug what commands the printer is receiving.
    This worked well on Windows Xp; Vista always asks for permissions for the applet, and altough I guarantee these permissions, printer is not allowed to create the output file and reports an error writing
    after a little research, I have found that java applets have all permissions when certificated as trusted applications; all but file creating permissions
    anyone has any idea of how could I fix this problem?
    Thanks in advance

    HI,
    Have you actually signed your applet? If the signers certificate is the trusted key store for Java it should treat your applet as trusted. You can use a self signed certificate for testing as long as the cert is in the trusted key store.
    Some links that might help:
    [http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/keytool.html]
    [http://java.sun.com/j2se/1.4.2/docs/guide/plugin/developer_guide/rsa_signing.html]
    Cheers,
    Shane

  • Using MVC with Applet inside Servlet

    Hello fellow Java developers,
    I want to implement the Model View Controller concept inside a Bean Applet combination running in a servlet environment.
    When my model (the Bean) changes, I want my Applet (the View) to get notified so it can get the update from the Bean. The Applet is incorporated inside the jsp page (e.g. the servlet). The Bean is known inside the jsp. How do I make that same Bean known inside the Applet?
    When I create a new Bean during init, or in the constructor of the Applet, I get a complete other reference than the Bean inside the jsp. So, when I ask information from the Bean, I often get NullPointerExceptions, because I am referencing the wrong Bean.
    Does anyone have a solution for my problem?
    Regards,
    Michel

    hi,
    a servlet is server side object, an applet is client side object.
    For the communication, you should try HttpUrlConnection from applet to servlet.
    another way is tu use ejb, or rmi communcation

  • Call JSP with applet and wait till it is loaded

    Hi,
    I am calling a JSP with a java-script. The targetpage needs some time, until the applet is loaded. I would like to call a function in the applet.
    My problem is, that I cannot set 'location.href' and straight after that call the applet, because it will not be there. How can I delay the applet-call, until it is really there?
    function loadOrder(){
    top.mainFrame.location.href = 'auftragseditor.jsp';
    top.mainFrame.OrderApplet.setOrder( orderno )
    I also fitted a while(...) loop between the two statements, but obviously the page is not build up in another thread. The loading will wait.
    Thanks for your help
    Klaus

    Assuming that top.mainFrame.OrderApplet.setOrder( orderno ) causes an exception because
    the applet is not loaded yet you should put it in a try and catch.
    One other problem is that orderno is not defigned anywhere in your method.
    function loadOrder(){
      top.mainFrame.location.href = 'auftragseditor.jsp';
      callApplet( orderno );
    function callApplet(strPassToApplet){
      try{
         top.mainFrame.OrderApplet.setOrder( orderno )
      }catch(e){
        // try again in .1 seconds
        setTimeout("callApplet(\"" + strPassToApplet + \");",100);
    }

  • New Bie - Starting with JSP and Servlets

    Hello fellow members,
    It's my pleasure to be a part of such a wonderful forum. Today, I am here to learn JSP, Servlets, and related tech/frameworks.
    I'd be thankful to any member who can guide me in the right direction.
    I have good working knowledge of Core java.
    I have a licensed copy of weblogic 9.2, though I have no idea how it works :).
    Looking forward for some good pointers to start with. If anyone can hand hold me and tell me exercises I should do every day, there is nothing like that. I can dedicate in excess of 6 hrs daily to learn these new technologies.
    Thanks in advance,

    Sonia_31 wrote:
    I planned to start with tomcat. Tomcat is a good choice.
    I am using my cousins laptop which already has BEA weblogic 9.2 installed. He used to work as software engineer. So I thought it was better start with weblogic, than going for something else.Apparently his company is using Weblogic.
    As I am serious about the whole thing weblogic is a better option. You have application servers and application servers. When I say that Weblogic is commonly only used in "real" production environments, I do not mean that "real" production environments only use Weblogic. You can use any self-respected application server to your taste. Either freeware or payware. That you're using a payware one to start with just made my eyebrows raise.
    Looking for some info to get started. I have downloaded the pdf you have mentioned and started studying. I'll post my questions soon.Good luck.

  • Help with jsp and servlets(litterature)

    I'm planning on converting a asp website to jsp and I need to figure out the following:
    1: servlet that gives out connection objects from a pool and manages "lost" connections to a mysql db
    2: a bean that has getConnection and closeConnection that is used on every jsp page.
    3: servlet/bean that can check size/dimesions/filetype on a remote url image
    4: Figure out what users are logged in at every given moment. result: x users are on, these are user1, user2, user3. automatic removal when session runs out. probably need a servlet for this.
    I got these books:
    deitel java how to program 3rd edition
    deitel advanced java 2 platform how to program
    The last book has a servlet and jsp section ut I suspect that java has evolved since then so thats why I'm asking if you have any other suggestions that offer more than 2 chapters. Its really basic the stuff i have :)
    Its been 3 years since I've touched java so i hope you guys can recomend jsp/servlet books that can answer these questions for me and help me get started with this project?
    Thanks :)

    1. apache dbcp commons library.
    http://jakarta.apache.org/commons/dbcp/
    2. tomcat DataSource, which already has the dbpc logic incorporated into it.
    http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html
    3. no idea, google may help
    4. HttpSessionBindingListener. This allows you to monitor when a bean (such as a User bean) is added to the session and when it is removed from the session. This way you can track yourself which users are online.
    http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/http/HttpSessionBindingListener.html

  • Issue with applet and Weblogic 8.1 SP3

    Hello,
    I have an applet that is making EJB calls to a Weblogic 8.1 SP2 app server via an IIS web server. The weblogic.ejbc tool was used to generate the stubs and skeletons and deployed into the applet.jar. The applet comes up fine in this scenario. But when this applet is connected to a Weblogic 8.1 SP3 app server it failes to come up. Apparently, there is some dependency between the ejbc generated stubs and skeletons with the service pack that is being used. One way of solving this problem is to generate separate stubs and skeletons for each service pack but I would like to avoid doing this and would like it to be transparent to the applet. Is there any configuration that I can make which can help solve this problem ?
    -Vijay

    You could check up for the relaease. I don't think there was such a change in SP3. But generating the stubs and skeletons again will definitely solve. You might even test it backwards (generate on SP3 and test on SP2).
    xH4x0r

  • Delete data dynamically with JSP and servlet (Very Urgent)

    Hi,
    I am new with servlets and JSP. On my jsp page I am populating customer names in a drop box from database and I have 3 buttons ADD, DELETE and EDIT.
    Now when I press DELETE buttong I am calling delete function which is writen in Javascript on my jsp file only,now I want to pass these selcted values ehich I have stored in an array to be pass to servlet,so I can write Delete query for it and delete.
    Could anyone help with sample code>
    Here what I am trying to say:
    <HTML>
    <HEAD>
    <script language="JavaScript" type="text/javascript">
    <!--
    function remove()
    var u = confirm("Are you sure you want to Delete Selected names?")
    if (u==true)
         var selectedArray = new Array();
         var selObj = document.getElementById('CUSTOMER_NAME');
         var i;
         var count = 0;
         for (i=0; i<selObj.options.length; i++) {
         if (selObj.options.selected) {
         selectedArray[count] = selObj.options[i].value;
         count++;
         alert("names to be deleted are:"+selectedArray);
         // selectedArray has the selected items stored
         alert("Items Deleted!")
    else
    alert("No data were deleted!!You pressed Cancel!")
    //-->
    </script>
    </HEAD>
    <BODY>
    //calling servlet on action tag of form
    <FORM METHOD= 'POST' ACTION='Remove_Customer'>
    <form ><INPUT TYPE='submit' NAME='DELETE' VALUE='DELETE' onclick="remove()"></TD></form>
    <form><INPUT TYPE='submit' NAME='MODIFY' VALUE='MODIFY' onclick="modification()" ></TD></form>
    </BODY>
    </HTML>
    PLEASE HELPME,it's very urgent.
    Since the selected Array is in javascrip language , I don't know how can I pass that to servlet.
    request.getParameter is not working,since it's an array
    Many thanks in Advance.

    Hey,
    I am having problem deleting multiple values.
    If I just select one value,it deletes it
    But for multiple values the code is not working right.
    If there 2 values selcted then the last value gets deleted,if there are more than 2 values selected none values delete.
    Could plese check the code,and let meknow what mistake am I doing?
    Please help
    String delName="";
    int pos = tStr.indexOf(",");
    System.out.println(pos);
         if (pos != -1)
                   delName = tStr.substring(0, tStr.indexOf(","));
              tStr = tStr.substring(tStr.indexOf(",") + 1 );
                   System.out.println("DElName:"+delName);
                   System.out.println("tStr::"+tStr);                              
                        delName = tStr;
                        delete_Customer(delName);
    Thanks
    ASH

  • Problems with EJB and Servlet

    I'm doing a simple servlet that invokes an EJB taht returns an ArrayList with a values.
    My problem is that I do trace of my execution an this woks well in the EJB but when my remothe method do the return the app finish and never return to servlet that invoked it. I don't know 'cause this happend.
    I'm using WASD 5.0.1 as my Web y EJB container.
    Help would be appreciate

    What does that ArrayList contain?
    Could you post the code please.

  • Problem with JSP and servlet in Tomcat

    hello all,
    I have made a simple hello world in Eclipse and Tomcat, it works well on my localhost, but now that I try to run it on the server in our lab I got this exception:
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    javax.servlet.ServletException: Implementing class
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:272)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    root cause
    java.lang.IncompatibleClassChangeError: Implementing class
         java.lang.ClassLoader.defineClass1(Native Method)
         java.lang.ClassLoader.defineClass(ClassLoader.java:620)
         java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
         org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1815)
         org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:869)
         org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1322)
         org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1201)
         org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:127)
         org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:65)
         java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
         java.lang.Class.getDeclaredConstructors0(Native Method)
         java.lang.Class.privateGetDeclaredConstructors(Class.java:2328)
         java.lang.Class.getConstructor0(Class.java:2640)
         java.lang.Class.newInstance0(Class.java:321)
         java.lang.Class.newInstance(Class.java:303)
         org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:148)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    I have transfered the web.xml file and lib and classes folder in a WEB-INF folder and also all the JSP files. I can see he JSP file, but the 'hello worl' does not work and gives this exception!
    Does any one have any idea what could be the problem?
    thanks a lot
    Mitra

    seems the web Server code previously loaded a class only when it was used rather than when it was referenced,
    ask your question in the tomcat-user mailing ! !!!

  • Https with midp and servlets

    Hi Everyone,
    I've written an application in MIDP which connects to a servlet and the servlet returns some information using a HTTP connection. Now I want to build in some sort of security and heard that it is possible to use HTTPS. Does anyone know some links where there is a tutorial or explanation on how to use HTTPS (both in MIDP as in J2EE)?
    Thanks in advance,
    Martijn

    it doesn't exist in MIDP for PalmOS yet. apparently it's due some time in "the next couple of months" (read sometime in 2010).
    As for the other midp implementations, who knows.
    generic embedded encryption is available from bouncycastle.org
    -mcclain

  • Help with applets and shape/pixel detection

    hi
    im currently trying to write my first propear programming project, its a little evolving ecosystem but ive hit a stumbling block. im trying to write a method which returns an array of positions around a calling creatures location filled with numbers that refer to its surroundings, in the snippet below it places a 1 in reference to a prey. the method performs a pixel by pixel search of x y matches in an area around the calling creature, it then decides what location the reference is to be placed by working out which range of positions it is in.
    unfortunately no one seems to recognise anybody or behave in the manner in which im encoding them to. i suspect its problem with my basic (and im sure crude) algorithm. if anyone has the time or indeed the inclination to look over this code and offer some opinion i would be very greatful indeed. or has anyone worked on a problem similar to this and could offer me some advice.
    thanks
    for(int index = 0; index < prey.size(); index++)
    otherx = ((Prey)prey.get(index)).getXcord();
    othery = ((Prey)prey.get(index)).getYcord();
    for(int i = -8; i < 9; i++)
    for(int j = -8; j < 9; j++)
    if(otherx == xpos + i && othery == ypos + j && otherx != xpos
    && othery != ypos )
    if(otherx <= xpos && otherx > (xpos - 8)
    && othery > (ypos + 3) && othery < (ypos + 8))
         objectsaround[zero] = 1;
    else if(otherx <= xpos && otherx > (xpos - 8)
    && othery >= ypos && othery < (ypos + 4))
         objectsaround[one] = 1;
    else if(otherx <= xpos && otherx > (xpos - 8)
    && othery <= ypos && othery > (ypos - 8))
         objectsaround[two] = 1;
    else if(otherx >= xpos && otherx < (xpos + 4)
    && othery <= ypos && othery > (ypos - 8))
         objectsaround[three] = 1;
    else if(otherx > (xpos + 3) && otherx < (xpos + 8)
    && othery <= ypos && othery > (ypos - 8 ))
         objectsaround[four] = 1;
    else if(otherx > (xpos + 3) && otherx < (xpos + 8)
    && othery >= ypos && othery < (ypos + 4))
         objectsaround[five] = 1;
    else if(otherx > (xpos + 3) && otherx < (xpos + 8)
    && othery > (ypos + 3) && othery < (ypos + 8))
    objectsaround[six] = 1;
    else if(otherx >= xpos && otherx < (xpos + 4)
    && othery > (ypos + 3) && othery < (ypos + 8))
    objectsaround[seven] = 1;
    }

    I'm reposting the code with the formatting tags so that I can read it.
    for(int index = 0; index < prey.size(); index++)
    otherx = ((Prey)prey.get(index)).getXcord();
    othery = ((Prey)prey.get(index)).getYcord();
    for(int i = -8; i < 9; i++)
    for(int j = -8; j < 9; j++)
    if(otherx == xpos + i && othery == ypos + j && otherx != xpos && othery != ypos )
    if(otherx <= xpos && otherx > (xpos - 8) && othery > (ypos + 3) && othery < (ypos + 8))
         objectsaround[zero] = 1;
    else if(otherx <= xpos && otherx > (xpos - 8) && othery >= ypos && othery < (ypos + 4))
         objectsaround[one] = 1;
    else if(otherx <= xpos && otherx > (xpos - 8) && othery <= ypos && othery > (ypos - 8))
         objectsaround[two] = 1;
    else if(otherx >= xpos && otherx < (xpos + 4) && othery <= ypos && othery > (ypos - 8))
         objectsaround[three] = 1;
    else if(otherx > (xpos + 3) && otherx < (xpos + 8) && othery <= ypos && othery > (ypos - 8))
         objectsaround[four] = 1;
    else if(otherx > (xpos + 3) && otherx < (xpos + 8) && othery >= ypos && othery < (ypos + 4))
         objectsaround[five] = 1;
    else if(otherx > (xpos + 3) && otherx < (xpos + 8) && othery > (ypos + 3) && othery < (ypos + 8))
    objectsaround[six] = 1;
    else if(otherx >= xpos && otherx < (xpos + 4) && othery > (ypos + 3) && othery < (ypos + 8))
    objectsaround[seven] = 1;

  • Best websites with JSP and Servlets

    I would like to see some examples of the best well-known websites realised with jsp & servlets.(if it's possible some awarded ones)
    thx

    This forum is using JSPs. I can see post.jsp in the URL as I type this. Famous enough?
    I believe eBay is 100% J2EE:
    http://www.theserverside.com/home/thread.jsp?thread_id=8906
    MOD

Maybe you are looking for

  • Help needed in activating and deactivating a window

    In my GUI, I have created a window, that is having one textfield, one label and 2 buttons named "Enabled" & "Disabled" . MY requirement is: After execution of the window when I will click "Disabled" button, the window should be deactivated, even I ca

  • Can't Open Some PDFs

    I have the most recent version of Adobe Reader and can't open/read some PDFs that I could open with OS10.6.

  • How do you change the time on the all day setting in the iCal on an iPhone?

    I updated to ios 7 and when I want to put an all day event in. When I set it for an alert, it will only allow it to go off at 9:00 am. How do I change the time of 9:00?

  • Obiee 11g hierarchy columns download into csv format.

    When using hierarchical columns, Is there a way to download the results as the user see it on the view (be it table or pivot view) into a CSV format. Excel format works, but if the user drill down on the hierarchy column and then export in CSV format

  • Cannot View by Film Roll

    I have been going through 5 years of photos updating titles keywords etc. All of a sudden, I cannot view by film roll. It is as if my entire library is one single film roll. Have checked preferences and set view and sort to film roll. Nothing. Any id