Results 1 to 4 of 4
  1. #1
    maas is offline Member
    Join Date
    Jul 2010
    Posts
    30
    Rep Power
    0

    Default Design search results .jsp

    Hello All,

    I am designing now two jsps, the first jsp where the user inputs the name, type, date.

    The second jsp, is the jsp where the search results are being showed. So, can you please inform me on how to design the search results page where I will get a grid and inside it, the ID, name, type.

    Should that be a straight forward select statement? or how to?

  2. #2
    arun9683 is offline Member
    Join Date
    Jun 2010
    Location
    Bangalore,India
    Posts
    70
    Rep Power
    0

    Thumbs up

    is your problem to display the results which you got out of the query in JSP?

    refere the below code snippet.. Hope it helps you..

    Java Code:
    <table>
    	<tr>
    		<td>id</td>
    		<td>name</td>
    		<td>type</td>
    	</tr>
    <%
    	while(resultSet.next())
    	{
    		%>
    		<tr>
    		<td><%=resultSet.getString(1)%></td>
    		<td><%=resultSet.getString(2)%></td>
    		<td><%=resultSet.getString(3)%></td>
    	</tr>
    <%
    	}
    %>
    </table>
    Arun K R,Bangalore,India
    :)

  3. #3
    maas is offline Member
    Join Date
    Jul 2010
    Posts
    30
    Rep Power
    0

    Default

    Thank you

    It works.

    Now also I have one more difficulty is that how can I pass the ><%=resultSet.getString(1)%> to a new page in the URL or if the user clicks on the id in the table, it will show the view screen information upon the ID as a pop up

  4. #4
    arun9683 is offline Member
    Join Date
    Jun 2010
    Location
    Bangalore,India
    Posts
    70
    Rep Power
    0

    Default

    Use anchor tag..

    <a href="javascript: popFunc()"><%=resultSet.getString(1)%></a>

    THis will call the Javascript function. You write the pop up function in the javascript..
    Arun K R,Bangalore,India
    :)

Similar Threads

  1. Binary search tree search method
    By chopo1980 in forum New To Java
    Replies: 2
    Last Post: 12-10-2009, 02:42 AM
  2. Replies: 0
    Last Post: 10-29-2009, 10:28 AM
  3. Unique Filter on search results
    By selva in forum Lucene
    Replies: 0
    Last Post: 02-17-2009, 08:32 AM
  4. Replies: 5
    Last Post: 08-26-2008, 04:43 PM
  5. Problem with displaying search results from an array
    By BHCluster in forum New To Java
    Replies: 4
    Last Post: 04-24-2008, 04:34 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •