How to populate an HTML table using jstl code

Ads
 

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

Ads









Related Tutorials/Questions & Answers:
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
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
Advertisements
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
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 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
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
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
how to space images in html code
how to space images in html code  how to space images in html code
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
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 update table using inner joins
how to update table using inner joins  how to update table using inner joins
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
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
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
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
HTML Table in javascript
HTML Table in javascript  hi all, how to add last row with sum in table using javascript
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
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 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
How to retrive database information using servlet and disply in table format in browser
How to retrive database information using servlet and disply in table format in browser  Hi, any one send code how to retrive the data base information in table format in web browser
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
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
How to export the table content from an webpage to excel using java?
How to export the table content from an webpage to excel using java?  How to export the table content from an webpage to excel using java? The table contents are generated dynamically in that java page
How to export the table content from an webpage to excel using java?
How to export the table content from an webpage to excel using java?  How to export the table content from an webpage to excel using java? The table contents are generated dynamically in that java page
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
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
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

Ads