Hi,
I've been playing around with Roo and ran into a problem when using non-Long type identifiers.
Here is the roo script for creating the entities:
Code:entity --class ~.domain.Users --identifierField username --identifierType java.lang.String field string --class ~.domain.Users --fieldName password --sizeMax 50 --sizeMin 6 --notNull field boolean --class ~.domain.Users --fieldName enabled entity --class ~.domain.Authorities field reference --class ~.domain.Authorities --fieldName username --type ~.domain.Users controller all --package ~.web
The Users entity has a string identifier type rather than the default Long.
When trying to create an Authority entry using the roo-generated web interface I get the following error:
I managed to get it to work by editing the create.jspx file in the authorities directory and changing:Code:IO Error executing tag: JSPException including path '/WEB-INF/views/authorities/create.jspx'. org.apache.tiles.util.TilesIOException: JSPException including path '/WEB-INF/views/authorities/create.jspx'. at org.apache.tiles.servlet.context.ServletUtil.wrapServletException(ServletUtil.java:232) at org.apache.tiles.jsp.context.JspTilesRequestContext.include(JspTilesRequestContext.java:105) at org.apache.tiles.jsp.context.JspTilesRequestContext.dispatch(JspTilesRequestContext.java:96) at org.apache.tiles.renderer.impl.UntypedAttributeRenderer.write(UntypedAttributeRenderer.java:61) at org.apache.tiles.renderer.impl.AbstractBaseAttributeRenderer.render(AbstractBaseAttributeRenderer.java:103) at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:669) at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:337) at org.apache.tiles.jsp.taglib.InsertAttributeTag.render(InsertAttributeTag.java:234) at org.apache.tiles.jsp.taglib.InsertAttributeTag.render(InsertAttributeTag.java:211) at org.apache.tiles.jsp.taglib.RenderTag.doEndTag(RenderTag.java:220) at org.apache.jsp.WEB_002dINF.layouts.default_jspx._jspx_meth_tiles_005finsertAttribute_005f1(default_jspx.java:490) at org.apache.jsp.WEB_002dINF.layouts.default_jspx._jspService(default_jspx.java:145)
toCode:<form:options itemValue="id" items="${userses}"/>
Obviously Roo changes this back when ever the Users.java file is changed.Code:<form:options itemValue="username" items="${userses}"/>
As far as I can tell the problem only occurs when using a different identifier type. I tried only it using a different identifier column name which works fine.
Is this a known problem or am I missing something?
Sean


Reply With Quote
