Results 1 to 6 of 6

Thread: Open MS Word Document From JSP Page

  1. #1
    Join Date
    Nov 2009
    Posts
    678

    Open MS Word Document From JSP Page

    Hello, I am trying to create an application that is for the candidates to upload their Resumes in word format and the data of that file will automatically insert a form which is created into the jsp page. When the client upload their resume in return he will have a form or the name he has on his resume mid will insert the form name in the box. I am not able to achieve the technique from which I will able to Link the MS Word Document From JSP Page. So, please help me to do this.

  2. #2
    Join Date
    Feb 2008
    Posts
    1,852

    Re: Open MS Word Document From JSP Page

    Hello, You can use the framework of Apache POI which allows you to manipulate files in Microsoft (Excel, Word, etc..) Java. He'll just have to use the values retrieved for display in the form of your JSP. I am not able to create coding for it, as it will need to consider the all of the details from the document and then it is needed to add the data to the form. So, it is quiet complicated. So, you need to work more on it.

  3. #3
    Join Date
    Jan 2008
    Posts
    1,521

    Re: Open MS Word Document From JSP Page

    First File code:
    Code:
    <a style="cursor: hand;"
    onClick="window.open('test.jsp','','height=400,width=600,scrollbars=yes,resizable=no')">
    test link - open word file
    </a>
    Second File : It is having the word file coding:
    Code:
    <%@ page contentType="text/html;charset=windows-1452"%>
    <%
    res.setContentType("application/msword");
    res.setHeader("Content-disposition","attachment;filename=resume.doc");
    %>
    <%@ page language = "java" %>
    <html>
    <head></head>
    <body>
    <img src="test.jpg" width="150" height="150" border="0" alt="test"/>
    <br>
    </body>
    </html>
    With the help of the both of the code below you will able to get the solution for your problem.

  4. #4
    Join Date
    Apr 2008
    Posts
    1,948

    Re: Open MS Word Document From JSP Page

    It seems so complicated. You may be trying to isolate the "administrative" to resume searching for patterns containing the address, phone, etc. Usually the name first placed it. It can then be isolated in this block, a string type "FIRST NAME" or "FIRST NAME". This will create a problem while creating the project. We could go through a table containing a list of names but whatever happens, the filling of the name / first name in your form from any resume will never suddenly run on to 100%.

  5. #5
    Join Date
    May 2008
    Posts
    2,012

    Re: Open MS Word Document From JSP Page

    Hello, I am having the code below which will simply provide you more help for getting the solution.
    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();
                   }
            } 
    }

  6. #6
    Join Date
    May 2008
    Posts
    2,389

    Re: Open MS Word Document From JSP Page

    Hello, if you want to add the application context to the URL of the servlet then you must need to make use of the code below:
    Code:
    <a href ="<% = request.getContextPath () +"/ Verification"%>"> RSS </ a>
    If you want to avoid the more difficult coding in your program then you can simply get the use of the method of the getContextPath () of HttpServletRequest like the code above.

Similar Threads

  1. How to make a Excel Table fit for Word Document Page Size
    By M.N.S in forum MS Office Support
    Replies: 3
    Last Post: 23-02-2012, 02:58 PM
  2. Word cannot open document
    By Scotty816 in forum Windows Software
    Replies: 1
    Last Post: 03-10-2011, 12:16 PM
  3. To fit multiple pages Word document on one page
    By Itronix in forum Tips & Tweaks
    Replies: 5
    Last Post: 15-09-2009, 10:30 PM
  4. Page Numbers in MS Word 2007 document
    By S Kent in forum Office Update Service
    Replies: 3
    Last Post: 06-08-2009, 03:06 AM
  5. Open MS Word document using VB.NET
    By kaartik in forum Software Development
    Replies: 2
    Last Post: 19-01-2009, 05:12 PM

Tags for this Thread

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
  •  
Page generated in 1,713,428,229.90513 seconds with 17 queries