| | |
Question on dynamic hyperlinking
Please support our JSP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Oct 2008
Posts: 2
Reputation:
Solved Threads: 0
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.
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.
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:
Hope that answers your question. If not, tell me, i can try to help you further.
You'll have to write something like this:
JSP Syntax (Toggle Plain Text)
<a href=GetBook.jsp?book=<%= BookTitle[i]%> > <%=BookTitle[i]%> </a>
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.
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.
•
•
Join Date: Oct 2008
Posts: 2
Reputation:
Solved Threads: 0
thanks for your help. Your suggestion was helpful. I ended up using a slight variation since I'm using the JSTL data table
JSP Syntax (Toggle Plain Text)
<h:outputLink value="ListingTerm.faces?term=#{vartermListing.NAME}"> <h:outputText id="termName" value="#{vartermListing.NAME}" styleClass="outputText"> </h:outputText> </h:outputLink>
![]() |
Similar Threads
- dynamic array and dymanic variables (PHP)
- Question on Dynamic drives (IT Professionals' Lounge)
- What is the use of Dynamic Memory? (C++)
- Why use dynamic cast (C++)
- Dynamic Keyword Insertion ? (ASP.NET)
- Please Help Dynamic Memory Allocation. (C++)
- Hit counter (JavaScript / DHTML / AJAX)
- "add this site to your bookmarks" in firefox (JavaScript / DHTML / AJAX)
- Select Box populates text field (JavaScript / DHTML / AJAX)
- Dynamic Initialization implies Dynamic Help (C++)
Other Threads in the JSP Forum
- Previous Thread: how to let servlet sends responds to an e-mail
- Next Thread: Is it possible to make a servlet include a .jsp page? view example.
| Thread Tools | Search this Thread |
apache backbutton combobox connection database development directorystructure dynamicpagetitles eclipse frames glassfish ie8 imagetodatabse imageupload integer internet java javaee javascript jsf jsp jsppagetitles levels mvc2 mvcmodel2 network parameters passing ping printinserverinsteadofclient redirect request.getparameter response servlet servletdopost()readxml sessions software ssl state_saving_method stocks sun tomcat tutorial update video web





