Regarding servlet(urgent)

hello to all
i recently installd the J2EE SDK to my system, and try to run a very small sevlet program. but as i start compilation i got so much error, these error is only because of "can not read servlet pakage", i have import it when i wrote code.
i tried it to compile it everywhere (lib/bin/outside the folder). i chang the class path and path also. please give me reply to solve this problem
varun seth
09945051989

You need to add the j2ee.jar in the classpath. Specify it explicitly while compiling
javac -cp "<whatever>;<j2ee lib dir>\j2ee.jar" *.java

Similar Messages

  • Regarding servlet

    I know java,,i nstalled tomcat,& i do one simple servlet program when i compile it doesn't compile & shows that javax,servlet not found error appeared..I set path as C:\Program Files\Java\jdk1.5.0_07\bin; & class path as +C:\Program Files\Apache Software Foundation\Tomcat 5.0\common\lib.*;        but idoesn't compile whats the problem                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    regarding servlet
    Posted: Jun 17, 2008 12:39 AM
    I know java,,i nstalled tomcat,& i do one simple servlet program when i compile it doesn't compile & shows that javax,servlet not found error appeared..I set path as C:\Program Files\Java\jdk1.5.0_07\bin; & class path as +C:\Program Files\Apache Software Foundation\Tomcat 5.0\common\lib.*; but idoesn't                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Regarding servlet exception

    Hi,
    while i am testing an application, which was deployed in weblogic , iam getting the folling error, pelase help , its littlebit urgent.
    <Error> <HTTP> <BEA-101017> <[weblogic.servlet.internal.WebAppServletContext@14d5aaf - appName: xxxxxxxxxx', name: 'xxxxxxxxxxxxxxxxxr', context-path: '/xxxxxxxxxx/xxxxxxxxxxxxxxxx spec-version: 'null', version: 'Default_Version'] Root cause of ServletException.
    java.lang.UnsatisfiedLinkError: Can't load library: /xxxxxxxxx/weblogic/java/jrockit_160_05/jre/lib/i386/xawt/libmawt.so
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1650)
    at java.lang.Runtime.load0(Runtime.java:770)
    at java.lang.System.load(System.java:1005)
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751)
    Truncated. see log file for complete stacktrace

    Hi,
    From the following exception, I think the issue could be related to the context path
    <[weblogic.servlet.internal.WebAppServletContext@14d5aaf - appName: xxxxxxxxxx', name: 'xxxxxxxxxxxxxxxxxr', context-path: '/xxxxxxxxxx/xxxxxxxxxxxxxxxx spec-version: 'null', version: 'Default_Version']
    Did you had a chance to check the context root matching and DD (deployment descitors). Also, can I hav the system out log or the server log after you had deployed the application!!
    regards,
    Zeno

  • Regarding  RFC [ URGENT ]

    Hello Experts
    I am updating a table in SCM server with the data from R/3 tables. I am using RFC with destination.
    I created an FM[RFC] in R/3
    I created a program in SCM, in that i am calling that RFC.
    I created a dummy RFC in SCM with the same paramters.
    When i am executing the FM in R/3 i could able to fetch the data as output including some return value.
    But when i am executing the program which is calling the RFC i am not getting the data.
    But i am able to get the return value in R/3 FM[RFC]*
    So i am sure that logical destination name is working
    [ call  'FM' destination 'dest name' ].
    My problem is i am not getting the data to the SCM server eventhogh i could able to get data in R/3 and I could able to connect to remote server.
    *Guys Kindly let me know the solution for this it's a bit urgent
    thanks in advance
    Pramod

    Hi Pramod,
    In the RFC function place the code as infinate loop. like
    Data : x type c.
    do.
    if not x is initial.
    exit.
    endif.
    enddo.
    when you execute this the process will stop in this loop. Go to SM50 and select the process in debug mode. And in the debug mode you can change the value of x. then you can continue from that step in debug mode and you can trace.
    Regards
    Ganesh

  • How can we share  setting Header between two servlets-Urgent

    Hi ,
    I have setting one Header on my 1st servlet and but I need to access same header on my 2nd servlet. Please tell me how can I solve this issues?
    Regards,
    Pattanaik

    Sorry, misread the first time.
    As long as you don't write to the body of the response in the first servlet, you should be able to write to the header in the second. So is your problem that both servlets try to write to the body of the response?
    Edited by: paulcw on Nov 12, 2007 9:07 PM

  • Creating image (graphs, charts) wiht Servlet (Urgent !!)

    I need a complete example that can give source codes and all libraries for encoding images (which is completely free). The program can do following task . It gets some data (doesn't mater where it comes from) then creates a graph or chart depending on given values. Convert (encode) this chart or graph in gif or jpeg format inside servlet.
    Send this jpeg or gif image to Jsp page for displaying.
    Please send me your codes and comments urgently !!
    Thanks in Advance..
    P.S : Please for those who send me codes indicate , where I can download libraries that is given their codes and send me fully free codes.

    There...Yonder....Over the cliff...Coming on strong......The entire Bolivian army...

  • Problem with a Servlet - URGENT help

    Hello
    i really need your help. here i uploaded my web project: http://www.2shared.com/file/4450238/aaa4d9cd/JMSTest.html
    it's about 2 servlets, one Test servlet sending a message, and another one, Receiver, to receive the message sent via JMS (i use ActiveMQ)
    i didn't know what's wrong, if i call http://localhost:8080/JMSTest , then i enter something into that textfield, then i press the button(form action is http://localhost:8080/test ). it writes that "Mesaj trimis" (message sent - written by me in Romanian), and when i call http://localhost:8080/receiver i did not receive the message. Why?
    I use queue, so i think the send message is stored in a queue until a receiver receives it.
    Please download the project, isn't complicated.
    I did not know what's the problem.
    here is the server.xml file from Tomcat conf folder:
    <?xml version="1.0" encoding="UTF-8"?>
    <Server port="8005" shutdown="SHUTDOWN">
      <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"/>
      <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
      <!-- Global JNDI resources
           Documentation at /docs/jndi-resources-howto.html
      -->
      <GlobalNamingResources>
        <!-- Editable user database that can also be used by
             UserDatabaseRealm to authenticate users
        -->
        <Resource auth="Container" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" name="UserDatabase" pathname="conf/tomcat-users.xml" type="org.apache.catalina.UserDatabase"/>
      </GlobalNamingResources>
      <Service name="Catalina">
        <Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443"/>      
        <Connector port="8009" protocol="AJP/1.3" redirectPort="8443"/>
        <Engine defaultHost="localhost" name="Catalina"> 
          <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/>
          <!-- Define the default virtual host
               Note: XML Schema validation will not work with Xerces 2.2.
           -->
          <Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true" xmlNamespaceAware="false" xmlValidation="false">
            <!-- SingleSignOn valve, share authentication between web applications
                 Documentation at: /docs/config/valve.html -->
            <!--
            <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
            -->
            <!-- Access log processes all example.
                 Documentation at: /docs/config/valve.html -->
            <!--
            <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" 
                   prefix="localhost_access_log." suffix=".txt" pattern="common" resolveHosts="false"/>
            -->
           <Context path="/JMSTest" docBase="JMSTest"
            debug="5" reloadable="true" crossContext="true">
        <Resource name="jms/ConnectionFactory" auth="Container"
                     type="org.apache.activemq.ActiveMQConnectionFactory"
                     description="JMS Connection Factory"
                     factory="org.apache.activemq.jndi.JNDIReferenceFactory"
                     brokerURL="vm://localhost"
                     brokerName="LocalActiveMQBroker"
                     userName="activemq" password="activemq"
                     useEmbeddedBroker="false"
                     clientID="TomcatClientID" />
        <Resource name="jms/myQueue" auth="Container"
                     type="org.apache.activemq.command.ActiveMQQueue"
                     description="JMS Queue"
                     factory="org.apache.activemq.jndi.JNDIReferenceFactory"
                     physicalName="TEST.FOO" />
        <Resource name="jms/myTopic" auth="Container"
                     type="org.apache.activemq.command.ActiveMQTopic"
                     description="JMS Topic"
                     factory="org.apache.activemq.jndi.JNDIReferenceFactory"
                     physicalName="TEST.BAR"/>
    </Context>
           </Host>
        </Engine>
      </Service>
    </Server>or, how should i do this, but using Sun Message Queue? my way is using Apache MQ
    Thanks
    Edited by: Talkabout on Dec 13, 2008 7:15 AM

    I didn't go all through your code, but I'd say you should make sure that the Receiver servlet is up and running BEFORE your access the Sender servlet.

  • Regarding report(urgent)

    Hi experts,
    i need to add some fields to output of the report.
    here i am giving the fields required to add and giving the code below please build the code
    , we need to add the following data in the report output.
        > GR Document (RSEG-LFBNR)
        > GR date (MKPF-BLDAT)
        > Quantity (MSEG-ERFMG)
        > Amount in LC(MSEG-DMBTR)
        > GL Account (MSEG-SAKTO)
    Logic in getting the record:
        > for each invoice no(RESG-BELNR) of a PO Line(EKKO-EBELN,EKPO-EBELP), get GR no (RSEG-LFBNR) and doc. year(RSEG-LFGJA),  
        > select the matching record in MSEG using the GR no and year  (RSEG-LFBNR = MKPF-MBLNR & RSEG-LFGJA=MKPF-MJAHR,                                                                               
    EKKO-EBELN=RSEG- EBELN,EKPO-EBELP=RSEG-EBELP)
        > select the matching record in MKPF using the GR no and year (RSEG-LFBNR = MKPF-MBLNR & RSEG-LFGJA=MKPF-MJAHR)
    here iam giving my code  we have to add thos fields into this code:
    TABLES: ekko,   "Purchasing Document Header
            ekpo,   "Purchasing Document Item
            rbkp.   "Document Header: Invoice Receipt
    Type-Pools
    TYPE-POOLS : slis.   " Has to be declared to use ALVs
    To hold ALV field catgory data
    DATA : it_fieldcat TYPE slis_t_fieldcat_alv,
           wa_fieldcat LIKE LINE OF it_fieldcat.
    Internal tables declarations
    Internal table to hold Report data
    DATA: BEGIN OF it_output OCCURS 0,
           dir_indir(9),
           bukrs LIKE ekko-bukrs,    "company code
           ebeln LIKE ekko-ebeln,    "Purchasing Document Number
           ebelp LIKE ekpo-ebelp,    "Item
           aedat LIKE ekko-aedat,    "Date on which the record was created
           belnr LIKE rseg-belnr,    "Accounting document number
           bldat LIKE rbkp-bldat,    "Document date in document
           budat LIKE rbkp-budat,    "Posting date in the document
           wrbtr LIKE rseg-wrbtr,    "Amount in document currency
           curr  LIKE t880-curr,     "Price unit (Local Curr)
           bednr LIKE ekpo-bednr,    "Requirement tracking number
           lifnr LIKE ekko-lifnr,    "Vendor's account number
           name1 LIKE lfa1-name1,                               "name1
           name2(30),                "preparer name
           name3(30),                "requester name
           gjahr LIKE rseg-gjahr,    "Fiscal year
           ernam LIKE ekko-ernam,    "Name of Person who Created the Object
           kursf LIKE rbkp-kursf,    "Exchange rate
           shkzg LIKE rseg-shkzg,    "Debit/credit indicator
           banfn LIKE ekpo-banfn,    "Purchase requisition number
            bnfpo like eban-bnfpo,
           knttp LIKE ekpo-knttp,    "account assignment category
          END OF it_output.
    Selection Screen
    SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS: p_bukrs LIKE ekko-bukrs OBLIGATORY.
    Parameters: P_knttp like ekpo-knttp as checkbox default 'X'.
    SELECT-OPTIONS: s_invdat FOR rbkp-bldat,    "Document date in document
                    s_vendor FOR ekko-lifnr,    "Vendor's account number
                    s_purcdo FOR ekko-ebeln,    "Purchasing Document no
                    s_credat FOR ekko-aedat OBLIGATORY,"create date
                    s_plant  FOR ekpo-werks,    "Plant
                    s_doctyp FOR ekko-bsart,    "Purchasing document type
                    s_purorg FOR ekko-ekorg,    "Purchasing organization
                    s_trcnum FOR ekpo-bednr,    "Requirement tracking number
                    s_knttp  FOR ekpo-knttp.    "account assignment category
    SELECTION-SCREEN: END OF BLOCK b1.
    DATA: count TYPE i VALUE 0.            " Used to count records
              INITIALIZATION                                             *
    INITIALIZATION.
    At Selection Screen
    AT SELECTION-SCREEN.
    Checking for the input values of selection screen fields.
      PERFORM validate_params.
    Start Of Selection
    START-OF-SELECTION.
    if p_knttp = 'X'.
    PERFORM get_data.
    else.
    skip.
    *message e021 with 'no output'.
    endif.
      PERFORM get_data.
    End Of Selection
    END-OF-SELECTION.
    SUBROUTINE TO CALL THE FUNCTION MERGE TO ENSURE PROPER DISPLAY.
      PERFORM merge_fieldcatalog.
      PERFORM modify_fieldcat.
      PERFORM alv_report.
          FORM validate_params                                          *
    FORM validate_params.
    Validate company code
      SELECT SINGLE COUNT(*) FROM t001 WHERE bukrs = p_bukrs.
      IF sy-subrc <> 0.
        MESSAGE e021 WITH 'Please enter a valid Company code'.
      ENDIF.
    *Validate Vendor.
      SELECT SINGLE COUNT(*) FROM lfa1 WHERE lifnr IN s_vendor.
      CASE sy-subrc.
        WHEN 0.
        WHEN OTHERS.
          MESSAGE e021 WITH 'Please enter a valid Vendor'.
      ENDCASE.
    *Validate PO doc type
      SELECT SINGLE COUNT(*) FROM t161 WHERE bsart IN s_doctyp.
      CASE sy-subrc.
        WHEN 0.
        WHEN OTHERS.
          MESSAGE e021 WITH 'Please enter a valid PO Doc. Type'.
      ENDCASE.
    *Validate plant
      SELECT SINGLE COUNT(*) FROM t001w WHERE werks IN s_plant.
      CASE sy-subrc.
        WHEN 0.
        WHEN OTHERS.
          MESSAGE e021 WITH 'Please enter a valid Plant. Type'.
      ENDCASE.
    *Validate Purch. Org
      SELECT SINGLE COUNT(*) FROM t024e WHERE ekorg IN s_purorg.
      CASE sy-subrc.
        WHEN 0.
        WHEN OTHERS.
          MESSAGE e021 WITH 'Please enter a valid Purch. Org.'.
      ENDCASE.
    ENDFORM.                               " PERFORM VALIDATE_PARAMS.
          FORM get_data                                                 *
    FORM get_data.
      DATA: l_persnumber LIKE usr21-persnumber.
    Get PO data
      SELECT a~bukrs a~ebeln b~ebelp a~aedat a~lifnr a~ernam
             b~knttp b~bednr b~banfn
             c~belnr c~wrbtr c~gjahr c~shkzg
             d~bldat d~budat d~kursf
             e~dir_indir
      INTO CORRESPONDING FIELDS OF TABLE it_output
      FROM ekko AS a
      JOIN ekpo AS b ON b~ebeln = a~ebeln
      JOIN rseg AS c ON c~ebeln = b~ebeln
                    AND c~ebelp = b~ebelp
                    AND c~bukrs = a~bukrs
      JOIN rbkp AS d ON d~belnr = c~belnr
                    AND d~gjahr = c~gjahr
      LEFT JOIN zpo_dirindir AS e ON e~knttp = b~knttp
      WHERE a~bukrs = p_bukrs
        AND a~lifnr IN s_vendor
        AND a~ebeln IN s_purcdo
        AND a~bsart IN s_doctyp
        AND a~ekorg IN s_purorg
        AND a~aedat IN s_credat
        AND b~knttp IN s_knttp
        AND b~werks IN s_plant
        AND b~bednr IN s_trcnum.
      LOOP AT it_output.
      Get posting date, Doc. date & Curr. Key
        IF it_output-kursf > 0.
          it_output-wrbtr = it_output-wrbtr * it_output-kursf.
          else.
          if it_output-kursf < 0.
         it_output-wrbtr =   it_output-Wrbtr * ( 1 / it_output-kursf ).
           it_output-wrbtr = abs( it_output-wrbtr ).
          endif.
        ENDIF.
      get local currency
        SELECT SINGLE waers INTO it_output-curr FROM t001
                 WHERE bukrs = it_output-bukrs.
      Get vendor name.
        SELECT SINGLE name1 FROM lfa1 INTO it_output-name1
        WHERE lifnr = it_output-lifnr.
      Get PO created person name
        SELECT SINGLE persnumber INTO l_persnumber FROM usr21
         WHERE bname = it_output-ernam.
        IF sy-subrc = 0.
          SELECT SINGLE name_text FROM adrp INTO it_output-name2
           WHERE persnumber = l_persnumber.
       ELSE.
          it_output-name2 = it_output-ernam.
        ENDIF.
      Get get requested by from Unloading point in PO
      else PR created by (If PR exists)
        CASE it_output-dir_indir.
          WHEN 'I'.
          Take requested by from Unloading point.
            SELECT SINGLE ablad INTO it_output-name3 FROM ekkn
             WHERE ebeln = it_output-ebeln
               AND ebelp = it_output-ebelp .
          WHEN 'D'.
           SELECT SINGLE ernam INTO it_output-name3 FROM eban
            WHERE banfn = it_output-banfn
                     AND ebelp = it_output-ebelp.
           IF sy-subrc <> 0.
             MOVE it_output-ernam TO it_output-name3.
           ENDIF.
           SELECT SINGLE persnumber INTO l_persnumber FROM usr21
               WHERE bname = it_output-name3.
           IF sy-subrc = 0.
             SELECT SINGLE name_text FROM adrp INTO it_output-name3
              WHERE persnumber = l_persnumber.
           ENDIF.
    select single ernam into  it_output-name3 from eban where
         banfn = it_output-banfn and bnfpo = it_output-bnfpo.
                 move it_output-name3 to it_output-name3.
                if sy-subrc = 0.
            SELECT SINGLE PERSNUMBER INTO L_PERSNUMBER FROM USR21
                WHERE BNAME = it_output-name3.
            IF SY-SUBRC = 0.
              SELECT SINGLE NAME_TEXT FROM ADRP INTO it_output-name3
               WHERE PERSNUMBER = L_PERSNUMBER.
            ELSE.          it_output-name3 = it_output-name3.
            endif.
          else.
            SELECT SINGLE PERSNUMBER INTO L_PERSNUMBER FROM USR21
                    WHERE BNAME = it_output-ernam.
            IF SY-SUBRC = 0.
              SELECT SINGLE NAME_TEXT FROM ADRP INTO it_output-name3
               WHERE PERSNUMBER = L_PERSNUMBER.
            ELSE.
              it_output-name3 = it_output-ernam.
            endif.
          endif.
        ENDCASE.
      translate direction indicator to Indirect or Direct
        CASE it_output-dir_indir.
          WHEN 'I'. it_output-dir_indir = 'Indirect'.
          WHEN 'D'. it_output-dir_indir = 'Direct'.
        ENDCASE.
        MODIFY it_output.
      ENDLOOP.
    ENDFORM.
    FORM MERGE_FIELDCATALOG                                             *
    FORM merge_fieldcatalog.
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
           EXPORTING
                i_program_name         = sy-cprog
                i_internal_tabname     = 'IT_OUTPUT'
                i_inclname             = sy-cprog
           CHANGING
                ct_fieldcat            = it_fieldcat[]
           EXCEPTIONS
                inconsistent_interface = 1
                program_error          = 2
                OTHERS                 = 3.
    ENDFORM. " MERGE_FIELDCATALOG
          FORM modify_fieldcat                                          *
    FORM modify_fieldcat.
      DATA: wa_fieldcat TYPE slis_fieldcat_alv.
      LOOP AT it_fieldcat INTO wa_fieldcat.
        CASE wa_fieldcat-fieldname.
          WHEN 'DIR_INDIR'.
            wa_fieldcat-seltext_m = 'Direct/Indirect'.
          WHEN 'NAME2'.
            wa_fieldcat-seltext_m = 'PREPARER NAME'.
          WHEN 'NAME3'.
            wa_fieldcat-seltext_m = 'REQUESTER NAME'.
          WHEN 'BEDNR'.
            wa_fieldcat-seltext_m = 'SSP PO'.
          WHEN 'AEDAT'.
            wa_fieldcat-seltext_m = 'PO DOCUMENT DATE'.
          WHEN 'BLDAT'.
            wa_fieldcat-seltext_m = 'INVOICE DOCU DATE'.
          WHEN 'BUDAT'.
            wa_fieldcat-seltext_m = 'POSTAGE DATE'.
          WHEN 'WRBTR'.
            wa_fieldcat-seltext_m = 'LOCAL AMOUNT'.
            wa_fieldcat-cfieldname = 'CURR'.
            wa_fieldcat-ctabname   =  wa_fieldcat-tabname.
          WHEN 'CURR'.
            wa_fieldcat-seltext_m = 'LOCAL CURR'.
          WHEN 'NAME1'.
            wa_fieldcat-seltext_m = 'VENDOR NAME'.
        ENDCASE.
        MODIFY it_fieldcat FROM wa_fieldcat.
      ENDLOOP.
    ENDFORM.
          FORM ALV_REPORT                                               *
    FORM alv_report.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                i_callback_program = sy-cprog
                it_fieldcat        = it_fieldcat[]
           TABLES
                t_outtab           = it_output[].
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.

    Very sorry to say this Venu ...
    This is a forum to ask doubts .. "Not get your work done for Free"
    Kindly try to do it yourself first & then if you are stuck somewhere fell free to shout for help
    Best regards,
    Gaurav

  • Problem in Download Servlet (Urgent)

    Hai
    i am using an servlet to download files.
    i am facing an problem with that servlet.While downloading, at times it strucks at 290k or 330k.
    Note : Acually i am calling this servlet from a popup window.The popup window closes automatically after one minute irrescpective of the download progress.At times i noticed that the download strucks while the popup closes, whether is causes the problem of strucking.
    import java.io.*;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class Download extends HttpServlet {
    HttpSession session =null;
    File F;
    BufferedInputStream fif;
    ServletOutputStream stream;
    public void init(){
    F=null;
    fif=null;
    stream =null;
    public void doGet(HttpServletRequest request ,HttpServletResponse response) {
    try{
         // Setting Buffer size
    response.setBufferSize(50000);
                   // Setting Content Type
    response.setContentType("application/x-filler");
    int buffersize;
    String cfile="";
    boolean flag=false;
    session = request.getSession(true);
                   //Receiving variables
    String fileName= request.getParameter("filename");
    String filePath = request.getParameter("filepath");
    String downloadFile = filePath + fileName;
    F=new File(downloadFile);
    String download_date = "sysdate";
    String file=F.getName();
    buffersize=(int)F.length();
    byte b[]=new byte[buffersize];
         //Servet output stream to download file
    stream = response.getOutputStream();
    response.setHeader("Content-Disposition", "attachment; filename=\"" + file + "\";");
    int data;
    fif = new BufferedInputStream(new FileInputStream(F));
    //writing data to output stream
    while((data = fif.read()) != -1) {
    stream.write(data);
                   //closing objects
    fif.close();
    stream.close();
    F.delete();
    }catch(java.net.SocketException se){
    System.out.println("SocketException " +se);
    catch(IOException io){
    System.out.println("IOException " + io);
    catch(Exception e){
    System.out.println("Exception " +e);      
    }

    I guess your closing of the window is your problem. Your servlet looks just fine to me.
    Try calling this servlet from a browser and see if it still stops..

  • Problem in(IE 6) Opening non-html files using Servlets (Urgent)

    Hi,
    My application developed using struts 1.3 have an option to upload and download any kind of files.
    The uploaded files shall be displayed as hyperlinks in the HTML page. On click of a hyperlink, a servlet shall be called and the corresponding file shall be opened as an attachment. But i am facing problem in opening the files.
    The problem is,
    Whenever i try to open a file of type (.doc or .xls or .pdf) the browser(*IE 6*) does not identify the content type. So it opens the content in a browser as binary content. But it works perfectly in IE 7 and firefox. (I used mim.types file to fetch the content type dynamically based on the file chosen)
    However, the code i used to open a .doc file is,
    response.setContentType("application/msword");
    response.setHeader("Content-Disposition", "attachment;filename="+content.getFileName());
    response.setContentLength(content.getStream().size());
    ServletOutputStream out;
    out = response.getOutputStream();
    content.getStream().writeTo(out);
    out.flush();
    content - is a TO which shall hold the fileName and ByteArrayOutputStream ,etc.
    Please anyone can help me solving this issue.
    Thanks,

    thanks..
    its working fine now. i just added response.reset() before setting the properties of HTTPResponse object.

  • Problem regarding servlets+ threads

    <meta http-equiv=\"refresh\"" " content=\"5\" ";URL=\"\">";
    Iam using meta refresh tag for refreshing browser for every 5 seconds.
    When i invoke doPost () then iam creating thread and for every 5 sec it calls doGet() .
    If i close browser then servlet is not invkoing but thread is running
    How to stop a thread when we close browser?

    iam using Tomcat
    <Connector acceptCount="100"
    connectionTimeout="20000"
    disableUploadTimeout="true" port="8080"
    redirectPort="8443" maxSpareThreads="75"
    maxThreads="150" minSpareThreads="25">
    </Connector>
    his is ok.Ignore my first post.
    Your problem has nothing to do with the containers thread management.
    Is there any way to excute following method
    Thread.currentThread().destroy(); or stop when i
    close browserPlease see malcolmmc's great post (i.e, the browser refresh is driving things - you shouldn't need a thread in the servlet).
    Servlets are blocking request / response based: When you've written a response, you're done. They are not connection based - and there isn't (and shouldn't be) any direct way to know when a connection has gone

  • Regarding servlets instance and client

    Hi
    Suppose 5 client programs are calling one servlets at a time.
    Then how many instance will create 1 or 5?
    if 1 then how 5 requests will be be processed

    Please read "SRV.2.2 Number of Instances" in the Servlet specification.

  • Problem regarding servlets

    what will be happen when we call destroy method in init method.

    Probably nothing smart, since both methods are supposed to be called by the
    servlet container. Why don't you try it and see?

  • Regarding  bapi ( urgent)

    hi
    w t is   the  difference   b/w   of BAPIMEPOHEADERX,BAPIMEPOHEADER
    wr can i use   this   BAPIMEPOHEADERX,
    Regards
    Spandana

    hi spandana,
    check this sample program.
    *& Report  ZMM_PO_CREATE1                                              *
    REPORT  ZMM_PO_CREATE1                          .
    data : POHEADER like BAPIMEPOHEADER occurs 0 with header line,
           POHEADERX like BAPIMEPOHEADERX occurs 0 with header line,
           POITEM like BAPIMEPOITEM occurs 0 with header line,
           POITEMX like BAPIMEPOITEMX occurs 0 with header line,
           POESLLC like BAPIESLLC occurs 0 with header line,
           POACCOUNT like BAPIMEPOACCOUNT occurs 0 with header line,
           POACCOUNTX like BAPIMEPOACCOUNTX occurs 0 with header line,
           POCONDHEADER like BAPIMEPOCONDHEADER occurs 0 with header line,
           POCONDHEADERX like BAPIMEPOCONDHEADERX occurs 0 with header line,
           POCOND like BAPIMEPOCOND occurs 0 with header line,
           RETURN like BAPIRET2 occurs 0 with header line.
    data : po_no(10).
    data : begin of it_head occurs 0,
           ref(10),
           bsart like ekko-bsart,
           lifnr like ekko-lifnr,
           ekorg like ekko-ekorg,
           ekgrp like ekko-ekgrp,
           bukrs like ekko-bukrs,
           verkf like ekko-verkf,
           telf1 like ekko-telf1,
           ihrez like ekko-ihrez,
           unsez like ekko-unsez,
           kdatb(10),
           kdate(10),
           end of it_head.
    data : begin of it_det occurs 0,
           ref(10),
           knttp like ekpo-knttp,
           pstyp like ekpo-pstyp,
           txz01 like ekpo-txz01,
           matkl like ekpo-matkl,
           werks like ekpo-werks,
           afnam like ekpo-afnam,
           ktext1 like esll-ktext1,
           srvpos like esll-srvpos,
           frmval1 like esll-frmval1,
           frmval2 like esll-frmval2,
           menge like esll-menge,
           kostl like eskn-kostl,
           sakto like eskn-sakto,
           zzcode like eskn-zzcode,
           kbetr like konv-kbetr,
           end of it_det.
    data : c_col1 TYPE i VALUE '0001',
           c_col2 TYPE i VALUE '0002',
           c_col3 TYPE i VALUE '0003',
           c_col4 TYPE i VALUE '0004',
           c_col5 TYPE i VALUE '0005',
           c_col6 TYPE i VALUE '0006',
           c_col7 TYPE i VALUE '0007',
           c_col8 TYPE i VALUE '0008',
           c_col9 TYPE i VALUE '0009',
           c_col10 TYPE i VALUE '0010',
           c_col11 TYPE i VALUE '0011',
           c_col12 TYPE i VALUE '0012',
           c_col13 TYPE i VALUE '0013',
           c_col14 TYPE i VALUE '0014',
           c_col15 TYPE i VALUE '0015',
           c_col16 TYPE i VALUE '0016'.
    data : v_currentrow type i,
           v_currentrow1 type i.
    data : itab_head like ALSMEX_TABLINE occurs 0 with header line,
           itab_det like ALSMEX_TABLINE occurs 0 with header line.
    data : file_head type RLGRAP-FILENAME,
           file_item type RLGRAP-FILENAME.
    file_head = 'C:\Documents and Settings\abap.fi\Desktop\head.xls'.
    file_item = 'C:\Documents and Settings\abap.fi\Desktop\item.xls'.
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
      EXPORTING
        filename                      = file_head
        i_begin_col                   = 1
        i_begin_row                   = 1
        i_end_col                     = 12
        i_end_row                     = 50
      tables
        intern                        = itab_head
    EXCEPTIONS
      INCONSISTENT_PARAMETERS       = 1
      UPLOAD_OLE                    = 2
      OTHERS                        = 3
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
      EXPORTING
        filename                      = file_item
        i_begin_col                   = 1
        i_begin_row                   = 1
        i_end_col                     = 16
        i_end_row                     = 50
      tables
        intern                        = itab_det
    EXCEPTIONS
      INCONSISTENT_PARAMETERS       = 1
      UPLOAD_OLE                    = 2
      OTHERS                        = 3
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    IF itab_head[] IS INITIAL.
       WRITE:/ 'No Header Data  Exists '.
       STOP.
    ELSE.
    sort itab_head by row col.
    read table itab_head index 1.
    v_currentrow = itab_head-row.
    loop at itab_head.
    if itab_head-row ne v_currentrow.
       APPEND it_head.
       v_currentrow = itab_head-row.
       ENDIF.
    CASE itab_head-col.
            WHEN  c_col1.
              it_head-ref = itab_head-value.
            WHEN  c_col2.
              it_head-bsart = itab_head-value.
            WHEN c_col3.
              it_head-lifnr = itab_head-value.
            WHEN c_col4.
              it_head-ekorg = itab_head-value.
            WHEN c_col5.
              it_head-ekgrp = itab_head-value.
            WHEN c_col6.
              it_head-bukrs = itab_head-value.
            WHEN c_col7.
              it_head-verkf = itab_head-value.
            WHEN c_col8.
              it_head-telf1 = itab_head-value.
            WHEN c_col9.
              it_head-ihrez = itab_head-value.
            WHEN c_col10.
              it_head-unsez = itab_head-value.
            WHEN c_col11.
              it_head-kdatb = itab_head-value.
            WHEN c_col12.
              it_head-kdate = itab_head-value.
    ENDCASE.
    ENDLOOP.
    APPEND it_head.
    CLEAR it_head.
    ENDIF.
    IF itab_det[] IS INITIAL.
       WRITE:/ 'No Item Data  Exists '.
       STOP.
    ELSE.
    sort itab_det by row col.
    read table itab_det index 1.
    v_currentrow1 = itab_det-row.
    loop at itab_det.
    if itab_det-row ne v_currentrow1.
       APPEND it_det.
       v_currentrow1 = itab_det-row.
       ENDIF.
    CASE itab_det-col.
            WHEN  c_col1.
              it_det-ref = itab_det-value.
            WHEN  c_col2.
              it_det-knttp = itab_det-value.
            WHEN c_col3.
              it_det-pstyp = itab_det-value.
            WHEN c_col4.
              it_det-txz01 = itab_det-value.
            WHEN c_col5.
              it_det-matkl = itab_det-value.
            WHEN c_col6.
              it_det-werks = itab_det-value.
            WHEN c_col7.
              it_det-afnam = itab_det-value.
            WHEN c_col8.
              it_det-srvpos = itab_det-value.
            WHEN c_col9.
              it_det-ktext1 = itab_det-value.
            WHEN c_col10.
              it_det-frmval1 = itab_det-value.
            WHEN c_col11.
              it_det-frmval2 = itab_det-value.
            WHEN c_col12.
              it_det-menge = itab_det-value.
            WHEN c_col13.
              it_det-kostl = itab_det-value.
            WHEN c_col14.
              it_det-sakto = itab_det-value.
            WHEN c_col15.
              it_det-zzcode = itab_det-value.
            WHEN c_col16.
              it_det-kbetr = itab_det-value.
    ENDCASE.
    ENDLOOP.
    APPEND it_det.
    CLEAR it_det.
    ENDIF.
    loop at it_head.
    poheader-doc_type = it_head-bsart.
    poheader-vendor = it_head-lifnr.
    poheader-purch_org = it_head-ekorg.
    poheader-pur_group = it_head-ekgrp.
    poheader-comp_code = it_head-bukrs.
    poheader-sales_pers = it_head-verkf.
    poheader-telephone = it_head-telf1.
    poheader-REF_1 = it_head-ihrez.
    poheader-OUR_REF = it_head-unsez.
    poheader-VPER_START = it_head-kdatb.
    poheader-VPER_END = it_head-kdate.
    loop at it_det where ref = it_head-ref.
      poitem-acctasscat = it_det-knttp.
      poitem-item_cat = it_det-pstyp.
      poitem-short_text = it_det-txz01.
      poitem-matl_group = it_det-matkl.
      poitem-plant = it_det-werks.
      poitem-PREQ_NAME = it_det-afnam.
      POESLLC-SERVICE = it_det-srvpos.
      POESLLC-SHORT_TEXT = it_det-ktext1.
      POESLLC-FORM_VAL1 = it_det-frmval1.
      POESLLC-FORM_VAL2 = it_det-frmval2.
      POESLLC-QUANTITY = it_det-menge.
      POACCOUNT-COSTCENTER = it_det-kostl.
      POACCOUNT-GL_ACCOUNT = it_det-sakto.
      POCONDHEADER-COND_TYPE = 'R000'.
      POCONDHEADER-COND_VALUE = it_det-kbetr.
    endloop.
    endloop.
    poheaderx-doc_type = 'X'.
    poheaderx-vendor = 'X'.
    poheaderx-purch_org = 'X'.
    poheaderx-pur_group = 'X'.
    poheaderx-comp_code = 'X'.
    poheaderx-sales_pers = 'X'.
    poheaderx-telephone = 'X'.
    poheaderx-REF_1 = 'X'.
    poheaderx-OUR_REF = 'X'.
    poheaderx-VPER_START = 'X'.
    poheaderx-VPER_END = 'X'.
    poitemx-acctasscat = 'X'.
    poitemx-item_cat = 'X'.
    poitemx-short_text = 'X'.
    poitemx-matl_group = 'X'.
    poitemx-plant = 'X'.
    poitemx-PREQ_NAME = 'X'.
    *POESLLCx-SHORT_TEXT = 'X'.
    POACCOUNTx-COSTCENTER = 'X'.
    POACCOUNTx-GL_ACCOUNT = 'X'.
    POCONDHEADER-cond_type = 'X'.
    CALL FUNCTION 'BAPI_PO_CREATE1'
      EXPORTING
        poheader                     = poheader
       POHEADERX                    = poheaderx
      POADDRVENDOR                 =
      TESTRUN                      =
      MEMORY_UNCOMPLETE            =
      MEMORY_COMPLETE              =
      POEXPIMPHEADER               =
      POEXPIMPHEADERX              =
      VERSIONS                     =
      NO_MESSAGING                 =
      NO_MESSAGE_REQ               =
      NO_AUTHORITY                 =
      NO_PRICE_FROM_PO             =
    IMPORTING
       EXPPURCHASEORDER             = po_no
      EXPHEADER                    =
      EXPPOEXPIMPHEADER            =
    TABLES
       RETURN                       = return
       POITEM                       = poitem
       POITEMX                      = poitemx
      POADDRDELIVERY               =
      POSCHEDULE                   =
      POSCHEDULEX                  =
       POACCOUNT                    = poaccount
      POACCOUNTPROFITSEGMENT       =
       POACCOUNTX                   = poaccountx
       POCONDHEADER                 = pocondheader
       POCONDHEADERX                = pocondheaderx
      POCOND                       =
      POCONDX                      =
      POLIMITS                     =
      POCONTRACTLIMITS             =
       POSERVICES                   = poesllc
      POSRVACCESSVALUES            =
      POSERVICESTEXT               =
      EXTENSIONIN                  =
      EXTENSIONOUT                 =
      POEXPIMPITEM                 =
      POEXPIMPITEMX                =
      POTEXTHEADER                 =
      POTEXTITEM                   =
      ALLVERSIONS                  =
      POPARTNER                    =
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
       WAIT          =
    IMPORTING
       RETURN        =
    if sy-subrc = 0.
    loop at return.
    write return-MESSAGE_V1.
    write po_no.
    endloop.
    endif.
    reward points if hlpful.

  • Regarding Varrays (Urgent)

    Dear Experts,
    Please tell me how to store emp_name in varray.
    and I need to pass that varray to another procedure.
    so please send code .

    All forum volunteers are assisting with other issues right now, your request has been logged and will be answered some time within the next six months.
    If this is an urgent request please contact your support representative or engage qualified qualified consultants.

Maybe you are looking for

  • Why Outlook email messages show unreadable characters

    When you receive a new email in Outlook, you may see unreadable characters in the email message body. This issue could be caused by one of the following reasons on Outlook client side: The email you received is converted to plain text format or a dif

  • Automatic PR based on Sales order, stock not on special stock E

    Hi, I woudl like to know if it is possible to have a kind of Individual PO, without having special stock, stock dedicated to SO. In other words, I would like to have the strong link between SO and PO, but keeping the flexibilty of normal stock. We wa

  • Populate a PDF with VBA and FDF, stopped working.

    I work with a non-profit children's camp where I need to be able to populate a PDF form from a MS Access database. The problem is that I do not have much server access, so I've had to find sneaky ways to do this. I can not use anything I have to inst

  • RFC Destination None Error for MIGO

    Hi, I am getting RFC Destinatnation NONE error while posting Goods Receipt. GTS service for SD and MM is not active. Error showing for FM GRC01_COST_OBJECT_COST. Can any one help in this regard. Thanks in advance. SP Raj

  • IMovie File Location

    I am new to this 08 iMovie. I can't seem to find the full project file location like in iMovie 06. It seems to show a alias file in the Movie Folder, but not the full project. I do a search and can't find it the full size file. Any idea where it is?