tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gokhan <>
Subject whats up with sql:param
Date Thu, 16 Jun 2005 21:55:22 GMT

I just need to approve just something in site without disturbing general 
MVC logic.
And decided JSTL sql:query facility.

I am in test.jsp and i can send user to another page with
<a href="another_page.jsp?testnumber=2">Another Page</a>
And on another_page.jsp i just need to insert this testnumber to table 
as a parameter.

I can see the value with <c:out value="${param.testnumber}"/>. yes 
exactly i can see the number 2 on there.
it means i can get this value from param.testnumber right?

When i want to assign this value to sql query

<sql:update dataSource="jdbc/zobarenk">
insert into test_table (testnumber_id) values (?)

<fmt:parseNumber var="roll" value="${param.testnumber}"/> //Since it is 
<sql:param value="${roll}"/>

or with <sql:param><%request.getParameter("testnumber");%></sql:param>
or with <sql:param><c:out value="${param.testnumber}"/></sql:param>
or assign variable directly to the page scope and get it from there with
<c:set var="testnumber_sucks" value="${param.testnumber}" scope="page" />
<sql:param value="${pageScope.testnumber_sucks}"/></sql:update>

At the end of the all bloody ways i tried, i have this lovely error;
ERROR: null value in column "testnumber_id" violates not-null constraint
Because nothing inside of this lovely testnumber variable.
If i could have type conversion error i would be really happy, but i 
have null.

My question is, if this variable param.testnumber is empty or null how
can i see the value of this parameter with c:out ?
If i can see this bloody value how i can't insert it to the table with 
sql:param with the methods above.

Would it be related to _rt stuff or something?
I am using latest jstl 1.1.2 taglibs

Take care all,

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message