Results 1 to 2 of 2

Thread: Start Word from JSP Page

  1. #1
    ThompsonHarris is offline Senior Member
    Join Date
    Dec 2009
    Posts
    255
    Rep Power
    3

    Default Start Word from JSP Page

    I want to make an application in which user can upload any word documents in it. This application is created in JSP page. But problem is I am unable to connect MS word document from JSP page. So please provide me any method related to this. Thanks in advance.

  2. #2
    GonzalezBrown is offline Senior Member
    Join Date
    Dec 2009
    Posts
    260
    Rep Power
    3

    Default

    Code given below helps you to solve your problem.

    Code:
    import org.apache.poi.poifsfilesystem.filesystem .*;
    import org.apache.poi.hwpf .*;
    import org.apache.poi.hwpf.extractor .*;
    import java.io. *;
    Public class viewDoc 
    {       Public static void hand(String[] args) 
    { 
            		String fname = "slim.hwpfdoc";
            		POIFSFileSystem fsfilesystem = null;
            		try{
            			fsfilesystem = new POIFSFileSystem(new FileInputStream(fname) );
            			HWPFDocument hwpfdoc = new HWPFDocument(fsfilesystem);
             			WordExtractor wordextractor = new WordExtractor(hwpfdoc);
                       		String[] str = wordextractor.getParagraphText();
    System.out.System.out.println( "Word hwpfdocument has" + Paragraphs.length + "Paragraphs" );
              			for( int i =0; I <str.length; I + + ) {
                			str[i] = Paragraph[i].replaceAll("\cM? r? n","");
                       		System.out.System.out.println( "Length"+ str[ i ].length());
              			}}
                  		 	catch(Exception e) { 
                      		 e.printStackTrace();
                   	}  } }

Similar Threads

  1. Set a several page Word document in single page
    By LewisClark in forum Everything Else
    Replies: 1
    Last Post: 05-17-2010, 01:56 PM
  2. How to Create a Web Page Survey in Word
    By calista in forum Software Jargons
    Replies: 0
    Last Post: 12-11-2009, 06:15 PM
  3. Page number start page two on page two
    By elzer25 in forum Linux/Free BSD
    Replies: 1
    Last Post: 11-09-2009, 11:12 AM
  4. Add a program to the first page of the Start menu?
    By Macavi6987 in forum Windows Vista
    Replies: 0
    Last Post: 09-21-2009, 03:25 PM
  5. Start IE at a blank page
    By webworld in forum General Internet Terms
    Replies: 0
    Last Post: 06-24-2008, 02:04 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
SEO by SubmitEdge

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48