Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Spring How to populate an HTML table using jstl code
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


rajib dihingia
How to populate an HTML table using jstl code
0 Answer(s)      4 years and 10 months ago
Posted in : Spring


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>

Advertisement
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 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
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 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
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
how to space images in html code
how to space images in html code  how to space images in html code
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
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 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
How to populate collection like map with annotation in mybatis?
How to populate collection like map with annotation in mybatis?   <collection property="participantCas" column="agmtsID" javaType... tried to map this collection property using annotation. But it didn't work.How
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
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 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
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
HTML Table in javascript
HTML Table in javascript  hi all, how to add last row with sum in table using javascript
how to update table using inner joins
how to update table using inner joins  how to update table using inner joins
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: 1)form.html...=req.getParameter("msg"); res.setContentType("text/html"); PrintWriter
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
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
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
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 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: http://roseindia.net/jsp/servlet-jsp-data-list.shtml Thanks
populate Combo Box dynamically
populate Combo Box dynamically  Hi, How to populate the Combo Box dynamically using Flex with Jsp's
 

 

 

DMCA.com