logic-iterate
in my code i am using for-each loop for displaying data i want use tag to display data how to use plase help me
<%@ page import="java.sql.*" %>
<%String[] id = (String[])session.getAttribute("ids"); %>
<%try{ %>
<% Class.forName("oracle.jdbc.driver.OracleDriver"); %>
<HTML>
<head>
</head>
<BODY BGCOLOR="baba21">
<table>
<tr>
<th><h4>UserName:<%=session.getAttribute("username")%></h4></th>
<th align="right"colspan="200"><a href="logout.jsp">Logout</a></th>
</tr>
</table>
<H1 align="center">MyCart</H1>
<form action="logout.jsp">
<%!
Connection connection=null;
%>
<%
connection = DriverManager.getConnection(
"jdbc:oracle:thin:@localhost:1521:xe","bms","abc");
Statement statement = connection.createStatement() ;
%>
<TABLE BORDER="1"align="center">
<TR>
<TH>Selected Books</TH>
</TR>
<%
for(String i : id){
ResultSet rs = statement.executeQuery("select * from books where bookname='"+i+"'") ;
%>
<% while(rs.next()){%>
<TR>
<td><%=rs.getString(1)%></td>
</TR>
<% } } %>
<%}catch(Exception e){ } %>
</TABLE>
<%
try{
String name=(String)session.getAttribute("username");
for(String i : id){
PreparedStatement ps=connection.prepareStatement("insert into buy values(?,?)");
ps.setString(1,name);
ps.setString(2,i);
ps.executeUpdate();
}
}
catch(Exception se){ }
%>
</form>
</BODY>
</HTML>
View Answers
Related Tutorials/Questions & Answers:
Logic Iterate.Logic Iterate. I have one doubt about
logic:
iterate.
I use text feild inside of
logic:
iterate , there is possible will generate N no of rows (text feild) inside of
iterate. my doubt is how to get the Paritcular rows text
Logic Iterate.Logic Iterate.
logic iterate Struts
I have one doubt about
logic:
iterate.
I use text field inside of
logic:
iterate , there is possible... the Particular rows text value.
for example:
print("<
logic:
iterate id="xid
Advertisements
logic iterate tag - Strutslogic iterate tag Hey I am displaying the values in a jsp called categoryView.jsp using
logic iterate tag as
Now properties bname and quant belongs to another formbean named as ViewCategoryForm.java.When I
Struts logic iterate;
<body>
<h1> Search </h1>
<
logic:
iterate name...;tr>
<td align="center">
<
logic:
iterate name="listMs...Struts
logic iterate This is my jsp page in which i used 3
logic struts logic:iterate tagstruts
logic:
iterate tag Hi All,
I am writing a look up jsp which is using logc:
iterate every thing is fine except this the problem here is unable to go inside the tag. Here is the stack trace I am getting.
[#|2010-10-27T00
logic-iteratelogic-iterate in my code i am using for-each loop for displaying data i want use tag to display data how to use plase help me
<%@ page import="java.sql.*" %>
<%String[] id = (String[])session.getAttribute("ids
struts <logic:iterate problem - JSP-Servletstruts hi.
i have 10 records in my hash table and i have to display only 4 rows at a time and i need to provide pagination
logic here like previous and next
so how can i restrict the no.of rows to be displayed is equal
Struts,JSP - StrutsStruts,JSP I'm facing problem while using
logic:
iterate to render the data in the jsp from the Array list. javax.servlet.ServletException: Cannot find...("uname",employees); In the jsp
i want to know how a slide will hidei want to know how a slide will hide when im click on the button then im getting a slide, but when im click on the another button this slide will be hide.. and here im using
logic iterate to getting the values from action class
i want to know how a slide will hidei want to know how a slide will hide when im click on the button then im getting a slide, but when im click on the another button this slide will be hide.. and here im using
logic iterate to getting the values from action class
jsp page to Showuser details;Last Name</b></td>
</tr>
<
logic:
iterate id..." prefix="
logic" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>...;
</tr>
</
logic:iterate>
<tr>
Struts iteraor;%@taglib uri="http://struts.apache.org/tags-
logic" prefix="
logic"%>
<html>...;body>
<h1> Search </h1>
<table> <tbody>
<
logic:
iterate name="listMsg" id="listMsgId">
<tr>
<bean:write name
struts validation="multipleselect">
<
logic:
iterate id...;
<
logic:
iterate id="statusMasterBe...="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="
logic" %>
<
struts validation="multipleselect">
<
logic:
iterate id...;
<
logic:
iterate id="statusMasterBe...="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="
logic" %>
<
how can i hide and show tables;
<
logic:present name="list">
<
logic:
iterate id...="totZoneRecord">
<
logic:
iterate id="ZoneRecord" name="totZoneRecord...;
<
logic:
iterate id="TerritoryRecord" name="listTerr">
Struts Articles;
logic:
iterate/> and <html:radio/>. I then reference a specified form bean... architectural components: the model is the representation of the
logic... this category. Even though the business
logic may be just three or four lines