You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by "LA ROSA, Giuseppe, VF-IT" <Gi...@vodafone.com> on 2009/03/13 11:52:22 UTC
iBatis , JSP & classes
Hi,
I have a strange problem with Eclipse when I use iBatis .
I use the follow xml files (iBatis) :
Ibatis-config.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMapConfig PUBLIC "-//iBATIS.com//DTD SQL Map Config
2.0//EN" "http://www.ibatis.com/dtd/sql-map-config-2.dtd">
<sqlMapConfig>
<settings
cacheModelsEnabled="true"
maxRequests="32"
maxSessions="100"
maxTransactions="100"/>
<transactionManager type="JDBC">
...
</transactionManager>
<sqlMap resource="select.xml"/>
</sqlMapConfig>
Select.xml
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE sqlMap PUBLIC
"-//iBATIS.com//DTD SQL Map 2.0//EN"
"http://www.ibatis.com/dtd/sql-map-config-2.dtd"> <sqlMap
namespace="ITILDB">
<select id="selUsers" resultClass="hpgrit.Users"> SELECT id, username
FROM Users </select>
<select id="selServers" resultClass="hpgrit.Servers"> SELECT id, host
FROM Servers </select>
</sqlMap>
The follow code :
List<Users> users =(List<Users>) sqlMap.queryForList("selUsers") ;
works fine inside java classes, but return the follow error when I run
it inside a JSP page :
com.ibatis.sqlmap.client.SqlMapException: There is no statement named
SelUsers in this SqlMap
Why JSP is able to use SelServers statement but no SelUsers ?
Can be a Eclipse or Tomcat's problem ?
Best
Giuseppe
RE: iBatis , JSP & classes
Posted by "LA ROSA, Giuseppe, VF-IT" <Gi...@vodafone.com>.
-----Original Message-----
From: Ingmar Lötzsch [mailto:iloetzsch@asci-systemhaus.de]
>SelUsers
>^
>A typo somewhere in your DAOs?
I'm a dummy, I write selUsers in java class and SelUsers in JSP. I cannot believe in it !!!
Thank's 4 your support.
Best
Giuseppe
Re: iBatis , JSP & classes
Posted by Ingmar Lötzsch <il...@asci-systemhaus.de>.
> works fine inside java classes, but return the follow error when I run
> it inside a JSP page :
> com.ibatis.sqlmap.client.SqlMapException: There is no statement named
> SelUsers in this SqlMap
SelUsers
^
A typo somewhere in your DAOs?