0

Hi,

I need to create dynamic table in jsp and submit data to the server. What is the best way to do this?
Anyone has sample code?

thanks in advance,
bvssn

Edited by peter_budo: Do not use CODE SNIPPED for asking questions. Use FORUM HREAD!

2
Contributors
1
Reply
3
Views
7 Years
Discussion Span
Last Post by ddempsey96
0

Here is an example for the 1st part (creating a dynamic table) using JSP. You can only do this if you have the JSTL libraries. If you don't have them, you will need to use Java to generate the tags. Let us know if you need an example of that:

<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"  %>

<!-- Quirk on -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<script language="Javascript" type="text/javascript" src="/ajax/ajaxLib.js">
</script> 

<script language="Javascript" type="text/javascript">

	function loadRpt() {
		loadXmlData("http://wfgsust.pp.iw.gm.com/darItem.jsp?time=" + new Date().getTime(),"itmFrame","nothing");		

	}
	
</script>


<html>
<body onLoad="loadRpt();">
	<% out.write( "Testing .." +  request.getHeader("cn")); %>
	<table>
	<c:forEach var="hdr" items="${headerValues}">
	<tr>
		<td><c:out value="${hdr.key}"/></td>
			<c:forEach var="val" items="${hdr.value}">
				<td><c:out value="${val}"/></td>
			</c:forEach>
	</tr>
	</c:forEach>
	<tr>
	<td>User ID:</td>	
	
	</tr>
	</table>
	<div id="tabFrame">
		<form name="tabForm" >
		Testing Ajax....
		<input name="myId" type="text" />
		<input type="button" value="Refresh" onclick="loadRpt();"/>
		</form>
	</div>
	
	<div id="itmFrame" style="height:500px; width:500px;">
		 
	</div>
	<!~-   -->
</body>
</html>

There are different ways to submit data. Do you want the users to fill out a form and submit that data?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.