Question on dynamic hyperlinking

Thread Solved

Join Date: Oct 2008
Posts: 2
Reputation: UnforsakenX is an unknown quantity at this point 
Solved Threads: 0
UnforsakenX UnforsakenX is offline Offline
Newbie Poster

Question on dynamic hyperlinking

 
0
  #1
Jul 17th, 2009
I'm trying to figure out how to get results from a database query to be displayed on a listed page and if the user wants to know more about the results they will click one of the dynamically generated items that is hyperlinked. This will then bring the user to a detail page where they can read more about the item.

Currently, I have used one of the JSTL objects to connect to my SQL Server database and produce the correct results into a data table onto the item listing page. However I'm not quite clear on how to make these results be hyperlinks that query the detail page.

I've done this hundreds of times in ASP.NET but to be honest I haven't the slightest clue on how to do this in JSP. Any pointers or references to tutorials would be much appreciated.
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 97
Reputation: Alex_ is an unknown quantity at this point 
Solved Threads: 2
Alex_'s Avatar
Alex_ Alex_ is offline Offline
Junior Poster in Training

Re: Question on dynamic hyperlinking

 
0
  #2
Jul 17th, 2009
Let's say you retrieved some books' name/title from the database and you want to print their name/title on the page, and still be a link.
You'll have to write something like this:
  1. <a href=GetBook.jsp?book=<%= BookTitle[i]%> > <%=BookTitle[i]%> </a>
Hope that answers your question. If not, tell me, i can try to help you further.
Last edited by Alex_; Jul 17th, 2009 at 11:04 am.
Fundamental law of life:
do{ ThingsToDo+=me.CompleteTask(ThingsToDo); }while(ThingsToDo); Die(me);
Law of the Spirit:
do{ Rebuke(me); }while(!me.Repented); LiveEternal(me);
PM me to know more why i wrote this or what it means.
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 2
Reputation: UnforsakenX is an unknown quantity at this point 
Solved Threads: 0
UnforsakenX UnforsakenX is offline Offline
Newbie Poster

Re: Question on dynamic hyperlinking

 
1
  #3
Jul 17th, 2009
thanks for your help. Your suggestion was helpful. I ended up using a slight variation since I'm using the JSTL data table

  1. <h:outputLink value="ListingTerm.faces?term=#{vartermListing.NAME}">
  2. <h:outputText id="termName" value="#{vartermListing.NAME}" styleClass="outputText">
  3. </h:outputText> </h:outputLink>
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC