Printout from applet varies depending on server

We have always run our web app on Tomcat on Windows, but we're trying to move it to Linux. One small but important component of our site is a simple signed applet that allows users to print out 4x6 packing labels on a thermal printer. If the Zebra (or whatever brand) printer driver is installed properly, the label image lines up perfectly.
Everything continues as normal when the web app is running on a Linux box in our internal/private network, but when the server is our new production Linux server (which is sitting outside our internal network), the image that gets pulled down by the applet is half an inch too far to the right. The code is the same, the Tomcat startup parameters telling it to start headless are the same, the version of Enterprise Red Hat is the same...what could be causing this difference?
I know I'm reaching here, but does it have anything to do with SSL or the applet being signed or something like that? Obviously right now, we don't access that new production machine by DNS name yet--we just hit it by its public IP address (which goes through a BigIP load balancer). I just need to know what in the world to look for!
Thanks...

Weird...that problem was occuring when trying to print with Firefox 0.9.2, but it doesn't occur for IE 6. Both browsers have Java plug-ins associated with 1.4.2 versions of the JRE. This doesn't make me happy at all...that same Firefox browser prints labels from our current Windows-based webserver without a hitch. Why would this Firefox browser move the document/image over half an inch when the webserver was a Linux one, but the IE client browser wouldn't do that? Remember, both use the same JAR for the applet code...

