How to create file form servlet in our virtual directory

hi....
I want to create a file form my servlet in my virtual directory..
my directory name ia vps
it cconatin vps -> WEB-INF -> classes-> servTest
servTest is servlet....
and i want to create file from servTest in vps directory..
actually i am trying to create file but it by default saved in windows/system32 directory.

You need to give the absolute path to create the file, if you just give the filename, the file will be created in the working directory which is system32 for Windows.
You could either hardcode it, or you can use ServletContext.getRealPath("/") ( http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/ServletContext.html#getRealPath(java.lang.String) ) This will return the path on the server's filesystem where your application folder ( under webapps for Tomcat) is located.
NOTE: If you application is in the form of a .war file, this may not work! The server may return a null.
"/" specifies the root i.e., your application's highest level directory. If your application is webapps/vps then getRealPath("/") will return something like C:\Program Files\Apache Group\Tomcat 4.1\webapps\vps

Similar Messages

  • How to create pdf forms in wda

    how to create pdf forms in wda

    hi,
    check these links
    https://www.sdn.sap.com/irj/sdn/adobe
    https://www.sdn.sap.com/irj/sdn/interactiveforms-elearning
    http://help.sap.com/saphelp_nw2004s/helpdata/en/37/47a2be350c4ac8afe36b691203971f/frameset.htm
    The following links contain all the detailed information (PDF & PPT docs) on Adobe Interactive Form with examples which wil make u'r learning easier:
    https://www.sdn.sap.com/irj/sdn/adobe
    Improving the Performance of Adobe® LiveCycleu2122 Designer Forms(scripting)
    http://www.adobe.com/devnet/livecycle/articles/lc_designer_perf_guidelines.pdf
    Interactive Forms Based on Adobe Software: Overview
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/e635e290-0201-0010-a9be-9e8e4ce04770
    Adobe Interactive Forms
    http://www.saplounge.be/Files/media/pdf/Huberland-Interactive-Forms-2007.10.10.pdf
    Taking interactive forms to next level
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/8c103c36-0301-0010-cda8-f6b381bedb6e
    Introduction to Adobe PDF Library SDK(PDFL SDK)(Simply scroll the document)
    http://partners.adobe.com/public/developer/en/webseminars/PDFL_WebSeminar.pdf
    Creating Interactive forms in webdynpro for java
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/5f27e290-0201-0010-ff82-c21557572da1
    PDF-Based Print Forms/SAP Interactive Forms by Adobe
    http://help.sap.com/saphelp_nw04s/helpdata/en/c8/4adf7ba13c4ac1b4600d4df15f8b84/frameset.htm
    Date Objects in Adobe Designer
    http://help.sap.com/saphelp_nw04/helpdata/en/dd/60694fddb74ad88cdb7d2a094f3dd2/frameset.htm
    Checking and Testing a PDF-Based Print Form
    http://help.sap.com/saphelp_nw04s/helpdata/en/c2/1fe9aa4d7b413e8515f90b73729e97/frameset.htm
    Architecture
    http://help.sap.com/saphelp_nw04/helpdata/en/f2/21021b911f4c0cae11459a4ce0bc62/frameset.htm
    http://www.nl4b.com/Adobe/Invitation_SAPBrussels_Q407.pdf
    Yogesh N

  • How to create file on application server?

    how to create file on application server?

    Hi,
    The following program illustrates the creation of ifle in app server and reading the file from appli server:
    DATA: ITAB LIKE vbakOCCURS 0 WITH HEADER LINE.
    PARAMETERS: P_VBELN LIKE VBAP-VBELN.
    START-OF-SELECTION.
      SELECT *
        FROM VBAP
        INTO TABLE ITAB
    WHERE VBELN = P_VBELN
        PERFORM WRITE_DATA.
        PERFORM READ_DATA.
    *&      Form  WRITE_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM WRITE_DATA.
    OPEN DATASET 'VBAP_DATA' FOR OUTPUT IN TEXT MODE.
    LOOP AT ITAB.
    TRANSFER ITAB TO 'VBAP_DATA'.
    ENDLOOP.
    CLOSE DATASET 'VBAP_DATA'.
    CLEAR: ITAB, ITAB[].
    ENDFORM.                    " WRITE_DATA
    *&      Form  READ_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM READ_DATA.
    OPEN DATASET 'VBAP_DATA' FOR INPUT IN TEXT MODE.
    DO.
    READ DATASET 'VBAP_DATA' INTO ITAB.
    IF SY-SUBRC <> 0.
    EXIT.
    ENDIF.
    APPEND ITAB.
    ENDDO.
    CLOSE DATASET 'VBAP_DATA'.
    LOOP AT ITAB.
    WRITE:/ ITAB-VBELN,
            ITAB-POSNR.
    ENDLOOP.
    ENDFORM.                    " READ_DATA
    If it is helpful rewards points
    Regards
    Pratap.M

  • How to create one form for two Udo object

    Hy ,
    I have two Object Udo (header and line)
    How we created a form to manage these two files (UDO)
    Thanks

    Thank you janos
    it works, I put the code to other developers for information
         Shared Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_application.ItemEvent
                If ((FormUID = "SIR001_") And (pVal.ItemUID = "add") And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_CLICK) And (pVal.Before_Action = False)) Then
                    Dim oDS As SAPbouiCOM.DBDataSource
                    oDS = SBO_application.Forms.Item(FormUID).DataSources.DBDataSources.Item("@SIR_LOTL")
                    oDS.InsertRecord(oDS.Size)
                    oDS.Offset = oDS.Size - 1
                    oform = SBO_application.Forms.Item(FormUID)
                    oMatrix = oform.Items.Item("mtx_0").Specific
                    oMatrix.AddRow(1)
                End If
                If ((FormUID = "SIR001_") And (pVal.ItemUID = "del") And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_CLICK) And (pVal.Before_Action = False)) Then
                    oform = SBO_application.Forms.Item(FormUID)
                    oMatrix = oform.Items.Item("mtx_0").Specific
                    For index As Integer = oMatrix.RowCount To 1 Step -1
                        If oMatrix.IsRowSelected(index) = True Then
                            oMatrix.DeleteRow(index)
                            oform.Mode = SAPbouiCOM.BoFormMode.fm_UPDATE_MODE
                        End If
                    Next
                End If
            End Sub

  • How to create a form that requires thousands of checkboxes?

    Hello forum members,
    I have Adobe Acrobat 8 Professional.  I've been searching the internet/forums for the past few hours and I can't seem to find any information on how to create a form with many checkboxes.  I do not want to have to give individual names to thousands of checkboxes.  I'm hoping there's an easy solution to my problem.  Maybe I don't even need to use checkboxes.
    Here it is...
    I'm a DJ and wedding season is coming up.  For each wedding that I do, I usually give the bride and groom a list of my songs and they choose a bunch of songs that they'd like to have at their reception.  In the past, I've just been sending them a webpage word document with the songs and they'd send me their selections in a different document or directly in the reply email.  I'd like to make this process easy for them (and myself) by making a pdf document where they can simply place a checkmark beside the songs that they want and then send it back to me.  As a bonus (if it's possible) i'd like to be able to export the songs that they selected into a separate document so that I don't have to go through the entire pdf (with thousands and thousands of songs) when they send it back to me.
    I would be ever greatful if somebody help me or direct me to a link with some additional information.
    Thanks in advance,
    Mike

    George, thank you very much for your quick reply and good advice.
    Mike

  • Quick Tip: How to create editable form fields | Acrobat X Tips & Tricks | Adobe TV

    A short tip that details how to create editable form fields using Acrobat X Std. or Pro.
    http://adobe.ly/wzXkmL

    I have created a form which will be filled out by customers and sent back to me via 'submit' button. What I am trying to figure out is when we receive the filled out form, is there any way to have it as a pdf. To clarify, when the form is filled out and sent, the receiver opens the email and attached is a non-editable pdf. This way the customers information is no longer editable.

  • How to create file menu in the swing?

    How to create file menu or any menu in the swing?
    Please help me.

    How to create file menu or any menu in the
    swing?
    Please help me.By file menu, do you mean where you can choose a file to open or save to? If so, have you had a look at the File Chooser component? If not, please click on the link in the previous sentence to the Sun tutorial.
    Good luck
    /Pete

  • How to create file with APDU

    Hello everybody,
    It's my first time using Java Card ^_^,I want to create a file and fill the fill with binary data.but i don't know how to create file with APDU commands,so I need help here.
    I think that there must be a Manual of the JavaCard's OS in this world,can someone tell me where to download it??
    Thanks.
    the fllowing is my card:
    Samsung S1
    Model:TiEx-32J
    EEPROM size:32k
    Platform Version:OP 2.0.1
    Card Manager Status:OP_READY
    KMC:40~4F/No derivation
    Message was edited by:
    AllenHuang

    If you look around the forum for a bit, you will see that there is no notion of file systems on JavaCards (lexdabear posted this information less than two hours ago :-)). To store files, you will have to write an applet to hold byte arrays of the required size and handle receiving and sending of these.
    As for documentation, you should have a look at the GP (General Platform) specification at http://www.globalplatform.org/, which defines communication between smart cards and other devices, as well as Sun's own JavaCard pages (http://java.sun.com/products/javacard/), which contain several useful resources on JavaCards.
    Message was edited by:
    Lillesand

  • How to create file system datagrid in flex web application

    how to create file system datagrid in flex web application

    Hi,
    Check this out:
    http://shigeru-nakagaki.com/flex_samples/FileReference/FileUploadExample2/FileUploadExampl e2.html
    Johnny
    Please rate answer.

  • How to create a form and show it as a modal window in VB6?

    oform.modal  -> modal is read-only property
    help,please.

    Hi Santiago!
    HTH: How to create a form and show it as a modal window?

  • How to create arabic forms using adobe central forms

    How to create arabic forms using adobe central forms

    Any luck here? I have just a subset of your challenge, i.e., I want to get forms designed in Designer 8.2/Acrobat 9 to work in Reader 7.0.5
    Thanks!

  • How to create a form that will allow the applicant to upload their photo

    I have Adobe Acrobat 9 Pro Extended and I know how to create forms that require text input.
    How to create a form that will allow the applicant to upload their photo? I alo wish to know how to upload a photograph so that I can test the form I created.
    Thank you
    Adrian Watts

    test@ORA10G> with x as (
      2    select '234-1111' as customer, to_date('2-Jan-2008','dd-Mon-yyyy') as call_date, 'Order product' as reason from dual union all
      3    select '234-1132', to_date('3-Jan-2008','dd-Mon-yyyy'), 'Request info' from dual union all
      4    select '231-1154', to_date('4-Sep-2007','dd-Mon-yyyy'), 'Request info' from dual union all
      5    select '234-1111', to_date('2-Nov-2007','dd-Mon-yyyy'), 'Order product' from dual union all
      6    select '234-1132', to_date('9-Jan-2008','dd-Mon-yyyy'), 'Request info' from dual union all
      7    select '231-1154', to_date('9-Sep-2007','dd-Mon-yyyy'), 'Request info' from dual union all
      8    select '234-1111', to_date('5-Dec-2007','dd-Mon-yyyy'), 'Order product' from dual union all
      9    select '234-1131', to_date('7-Dec-2007','dd-Mon-yyyy'), 'Request info' from dual union all
    10    select '231-1154', to_date('1-Sep-2007','dd-Mon-yyyy'), 'Request info' from dual union all
    11    select '234-1111', to_date('8-Jan-2008','dd-Mon-yyyy'), 'Order product' from dual union all
    12    select '234-1131', to_date('3-Dec-2007','dd-Mon-yyyy'), 'Request info' from dual union all
    13    select '231-1154', to_date('4-Nov-2007','dd-Mon-yyyy'), 'Forward to Sales' from dual)
    14  --
    15  select customer,max(call_date), reason
    16  from x
    17  where reason = 'Request info'
    18  group by customer, reason;
    CUSTOMER MAX(CALL_ REASON
    231-1154 09-SEP-07 Request info
    234-1131 07-DEC-07 Request info
    234-1132 09-JAN-08 Request info
    test@ORA10G>
    test@ORA10G>pratz

  • How to create a form contains a diagram

    hi all ,
    if there is a group of people in one table and the other table contains another group of people, and there is a relation between those groups, how to create a form or a report representing diagram for this relation. This diagram should be dynamic, when we change in the records of these people.
    Which tool can I use and how?
    Is there anyone who could help me? My email address is
    [email protected]
    or [email protected]
    thanks

    George, thank you very much for your quick reply and good advice.
    Mike

  • Send a file that resides above the virtual directory to the browser using ASP.

    How do you send a file that resides above the virtual
    directory to the browser using ASP.
    this doesn't work:
    <% Response.Redirect(Server.Mappath("..\..\..\files\"
    & rsgetefile("filename"))) %>

    Basically you can't send a person to the location as that
    would totally
    defeat the purpose of placing files above the virtual root.
    You can stream a
    file from a page on the site if you use the physical location
    on the server
    to call it.
    Paul Whitham
    Certified Dreamweaver MX2004 Professional
    Adobe Community Expert - Dreamweaver
    Valleybiz Internet Design
    www.valleybiz.net
    "lovewebdev" <[email protected]> wrote in
    message
    news:ec2paf$9ht$[email protected]..
    > How do you send a file that resides above the virtual
    directory to the
    > browser using ASP.
    >
    > this doesn't work:
    > <% Response.Redirect(Server.Mappath("..\..\..\files\"
    > rsgetefile("filename"))) %>
    >

  • How to create a form to be filled out on the iPad?

    Hello,
    I have created a daily report/timesheet pdf form to be filled out by our jobsite superintendents on their iPads.  I have tried everything (including downloading as many free-and some not so free-apps from the app store) and still cannot get my forms to work on the iPads.  Most of these will not even open my file.  I have no problem purchasing an app, but I would love to know that it will indeed work beforehand. 
    My questions are:
    Can I create a form with Acrobat Pro that can be filled in on an iPad? 
    What iPad apps actually offer this function?
    (If we make it this far) Are there any limitations to the complexity of the forms I create?  
    Additional Info:  I emailed the pdf form document to myself as an attachment.  On my desktop, it opens like a normal PDF.  On my iPad it is labelled as "winmail.dat" and will only not open.
    Thank you.

    Thanks George.
    Does the PDF Expert app allow you to include drop downs, check boxes, etc in your forms?  At the moment, all I need the app for is to fill this form... naturally, we can find more uses for it as we use it, but I would hate to download it only to find that it won't work.  Could I by chance email you the form to see if it will work?   
    Regarding the "winmail.dat" issue, I emailed it in HTML, Rich, and plain.  It shows up the same in every one.
    Thanks again.  

Maybe you are looking for

  • Photoshop Elements 12 Editor Shuts Down Without Saving for Web

    Hi I have a mac version of Photoshop Elements 12 Editor. I have been using the products for a few months with no problems until recently when I try to save for web (after the preview is shown), the program will shut down by itself when I click the "S

  • How do i get firefox to recognise and allow me to access google mail?

    HELP! my friend uploaded firefox as my main browser a couple of days ago, and also ran a full malware and antivirus check on my laptop. however, since then i haven't been able to access my google mail. i can get onto google.com but whenever i try to

  • Column Headers - Can't Change Text Orientation

    In Excel I am able to change the column header row text orientation so that I can have long text headers for both my rows and columns. With pages, my text can only be horizontal, which make a spread sheet with long column names very wide, even though

  • Unable to Define New Plant

    Hi, I need help regarding creating New Plant. I used the following steps IMG> Enterprise Structure> Defiintion> Logistics Genral> Define, Copy, Delete, Check Plant 1.   Execute 2.   (Double Click) Define Plant 3.   New Entries 4.   Give Plant Name 5.

  • How to get the Thread in another running application??

    Hi, If I have a java application running (as daemon), how can I get the running thread context from another new started java application? What I'm trying to accomplish here is that, after I started a daemon thread ( a ServerSocket program ), I want t