*
The moose likes JSP and the fly likes Drop Down box for Jstl Select query results Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Drop Down box for Jstl Select query results" Watch "Drop Down box for Jstl Select query results" New topic
Author

Drop Down box for Jstl Select query results

SP Nam
Ranch Hand

Joined: Oct 15, 2003
Posts: 41
I have a jsp page and inside it I have a Select query which gets results for a table. I want to show that results as drop down box on a jsp page.

How to get the results into drop down box on a jsp page.

Any ideas.

Thanks

SP Nam
SP Nam
Ranch Hand

Joined: Oct 15, 2003
Posts: 41
Hi
This is my code,
any body look in and suggest
SP Name

----------------

<%@ taglib uri="http://java.sun.com/jstl/sql" prefix="sql" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>

<html>
<head>
<title>JSTL: SQL action examples</title>
</head>
<body bgcolor="#FFFFFF">

<h1>SQL Update Exec</h1>

<sql:setDataSource

var="example"
driver="oracle.jdbc.driver.OracleDriver"
url="jdbc racle:thin:@insn104a.idc.oracle.com:1522 ra9idb"
user="scott"
password="tiger"
/>

<sql:transaction dataSource="${example}">

<sql:query var="abc">
select emp_id from emp
</sql:query>

</sql:transaction>



<p>Select a Class
<select Name ="ClassDrop">
<c:forEach var="row" items="${abc.rows}">
<option><c ut value="${row.emp_id}" /></option>
</c:forEach>
</select>
<p>

<input type="submit" value="SUBMIT"/>
<input type="reset" value="RESET"/>
</body>
</html>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Drop Down box for Jstl Select query results
 
Similar Threads
setting the selected option in a select element
dynamic help
accessing database using javascript
Passing variable value from javascript to jsp page at run time
Drop down box issue