How do I do Export to Text? Using JSP

Hi All,
I need your help for doing Export to Text functionality.
If I hit on "Export to Text" link, the file dialog will be open and I save the data.
Is this possible through response?
like response.setHeader("Content-type","application/text");
If not possible through response then give me a another solution
Thanks
Amit

http://forum.java.sun.com/thread.jspa?threadID=5199777&messageID=9792760#9792760

Similar Messages

  • Determin how many user log on the site using JSP/Servlet?

    Hi all,
    Is there a way to determine how many user log on the site using JSP/Sevlet? I'm running Apache 2.x & Tomcat 4.x
    I'm trying to get a list of user currently log in the site.
    Please help!
    Thanks,
    -JN-

    You could use the HttpSessionBindingListener interface. Every time a user logs into the session put a user object into the session. The user object will implement the HttpSessionBindingListener interface. When the user object is added to a sessiion it recieves an event and it increments a counter. When the session times out or you invalidate the session because the user has logged out the user object will recieve an event and it can then decrement the counter.
    This will at least tell how many active user sessions there are.

  • How can I change Label's text using ActionScript?

    Hi~ everyone~
    I want change Label's text using ActionScript.
    Test.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
          xmlns:s="library://ns.adobe.com/flex/spark"
          xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" initialize="init()">
    <fx:Script>
      <![CDATA[
       private function init():void{
        var btn:BtnScript = new BtnScript();
        this.addElement(btn);
      ]]>
    </fx:Script>
    <fx:Declarations>
      <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <s:Label x="182" y="149" text="Label" id="lbl"/>
    </s:Application>
    BtnScript.as
    package
    import flash.events.MouseEvent;
    import mx.controls.Alert;
    import spark.components.Button;
    public class BtnScript extends Button
      public function BtnScript()
       super();
       this.addEventListener(MouseEvent.CLICK, eventHandler);
      private function eventHandler(event:MouseEvent):void{
              // lbl.text = "changed text";
           // HOW CAN I ACCESS LABEL IN MXML FILE?
    I'm about to learn flex. Please help me.
    Thanks in advanced.

    You could achive this very easily(but this shouldn't be used in production code as it'll be difficult to manage as the project grows) by defining a static data member varibale of DataType Label something like below, (modified/added code in BOLD)
    Test.mxml
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
          xmlns:s="library://ns.adobe.com/flex/spark"
          xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" initialize="init()"
          creationComplete="creationCompleteHandler(event)">
    <fx:Script>
      <![CDATA[
       private function init():void{
         var btn:BtnScript = new BtnScript();
         this.addElement(btn);
       private function creationCompleteHandler(event:FlexEvent):void{
         Model.someLabel = lbl;
      ]]>
    </fx:Script>
    <fx:Declarations>
      <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <s:Label x="182" y="149" text="Label" id="lbl"/>
    </s:Application>
    BtnScript.as
    package
      import flash.events.MouseEvent;
      import mx.controls.Alert;
      import spark.components.Button;
      public class BtnScript extends Button
        public function BtnScript()
          super();
          this.addEventListener(MouseEvent.CLICK, eventHandler);
        private function eventHandler(event:MouseEvent):void{
              // lbl.text = "changed text";
          // Now use Model.someLabel which is basically 'lbl'.
          Model.someLabel.text = "changed text";  //Mission Accomplished....
    Model.as
    package
      public class Model
        public static someLabel:Label;
    Note: This approach is just to give you an idea but instead should use the MVC pattern.

  • How do we identify the standard texts used in a sap script?

    Hi,
    Is there any way that i can identify the standard texts used in SAP scripts?
    Not manually going to each window in the script and checking.
    Will there be any table where I can look ?
    Thanks,
    krishna.

    Hi,
    GO to the forminfo of the sapscript in SE71..and then search for INCLUDE
    after displaying the form...utilities->form info..
    hope this works..
    Thanks
    Naren

  • How to store files in mysql database using JSP?

    I'm developing an online recruitment system using JSP in server side. For the users who registers in it, I want them to upload their cv's from the web site so that I can store it in the database..I'm using mysql as the db..
    Can I know how to do it.?..or else is there any better way of doing that?
    Need a quick reply..Tx

    The best way to put data in a database in a JSP is to not do it. Instead, use a Servlet that calls a DataAccessObject. The DAO puts the data in the DB and the servlet gives the data to the DAO. The JSP does nothing but display results.
    Take a google for JSP MVC and DAO. BalusC has a great example of DAO and a JSP that uses one on his blog.

  • How can I display a confirm box using JSP?

    Dear All,
    I am new to the Java language; please help!
    What I'd like to do is to prompt the user, within a loop, to click OK to continue the loop or CANCEL to exit the loop. I've tried to use JavaScript in conjunction w/ Form submittion to handle the parameter passing ('true'/'false') of the confirm box to a JSP. Yet, every form submission will cause the JSP page to re-load from the top which is the incident I'd like to avoid.
    Is there anyway I can have a confirm box written using JSP? Please help!!
    Thanks,Wing.

    if you do any modifications in the jsp page the whole page will be refreshed to show the latest result after modification.
    if you dont want the whole page to be refreshed
    you can pass the control to another page after the confirm box or you can use frames to your interest.

  • How to create two level dynamic list using JSP , Java Script and Oracle

    I am new in JSP. And i am facing problem in creating two level dynamic list using JSP ,Java Script where the listdata will come from Oracle 10g express edition database. Is there any easy way in JSP that is available on in ASP.NET.
    Plz response with details.

    1) Learn JDBC API [http://java.sun.com/docs/books/tutorial/jdbc/index.html].
    2) Create DAO class which contains JDBC code and do all SQL queries and returns or takes ID's or DTO objects.
    3) Learn Servlet API [http://java.sun.com/javaee/5/docs/tutorial/doc/].
    4) Create Servlet class which calls the DAO class, gets the list of DTO's as result, puts it as a request attribute and forwards the request to a JSP page.
    5) Learn JSP and JSTL [http://java.sun.com/javaee/5/docs/tutorial/doc/]. Also learn HTML if you even don't know it.
    6) Create JSP page which uses the JSTL c:forEach tag to access the list of DTO's and iterate over it and prints a HTML list out.
    You don't need Javascript for this.

  • How can I load and save text using FileReference class

    Let me start by saying I have no intention of using php and I can't wait until flash cs5 comes out with its new read/write capabilities
    I want to load and save XML files (stored on my local hard-drive) in AS3.
    I am using the FileReference class.
    Firstly I have noticed that when using FileReference.save if you replace an existing file instead of writing over the file data is appended to the end of the file. Can I make it so the file is overwritten (as it should be) or make it impossible for the user to save in such a situation.
    Secondly I want to load in text from an external file using FileReference.load I know that somehow you use FileReference.browse first to get it to work but I want to know exactly how to do it.
    I have looked for a tutorial about loading text in this manner and have not found one.
    Any help would be much appreciated especially if you could point me in the direction of a relevant tutorial
    Thanks

    the filereference class is for downloading and uploading files.
    if you want to load xml, use the xml class.
    and, if you want to write to an xml file and don't want to use server-side code, wait.

  • How to wrap the export/import utility using perl

    Hello,
    How to user perl to wrap the export/import utility? Thanks.

    If you are using DBMS_SCHEDULER, I would expect that you would just invoke export directly. I'm not sure I see the benefit to putting a Perl wrapper on top in that case. Of course, DBMS_SCHEDULER could invoke a Perl script just as it can invoke a shell script if there was some particular need to have a Perl layer there.
    Of course, I assume that you're not trying to invoke export on a regular basis as your primary backup method... Exports should be a complement, not a supplement, to a proper physical backup (i.e. via RMAN).
    Justin

  • How do I select similarly colored text using the magic wand?

    I converted a large document from RGB to CYMK (File | Document Color Mode). I'd like to select all of the text that was RGB(0,0,0) and is now CMYK(75.02,67.97,67.02,90.16) so I can change it to CMYK(0,0,0,100). I think the magic wand is the way to do this (correct me if I'm wrong).
    I have text in a dozen or more text areas. Many of the text areas overflow text into another text area. Some of the text in the text areas is "black" but there is also text with other colors that I'd like to remain unchanged.
    For example, I'd like to select all of the black text in the following two text areas without selecting the red text. I thought  that I could click on the black text and have all the black text (but not the red text), selected, but the entire text box is selected (and nothing in the second text box is selected). Can the wand select some text within several text boxes? If not, how should I go about changing the black? Thanks.

    Thanks Mylenium.
    If I use the Same Fill command, it does select both text areas. But if I then choose a replacement color (e.g., CMYK(0,0,0,100)) all of the text in both text areas is changed to black (i.e., the red text in my above illustration also changes to black).

  • POI's How Import to phone & Export from phone (use...

    Hi 2 all!
    Q very simple:
    POI's how Import & Export i mean that will be use any popular POI's file formats...
    I have some POI's on my PC and i whant copy my POI's to my N95-1, also i wnat have some a programe for manage my POI's and control it's on my phone...
    May any body known about this...
    (hm... why Nokia does not add support on phone with GPS this is feature - it's so hard )
    Nokia! Take a care for me and we real say THANK YOU NOKIA and you can collect a more money

    You probably can't, but you should post your question in the Address Book forums:
    http://discussions.apple.com/forum.jspa?forumID=1223

  • How can I listen to a text using Siri whilst phone is locked?

    Hi I have just been playing with my new 4s and I would like to listen to a text through my headphones whilst biking. But it's annoying as Siri says I need to unlock my phone first. Is there settings to overwrite this? Also why can't I listen to an old message from someone? Even if it's the last one and if I voice the contact.
    Thanks

    My suggestion is to first run the Acrobat repair tool: http://labs.adobe.com/downloads/acrobatcleaner.html
    If that doesn't work then you can try to use the CC Cleaner tool, then re-install the entire suite
    http://helpx.adobe.com/creative-suite/kb/cs5-cleaner-tool-installation-problems.html

  • How to extract a part of text using utl_file

    hi,
    I have a small requirement which goes as follows. I have a text file which is a resultof the sql query and it contains 16 columns as TAB delimited text . I am using the UTL_FILE package concept to read the data. In general when we use the UTL_FILE.GET_LINE we read the entire line of text. But i need to read the 10th column of the query or the tab delimited text .
    Please advice.
    My query goes something like this:
    declare
    f utl_file.file_type;
    s long;
    c number := 0;
    begin
    f := utl_file.fopen('ABC_EXTRACTS','sample1.txt','R');
    loop
    utl_file.get_line(f,s);
    insert into s values (s);
    c := c + 1;
    end loop;
    exception
    when NO_DATA_FOUND then
    utl_file.fclose(f);
    dbms_output.put_line('No. of rows inserted : ' || c);
    end;

    prazy the one which you have specified above seems to work fine .but if a word is seperated by the space it is considering as tab (space delimited is considered as tab limited by your query)delimited .
    with T as (
    select 'john sam alfred nobel samuel thomas' col1 from dual)
    select regexp_substr(col1,'[^      ]+',1,4) from t
    here alfred nobel is a single name and is seperated by a space .the above query returns nobel but we need samuel .
    What i mean to say is space delimited should not be taken into consideration when tab delimited is considered(since if 4 is replaced by 5 in the above query we may get samuel) .
    Please advice

  • How to close a window of IE7 using jsp code

    Hi,
    Can any one suggest how to use window.close method for closing a window of IE7 , presently i am using below code for logging off a page but i am recieving an error saying object expected and some text undefined , can any one let me know what extra code is required to be added in below jsp code  for logging of a window in  IE7
    function logoff()
            if (EPCM.getUAType() == EPCM.MSIE)
                window.returnValue = 'logoff';
            else
                window.opener.logoff();
            closeWindow();
        function closeWindow()
            window.close();
    Thanks
    Abhai

    Hi Abhai,
    In your javascript, you can add a try catch block to check which object is null.
    Also check this:
    Portal user often can't log off because of the Log off window was blocked
    Greetings,
    Praveen Gudapati
    p.s. Points are always welcome for helpful answers

  • How to check files in the directory using JSP?.

    Hi,
    How can i check the file is directory or file and readable or writable and file size and type of file(Ex. jpg, txt, doc., etc). i want to list the specific type of file in the particular directroy.. please help me..
    Regards
    CHinna

    With the File class, using the methods isFile(), isDirectory(), canRead(), canWrite(), length() and getName()
    With File.listFiles() you can get a directory listing. If you want to limit the amount of files returned, you can pass your own FileFilter to it.
    http://java.sun.com/javase/6/docs/api/java/io/File.html

Maybe you are looking for

  • Bi cats datasource

    Hi Gurus I am working on the BI development, I had an issue regarding the CATS datasource, which was active , we had created new records in R/3, these values were not reflecting in the datasource when it is viewed in the Extract Checker. Can anyone h

  • Setting masks with AS

    What am I doing wrong? I have a MC in my library with a linkage identifier of "mask". And I have a bunch of MCs on my stage with a instance names of line_0, line_1, line_2.... etc. Somehow the mask it not getting set. What am I doing wrong? for (var

  • "There was not enough memory" error, DNG conversion.

    I have CS4 and I like to convert my files to dng, however, I can't seem to do it on multiple raw files, because after fifty or so, I get the message, Incomplete because 'There was not enough memory.' I originally thought this may have had something t

  • Performance Issues for polling files frequently

    Hi I have around 15-16 interfaces which has to be polled every 15 mins....like they have to be real time. Would there be any performance related issues. Regards Rinku

  • What Version do i need?

    I've been bring to buy Photoshop for a while now and when i went to best buy to get CS6 they where pulled off the shelves and said they couldn't sell them, i just want to know what photoshop i need to get for a Mac 10.7.5