Similar Messages

  • Is it possible to record audio/ vedio from applet and store it on server

    Pls tell me if it is possible to record audio/ vedio from applet and store it on server. I am using JMF. i am able to store audio on the same machine by making a java application but i am not able to understand how to use RTP with it to store it on server from an applet. pls help me i am in urgent need.

    If u want to capture audio/video from the client machine these are the pre-requisites
    1. u need to have JMF installed on the client :(
    one way out of this is that u bundle the library files along ur applet to the client. I am still to figure out how
    to fo that.
    2. while installation uncheck the option 'copy DLLs to system folder....' and check the option 'Allow capture
    from applets.
    3. The Applets u create must be signed, for accessing the client resources such as hard drive.
    You can then capture n save file on the client, open an inout stream out of it, open an outputstream to the server as already described above and start uploading......

  • Call a PL/SQL procedure or function from applet

    Could anyone please let me know how I could call a PL/SQL procedure
    or function from a JDBC method from applet with Internet Explorer?

    It depends from where you are calling your PLSQL routine. If it is SQL*Plus then you can use & (ampersand) with the variable to be input at run time.
    If you are executing the PLSQL routine from another application (some front end application) then it's not possible. Because when a procedure is executing at server side, the front end application does not have control, and the control is only transfered back to front end application when the PLSQL routine either completes successfully or throws an exception.
    In either case, you can not go back to the PLSQL routine.
    In this case, what you can do is, write code in your front end application to get that variable value from user and then pass that value to PLSQL routine.

  • Passing values from applet using POST method to PHP page

    Hello there ;)
    I realy need a help here.. I`ve been working all day on sending mail from applet. I didn`t succeed bcs of the security restrictions.
    So I decided just to pass arguments into PHP page, which process them and send e-mail to me.
    So here is the problem.. I need to send String variables througth POST into my php page. Now I`m using GET method, but I need more than 4000 characters.
    My actual solution is:
      URL url = new URL("http://127.0.0.1/index.php?name=" + name + "&message=" + message);
    this.getAppletContext().showDocument(url,"_self");I really need to rewrite it into POST. Would you be so kind and write few lines example [applet + php code]? I`ve already searched, googled, etc.. Pls don`t copy links to other forums here, probably I`ve read it.
    Thanx in advance to all :)

    hi!
    i`ve got some news about my applet.. so take this applet code:
    public class Apletik extends JApplet {
        public void init() { }
        public void start()
        try
          String aLine; // only if reading response
          String  parametersAsString = "msg=ahoj&to=world";
          byte[] parameterAsBytes = parametersAsString.getBytes();
          // send parameters to server
          URL url = this.getCodeBase();
          url = new URL(url + "spracuj.php");
          URLConnection con = url.openConnection();
          con.setDoOutput(true);
          con.setDoInput(true); // only if reading response
          con.setUseCaches(false);
          con.setRequestProperty("Content=length", String.valueOf(parameterAsBytes.length));
          OutputStream oStream = con.getOutputStream();
          oStream.write(parameterAsBytes);
          oStream.flush();
          String line="";
          BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
          while ((aLine = in.readLine()) != null)
           JOptionPane.showMessageDialog(null, aLine);      
           if(aLine.equals("")) break;
          in.close();      
          oStream.close();
        catch (Exception ex)
          JOptionPane.showMessageDialog(null, ex.toString());
    }here is code of spracuj.php which is on server:
    <?php
      if(isset($_POST['msg']))
        echo('hurray!');
    ?>it has only 1 problem.. when i test it on my localhost, everything seems to be all right. but when i post it to my server, i got IOException HTTP 400 error code :( where is the problem? please help me, i`m so close :D thanx

  • Issue Invoking 10.1.2 BPEL Process from 10.1.3 Embedded server.

    Hi All,
    I am trying to connect to BPEL 10.1.2 from 10.1.3 embedded server. When I run following
    code in debug it just stays at
    Locator locator = new Locator("default","bpel",jndi); line. It does not give any error message.
    Please help. Let me know if I am doing anything wrong here.
    Thank you.
    Jigar
    package com.sjrwmd.bpel;
    import com.oracle.bpel.client.Locator;
    import com.oracle.bpel.client.NormalizedMessage;
    import com.oracle.bpel.client.delivery.IDeliveryService;
    import java.rmi.RemoteException;
    import java.util.Hashtable;
    import java.util.Map;
    import javax.naming.Context;
    public class TestBPEL {
    public TestBPEL() {
    public static void main(String[] args) {
    try{
    Hashtable jndi = null;
    String ssn = "123456789";
    jndi = new Hashtable();
    jndi.put(Context.PROVIDER_URL, "ormi://dell17316/orabpel");
    jndi.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.rmi.RMIInitialContextFactory");
    jndi.put(Context.SECURITY_PRINCIPAL, "admin");
    jndi.put(Context.SECURITY_CREDENTIALS, "welcome");
    //jndi.put("dedicated.connection", "true");
    String xml = "<ssn xmlns=\"http://services.otn.com\">" + ssn + "</ssn>";
    Locator locator = new Locator("default","bpel",jndi);
    IDeliveryService deliveryService = (IDeliveryService)locator.lookupService
    (IDeliveryService.SERVICE_NAME );
    // construct the normalized message and send to collaxa server
    NormalizedMessage nm = new NormalizedMessage( );
    nm.addPart("payload", xml );
    NormalizedMessage res =
    deliveryService.request ("CreditRatingService", "process", nm);
    Map payload = res.getPayload();
    System.out.println( "BPELProcess CreditRatingService executed!" );
    System.out.println( "Credit Rating is " + payload.get("payload") );
    } catch( com.oracle.bpel.client.ServerException se ){
    se.printStackTrace();
    } catch (RemoteException e) {
    // TODO
    }

    Hi Clemens,
    Do don't have to say sorry. It happens sometime. I have remove patch from 10.1.3 and apply back to 10.1.2.
    This is my obsetenv.bat file
    @REM --------------------------------------------------
    @REM ADJUST THESE VARIABLE TO MATCH YOUR ENVIRONMENT
    @REM --------------------------------------------------
    @REM Where has Orabpel been installed on this machine?
    set OB_HOME=C:\OraBPELPM\integration\orabpel
    @REM Which is app server going to use on this machine?
    set OB_PLATFORM=oc4j_10g
    @REM Is there a classpath that you would like Orabpel to add to it's
    @REM classpath? We recommend that you append any additional directories
    @REM to the environment classpath. For example,
    @REM
    @REM set MY_CLASSES_DIR=%CLASSPATH%
    set MY_CLASSES_DIR=%OB_HOME%\system\classes
    set MY_CLASSPATH=%MY_CLASSES_DIR%
    set PROXY_SET="[HTTP_PROXY_SET]"
    @REM Where has the JDK (supporting 1.4.1 or higher) been installed on
    @REM this machine?
    set JAVA_HOME=C:\OraBPELPM\jdk
    if %PROXY_SET% == "true" goto set_proxy
    set OB_JAVA_PROPERTIES=
    goto end_set_proxy
    :set_proxy
    set OB_JAVA_PROPERTIES="-Dhttp.proxySet=true" "-Dhttp.proxyHost=[HTTP_PROXY_HOST]" "-Dhttp.proxyPort=[HTTP_PROXY_PORT]" "-Dhttp.nonProxyHosts=[HTTP_NON_PROXY_HOSTS]"
    :end_set_proxy
    @REM Where the j2ee applications can be deployed, this environment variable
    @REM is application server dependent. The process developers will use this
    @REM this env. variable to deploy their J2EE applications
    @REM (e.g. .war or .ear files)
    set J2EE_APPLICATIONS=C:\OraBPELPM\integration\orabpel\system\appserver\oc4j\j2ee\home\applications
    @REM --------------------------------------------------
    @REM PLEASE DO NOT UPDATE THE REST OF THIS FILE
    @REM --------------------------------------------------
    @REM Classpath
    set OB_LIB=%OB_HOME%\lib
    @REM List of Orabpel and Orabpel related libraries.
    set BASE_OB_CLASSPATH=%MY_CLASSPATH%;%JAVA_HOME%\lib\tools.jar;%OB_LIB%\orabpel-common.jar;%OB_LIB%\orabpel-thirdparty.jar;%OB_LIB%\orabpel.jar;%OB_LIB%\orabpel-ant.jar;%OB_LIB%\ant-launcher_1.6.2.jar;%OB_LIB%\ant_1.6.2.jar;%OB_LIB%\oracle_http_client.jar;%OB_LIB%\xmlparserv2.jar;%OB_LIB%\olite40.jar;%OB_LIB%\aqapi.jar;%OB_LIB%\orawsdl.jar;%OB_LIB%\bpm-infra.jar;%OB_HOME%\system\services\lib\bpm-services.jar;%OB_LIB%\bipres.jar;%OB_LIB%\bicmn.jar;%OB_LIB%\uix2.jar;%OB_LIB%\share.jar;%OB_LIB%\regexp.jar
    @REM Core java runtime libraries
    set JAVA_CLASSPATH=%JAVA_HOME%\jre\lib\rt.jar
    @REM The Xerces and Xalan libraries need to loaded via the bootclasspath option
    @REM since JDK 1.4 packages an older version of Xalan.
    @REM
    set BOOT_LIBS=%OB_LIB%\orabpel-boot.jar;%OB_LIB%\connector15.jar
    @REM Combined classpath
    set OBDK_CLASSPATH=%JAVA_CLASSPATH%;%BASE_OB_CLASSPATH%;%OB_LIB%\j2ee_1.3.01.jar;
    set OB_CLASSPATH=%BASE_OB_CLASSPATH%
    goto finish
    :finish
    @REM --------------------------------------------------
    @REM END OF FILE
    @REM --------------------------------------------------
    This is my startorabpel.bat
    @echo off
    set ECHO=off
    call "C:\OraBPELPM\integration\orabpel\bin\obsetenv.bat"
    @rem Launch Oracle Lite
    @rem
    @rem start /d "C:\OraBPELPM\integration\orabpel\bin" /min /realtime start_olite.bat
    @rem java -Dorabpel.home=C:\OraBPELPM\integration\orabpel -Doracle.mdb.fastUndeploy=60 -Ddatasource.verbose=true -Djdbc.debug=true -Djms.debug=true -Dtransaction.debug=true -jar oc4j.jar
    set OPTS=-Doracle.mdb.fastUndeploy=60 -Doc4j.userThreads=true %OB_JAVA_PROPERTIES%
    set MEM_ARGS=-Xms512m -Xmx512m -Xmn300m -XX:MaxPermSize=80m
    set JAVA_VM=-server
    cd "C:\OraBPELPM\integration\orabpel\system\appserver\oc4j\j2ee\home"
    "C:\OraBPELPM\jdk\bin\java" -Xbootclasspath/p:"%BOOT_LIBS%" %JAVA_VM% %MEM_ARGS% -Dorabpel.home=C:\OraBPELPM\integration\orabpel %OPTS% -jar oc4j.jar -verbosity 10
    Let me know if you need anything more from me.
    Thanks for your help resolving this.
    Jigar

  • Playing an audio file from applet

    Hi friends,
    I have a problem to be solved .
    Please help me.
    I have to play an audio file from applet.When the applet loads it shold start playing .There is a progress bar in the applet it shold alsomove corresponding to that.
    How can i do that.Give me an idea.
    I know nothing about jmf.
    I am using j2sdk1.4,windows 2000 server.

    Andrew,
    Forgive my naivety, but i struggle with JAVA! I am desperately trying to create a JAVA plugin to SERVOY and have to date been successful with a few things. Record, Playback, convert to .spx.
    I am really struggling with implementing a rewind and fastforward function of the type you have. I thought it would be easy, but it appears not.
    At the bottom is the complete code from my class that is called by the servoy plugin wrapper,
    i had thought that adding some simple jump 500 ms would have been easy in something like this:
    public AudioStream js_FastForward (AudioStream as) throws IOException {
    !!! Line or two here to move the play head forward !!!
         AudioPlayer.player.start(as);
         return as;
    Can you give me any pointers to how i code that fast forward bit.
    many thanks
    David
    package com.d2e.MyPlugin;
    import com.servoy.j2db.scripting.IScriptObject;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.awt.Button;
    import javax.sound.sampled.*;
    import org.xiph.speex.*;
    import org.xiph.speex.spi.*;
    import  sun.audio.*;    //import the sun.audio package
    public class MyPluginProvider implements IScriptObject  {
          public void JSencode()
             throws IOException{
               /** Version of the Speex Encoder */
                final String VERSION = "Java Speex Command Line Encoder v0.9.7 ($Revision: 1.5 $)";
                /** Copyright display String */
                final String COPYRIGHT = "Copyright (C) 2002-2004 Wimba S.A.";
                /** Print level for messages : Print debug information */
                final int DEBUG = 0;
                /** Print level for messages : Print basic information */
                final int INFO  = 1;
                /** Print level for messages : Print only warnings and errors */
                final int WARN  = 2;
                /** Print level for messages : Print only errors */
                final int ERROR = 3;
                int printlevel = INFO;
                /** File format for input or output audio file: Raw */
                final int FILE_FORMAT_RAW  = 0;
                /** File format for input or output audio file: Ogg */
                final int FILE_FORMAT_OGG  = 1;
                /** File format for input or output audio file: Wave */
                final int FILE_FORMAT_WAVE = 2;
                int srcFormat  = FILE_FORMAT_OGG;
                int destFormat = FILE_FORMAT_WAVE;
                int mode       = -1;
                int quality    = 4;
                /** Defines the encoders algorithmic complexity. */
                 int complexity = 3;
                /** Defines the number of frames per speex packet. */
                 int nframes    = 1;
                /** Defines the desired bitrate for the encoded audio. */
                 int bitrate    = -1;
                /** Defines the sampling rate of the audio input. */
                 int sampleRate = -1;
                /** Defines the number of channels of the audio input (1=mono, 2=stereo). */
                 int channels   = 1;
                /** Defines the encoder VBR quality setting (float from 0 to 10). */
                 float vbr_quality = -1;
                /** Defines whether or not to use VBR (Variable Bit Rate). */
                 boolean vbr    = false;
                /** Defines whether or not to use VAD (Voice Activity Detection). */
                 boolean vad    = false;
                /** Defines whether or not to use DTX (Discontinuous Transmission). */
                 boolean dtx    = false;
              //HArd code src format and dest
               // private String srcPath ="junk.wav";
              srcFormat = FILE_FORMAT_WAVE;
              destFormat = FILE_FORMAT_OGG;
              //destPath="junk.spx";
             byte[] temp    = new byte[2560]; // stereo UWB requires one to read 2560b
             final int HEADERSIZE = 8;
             final String RIFF      = "RIFF";
             final String WAVE      = "WAVE";
             final String FORMAT    = "fmt ";
             final String DATA      = "data";
             final int WAVE_FORMAT_PCM = 0x0001;
             // Open the input stream
             DataInputStream dis = new DataInputStream(new FileInputStream("junk.wav"));
             // Prepare input stream
           //DP - Sort out the Wave File
               // read the WAVE header
               dis.readFully(temp, 0, HEADERSIZE+4);
               // Read other header chunks
               dis.readFully(temp, 0, HEADERSIZE);
               String chunk = new String(temp, 0, 4);
               int size = readInt(temp, 4);
               while (!chunk.equals(DATA)) {
                 dis.readFully(temp, 0, size);
                 if (chunk.equals(FORMAT)) {
                   typedef struct waveformat_extended_tag {
                   WORD wFormatTag; // format type
                   WORD nChannels; // number of channels (i.e. mono, stereo...)
                   DWORD nSamplesPerSec; // sample rate
                   DWORD nAvgBytesPerSec; // for buffer estimation
                   WORD nBlockAlign; // block size of data
                   WORD wBitsPerSample; // Number of bits per sample of mono data
                   WORD cbSize; // The count in bytes of the extra size
                   } WAVEFORMATEX;
                   if (readShort(temp, 0) != WAVE_FORMAT_PCM) {
                     System.err.println("Not a PCM file");
                     return;
                   channels = readShort(temp, 2);
                   sampleRate = readInt(temp, 4);
                   if (readShort(temp, 14) != 16) {
                     System.err.println("Not a 16 bit file " + readShort(temp, 18));
                     return;
                   // Display audio info
                   if (printlevel <= DEBUG) {
                     System.out.println("File Format: PCM wave");
                     System.out.println("Sample Rate: " + sampleRate);
                     System.out.println("Channels: " + channels);
                 dis.readFully(temp, 0, HEADERSIZE);
                 chunk = new String(temp, 0, 4);
                 size = readInt(temp, 4);
               if (printlevel <= DEBUG) System.out.println("Data size: " + size);
           //DP ENd sort wave file 
           //Now Choose the mode , we have a file sampled at 44100
                 mode = 2; // Ultra-wideband
             // Construct a new encoder
             SpeexEncoder speexEncoder = new SpeexEncoder();
             speexEncoder.init(mode, quality, sampleRate, channels);
             if (complexity > 0) {
               speexEncoder.getEncoder().setComplexity(complexity);
             if (bitrate > 0) {
               speexEncoder.getEncoder().setBitRate(bitrate);
             if (vbr) {
               speexEncoder.getEncoder().setVbr(vbr);
               if (vbr_quality > 0) {
                 speexEncoder.getEncoder().setVbrQuality(vbr_quality);
             if (vad) {
               speexEncoder.getEncoder().setVad(vad);
             if (dtx) {
               speexEncoder.getEncoder().setDtx(dtx);
             // Display info
             // Open the file writer
             AudioFileWriter writer;
             if (destFormat == FILE_FORMAT_OGG) {
               writer = new OggSpeexWriter(mode, sampleRate, channels, nframes, vbr);
             else if (destFormat == FILE_FORMAT_WAVE) {
               nframes = PcmWaveWriter.WAVE_FRAME_SIZES[mode-1][channels-1][quality];
               writer = new PcmWaveWriter(mode, quality, sampleRate, channels, nframes, vbr);
             else {
               writer = new RawWriter();
             writer.open("junk.spx");
             writer.writeHeader("Encoded with: " + VERSION);
             int pcmPacketSize = 2 * channels * speexEncoder.getFrameSize();
             try {
               // read until we get to EOF
               while (true) {
                 dis.readFully(temp, 0, nframes*pcmPacketSize);
                 for (int i=0; i<nframes; i++)
                   speexEncoder.processData(temp, i*pcmPacketSize, pcmPacketSize);
                 int encsize = speexEncoder.getProcessedData(temp, 0);
                 if (encsize > 0) {
                   writer.writePacket(temp, 0, encsize);
             catch (EOFException e) {}
             writer.close();
             dis.close();
            * Converts Little Endian (Windows) bytes to an int (Java uses Big Endian).
            * @param data the data to read.
            * @param offset the offset from which to start reading.
            * @return the integer value of the reassembled bytes.
           protected static int readInt(final byte[] data, final int offset)
             return (data[offset] & 0xff) |
                    ((data[offset+1] & 0xff) <<  8) |
                    ((data[offset+2] & 0xff) << 16) |
                    (data[offset+3] << 24); // no 0xff on the last one to keep the sign
            * Converts Little Endian (Windows) bytes to an short (Java uses Big Endian).
            * @param data the data to read.
            * @param offset the offset from which to start reading.
            * @return the integer value of the reassembled bytes.
           protected static int readShort(final byte[] data, final int offset)
             return (data[offset] & 0xff) |
                    (data[offset+1] << 8); // no 0xff on the last one to keep the sign
         AudioFormat audioFormat;
           TargetDataLine targetDataLine;
         public Class[] getAllReturnedTypes() {
              // TODO Auto-generated method stub
              return null;
         public String[] getParameterNames(String arg0) {
              // TODO Auto-generated method stub
              return null;
         public String getSample(String arg0) {
              // TODO Auto-generated method stub
              return null;
         public String getToolTip(String arg0) {
              // TODO Auto-generated method stub
              return null;
         public boolean isDeprecated(String arg0) {
              // TODO Auto-generated method stub
              return false;
         public String js_Record (String name){
              captureAudio();
              return "Started Recording " +name;
        public String js_StopRecord (String name) throws IOException{
             //new ActionListener(){
             //   public void actionPerformed(ActionEvent e)
                  //Terminate the capturing of input data
                  // from the microphone.
                  targetDataLine.stop();
                  targetDataLine.close();
              //  }//end actionPerformed
             //};//end ActionListener
                 // JSpeexEnc ("junk.wav","output.spx");
                  JSencode();
              return "Stop Records " +name;
        //Play audio file
        public AudioStream js_Playback (String name) throws IOException{
             InputStream in = new FileInputStream("junk.wav");
             AudioStream as = new AudioStream(in);        
             AudioPlayer.player.start(as);           
             return as;
        public AudioStream js_ContPlay (AudioStream as) throws IOException {
             AudioPlayer.player.start(as);           
             return as;
         //Stop Play
        public AudioStream js_Stop_Playback (AudioStream as) throws IOException{
             AudioPlayer.player.stop(as);
              return as;
         //This method captures audio input from a
        // microphone and saves it in an audio file.
        private void captureAudio(){
          try{
            //Get things set up for capture
            audioFormat = getAudioFormat();
            DataLine.Info dataLineInfo =
                                new DataLine.Info(
                                  TargetDataLine.class,
                                  audioFormat);
            targetDataLine = (TargetDataLine)
                     AudioSystem.getLine(dataLineInfo);
            //Create a thread to capture the microphone
            // data into an audio file and start the
            // thread running.  It will run until the
            // Stop button is clicked.  This method
            // will return after starting the thread.
            new CaptureThread().start();
          }catch (Exception e) {
            e.printStackTrace();
            System.exit(0);
          }//end catch
        }//end captureAudio method  
    //  This method creates and returns an
        // AudioFormat object for a given set of format
        // parameters.  If these parameters don't work
        // well for you, try some of the other
        // allowable parameter values, which are shown
        // in comments following the declarations.
        private AudioFormat getAudioFormat(){
          float sampleRate = 44100.0F;
          //8000,11025,16000,22050,44100
          int sampleSizeInBits = 16;
          //8,16
          int channels = 1;
          //1,2
          boolean signed = true;
          //true,false
          boolean bigEndian = true;
          //true,false
          return new AudioFormat(sampleRate,
                                 sampleSizeInBits,
                                 channels,
                                 signed,
                                 bigEndian);
        }//end getAudioFormat
        class CaptureThread extends Thread{
               public void run(){
                 AudioFileFormat.Type fileType = null;
                 File audioFile = null;
                 //Set the file type and the file extension
                 // based on the selected radio button.
                 //if(aifcBtn.isSelected()){
                  // fileType = AudioFileFormat.Type.AIFC;
                  // audioFile = new File("junk.aifc");
                // }else if(aiffBtn.isSelected()){
                 //  fileType = AudioFileFormat.Type.AIFF;
                 //  audioFile = new File("junk.aif");
                // }else if(auBtn.isSelected()){
                 //  fileType = AudioFileFormat.Type.AU;
                 //  audioFile = new File("junk.au");
                // }else if(sndBtn.isSelected()){
                //   fileType = AudioFileFormat.Type.SND;
                 //  audioFile = new File("junk.snd");
                // }else if(waveBtn.isSelected()){
                 fileType = AudioFileFormat.Type.WAVE;
                 audioFile = new File("junk.wav");
                // }//end if
                 try{
                   targetDataLine.open(audioFormat);
                   targetDataLine.start();
                   AudioSystem.write(
                         new AudioInputStream(targetDataLine),
                         fileType,
                         audioFile);
                 }catch (Exception e){
                   e.printStackTrace();
                 }//end catch
               }//end run
             }//end inner class CaptureThread
    }

  • Image: display from local drive, upload to server file system, and display from server

    Hello,
    I am using jdev 11.1.2.4.0...
    The requirement is that users would like to upload images from their local drive to server drive and they would like display images from server drive later.
    We don't want to keep images in database. I am not sure what the solution should be; however, I plan to ....
    1. create a table to keep an information of images -- image_id, image_location (server drive), image_filename
    2. create a page where users can enter image information and specific filename from a local drive (I think I will use inputFile component) and provide the preview button to display an image on screen before save it. To save data is to save information to the database and copy an image file to the server drive (the destination location for image files is predefined.)
    3. create another page where users can browse information from the database and display an image for a selected record by getting from the server.
    I need suggestions on...
    1. how to display an image on page from the local drive?
    2. how to copy a file from a local drive to a server?
    3. how to display an image on page from the server drive?
    Thank you.
    nat

    See:
    http://tompeez.wordpress.com/2011/11/26/jdev11-1-2-1-0-handling-imagesfiles-in-adf-part-1/
    http://tompeez.wordpress.com/2011/11/26/jdev11-1-2-1-0-handling-imagesfiles-in-adf-part-2/
    http://tompeez.wordpress.com/2011/12/16/jdev11-1-2-1-0-handling-imagesfiles-in-adf-part-3/
    Where Timo saves images to the database, you save it to the file system (examples on how to do this from Java are available plenty if you just Google for it). Similar to Timo you then use the image tag to display images. The difference is that you can directly add the URL from the database table.
    The benefit of using a database to host images is that you are not dependent on file server structures though
    Frank

  • How can a trusted applet get permissions on server

    Hello all,
    I have just now read some tutorial about Trusted Applet and not even experimented one. So my knowledge is absolutely zero.
    I would like to use Trusted Applets in my environment which I describe below:
    I have a database server on a Linux machine. On the same machine I have Apache web server. I want to deploy an applet in the Apache server so that all my clients can use it with a web browser. I want my applet to get permissions to connect to the database and retrieve the results etc., when any client uses my applet by connecting to the Apache server.
    According to what I understand from the Trusted Applet tutorial, they are used in an exactly opposite environment, meaning: to get permissions on the client machine to access the local file system etc., and their purpose is not to get permissions on the server.
    Could anyone please give me some detailed instructions on how to use Trusted Applet in my environment.
    Best regards,
    Gopal.

    Hello,
    I forgot to add one point: my Server machine has JDK 1.4.1_01
    Best,
    Gopal.

  • Getting host name from applet

    Hi All,
    How can i get the local host name from applet ( Host name where the applet running) . While i tried with InetAddress i got only the loop back address 127.0.0.1. Can anyone help me out in this regard.
    Thanks in advance
    V.S.Saravanan

    When you say you tried the InetAddress, did you try the following?
    You could try creating a Socket connection back to the host/server URL from where the Applet was downloaded (you should have permission to do this). You can then get the local address of the Socket.
    Something like:
    String hostName = getCodeBase();
    Socket s = new Socket( hostName, portNum );
    InetAddress address = s.getLocalAddress();
    String hostName = address.getHostName();
    Eric

  • Writing files from applet

    We ran into a problem with our Applet. We need to produce a
    report (it is prefferable to save it as a text file or HTML).
    We tried to use DataOuputStream to write out to a text file. It
    works on a local machine but we get a security exception when
    applet is on the server. Is there a way around the security?
    We want our report file in the same directory where Applet comes
    from and we thought that it should not be a problem to write to
    the same host where applet comes from but it seems to be more
    complicated than that.

    Hi gaotdw,
    Simply have your applet do a showDocument(url), and have a java
    servlet receive your request, create your document (in pdf, gif,
    or whatever) and send it back. When your applet invokes
    showDocument it does it within the context of the browser. Thus
    if you build a pdf document dynamically and send out the
    appropriate mime type, your browser will prompt the user to save
    or open your pdf file.
    Please look at this url:
    http://developer.netscape.com/docs/manuals/signedobj/signtool/ind
    I hope this will help you out.
    Regards,
    Tirumalarao
    Developer Technical Support,
    Sun Microsystems,
    http://www.sun.com/developers/support.

  • 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

  • Correlating a flow from client to the VIP and from the VIP to the server

    Hi,
    we need to look at a flow from a client to a server that is traversing a VIP on the ACE. So, we pulled the sniffer traces between the client and the VIP and also between the VIP and the back-end server. How do we find the same flow on these sniffer traces?
    Thanks.
    _ greg

    Hi Greg,
    If ACE is just forwarding the client request the you should see the client port and IP at the backend. If ACE is doing NAT then you can try and filter on the basis of time stamps or information in HTTP header like specific client cookie but mostly when you have different front end and back end streams then time stamps are your best option. Normally during TS taking simultaneous output of "show conn" also helps in corelating front end and backend connection. You can take connection ID and see the corresponding backend stream and vice versa
    show np x me-stats "-c -vvv"--->where x is NP 1 or 2 or 3 or 4 depending upon the specific connection output in show conn.
    Regards,
    Kanwal

  • Need to check the data flow from R/3 to BW server.

    Hi BI experts,
    This query is regarding need to check the data flow from R/3 to BW server.
    As of now I have some set of reports which I would need to take up in BW. The requirement is  to go through the list of transaction codes for reports in R/3 and find out if there are already  any existing objects in BW system which I can use for these reports.
    So, can u plz help me.

    Depends what are your Tcode or Reports users run in R/3 and they want the same in BW.Then in BI Content we have Out of the box Delivered reports.You can activate those Load data and use it.
    Gimme T-codes you have I can send you Standard reports in BI or Cube you can get these from.
    ~AK

  • About Calling PHP from Applet

    I'm developing a web page which incorporate applet. Now i want to call php(server side) from applet. It's ruuning good when the client is working in Direct Internet Connection. If client accessing internet from proxy ...how can i call the php
    With Regards
    Santhosh

    got answer :)..if any one need help post ur queries in this question.

  • How read a file from applet?

    Hello.
    I have an applet which is in a signed jar file. And a configuration xml file. All I want to do is to put it near the jar file and access to it from applet. But applet cannot find it. I just want to read it simply. Also I don�t want to put it in a specified location on the server and want to have it near the jar file.
    Thanks very much.

    Check the API doc for Applet (that's java.applet.Applet). You call myApplet.getDocumentBase() to get the base URL (directory). I believe the base URL returned is actually the base URL of the HTML doc which your applet is embedded in. Add your xml filename to the end of the path. Then look at the API doc for java.net.URLConnection. You can call myURLConnection.getInputStream() to get an input stream of your xml.
    Nick

Maybe you are looking for

  • Checkbox list not working on ipad

    Having a checkbox list for a product attribute isn't working on ipad and other Apple devises. The drop down list works fine. Is this a known problem? Is there an easy fix? Thanks!

  • Display restriction in AdvancedDataGrid

    Hi All, I am using AdvancedDataGrid for displaying information. I set "variableRowHeight= true", so I cannot set the rowCount property I guess. Now my Grid is displaying information beyond the pageheight ie., its adding number of rows as many as poss

  • Top 5 wait event

    I need some guidance on my AWR 5 top wait events I have 10gR2 on Solaris 9. The top 5 events in my AWR (ran hourly) always contain the following: (not necessary in order) CPU time control file parallel write dbfile parallel write log file parallel wr

  • Can not delete one email!?!?  it wont let me delete it!

    I can not delete a certain email. Each time i click the trash can, it brings me back to the home screen.

  • How to dsiplay & in string in oracle ?

    Hi memebrs, i need to display & in string. right now it asking me for variable values . i need to display gujarat & India. but it does not daiplsy.. any help is greatly appreciated. thanks.