How to populate an HTML table using jstl code

How to populate an HTML table using jstl code

Hi

I want to populate an HTML table using jstl code.I am using Hasp map.For 1 column its okay it works fine.But if I am suppose to populate 2 or 3 columns from the database than I am having problem to display them.Please help

This is my Code :
String tabvalue,tab1;
java.util.HashMap map = new java.util.HashMap();
String sQuery1 = "select * from company where CompanyName = '" + c.getCompany_Name() + "' " SqlRowSet srs = tpl.queryForRowSet("select CompanyName,CompanyAddress from company");
int rowCount = 0;
while (srs.next()) {
map.put("tabvalue"+rowCount,srs.getString("CompanyName")); map.put("tab1"+rowCount,srs.getString("CompanyAddress"));
rowCount++;
}
request.setAttribute("map", map);

My jstl code to populate a table is like this:
<form:form method="POST" action = "/companydo.htm" commandName="Company" name="x">
<TABLE class="comonfield1" colspan="3%" align="center" width="500" bgcolor="#808080?>
<c:forEach var='item' items='${map}'>
<TR><TD>
<c:out value='Key=${item.key}, Value=${item.value}'/>
</TD>
<TD>
<c:out value='Key=${item.key}, Value=${item.value}'/>
</TD>
</TR>
</c:forEach>
</TABLE>
</form:form>
View Answers









