Applet communicate Servlet Problem

Hi all, I wrote an application which is Applet communicates to Servlet with HttpURLConnection)url.openConnection() method, but sometime I get SocketException because "No processor available" on the server, this happens when two user do the same thing at the exactly time, and one of the application crashed, because on the server side there is not thread(processor) available to process the request. I am using JBoss application server and Tomcat servlet engine to handle my server side processes, I am wondering "Applet communicates to Servlet " is good for the Enterprise Application or not. Does this architect is scalable? Is there any way to configure the Sockets on the Tomcat to handle more request? or is depending on the server power?
Please someone help and I really appreciate your help
Billsend

how we can send the applet data to servlet and
vice-versa
http://www.unix.org.ua/orelly/java-ent/servlet/ch10_01.htm

Similar Messages

  • Problem while sending seriailized  object from applet to servlet

    Hi I m having Object communication between Applet and Servlet.
    I m getting error stack trace as
    java.io.EOFException
         at java.io.ObjectInputStream$PeekInputStream.readFully(Unknown Source)
         at java.io.ObjectInputStream$BlockDataInputStream.readShort(Unknown Source)
    at java.io.ObjectInputStream.readStreamHeader(Unknown Source)
         at java.io.ObjectInputStream.<init>(Unknown Source)
         at com.chat.client.ObjectClient.write(ObjectClient.java:56)
    at the line
    ObjectInputStream ois = new ObjectInputStream(conn.getInputStream());
    thanks in advance
    Ravi
    the whole code is as follows....
    public Serializable write(Serializable obj) throws IOException,ClassNotFoundException{
              URLConnection conn = serverURL.openConnection();
              conn.setDoOutput(true);
              conn.setDoInput(true);
              conn.setUseCaches(false);
              conn.setRequestProperty("Content-Type", "java-internal/"+obj.getClass().getName());
              conn.connect();
              ObjectOutputStream oos= null;
              try{
              oos = new ObjectOutputStream(
                   conn.getOutputStream());
                        oos.writeObject(obj);
                   catch(Exception ee){
                                       ee.printStackTrace();
                   finally{
                        if(oos!=null){
                             oos.flush();
                             oos.close();
                        return the reponse to the client
                   ObjectInputStream ois=null;
                   try{
    \\this is the line where i m getting the error               
    ois = new ObjectInputStream(conn.getInputStream());
                             return (Serializable)ois.readObject();
                        catch(Exception ee){
                                            System.out.println("Error in Object Client inputstream ");
                                            ee.printStackTrace();
                                            return null;
                        finally{
                             if(ois!=null){
                                  ois.close();

    Did anyone find a fix to this problem. I am having a similiar problem. Sometimes I receive an EOFException and othertimes I don't. When I do receive an EOFException I check for available() in the stream and it appears 0 bytes were sent to the Servlet from the Applet.
    I am always open to produce this problem when I use File->New in IE my applet loads on the new page.. and then I navigate to a JSP sitting on the same application server. When I go to the Applet on the initial page and try to send an object to the server I get an EOFException. No idea!

  • How can my applet communicate with servlet via HTTPS?

    hi all,
    I'm using jdk1.4.2_03. Tomcat 4.1.27/29.
    My applet used to communicate to serlvet/JSP via http protocol. However, I wish to apply SSL in my tomcat standalone. Is there any implication towards my existing applet to servlet codes?
    For example,
    URL servletURL = new URL("http://www.myhost.com/Shopping");
    // open connection between applet and servlet
    URLConnection servletConnection = servletURL.openConnection();
    servletConnection.setDoOutput(true); // allow connection do output
    servletConnection.setDoInput(true); // allow connection do input
    servletConnection.setUseCaches(false);
    servletConnection.setRequestProperty("Content-Type", "application/octet-stream");
    ObjectInputStream input = new ObjectInputStream(servletConnection.getInputStream());
    resultset = (Vector)input.readObject(); //get Object from Servlet
    input.close();

    http://java.sun.com/j2se/1.4.2/docs/api/javax/net/ssl/HttpsURLConnection.html
    I never used it though, you can check for some code here:
    http://javaalmanac.com/cgi-bin/search/find.pl?words=HttpsURLConnection

  • Problem in sending image from applet to servlet

    dear friends,
    i have a need to send an image from applet to servlet via HttpConnection and getting back that image from applet.
    i am struggling with this sice many hours and got tired by searching any post that would help me but haven't got yet.
    i tried using this code but it dosent make any execution sit right. i got NPE at ImageIcon.getDescription() line;
    at applet side
          jf.setContentPane(getJContentPane());
                     FileDialog fd=new FileDialog(jf,"hi");
                     fd.setMode(FileDialog.LOAD);
                     fd.setVisible(true);   
                     v=new Vector();
                     try{                                                
                               FileInputStream fis=new FileInputStream(new File(fd.getDirectory()+fd.getFile()));      
                               byte[] imgbuffer=new byte[fis.available()];
                               fis.read(imgbuffer);
                               ImageIcon imgdata=new ImageIcon(imgbuffer);
                               v.add(0,imgicon);
                                String strwp ="/UASProject/Storeimage";              
                                URL servletURL = new URL(getCodeBase(),strwp);             
                                HttpURLConnection servletCon = (HttpURLConnection)servletURL.openConnection();       
                                servletCon.setDoInput(true); 
                                servletCon.setDoOutput(true);
                                servletCon.setUseCaches(false);
                                servletCon.setDefaultUseCaches(false);   
                                servletCon.setRequestMethod("POST");     
                                servletCon.setRequestProperty("Content-Type", "application/octet-stream");   
                                servletCon.connect();            
                                ObjectOutputStream oboutStream = new ObjectOutputStream(servletCon.getOutputStream());                     
                                oboutStream.writeObject(v);
                                v.remove(0);
                                oboutStream.flush();      
                                oboutStream.close();  
                                //read back from servlet
                                ObjectInputStream inputStream = new ObjectInputStream(servletCon.getInputStream());
                                 v= (Vector)inputStream.readObject();                     
                                 imgicon=(ImageIcon)v.get(1);
                                 showimg.setIcon(imgicon);
                                 this.getContentPane().validate();
                                 this.validate();  
                                inputStream.close();                                                        
                             //  repaint();
                     }catch(Exception e){e.printStackTrace();}  and this is at servlet side
            try {       
                         Vector v=new Vector();                    
                         ObjectInputStream inputFromjsp = new ObjectInputStream(request.getInputStream());                                      
                          v = (Vector)inputFromjsp.readObject();                                                                                                          
                          imgicon=(ImageIcon)v.get(0);                     
                          inputFromjsp.close();            
                          System.out.println(imgicon.getDescription());                                      
                          v.remove(0);
                          v.add(1,imgicon);
    //sending back to applet
                           response.setContentType("application/octet-stream");
                          ObjectOutputStream oboutstream=new ObjectOutputStream(response.getOutputStream());            
                          oboutstream.writeObject(v);
                          oboutstream.flush();
                          oboutstream.close();
                   } catch (Exception e) {e.printStackTrace();}  i really need your help. please let me out of this headche
    thanks
    Edited by: san_4u on Nov 24, 2007 1:00 PM

    BalusC wrote:
    san_4u wrote:
    how can i made a HttpClient PostMethod using java applets? as i have experience making request using HttpURLConnection.POST method. ok first of all i am going make a search of this only after i will tell. please be onlineOnce again, see link [3] in my first reply of your former topic.
    yeah! i got the related topic at http://www.theserverside.com/tt/articles/article.tss?l=HttpClient_FileUpload. please look it, i am reading it right now and expecting to be reliable for me.
    well what i got, when request made by html code(stated above) then all the form fields and file data mixed as binary data and available in HttpServletRequest.getinputstream. and at servlet side we have to use a mutipart parser of DiskFileItemFactory class that automatically parse the file data and return a FileItem object cotaing the actual file data,right?.You can also setup the MultipartFilter in your environment and don't >care about it further. Uploaded files will be available as request attributes in the servlet.is the multipartfilter class file available in jar files(that u suggested to add in yours article) so that i can use it directly? one more thing the import org.apache.commons.httpclient package is not available in these jar files, so where can got it from?
    one mere question..
    i looked somewhere that when we request for a file from webserver using web browser then there is a server that process our request and after retrieving that file from database it sends back as response.
    now i confused that, wheather these webservers are like apache tomcat, IBM's webspher etc those processes these request or there is a unique server that always turned on and process all the request?
    because, suppose in an orgnisation made it's website using its own server then, in fact, all the time it will not turned on its server or yes it will? and a user can make a search for kind of information about this orgnisation at any time.
    hopes, you will have understand my quary, then please let me know the actual process
    thanks
    Edited by: san_4u on Nov 25, 2007 11:25 AM

  • Sending a file from Applet to servlet HELP me Please

    Sorry, i have the problem this is my code Applet & Servlet but it seems working asynchronously if you have some ideas please reply me i send bytes on outputstream but the inputstream of servlet receive nothing bytes but write my system.out.print on screen server:
    Applet:
    URL servletURL = new URL(codebase, "/InviaFile/servlet/Ricevi");
    HttpURLConnection urlConnection = (HttpURLConnection) servletURL.openConnection();
    urlConnection.setRequestMethod("POST");
    urlConnection.setUseCaches(false);
    urlConnection.setDoOutput(true);
    urlConnection.setDoInput(true);
    urlConnection.setAllowUserInteraction(false);
    urlConnection.setRequestProperty("Content-Type", "application/octet-stream");
    urlConnection.setRequestProperty("Content-length", String.valueOf(100));
    urlConnection.connect();
    if(urlConnection.HTTP_BAD_REQUEST == HttpURLConnection.HTTP_BAD_REQUEST){
    /*System.out.println("Cattiva Richiesta: "+urlConnection.getContentEncoding());
    System.out.println("Tipo di metodo: "+urlConnection.getRequestMethod());
    System.out.println("Tipo di Risposta: "+urlConnection.getResponseCode());
    System.out.println("Tipo di messaggio: "+urlConnection.getResponseMessage());
    System.out.println("Tipo di contenuto: "+urlConnection.getContentType());
    System.out.println("Tipo di lunghezza contenuto: "+urlConnection.getContentLength());
    System.out.println("Tipo di doinput: "+urlConnection.getDoInput());
    System.out.println("Tipo di doouput: "+urlConnection.getDoOutput());
    System.out.println("Tipo di URL: "+urlConnection.getURL());
    System.out.println("Tipo di propriet� richiesta: "+urlConnection.getRequestProperty("Content-Type"));
    System.out.println("Entra if");
    DataOutputStream dout = new DataOutputStream(urlConnection.getOutputStream());
    InputStream is = urlConnection.getInputStream();
    if(ritornaFile("C:/Ms.tif", dout))System.out.println("Finita lettura");
    dout.close();
    urlConnection.disconnect();
    System.out.println("Fine Applet");
    }catch(Exception e) { System.err.println(e.getMessage());e.printStackTrace();}
    public boolean ritornaFile(String file, OutputStream ots)throws Exception{
    FileInputStream f = null;
    try{
    f = new FileInputStream(file);
    byte[] buf = new byte[4 * 1024];
    int byteLetti;
    while((byteLetti = f.read()) != -1){ots.writeByte(buf, 0, byteLetti);ots.flush();
    while((byteLetti = f.read()) != -1){ots.write(byteLetti);ots.flush();
    System.out.println("byteLetti= "+byteLetti);
    return true;
    }catch(Exception ex){
    System.err.println(ex.getMessage());
    return false;
    }finally{
    if(f != null)f.close();
    Servlet:
    HttpSession ses = request.getSession(true);
    System.out.println("Passa servlet "+request.getMethod());
    System.out.println("Passa servlet "+ses.getId());
    ServletInputStream servletinputstream = request.getInputStream();
    DataInputStream dis = new DataInputStream(request.getInputStream());
    int c = dis.available();
    System.out.println("c="+c);
    //ServletOutputStream servletoutputstream
    //response.getOutputStream();
    response.setContentType("application/octet-stream");
    System.out.println("URI= "+request.getRequestURI());
    System.out.println("pathTranslated: "+request.getPathTranslated());
    System.out.println("RemoteUser: "+request.getRemoteUser());
    System.out.println("UserInRole: "+String.valueOf(request.isUserInRole("")));
    System.out.println("pathInfo: "+request.getPathInfo());
    System.out.println("Protocollo: "+request.getProtocol());
    System.out.println("RemoteAddr:"+request.getRemoteAddr());
    System.out.println("RemoteHost:"+request.getRemoteHost());
    System.out.println("SessionID:"+request.getRequestedSessionId());
    System.out.println("Schema:"+request.getScheme());
    System.out.println("SeesionValido:"+String.valueOf(request.isRequestedSessionIdValid()));
    System.out.println("FromURL:"+String.valueOf(request.isRequestedSessionIdFromURL()));
    int i = request.getContentLength();
    System.out.println("i: "+i);
    ritornaFile(servletinputstream, "C:"+File.separator+"Pluto.tif");
    System.out.println("GetMimeType= "+getServletContext().getMimeType("Ms.tif"));
    InputStream is = request.getInputStream();
    int in = is.available();
    System.out.println("Legge dallo stream in="+in);
    DataInputStream diss = new DataInputStream(servletinputstream);
    int ins = diss.read();
    System.out.println("Legge dallo stream ins="+ins);
    int disins = diss.available();
    System.out.println("Legge dallo stream disins="+disins);
    is.close();
    System.out.println("Fine Servlet");
    catch(Exception exception) {
    System.out.println("IOException occured in the Server: " + exception.getMessage());exception.printStackTrace();
    public void doPost(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, java.io.IOException {
    processRequest(request, response);
    public void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, java.io.IOException {
    processRequest(request, response);
    /** Returns a short description of the servlet.
    public String getServletInfo() {
    return "Short description";
    public void ritornaFile(InputStream its, String fileDest )throws Exception{
    FileOutputStream f = null;
    try{
    f = new FileOutputStream(fileDest);
    byte[] buf = new byte[2 * 1024];
    int byteLetti;
    while((byteLetti = its.read()) != -1){
    f.write(buf, 0, byteLetti);
    f.flush();
    System.out.println("Byteletti="+byteLetti);
    }catch(Exception ex){
    System.err.println(ex.getMessage());
    }finally{
    if(f != null)f.close();

    Hi all,
    Can anyone help me.I am trying to send an audio file from a applet to servlet with HTTP method(no raw sockets), also the servlet shld be able to save the file on the server.Any suggestions welcome.USing audiostream class from javax.sound.sampled.
    The part of applet code which calls servlet is :
    URL url = new URL("http://" + host + "/" + context + "/servlet/UserUpdateWorkLogAudio?userid=" + userId.replace(' ', '+') + "&FileName=" + filename.replace(' ', '+'));
    URLConnection myConnection = url.openConnection();
    myConnection.setUseCaches(false);
    myConnection.setDoOutput(true);
    urlConnection.setRequestProperty("Content-Type", "application/octet-stream");
    myConnection.connect();
    out = new BufferedOutputStream(myConnection.getOutputStream());
    AudioSystem.write(audioInputStream, fileType,out); // IS THIS RIGHT APPROACH?
    ************************end of applet code**********************
    ************************servlet code******************************
    try
    {BufferedInputStream in = new BufferedInputStream(request.getInputStream());
    ????????What code shld i write here to get the audio file stream
    BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(filename));
    *********************************************end***********************
    Thanks
    Joe.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Create Image from Stream in Applet via Servlet

    First of all, I apologize if this isn't posted to the proper forum, as I am dealing with several topics here. I think this is more of an Image and I/O problem than Applet/Servlet problem, so I thought this forum would be most appropriate. It's funny...I've been developing Java for over 4 years and this is my first post to the forums! :D
    The problem is I need to retrieve a map image (JPEG, GIF, etc) from an Open GIS Consortium (OGC) Web Map Server (WMS) and display that image in an OpenMap Applet as a layer. Due to the security constraints on Applets (e.g., can't connect to a server other than that from which it originated), I obviously just can't have the Applet create an ImageIcon from a URL. The OpenMap applet will need to connect to many remote WMS compliant servers.
    The first solution I devised is for the applet to pass the String URL to a servlet as a parameter, the servlet will then instantiate the URL and also create the ImageIcon. Then, I pass the ImageIcon back to the Applet as a serialized object. That works fine...no problems there.
    The second solution that I wanted to try was to come up with a more generic and reusable approach, in which I could pass a URL to a servlet, and simply return a stream, and allow the applet to process that stream as it needs, assuming it would know what it was getting from that URL. This would be more usable than the specific approach of only allowing ImageIcon retrieval. I suppose this is actually more of a proxy. The problem is that the first few "lines" of the image are fine (the first array of buffered bytes, it seems) but the rest is garbled and pixelated, and I don't know why. Moreover, the corruption of the image differs every time I query the server.
    Here are the relevant code snippets:
    =====================Servlet====================
        /* Get the URL String from the request parameters; This is a WMS
         * HTTP request such as follows:
         * http://www.geographynetwork.com/servlet/com.esri.wms.Esrimap?
         *      VERSION=1.1.0&REQUEST=GetMap&SRS=EPSG:4326&
         *      BBOX=-111.11361,3.5885315,-48.345818,71.141304&
         *      HEIGHT=480&...more params...
         * It returns an image (JPEG, JPG, GIF, etc.)
        String urlString =
            URLDecoder.decode(request.getParameter("wmsServer"),
                              "UTF-8");
        URL url = new URL(urlString);
        log("Request parameter: wmsServer = " + urlString);
        //Open and instantiate the streams
        InputStream urlInputStream = url.openStream();
        BufferedInputStream bis = new
            BufferedInputStream(urlInputStream);
        BufferedOutputStream bos = new
            BufferedOutputStream(response.getOutputStream());
        //Read the bytes from the in-stream, and immediately write them
        //out to the out-stream
        int read = 0;
        byte[] buffer = new byte[1024];
        while((read = bis.read(buffer, 0, buffer.length)) != -1) {
            bos.write(buffer, 0, buffer.length);
        //Flush and close
        bos.flush();
        urlInputStream.close();
        bis.close();
        bos.close();
        .=====================Applet=====================
        //Connect to the Servlet
        URLConnection conn = url.openConnection();
        conn.setUseCaches(false);
        conn.setRequestProperty("header", "value");
        conn.setDoOutput(true);
        //Write the encoded WMS HTTP request
        BufferedWriter out =
            new BufferedWriter( new OutputStreamWriter(
                conn.getOutputStream() ) );
        out.write("wmsServer=" + URLEncoder.encode(urlString, "UTF-8"));
        out.flush();
        out.close();
        //Setup the streams to process the servlet response
        BufferedInputStream bis = new
            BufferedInputStream(conn.getInputStream());
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        //Read the bytes and immediately write to the out-stream
        int read = 0;
        byte[] buffer = new byte[1024];
        while((read = bis.read(buffer, 0, buffer.length)) != -1) {
            bos.write(buffer, 0, buffer.length);
        //Flush and close
        bis.close();</code>
        bos.flush();</code>
        byte[] imageBytes = bos.toByteArray();
        //Create the Image/ImageIcon
        Toolkit tk = Toolkit.getDefaultToolkit();
        Image image = tk.createImage(imageBytes);
        imageIcon = new ImageIcon(image);
        Could this be an offset problem in my buffers? Is there some sort of encoding/decoding I am missing somewhere?
    Thanks!
    Ben

    Without having a probing look, I was wondering why you do the following...
    while((read = bis.read(buffer, 0, buffer.length)) != -1) {
    bos.write(buffer, 0, buffer.length);
    while((read = bis.read(buffer, 0, buffer.length)) != -1) {
    bos.write(buffer, 0, buffer.length);
    }Your int 'read' holds the number of bytes read in but you then specify buffer.length in your write methods?!? why not use read? otherwise you will be writing the end of the buffer to your stream which contains random memory addresses. I think thats right anyway...
    Rob.

  • About connecting applets to servlets

    Hi friens,
    I already posted regarding this problem twice but there were no replies. i am really desperate as it is eating up my time. I thought once more i will elaborate it.
    I am using the following code to connect an applet to servlet on my tomcat.
    /////////// swing code ////////////
    URL url = new URL(getCodeBase() + "MasterServlet?handlerName=SendGraphData&sessionid="+sessionid);
    URLConnection con = url.openConnection();
    con.setUseCaches(false);
    con.setDoOutput(true);
    con.setRequestProperty ("Content-Type", "application/octet-stream");
    ObjectOutputStream obj;
    obj = new ObjectOutputStream(con.getOutputStream());
    obj.writeObject(selectedNodes);
    obj.writeObject(saveType);
    obj.flush();
    obj.close();
    If i just use the connection to receive objects from servlet it is working fine. But if i use the statement "con.getOutputStream()" in the above code, connection is not getting established with the servlet at all (it is not going into the servlet). But some times it does go into the servlet but throws "java.io.EOFException" at the statment "request.getInputStream()" , which i call in my servlet code to read the objects sent by the applet.
    i already wasted one week on this. so, pls try to bail me out.
    bye
    steve

    Here is what I have. I did not use ObjectOutputStream as you did, however - just XML. I hope this is useful...
    url = new URL(sTheURL);
    con = url.openConnection();
    con.setRequestProperty("Content-Type", " application/x-www-form-urlencoded");
    con.setDoInput(true);
    con.setDoOutput(true);
    con.setUseCaches(false);
    con.setDefaultUseCaches(false);
    sXML = URLEncoder.encode(sXML);
    sXML = XML + "=" + sXML;
    OutputStream out = con.getOutputStream();
    out.write(sXML.getBytes());
    out.flush();
    out.close();
    InputStream is = con.getInputStream();
    BufferedReader br = new BufferedReader(new InputStreamReader(is));
    String line=null;
    while( (line = br.readLine())!=null)
         respBuf.append(line);
    br.close();

  • How to communicate servlets with windows media player

    I am new to web programming I am developing an application through which a client can play media file.
    I am getting problem in,how to communicate servlet through windows media player.
    I have developed the basic architecture of my application using tiger server,now I want to open media file through windows media player using openURL option(http request).
    Can any body guide me how to build a servlet which can listen this request and how to respond appropriately
    Please Reply.

    Check out the java doc for HttpServletResponse
    http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/http/HttpServletResponse.html
    Your sevlet will have to set the response contentType to the appropriate mime type
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwmt/html/mime.asp
    and contentLength to the file size (in bytes), then open the mp3/wma file and write the bytes to the servlet output stream.
    You could also choose to return an asx file (an xml document containing a url of the media file), and windows media player will automatically lookup the mp3/wma file stored on your web server.

  • 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

  • Stumped on applet to servlet comminication

    Guys and Gals
    I am stumped, hope someone can help out.
    I have an applet talking to a servlet using some options sent through the URL (= doGet). The servlet queries a database, creates a vector with the results and serializes it back to the applet. No problem, works like a charm.
    Now I want to expand on this:
    - call the servlet using some parameters to determine what it should do (= doGet)
    - write a serialized vector of information from the applet to the servlet
    - the servlet queries a database based on what is in the vector
    - the servlet creates a HashMap with the results of the queries and sends the serialized HashMap back to the applet
    What happens is that I am getting an EOFException when the servlet attempts to read the Vector. The Vector is not empty.
    Am I missing something fundamental here, because it really has me stumped? I have not read anything prohibiting me to write a Vector and receive a HashTable but I am getting the impression that writing and then reading on the same servlet connection is screwing things up.
    Thanks
    Ben

    as far as I think, you should use doPost() as doGet() has restrictions over the amount of data sent. and use ObjectOutput/Input Streams to send and recieve Vector objects...

  • Using applets as servlet front ends

    hi,
    i am looking for some examples
    thx
    Marrek

    See http://www.altio.com/ for a demonstration of an applet frontend to a servlet based server framework. If it's code samples you want, then there is nothing special about connecting applets to servlets, just find an example of an applet that connects back to the server it was launched from.

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

  • Calling an applet from servlet

    Hi
    I'm devoloping a server side java software(on netbeans 6) and I want my gui classes(Designed as swing japplet application) to be executed on server side.
    I mean I have database operations on my applet and some logging functions and I want them to execute on server side not client side
    Is it possible to call applets from servlet and so its executed on server if it is possible how can i do that is there a tutorial for that ?
    If it is not is there any other solution? Its really urgent for me
    Thanks

    tolgatanriverdi wrote:
    I'm devoloping a server side java software(on netbeans 6) and I want my gui classes(Designed as swing japplet application) to be executed on server side.Call a company named Citrix, they do stuff like that using a special client.
    I mean I have database operations on my applet and some logging functions and I want them to execute on server side not client sideSo it's not the GUI classes but the rest of the business logic.
    Is it possible to call applets from servlet and so its executed on server if it is possible how can i do that is there a tutorial for that ?It's possible for a servlet to call any class. It's not easily possible for a servlet to connect to a certain applet instance running on a certain client, and neither should it. Hello - it's the server. It's supposed to answer to requests. It's not supposed to issue requests to the client. And considering your set-up as I understood it, you don't ned that anyway. Let the applet just tell the servlet to do action X or Y or Z.
    Its really urgent for meGood Thing that you wrote it here. If you had written it at the beginning of your post, I wouldn't have bothered to answer.

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

  • Can I invoke applet from servlet

    Hello there,
    I was wondering whether I can call an applet in a servlet as follows: -
    out.println("<APPLET code=\"Main_Interface.class\" width=850 height=800></APPLET>");
    I tried the above line but the applet could not be loaded (Main_Interface.class is the applet class).
    Could anyone help me with this. If there is another way of doing it please let me know.
    Thanks in advance

    Hi Ugniss,
    I put my applet class in webapps/applets and servlet class in webapps/test/\WEB-INF\classes.
    here is how I call the applet in the servlet class:
    out.println("<APPLET code=\"Main_Interface.class\" codebase=\"../applets/\" width=850 height=800></APPLET>");
    But the applet is failing to load, any more hints please.
    Cheers

Maybe you are looking for

  • How to achieve automated posted for invoice and stock transfers

    Hi, I have following queries for an RFP, can some one give hints on how to achieve them in SAP o Receive self-billing documents from the customer, stating the deliveries and amounts that are settled and paid o Automatic posting of invoice documents f

  • Unable to login as sysdba after installing ODAC and Oracle developer tools

    Hi..I was able to login with sqlplus / as sysdba and unlock scott account. I then installed ODAC and now when i try to login as sysdba i get Insufficient privileges error. also tried sys/password , sys/change_on_install, system/manager but no luck. P

  • Office 2013 : Ribbon some commands are not available

    hi, Sometimes, in excel or others applications, we have some issues regarding ribbon : commands are not functional ! We must close office applications to get back to a normal state. We did a migration from Office 2007 to Office 2013. best regards

  • Skipping Text

    I am currently working on a lower third using LiveType. I used the "Logo Third" lower third template that comes with LiveType. I expanded upon that design. I need for certain text to scroll accross the bottom, as it does in the original template. How

  • ACR bug = wrong .dcp profiles displayed when Camera Matching profiles deleted

    ACR bug = wrong .dcp profiles displayed when (some) Camera Matching profiles deleted. Olympus E-M1 I deleted some CM profiles from "C:\Documents and Settings\All Users\Adobe\CameraRaw\CameraProfiles\Camera\Olympus E-M1" (I replaced those w/ modified