Sql in jsp

can n e 1 tell me where i am going wrong i am trying to use sql in a jsp to try to take out specific tuples from a table in my db but it is not working. i have been looking at the code for ages and can't figure out where i'm going wrong. please help!!!!!!!!!!!
here is the code and the errors.
<%@ page import="java.sql.*, java.util.*, java.io.* " %>
<body bgcolor="#ffffcc">
<% String name = (String)session.getAttribute("thefname"); %>
<% String staffid = (String)session.getAttribute("theusername"); %>
<center>
<h2><tt> Here are the assignments you've marked :<%=name%>:<%=staffid%> </tt></h2>
<%
     Class.forName("com.mysql.jdbc.Driver").newInstance();
     java.sql.Connection con1 = null;
     Statement stmt1 = null;
     ResultSet rs1 = null;
     String queryStr1 = null;
try{
con1 = DriverManager.getConnection(
          "jdbc:mysql://bushmouth.doc.stu.mmu.ac.uk:3306/dutts?user=*****&password=*********");
stmt1 = con1.createStatement();
queryStr1 = "SELECT *
               FROM e modresults, d module
               WHERE e.modid = d.modid
               And d.staffid = '" + staffid + "'";
rs1 = stmt1.executeQuery(queryStr1);
%>
<center>
<H2 color="#99ffff"><tt> All submited assignments</tt></h2>
<hr>
<br>
<table border="1" bgcolor="#66ccff" >
<tr>
<th> modid</th>
<th>courseid</th>
<th>studentid</th>
<th> assessmentno</th>
<th> url</th>
<th> grade</th>
<th>tutorcomment </th>
</tr>
<%
     while (rs1.next())
          String modid = rs1.getString(1);
               String courseid = rs1.getString(2);
               String studentid = rs1.getString(3);
               String assessmentno = rs1.getString(4);
               String url = rs1.getString(5);
               String grade = rs1.getString(6);
String tutorcomment = rs1.getString(7);
%>
<tr><td><%=modid%></td>
<td><%=courseid%></td>
<td><%=studentid%></td>
<td><%=assessmentno%></td>
<td><a href="<%=url%>"><%=url%></a></td>
<td><%=grade%></td>
<td><%=tutorcomment%></td></tr>
</center>
<%
     } // end while()
}catch(SQLException s){%> <%= s%> <% }
finally{
// clean up.
     try{
          if (rs1!=null) rs1.close();
          if (stmt1!=null) stmt1.close();
          if (con1!=null) con1.close();
     }catch(SQLException s){}
%>
</TABLE>
<br>
<button style="width:200;height:45"
onClick="history.go(-1)"><b>back to account</b></button>
</body>
</center>
</body>
rg.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 16 in the jsp file: /jsp/vmarked.jsp
Generated servlet error:
[javac] Compiling 1 source file
C:\tomcat\work\Standalone\localhost\student_mod2_dutts\jsp\vmarked_jsp.java:74: unclosed string literal
queryStr1 = "SELECT *
^
An error occurred at line: 16 in the jsp file: /jsp/vmarked.jsp
Generated servlet error:
C:\tomcat\work\Standalone\localhost\student_mod2_dutts\jsp\vmarked_jsp.java:77: unclosed character literal
               And d.staffid = '" + staffid + "'";
^
2 errors

thanks for that guys it has sorted that out. but i still have 1 little problem with it. i am getting the following error when i try to use that sql command
java.sql.SQLException: General error: Table 'dutts.e' doesn't exist
i know it's not really a java problem , but can i be cheeky enough to ask if some one could see if i have written my sql statement correctly?
here is the statement i have written
queryStr1 = "SELECT * FROM e modresults, d module WHERE e.modid = d.modid And d.staffid = '" + staffid + "'";

Similar Messages

  • PL/SQL vs JSP vs Servlets

    We are in the stage of deciding which language to develop portlets. I lean towards JSP or servlets for the wide array of Java libraries we can use. I think the only advantage of PL/SQL is speed. Thanks.

    It depends. If your developers are mainly Java developers, you'll probably prefer building web portlets. But if you have a strong PL/SQL skill set you could choose the latter. Additionally, if you're developing content that is database intensive you may want to build PL/SQL portlets since they transact with the database faster. If you're going to aggregate content from various web sites, using web providers is preferable. It's a matter of choice based on your requirements and preferences.

  • SQL in JSP - do I use JAVA code in % ... % or SQL Tag Library ??

    I have a small web app that makes needs to make about 12 SQL queries in a JSP and am trying to figure out what is the best way to do this
    I had initially coded this using plain JAVA code in the JSP as follows :-
    <%
    Connection conn = null;
    Statement st = null;
    ResultSet rs = null;
    try {
    st = conn.createStatement();
    rs = st.executeQuery("select .........");
    %>
    But then I came across the SQL Tag Library in an article and wonder if this is more efficient code?
    If so does anyone have a pointer to a good intro to these tags as they look complicated (I only am doing queries on the SQL database, no inserts or updates)

    Sometimes you've gotta do what you've gotta do.
    My rule is "no scriptlets".
    If you MUST access a database from a JSP, the only right way to do it is to use JSTL <sql> tags.
    %

  • Integration of PL/SQL and JSP (Java Server Pages)

    I need to match a web application developed with PL/SQL with another developed in JSP (Java Server Pages) the problem is that the two apps interact with the same databese, an share de same users, I need to know how to get the user and password loged into pl/sql when the user want to use same of de .jsp pages running on another application server?

    Hi Michael Vstling,
    Did you try the java classes library (SDOAPI) that can be downloaded from OTN?
    It may provide you with a better alternative when manipulating geometries in the Java space. There is an adapter in SDOAPI which can convert a JDBC STRUCT object into Java Geometry object defined in SDOAPI, and vice versa.
    There are at least two ways in mixing PL/SQL and Java. The first one, as you mentioned, is to define your custom function in terms of PL/SQL and call it from within your Java program. With SDOAPI, you have the second option, which is to define your own functions in Java using SDOAPI and deploy them as Java stored procedures in db. You can then call them from within your PL/SQL code. In either way performance depends on a lot of things and generally it requires a "try and improve" approach.
    About JPublisher and sdo_ordinate_array it may not be a spatial related problem. Did you try search the Java-related forums first?
    LJ

  • Explain plan output  for a sql in JSP page

    Hello all,
    I have a requirement to give SQL query as an input and get the output and explain plan in the same JSP page. i could get the SQL result, but i want to get the EXPLAIN Plan.
    can any one help me in this.
    Thanks
    Kiran

    Hello all,
    I have a requirement to give SQL query as an input and get the output and explain plan in the same JSP page. i could get the SQL result, but i want to get the EXPLAIN Plan.
    can any one help me in this.
    Thanks
    Kiran

  • SQL from JSP

    Hi everybody,
    i started to program in JSP only from yesterday and i'd like to execute a statement SQL from my JSP page....
    My code is
    <%Class.forName("oracle.jdbc.driver.OracleDriver");%>
    <%java.sql.Connection c = java.sql.DriverManager.getConnection("ora817", "protocs", "protocs");%>
    <% try {
    Statement dbst = c.createStatement();
    ResultSet rs;
    rs = dbst.executeQuery("update upload_status set stato= 4;");
    c.close ();
    catch (SQLException e) {
    out.println("Non riesco a fare l'update "+e);
    return;
    %>
    So when i use use JDeveloper and i run the project i obtain the following error
    500 Internal Server Error
    java.sql.SQLException: No suitable driver
         at java.sql.DriverManager.getConnection(DriverManager.java:532)
         at java.sql.DriverManager.getConnection(DriverManager.java:171)
    at untitled1.jspService(untitled1.jsp:17)
         [untitled1.jsp]
         at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:139)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:347)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:778)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
         at java.lang.Thread.run(Thread.java:534)
    I hope that some one can help me

    Let's see.
    You don't have the Oracle JDBC driver JAR in the CLASSPATH. Put it in WEB-INF/lib in your Web app's WAR file.
    Your Oracle database URL is totally wrong. It should look something like this:
    jdbc:oracle:thin:@host:1521:database
    You should separate out that JDBC code and test it in a separate object on the command line before you try sticking it into a JSP. At least make sure that you know how to connect to the database.
    Sounds like you need these:
    http://java.sun.com/docs/books/tutorial/jdbc/
    http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html
    MOD

  • Anybody using Hypersonic SQL in JSP?

    Hello,
    Does anybody use Hypersonic SQL?
    I implement a guestbook system with JSP that
    saves data in Hypersonic SQL. This system
    runs on www.mycgiserver.com. My JSP program
    has thread safe option set to false to make
    sure one thread is reading and writing the database
    at a time. However, every once in a while, the
    database will be wiped out mysteriously.
    So I am just wondering that this happens to
    anyone else? Is this a Hypersonic SQL's bug
    or it's the server that goofs up or I did something
    wrong with the JSP setting? Any ideas or
    comments please? Thanks !!!

    Hi there!
    I use Hypersonic locally and on mycgiserver.com. Luckilly, I haven't encountered your problems so far. I use a similar approach, I have a bean that handles a singleton-connection to the DB, and that will queue up all requests. But so far , I haven't had that much load on the app, so maybe I'll get back in this matter, with the same problem... Anyone att mycgiserver that had an id�a?
    regards
    Markus

  • Need an information using java.sql in jsp

    I found that there is a 'dataset' like architecture in .NET, is there any 'dataset' like substance in our java, if it is means can you give me some ideas for using it in jsp, give me some example for saving a record in the mysql database. very urgent please,

    KIRUPA_SHANKAR wrote:
    I found that there is a 'dataset' like architecture in .NET, is there any 'dataset' like substance in our java, if it is means can you give me some ideas for using it in jsp, give me some example for saving a record in the mysql database. Shouldn't be doing database stuff in JSPs. Use JSTL and its <sql> tags if you must.
    RowSet might be close. I don't write .NET.
    very urgent please,Not to me.
    %

  • SQL and JSP compatablility

    This part of code is not working properly as the JSP code has not been encorporated properly in the sql statement after LIKE.
    java.sql.ResultSet RS = statement.executeQuery("SELECT BookID, Ebook.AuthorID, Surname, BookTitle, FileSize, Description, Price, Image FROM Author INNER JOIN Ebook ON Author.AuthorID = Ebook.AuthorID WHERE BookTitle LIKE '*" + bookTitle2 + "*' AND Surname LIKE '*" + surname2 + "*'");
    It doesn't display the shopping cart but if I change the sql code to:
    WHERE BookTitle LIKE '* queen *' AND Surname LIKE '**'
    It works so I know its not the SQL code. I have included the code for the entire page below in case you spot any glaring mistakes.
    <%@ page language="java" contentType="text/html"
    import="ShoppingBasket,Product"
    errorPage="errorpage.jsp" %>
    <html>
    <head> <title>Search Results</title></head>
    <body>
    <table width="80%" border="0" cellspacing="5" cellpadding="1">
    <tr>
    <td width = "15%"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Search
    Results</font></b></td>
    <td width = "10%">�</td>
    <td width = "15%">�</td>
    <td width = "15%">�</td>
    <td width = "20%">�</td>
    <td width = "5%">�</td>
    <td width = "10%">�</td>
    <td width = "5%">�
    <td width="10%"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><a href="<%= response.encodeURL(shop-basket.jsp") %">"><img src="images\viewbasket.gif" border="0" alt="View Basket"></a></font></td>
    </tr>
    <tr>
    <td width = "15%"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"></font></td>
    <td width = "10%"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="2">E-Book
    No.</font></b></td>
    <td width = "15%"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Title</font></b></td>
    <td width = "15%"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Author</font></b></td>
    <td width = "20%"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Story
    Line</font></b></td>
    <td width = "5%"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="2">File
    Size</font></b></td>
    <td width = "10%"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Price</font></b></td>
    <td width = "5%"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b>Read
    Reviews</b> </font>
    <td width="10%"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"></font></td>
    </tr>
    <%
         String bookTitle2 = request.getParameter("bookTitle");
         bookTitle2 = bookTitle2.replaceAll("'", "''");
         String surname2 = request.getParameter("surname");
         surname2 = surname2.replaceAll("'", "''");
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    java.sql.Connection connection =
    java.sql.DriverManager.getConnection("jdbc:odbc:Novbase","","");
    java.sql.Statement statement = connection.createStatement();
    java.sql.ResultSet RS = statement.executeQuery("SELECT BookID, Ebook.AuthorID, Surname, BookTitle, FileSize, Description, Price, Image FROM Author INNER JOIN Ebook ON Author.AuthorID = Ebook.AuthorID WHERE BookTitle LIKE '*" + bookTitle2 + "*' AND Surname LIKE '*" + surname2 + "*'");
    int rowCounter = 0;
    while(RS.next())
         String image = RS.getString("Image");
    String bookID = RS.getString("BookID");
    String title = RS.getString("BookTitle");
         String surname = RS.getString("Surname");
    String storyLine = RS.getString("Description");
         String fileSize = RS.getString("FileSize");
    String price = RS.getString("price");
    rowCounter++;
    String bg = (rowCounter %2 !=0) ? "#C0C0C0" : "#FFFFFF";
    %>
    <tr bgcolor="<%= bg %>">
    <td width="15%" valign="top" align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><img src="<%= image %>"></font></td>
    <td width="10%" valign="top" align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><%= bookID %></font></td>
    <td width="10%" valign="top" align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><%= title %></font></td>
    <td width="10%" valign="top" align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><%= surname %></font></td>
    <td width="10%" valign="top" align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><%= storyLine %></font></td>
    <td width="5%" valign="top" align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><%= fileSize %>MB</font></td>
    <td width="10%" valign="top" align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="1">?<%= price %></font></td>
    <td width="10%" valign="top" align="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="1">
    review</font></td>
    <td width="10%" align="center" valign="top"><a href="<%= response.encodeURL("shop-products.jsp?title="+title+"&bookID="+bookID+"&price="+price) %> ">
    <font face="Verdana, Arial, Helvetica, sans-serif" size="1"><img src="images\addtobasket.gif" border="0" alt="Add To Basket"></font></a></td>
    </tr>
    <%
    RS.close();
    connection.close();
    %>
    </table>
    this is the contents of the surname field <%= surname2 %><br>
    this is the contents of the title field <%= bookTitle2 %>
    <jsp:useBean id="basket" class="ShoppingBasket" scope="session"/>
    <% String title = request.getParameter("BookTitle");
    if(title!=null)
    String bookID = request.getParameter("BookID");
    double price = Double.parseDouble(request.getParameter("Price"));
    Product item = new Product(bookID, title, price);
    basket.addProduct( item );
    %>
    </body>
    </html></a>

    found the answer. Wildcard should be like this:
    '%" + bookTitle + "%'

  • Performing SQL in JSP okay for clustering?

    I'm running on WLS 8.1 SP2. I've a JSP which is part of my main post login page. There're some SQL logics there. Would this be a problem to cluster replication & failover?

    thanks for that guys it has sorted that out. but i still have 1 little problem with it. i am getting the following error when i try to use that sql command
    java.sql.SQLException: General error: Table 'dutts.e' doesn't exist
    i know it's not really a java problem , but can i be cheeky enough to ask if some one could see if i have written my sql statement correctly?
    here is the statement i have written
    queryStr1 = "SELECT * FROM e modresults, d module WHERE e.modid = d.modid And d.staffid = '" + staffid + "'";

  • About using dynamic sql in jsp

    I make a jsp file with "CreateViewObjec".I can get the message from db ,but I get the same message when I push the button "next" .Please help me!
    my jsp file is:
    <%@ taglib uri="/webapp/DataTags.tld" prefix="jbo" %>
    <%@ page contentType="text/html;charset=MS936"%>
    <HTML>
    <HEAD>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=MS936">
    <TITLE>
    Hello World
    </TITLE>
    </HEAD>
    <BODY>
    <H2>
    The current time is:
    </H2>
    <P>
    <% out.println((new java.util.Date()).toString()); %>
    </P>
    <jbo:ApplicationModule id="MypackageModule" configname="mypackage.MypackageModule.MypackageModuleLocal" releasemode="Stateful" />
    <jbo:CreateViewObject appid="MypackageModule" name="dyname" rangesize="10" >
    select PRODUCT_NAME from product_information
    </jbo:CreateViewObject>
    <jbo:DataSource id="id" rangesize="20" appid="MypackageModule" viewobject="dyname" />
    <table border="0">
    <tr>
    <td ALIGN="right"><jbo:DataScroller datasource="id" /></td>
    </tr>
    <tr><td>
    <jbo:DataTable datasource="id" />
    </td>
    </tr>
    </BODY>
    </HTML>
    <jbo:ReleasePageResources />

    David,
    I want to change the where clause dynamically.Our objective is to make the map in a generic way so that if there is a change in where clause (i.e. adding more conditions in where clause) i dont have to change the map.I can change the values(if used, say emp_no=20) however i'm facing problem changing the whole condition i.e. even the column name.
    Thx

  • Sql in jsp - decrease fines by amount

    hi everyone, thx for looking at my problem, well can u pls help me to sort out this problem. the situation is when someone pays his/her fines by certain amount , i need to update the fines in the database.
    here is a a section of the program:
    String mem_ID= request.getParameter("mem_ID");
    String fines = request.getParameter("fines");
    String amount = request.getParameter("amount");
    int rowsAffected = SQLStatement.executeUpdate("update member set fines = (fines-'"+amount+"') where mem_ID ="+mem_ID);
    thanking u in advance

    hi dear,
    final solution.........
    String mem_ID= request.getParameter("mem_ID");
    String fines = request.getParameter("fines");
    String amount = request.getParameter("amount");
    float newFines = Float.parseFloat(fines) - Float.parseFloat(amount);
    int rowsAffected = SQLStatement.executeUpdate("update member set fines = '" + newFines + "' where mem_ID =" + mem_ID);
    // unless required very high precision, avoid usage of double - u may face unpredictable results
    bye for now...
    Pranav
    Make habit of having Dukes to share....basically, it's a give & take world

  • Sql and Jsp

    Sir
    I am using MSSQL for my application
    i want to know what to write in class.forNAme and Drivermanger.getconnction.
    Please help me
    Thanks in advance

    For this, you need to check the docs related to MSSQL. That quite depends upopn the database one is using.

  • Can someone help me correct this sql statement in a jsp page?

    ive been getting the java.sql.SQLException: Incorrect syntax error for one of my sql nested statements. i cant seem to find similar egs online, so reckon if anyone here could help, really appreciate it.
    as im putting the nested sql in jsp page, it has to be with lots of " " n crap. very confusing if there are nested.
    heres the sql statement without those "" that i want to use:
    select top 5 * from(
    select top+"'"+offset+"'"+" * from prod where cat=" +"'" cat "'"+"
    )order by prodID desc
    when i put this in my jsp pg, i had to add "" to become:
    String sql = "select top 5 * from("+"select top"+"'"+offset+"'"+" * from prod where cat=" +"'" +cat+ "'"+")order by prodID desc";cat=" +"'" cat "'"+")order by prodID desc";
    all those "" are confusing me to no end, so i cant figure out what should be the correct syntax. the error says the syntax error is near the offset.

    If offset is, say, 10, and cat is, say, "new", then it looks like you're going to produce the SQL:
    select top 5 * from(
      select top '10' * from prod where cat='new'
    )order by prodID descThat looks exactly like incorrect syntax to me... top almost certainly can't handle a string literal as its operand... you almost certainly would want "top 10" instead of "top '10'"...
    If you use PreparedStatement, you don't have to remember what you quote and what you don't and you can have your SQL in a single static final string to boot...

  • Pass jstl sql query result to jsp

    Hi I have the following code which works perfectly
    <%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <sql:setDataSource dataSource="jdbc/dbtest"/>
    <sql:query var="items" sql="SELECT * FROM homepagesubscriptions">
    </sql:query>
    <table border="0" align="center" valign="top">
    <c:forEach var="row" items="${items.rows}" begin = "0" end="10" >
                   <tr>
                   <td>
                        <img src="${row.imgurl}" width="100" height = "100"></a>
                   </td>
                   <tr>
    </c:forEach>
    </table>   Now what I want is to perform the query in one page and then display the data in another, as such
    index.jsp
    <%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
    <sql:setDataSource dataSource="jdbc/dbtest"/>
    <sql:query var="items" sql="SELECT * FROM homepagesubscriptions">
    </sql:query>
    <!-- NOT SURE WHAT TO DO HERE
    <jsp:useBean id="resultBean" scope="request"
         class="javax.servlet.jsp.jstl.sql.ResultSupport" />
    <jsp:setProperty name="rs" property="rs" />
    <jsp:forward page="test.jsp" />
    -->
        test.jsp
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <c:set var="items" value="${resultBean}" />
    <table border="0" align="center" valign="top">
    <c:forEach var="row" items="${items.rows}" begin = "0" end="10" >
                   <tr>
                   <td>
                        <img src="${row.imgurl}" width="100" height = "100"></a>
                   </td>
                   <tr>
    </c:forEach>
    </table>   I know in index.jsp I can use jsp forward and usebean but am not sure how to? What type is the result from the query? thanks

    Take a look at the "scope" attribute of the <sql:query> tag.
    query.jsp:
    <%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
    <sql:setDataSource dataSource="jdbc/dbtest"/>
    <sql:query var="items" scope="request" sql="SELECT * FROM homepagesubscriptions"/>
    <jsp:forward page="test.jsp" />and then test.jsp:
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 
    <table border="0" align="center" valign="top">
    <c:forEach var="row" items="${items.rows}" begin = "0" end="10" >
                   <tr>
                   <td>
                        <img src="${row.imgurl}" width="100" height = "100"></a>
                   </td>
                   <tr>
    </c:forEach>
    </table>  

Maybe you are looking for