Related Tutorials/Questions & Answers:
How to populate an HTML table using jstl code - Spring
How to populate an HTML table using jstl code  Hi I want to populate an HTML table using jstl code.I am using Hasp map.For 1 column its okay... jstl code to populate a table is like
How to populate text fields using php code?
How to populate text fields using php code?  How could I use php to populate text fields by selecting a name of a business from dropdown list? Those..., post code in php. Also, the user would also need to edit the information
Advertisements
Populate value into HTML page
Populate value into HTML page  Hi, How to populate values from one html page table to another html page..? Thanks
How to use next and previous button(or href) for database table that is retrieved from MySQL DB using jsp,jstl,javascript
How to use next and previous button(or href) for database table that is retrieved from MySQL DB using jsp,jstl,javascript  when click on the next... to display previous 10records. Database Query like this: Select * from table
how to update values of a html form into an excel table using java servlets?
how to update values of a html form into an excel table using java servlets?  i have written a java servlet program, which has a html form... be loaded into an excel table automatically. i have created a dsn for excel
how to load values of html form into an excel table using java servlet?
how to load values of html form into an excel table using java servlet?   i have written a java servlet program, which has a html form to be filled... be loaded into an excel table automatically. i have created a dsn for excel table
How to play FLV video files on Ipad using HTML code or javascript code?
How to play FLV video files on Ipad using HTML code or javascript code?  How to play FLV video files on Ipad using HTML code or javascript code
Html form using JavaScript to display the table content
Html form using JavaScript to display the table content  HI... want to write a Html JavaScript coding to display the content from database. can you teach me how and give me the code for that? Regards Karthik M
Hi how to transfer table data from html page to excel sheet by using javascript .
Hi how to transfer table data from html page to excel sheet by using javascript .  html page to excel sheet by using javascript and i dont want to transfer all rows in table, i want to hide some rows in excel sheet. Please send
How to Word-wrap in an HTML table?
How to Word-wrap in an HTML table?  Hi, I have HTML table in a web application. When long word grows it does not wordwraps. How to Word-wrap in an HTML table? Thanks   Hi, You may try this code: <style> td
View source code of a html page using java ..
View source code of a html page using java ..  I could find the html source code of a web page using the following program, http://download.oracle.com/javase/1.4.2/docs/api/java/net/URLConnection.html i could get the html code
How to store values in a database using JSTL? - JSP-Servlet
How to store values in a database using JSTL?  I want to store values in a database... How can i store in database? Here is my code... This wil... in database using JSTL name number Position add
how to space images in html code
how to space images in html code  how to space images in html code
HTML code to servlet to database using jdbc
HTML code to servlet to database using jdbc  pls send me the code related to the title   Hi Friend, Try the following code:ADS... { String msg=req.getParameter("msg"); res.setContentType("text/html
filter and display html table data using ajax - Ajax
on DisplayCategory.jsp in the form of the html table using responseText. how to do...filter and display html table data using ajax  Hi i am stuck up at a situation where i have a jsp page from where the control goes to the .js file
How to Extract row from table view using JSP Code - Java Beginners
How to Extract row from table view using JSP Code  Hi Friends...)deleteuser.jsp: For the above code, we have used following database table... to java world and trying to design a web page using NetBeans IDE 6.8. My
give me source code of webpage creation using html
give me source code of webpage creation using html  how to create a webpage using html
Error in using jstl tags
Error in using jstl tags  I'm trying to use jstl tags in jsp.i've.../jstl/core" %> but still i'm getting the error "CANNOT FIND THE TAG LIBRARY DESCRIPTOR FOR http://java.sun.com/jsp/jstl/core " Please tell me where am i
how html tags are extracted using java?
how html tags are extracted using java?  I would like to need the java code for extracting html tags
how html tags are extracted using java?
how html tags are extracted using java?  I would like to need the java code for extracting html tags
mini project using html,javascript and ms access with source code
mini project using html,javascript and ms access with source code  I want a mini project which uses html and java script and backend as ms access with source code. plz send its important and urgent
HTML Table in javascript
HTML Table in javascript  hi all, how to add last row with sum in table using javascript
Populate a combo box using data from a database
Populate a combo box using data from a database  Hi Guys, In need... to populate the first one, and then how to send the data off to a servlet and preform... to the client using ajax, and then populate the combo box, I must'nt reload
html report generation in emma code coverage using ANT acript
html report generation in emma code coverage using ANT acript  Hi Deepak, I am using emma code covarage tool and to generate coverage report by using Ant script i am getting following exception [report
HTML code
HTML code  How do I keep people from stealing my source code and/or images
How to hide HTML code from user? - Security
How to hide HTML code from user?  Hi All, I am trying to provide... viewing HTML source code. Can any one guide me for this topic? Thanks... showing source code is by generating the elements on the page using javascript
Tag Inside Table in HTML
in HTML.In this code we define a HTML page and show you to create a tag inside a Table in HTML. The following tags used in code to create tag inside table in HTML... Tag Inside Table in HTML     
how to print HTML using javascript or Jquery
how to print HTML using javascript or Jquery  is there any way to print a document(created using Html and javascript) without using window.print... single method/code to work for both browser
Populate dropdown menu from database using jsp and servlet
Populate dropdown menu from database using jsp and servlet  please i need code to populate dropdown menu from mysql database using jsp and servlet. thanks
how to update table using inner joins
how to update table using inner joins  how to update table using inner joins
HTML table layout
HTML table layout  i have table layout in that i have menu in td(column) ,when i click menu item ,the page will be open in that table right side td... requirement is layout using table
how to create database and table using jsp
how to create database and table using jsp  hi frnds...., i want to create database and table in mysql using jsp.... i have an registration form(name... table using jsp code... the table name should be the name of the person
Table Empty Cell in HTML
Table Empty Cell in HTML       The Table Empty Cell in HTML define no content inside a cell of table. The code is not able to display border around the empty cell in a table
HTML - table background color.
HTML - table background color. Description : Here, you will see how to specifies the table back ground color in html page. The <table > is a html... the background color of tableCode : <!DOCTYPE html PUBLIC "
how to insert data in database using html+jsp
how to insert data in database using html+jsp  anyone know what is wrong with my code? print("<% /* Create string..."; // declare a connection by using Connection interface
retriving data from sql server using jsp code and placing them in text fields of html code
retriving data from sql server using jsp code and placing them in text fields of html code  Hi, my question is how to retrieve data from sql server 2008 using a jsp file and place the values in the text fields of a html file
how to display a table from database using servlet
how to display a table from database using servlet  how to display a table with values from servletpage   Hi Friend, Please go through the following link:ADS_TO_REPLACE_1 http://roseindia.net/jsp/servlet-jsp-data
how to write a jsp form using html
how to write a jsp form using html  hi, i have written the code as below... but it is showing error. please help me how to resolve it. .html file...;%=vempNo%> <%=vempName%>   Here is your required code: 1
html table without border
html table without border  How to create a html table without border?   <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN..." content="text/html; charset=utf-8" /> <title>Table without borders<
Add/Remove Rows Dynamically with drop down list in html table using php
Add/Remove Rows Dynamically with drop down list in html table using php  Here Is My Code. I want to give and get the id of drop down list. Can Anyone Help? Dropdowndesign.php <html xmlns="http://www.w3.org/1999/xhtml">
how to convert doc file into html using java swing
how to convert doc file into html using java swing  i want to convert doc file into html and display it on jtextarea please help me and give the sample code
Imp-HTML Table Sorting
Imp-HTML Table Sorting   Hi, I am working on a project and as per requirement from client i have to sort a table based on the ID Column. I want... of HTML table sorting where sorting happenes whenever user clicks on column header
ModuleNotFoundError: No module named 'html-table'
'html-table' How to remove the ModuleNotFoundError: No module named 'html...ModuleNotFoundError: No module named 'html-table'  Hi, My Python... have to install padas library. You can install html-table python
Insert a row in 'Mysql' table using JSP Code
Insert a row in 'Mysql' table using JSP Code In this section, we will discuss about how to insert data in Mysql database using JSP code. Query... between your Tomcat server & Mysql database Table. Code to insert row in Mysql
How to export data from html to excel sheet by using java
How to export data from html to excel sheet by using java   How to export data from html to excel sheet by using java
how to validate the telephone number without using jquery in html with javascript
how to validate the telephone number without using jquery in html with javascript  how to validate the telephone number without using jquery in html with javascript
How to export data from html file to excel sheet by using java
How to export data from html file to excel sheet by using java   reading the data from Html file
to upload a table from DB to the same html page
to upload a table from DB to the same html page  how to make this booklist table to be opened in the same html page itself using a third frame
how to use jstl tags?
how to use jstl tags?  I installed jstl jar in my libraries. I got the following error in console screen. I need the solution to resolve this uri in web.xml. please help me.......... "The absolute cannot be resolved
How to export data from html file to excel sheet by using java
How to export data from html file to excel sheet by using java    How to export data from html file to excel sheet by using java

Ads