Question: logic-iterate

Ads

 
 
 

Share on Google+Share on Google+

Uppala Ravi
logic-iterate
0 Answer(s)      4 years ago
Posted in : JSP-Servlet

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>
Ads
View Answers
Ads









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 - Struts
logic 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 tag
struts 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-iterate
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
How to handle the list dynamically in struts inside logic:iterate tag
How to handle the list dynamically in struts inside logic:iterate tag  I am having following code in JSP <table> <tr> <logic:iterate name="loginForm" id="inutParams" property="inutParams" indexId="i"> <
struts <logic:iterate problem - JSP-Servlet
struts   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 - Struts
Struts,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 hide
i 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 hide
i 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
please tell anybody how can i set a value in hiperlink for edit n delete link
please tell anybody how can i set a value in hiperlink for edit n delete link  <logic:present name="allRecords"> <logic:notEmpty name="allRecords"> <logic:iterate id="user" name
jsp page to Showuser details
;Last Name</b></td> </tr> <logic:iterate id..." prefix="logic" %> <[email protected] contentType="text/html" pageEncoding="UTF-8"%>...; </tr> </logic:iterate> <tr>
Struts iteraor
;[email protected] 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
jsp pages for dispatchaction for adding user to database
;b>Last Name</b></td> </tr> <logic:iterate...-logic.tld" prefix="logic" %> <[email protected] contentType="text/html" pageEncoding="UTF-8...;/td> </tr> </logic:iterate> <tr>
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 to pass Array of string from action class to jsp page
;logic:iterate name="print" id="print" indexId="i"> <tr>...://struts.apache.org/tags-logic" prefix="logic" %> Institute of Preventive...;/logic:iterate> </table> <% String[] str = (String
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">
fetch database value to text box based on selected value my code given below pls correct my code
(){ <logic:notEmpty name="form" property="arrPriceLis"> <logic:iterate...; <[email protected] uri="WEB-INF/struts-logic.tld" prefix="logic" %> <html...= 'pricelist' property= 'priceList' />"; </logic:iterate> <
fetch database value to text box based on selected value my code given below pls correct my code
; <[email protected] uri="WEB-INF/struts-logic.tld" prefix="logic" %> <html...(){ <logic:notEmpty name="form" property="arrPriceLis"> <logic:iterate name="form" property="arrPriceLis" id="priceList "> destArray ["<
use struts 1.0 to view sql table value on JSP page
/tags-logic" prefix="logic"%> <logic:iterate name..."/> </fieldset> </logic:iterate> <
use struts 1.0 to view sql table value on JSP page
/tags-logic" prefix="logic"%> <logic:iterate name..."/> </fieldset> </logic:iterate> <
Struts Articles
;logic:iterate/> and <html:radio/>. I then reference a specified form bean... architectural components: the model is the representation of the logic... the business logic may be just three or four lines of code, exception handling might go
Tutorials   
Java Spring Hibernate Struts Training fat image from db fat image from db fat image from db fat image from db unable to get value returned from javascript variable in page How to change image size before adding to mysql using jsp Design a registration.jsp page with input for user registration details Cart Quantity jsp servlet coding issue servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ? servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ? servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ? servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ? servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ? servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ? servlet,jsp login registration forms without database in ecalipse ide using hashmap to store the registraion details ? image pdf marking pdf marking Multiple image upload using JSP Read code from excel sheet and upload into database using JSP Student java about search engine Convert BLOB to PDF and save it to a location how to copy files from remote to local machine using SFTP SSL in java? Like Team viewer Socket and Servert -Jsp how to copy files from remote location to local using java? How To Store Multilple Images In MySQL database dynamically with image uploader and then retrieve them in image gallery using java how to create SOAP based web service in java? how to fetch data from mysql database table and draw a bar chart on that data using in jsp how to create users in LDAP using java? how to authenticate user using TIVOLI api in java? how to create users using IBM Tivoi API in jsp/servelet? Java/J2ee Please explain this code as many packages and classes are unknown to me .! how to download the uploaded folder files using jsp Login Query image is display from path of mysql database please reply the code to store dynamic fields in database? Reloading issue in jsp How to get Button Id ? calling one jap page from another jsp page login login Problem to get connection from DAO class to JDBC Page Loading Time Fix table's column's name row(1st row of the table) so that it does not move up when the table is scrolled up to view more rows below Sending hidden values

Ads

 
Advertisement null

Ads