This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I get the following values from the database: String topicid = rs.getString("topicid"); String title = rs.getString("title"); And I can display these in broswer ok, simply out.print("topicd"); etc... However when I want to print out the title, and make it a link to open up a new jsp page displayTopic.jsp?topicid='"+topicid+"' ( from resultSet rs), it doesn't seem to display the title as a link properly in the browser. Can anyone spot any obvious errors in the following line of code: out.print("<td width='60%'><a href='displayTopic.jsp?topicid='"+topicid+"' '>" + title + "</a></td>"); Some help please....???
Note that these two pieces of code are different. The first displays the six letters "topicd". The second prints the value of the variable topicd. You want the second one to make sure the variable contains what you want it to.
Sorry my mistake I should have actually written out.print(topicid); Thats not where my problem is though, something within the long line code out.print("<td>"......... is not displaying in the browser as it should. I want it to display title as a link, the user can click on title which will open a new page, passing topicid (?topicd=topicid). Do you know whats wrong with that line of code.?
If you want topicid=xxx, don't u want out.println("<td width='60%'><a href='displayTopic.jsp?topicid="+topicid+"'>"...) instead of: out.print("<td width='60%'><a href='displayTopic.jsp?topicid='"+topicid+"' >");'>" + title + "</a></td> (you have an extra ' in the code originally) which gives you topicid='xxx' ? perhaps you should just right click on the link (if you are using IE) and copy shortcut so you can tell what the link points to? Adrian [ March 07, 2004: Message edited by: Adrian Pang ] [ March 07, 2004: Message edited by: Adrian Pang ]