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 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
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 HTML code to servlet to database using jdbcHTML 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
Error in using jstl tagsError 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
Populate a combo box using data from a databasePopulate 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 codeHTML code
How do I keep people from stealing my source
code and/or images
How to hide HTML code from user? - SecurityHow 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 Jqueryhow 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 layoutHTML 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 jsphow 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
table.
Code :
<!DOCTYPE
html PUBLIC "
how to display a table from database using servlethow 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 htmlhow 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 borderhtml 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<
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 CodeInsert 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 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