Posted on July 17, 2008, 10:04, by stefan, under
coding.
When trying to deploy an AppFuse application on Tomcat I received the following error: org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: 153 in the generated java file Type mismatch: cannot convert from null to int An error occurred at line: 168 in the generated java file Cannot cast from Object [...]
Posted on July 9, 2008, 10:50, by stefan, under
coding.
I had some problems getting date fields to work (and return a friendly error message) so here comes a little documentation for future reference. This was in an AppFuse based Spring Framework project. The model contains a java.util.Date property and simply exposing it as usual in a form will cause an exception since Spring doesn’t [...]
Posted on July 3, 2008, 11:03, by stefan, under
coding.
Using the LIKE condition with a “%” sign for pattern matching in a HQL query with named parameters required some tweaking. This did not work: String query = "from user u where u.name like %:name%" getHibernateTemplate().findByNamedParam(query, "name", str); It resulted in a org.hibernate.QueryException: unexpected char: ‘%’ error. Next I tried using single quotes: String query [...]
Posted on July 1, 2008, 6:53, by stefan, under
coding.
Spring Framework provides the convenient form:options tag to render a list of <option> tags for a form <select>. Here is an example: <form:select id="status" path="status" cssClass="text large" cssErrorClass="text large error" > <form:options items="${statusList}" itemValue="id" itemLabel="label"></form:options> </form:select> It does iteratate through statusList and will output each item as an option with the value statusList[i].id and the [...]