tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jack Lauman <jlau...@nwcascades.com>
Subject JSTL 1.0.5 Update Question
Date Sun, 13 Jun 2004 21:03:17 GMT
I'm using the following code to insert data from a form.
The first to fields in the data base don't come from form fields but 
from entries in the web.xml file.  How do you insert the web.xml value 
of: <%application.getInitParameter("descriptiveName")%> when updating a 
record?

<--- snip -->

<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>
<%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql" %>
<%@ taglib prefix="x" uri="http://java.sun.com/jstl/xml" %>
<%@ taglib prefix="nwc" uri="http://nwcascades.com" %>

<html><head>
<base href="http://<%=application.getInitParameter("baseUrl")%>/">
</head>

<jsp:useBean id="now" class="java.util.Date"/>
<fmt:formatDate value="${now}" var="submit_date" pattern="yyyy-MM-dd"/>
<fmt:formatDate value="${now}" var="submit_time" pattern="HH:mm:ss"/>

<jsp:useBean id="signmeupInfo" scope="request" 
class="com.nwc.biteof.forms.SignmeupInfoBean">
	<jsp:setProperty name="signmeupInfo" property="*"/>
</jsp:useBean>

<c:choose>
	<c:when test="${signmeupInfo.valid}">
		<sql:setDataSource
			var="restaurants"
			dataSource="jdbc/RestaurantDS"/>
		
		
		<sql:update dataSource="${restaurants}">
			INSERT INTO SignMeUp
			(website, code, name, cuisine, owner, address1, address2, city, 
state, zip, country, email, phone, fax, message, submit_date, submit_time)
			VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
			<sql:param value="<%application.getInitParameter("descriptiveName")%>"/>
			<sql:param value="<%application.getInitParameter("websiteName")%>"/>
			<sql:param value="${signmeupInfo.name}"/>
			<sql:param value="${signmeupInfo.cuisine}"/>
			<sql:param value="${signmeupInfo.owner}"/>
			<sql:param value="${signmeupInfo.address1}"/>
			<sql:param value="${signmeupInfo.address2}"/>
			<sql:param value="${signmeupInfo.city}"/>
			<sql:param value="${signmeupInfo.state}"/>
			<sql:param value="${signmeupInfo.zip}"/>
			<sql:param value="${signmeupInfo.country}"/>
			<sql:param value="${signmeupInfo.email}"/>
			<sql:param value="${signmeupInfo.phone}"/>
			<sql:param value="${signmeupInfo.fax}"/>
			<sql:param value="${signmeupInfo.comments}"/>
			<sql:param value="${submit_date}"/>
			<sql:param value="${submit_time}"/>
		</sql:update>



---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Mime
View raw message