关于action接收<s:param>参数,action是有ModelDriven<Book>接口的,在action接收book属性,
String where = "where name = ?"; Object[] queryParams = {book.getName()};这个是查询
语句,若写出
String where = "where name = ?"; Object[] queryParams = {“%”+book.getName()+“%”};是不行的,
可能sql语句错误。
关于jsp页面应该写为
<s:a action="book_findByName" namespace="/book">
<s:param name="book.name" value="'bixiuyi'"></s:param>
必修一
</s:a>
这样就可以传送参数进入action类了;
不过发现若传进中文字符是出现Error Code: 1267 Illegal mix of collations (gbk_chinese_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE)
这个搞了好久,看了很多案例,还是搞不行。