File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes open document using if statement Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Reply locked New topic

open document using if statement

orelia hans
Ranch Hand

Joined: Jan 29, 2004
Posts: 37
I tried to attach files to my database for me to be able to retrieve those documents on the web using an id number. I used binary objects but it didn't work.
Now I am using a method to read the id from the web then open the document. I think it can work but I don't know how.
On the jsp page I have :
Then on the other hand :
try {
Connection con = DriverManager.getConnection("jdbc dbc:AcessCore");
publicationNumber = request.getParameter("id");

??? how do I open a specfic document when you click on the link?

else if(publicationNumber=="NRR1")
href="C://hello.doc"; doesn't work
catch (
ClassNotFoundException e1) { }
catch (SQLException e2) { }
I have like 100 publications and I have to do this one by one. Can someone tell me how to do that? opening the document as a new window.
Any help will be so much appreciated.
[ February 16, 2004: Message edited by: Paul Wheaton ]
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15302

Intersting. This post has nothing to do with Linux. I mean, you aren't even on a Linux machine. I know this because of the line
href="C://hello.doc"; doesn't work

Oh well, moving to JSP.

GenRocket - Experts at Building Test Data
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63837

Actually, since this is a dupe of a question already asked in this forum, I'm closing this topic.
orelia, please do not cross-post the same question in multiple fourms.

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: open document using if statement
It's not a secret anymore!