aspose file tools*
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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSP
Reply locked New topic
Author

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 :
out.write(""+publicationNum+"</td>");
Then on the other hand :
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc dbc:AcessCore");
publicationNumber = request.getParameter("id");
out.println(publicationNumber);

if(publicationNumber=="NNR1")
{
??? how do I open a specfic document when you click on the link?
}

else if(publicationNumber=="NRR1")
{
href="C://hello.doc"; doesn't work
}
rs.close();
s.close();
con.close();
}
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.
Thanks
[ February 16, 2004: Message edited by: Paul Wheaton ]
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15286
    
    6

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 - A Test Data Generation Platform
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60041
    
  65

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] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: open document using if statement
 
Similar Threads
reading data from jsp page to another jsp page using request.getParameter
opening document using if statement
jsp attached to pdf file
Need Help With Dynamic text box in JSP
how to retrieve images on a jsp page