Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #29811

Issue in JSTL Programming (Is there any error in this code and why it does not save Data in Database?)

Newsgroups comp.lang.java.programmer
Date 2014-08-22 13:42 -0700
Message-ID <1df5f125-0868-4293-b9d5-44585f35c530@googlegroups.com> (permalink)
Subject Issue in JSTL Programming (Is there any error in this code and why it does not save Data in Database?)
From muhammad danish Khan <silentlips14.92@gmail.com>

Show all headers | View raw


I am just newbie to Expression language(el).

This is the code.

Before applying condition it was working correctly. Is there any error in Condition.

Non of My Parameter was empty....

I also check and instead of && and then it gives exception faild to parse EL Expression

    <c:if test="${not empty param.firstName && not empty param.lastName && 
            not empty param.fatherName && not empty param.gender && not empty param.day &&
            not empty param.month && not empty param.year && 
            not empty param.classNo && not empty param.address} ">

    <fmt:parseDate var="date" value="${param.day}-${param.month}-${param.year}" type="DATE"  
    pattern="dd-MM-yyyy" />
            
    <sql:update dataSource="${StdData }" scope="page" var="result">

	INSERT INTO students(FirstName,LastName,FatherName,Gender,DateOfBirth,Class,Address)  
    VALUES (?,?,?,?,?,?,?);
	<sql:param value="${param.firstName}" />
	
	<sql:param value="${param.lastName}" />
	
	<sql:param value="${param.fatherName}" />
	
	<sql:param value="${param.gender}"></sql:param>
	
	<sql:param value="${date}" />
	
	<sql:param value="${param.classNo}" />
	
	<sql:param value="${param.address}" />

    </sql:update>


    </c:if>	

I am just wondering why this code prints all parameters while the above code do not save data to database and also if i print data there it does not show on page.


<c:if test="${not empty param.firstName && not empty param.lastName && 
            not empty param.fatherName && not empty param.gender && 
            not empty param.day && not empty param.month && 
            not empty param.year && 
            not empty param.classNo && not empty param.address}">
            
        <c:out value="${param.firstName}"></c:out>
        <c:out value="${param.lastName}"></c:out>
        <c:out value="${param.fatherName}"></c:out>
        <c:out value="${param.gender}"></c:out>
        <c:out value="${param.day}/"></c:out>
        <c:out value="${param.month}/"></c:out>
        <c:out value="${param.year}"></c:out>
        <c:out value="${param.classNo}"></c:out>
        <c:out value="${param.address}"></c:out>
    </c:if>
 

Back to comp.lang.java.programmer | Previous | Next | Find similar | Unroll thread


Thread

Issue in JSTL Programming (Is there any error in this code and why it does not save Data in Database?) muhammad danish Khan <silentlips14.92@gmail.com> - 2014-08-22 13:42 -0700

csiph-web