DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2005
    Posts
    39

    Downloading a word document using JSP

    I am trying to download a Word file from jsp and from my research, I noticed that I can use an <a href""> </a> tag.

    So I tried it usign the following code:
    <a href = "<%=ClaimForm.doc%>"> Download a Claim Form</a>


    but I am getting the following message:

    Undefined variable or class name: ClaimForm
    out.print(ClaimForm.doc);

    Could anyone debug or inform me of how else I can download a Word Document by letting the user click on a hyperlink?
    Last edited by Maria Modeste; 10-05-2005 at 06:40 PM.

  2. #2
    Join Date
    Dec 2004
    Location
    San Bernardino County, California
    Posts
    1,468
    Isn't this supposed to be "good HTML"? If so, take out the extra <% and %> and just have the name of the document in quotes following your href=. If the doc is being generated on the fly by a jsp, reference the jsp as the attribute to your href.

  3. #3
    Join Date
    Sep 2005
    Posts
    39
    Thanks a mil! It's working in HTML!

Similar Threads

  1. Save Partial Word Document in ASP
    By Humair in forum ASP.NET
    Replies: 1
    Last Post: 04-28-2005, 01:10 AM
  2. Replies: 0
    Last Post: 05-16-2003, 10:02 AM
  3. Replies: 0
    Last Post: 02-12-2002, 06:04 AM
  4. downloading word document into our machine
    By geethan in forum ASP.NET
    Replies: 1
    Last Post: 01-14-2002, 12:07 PM
  5. Word document upload
    By Sven in forum VB Classic
    Replies: 1
    Last Post: 10-05-2000, 01:41 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
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links