I've created a tiny little test to how I would handle the http request parameters coming from a simple dynamic form in JSP using JSTL and EL, but I'm running into some issues for some reason.
It seems to be fairly straight forward, but the end result is just that the literal EL code gets printed to the screen.
I have this sneaky suspicion that something fundamentally is wrong, since the EL doesn't even seem to be executed, but rather just dumpt the actual text.
Thoughts, ideas or obvious fails I did here ?
Code:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<script src="js/jquery-2.0.3.min.js" language="Javascript" type="text/javascript"></script>
<c:forEach items="${param}" var="par">
Parameter Name/Value : <c:out value="${par} - ${par.value}"/>
</c:forEach>
<script>
jQuery(function($) {
var $button = $('#add-row'),
$row = $('.key-value-row').clone();
$button.click(function() {
$row.clone().insertBefore($button);
});
});
</script>
<body>
<form action="#" method="POST">
<fieldset id="key-value-rows">
<legend>Add Entries</legend>
<div class="key-value-row">
<label>Attribute Key:
<input type="text" name="attribute_key" width="50" />
</label>
<label>Attribute Value:
<input type="text" name="attribute_value" width="50" />
</label>
</div>
<input type="button" id="add-row" name="add-row" value="Add row" />
<input type="submit" id="submit-form" name="submit-form" value="Submit" />
</fieldset>
</form>
</body>