Não consigo acessar o formulario para inclusão:
@Resource
public class ItemController {
private final DaoFactory daoFactory;
private final Result result;
private final Validator validator;
public ItemController(DaoFactory daoFactory, Result result, Validator validator) {
this.daoFactory = daoFactory;
this.result = result;
this.validator = validator;
}
@Get
@Path("/item/lista")
public Collection<Item> lista() {
return this.daoFactory.getItemDao().listaTudoOrdenado();
}
@Get
@Path("/item/formulario/{item.id}")
public Item formulario(Item item) {
result.include("itens", this.daoFactory.getItemDao().listaTudoOrdenado());
return this.daoFactory.getItemDao().procura(item.getId());
}
@Get
@Path("/item/formularioInclusao")
public void formularioInclusao() {
}
o meu formulario está com o method = “Post”:
/item/formularioInclusao.jsp
quando tento acessar o formulario: “/item/formularioInclusao”
aparece o seguinte erro:
Obs.: Os outros metodos funcionam normalmente. Estou testando somento o acesso a camada de visualização, não implementei o resto (gravação).
exception
br.com.caelum.vraptor.http.InvalidParameterException: unable to parse expression 'item.id'
br.com.caelum.vraptor.http.ognl.OgnlParametersProvider.createViaOgnl(OgnlParametersProvider.java:161)
br.com.caelum.vraptor.http.ognl.OgnlParametersProvider.createRoot(OgnlParametersProvider.java:126)
br.com.caelum.vraptor.http.ognl.OgnlParametersProvider.getParametersFor(OgnlParametersProvider.java:102)
br.com.caelum.vraptor.interceptor.ParametersInstantiatorInterceptor.intercept(ParametersInstantiatorInterceptor.java:77)
br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:57)
br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:71)
br.com.caelum.vraptor.interceptor.InstantiateInterceptor.intercept(InstantiateInterceptor.java:54)
br.com.caelum.vraptor.core.InstantiatedInterceptorHandler.execute(InstantiatedInterceptorHandler.java:51)
br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:71)
br.com.caelum.vraptor.interceptor.multipart.MultipartInterceptor.intercept(MultipartInterceptor.java:61)
br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:57)
br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:71)
br.com.caelum.vraptor.interceptor.InterceptorListPriorToExecutionExtractor.intercept(InterceptorListPriorToExecutionExtractor.java:58)
br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:57)
br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:71)
br.com.caelum.vraptor.core.URLParameterExtractorInterceptor.intercept(URLParameterExtractorInterceptor.java:45)
br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:57)
br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:71)
br.com.caelum.vraptor.interceptor.ResourceLookupInterceptor.intercept(ResourceLookupInterceptor.java:70)
br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:57)
br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:71)
br.com.caelum.vraptor.core.DefaultRequestExecution.execute(DefaultRequestExecution.java:71)
br.com.caelum.vraptor.VRaptor$1.insideRequest(VRaptor.java:99)
br.com.caelum.vraptor.ioc.pico.PicoProvider.provideForRequest(PicoProvider.java:182)
br.com.caelum.vraptor.VRaptor.doFilter(VRaptor.java:97)
cause m�re
ognl.OgnlException: id [java.util.MissingResourceException: Can't find resource for bundle java.util.PropertyResourceBundle, key is_not_a_valid_integer]
ognl.ObjectPropertyAccessor.setPossibleProperty(ObjectPropertyAccessor.java:103)
ognl.ObjectPropertyAccessor.setProperty(ObjectPropertyAccessor.java:162)
ognl.OgnlRuntime.setProperty(OgnlRuntime.java:2225)
ognl.ASTProperty.setValueBody(ASTProperty.java:127)
ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:220)
ognl.SimpleNode.setValue(SimpleNode.java:279)
ognl.ASTChain.setValueBody(ASTChain.java:227)
ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:220)
ognl.SimpleNode.setValue(SimpleNode.java:279)
ognl.Ognl.setValue(Ognl.java:737)
ognl.Ognl.setValue(Ognl.java:783)
br.com.caelum.vraptor.http.ognl.OgnlParametersProvider.createViaOgnl(OgnlParametersProvider.java:152)
br.com.caelum.vraptor.http.ognl.OgnlParametersProvider.createRoot(OgnlParametersProvider.java:126)
br.com.caelum.vraptor.http.ognl.OgnlParametersProvider.getParametersFor(OgnlParametersProvider.java:102)
br.com.caelum.vraptor.interceptor.ParametersInstantiatorInterceptor.intercept(ParametersInstantiatorInterceptor.java:77)
br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:57)
br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:71)
br.com.caelum.vraptor.interceptor.InstantiateInterceptor.intercept(InstantiateInterceptor.java:54)
br.com.caelum.vraptor.core.InstantiatedInterceptorHandler.execute(InstantiatedInterceptorHandler.java:51)
br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:71)
br.com.caelum.vraptor.interceptor.multipart.MultipartInterceptor.intercept(MultipartInterceptor.java:61)
br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:57)
br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:71)
br.com.caelum.vraptor.interceptor.InterceptorListPriorToExecutionExtractor.intercept(InterceptorListPriorToExecutionExtractor.java:58)
br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:57)
br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:71)
br.com.caelum.vraptor.core.URLParameterExtractorInterceptor.intercept(URLParameterExtractorInterceptor.java:45)
br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:57)
br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:71)
br.com.caelum.vraptor.interceptor.ResourceLookupInterceptor.intercept(ResourceLookupInterceptor.java:70)
br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:57)
br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:71)
br.com.caelum.vraptor.core.DefaultRequestExecution.execute(DefaultRequestExecution.java:71)
br.com.caelum.vraptor.VRaptor$1.insideRequest(VRaptor.java:99)
br.com.caelum.vraptor.ioc.pico.PicoProvider.provideForRequest(PicoProvider.java:182)
br.com.caelum.vraptor.VRaptor.doFilter(VRaptor.java:97)
cause m�re
java.util.MissingResourceException: Can't find resource for bundle java.util.PropertyResourceBundle, key is_not_a_valid_integer
java.util.ResourceBundle.getObject(ResourceBundle.java:384)
java.util.ResourceBundle.getString(ResourceBundle.java:344)
br.com.caelum.vraptor.converter.LongConverter.convert(LongConverter.java:55)
br.com.caelum.vraptor.converter.LongConverter.convert(LongConverter.java:1)
br.com.caelum.vraptor.http.ognl.VRaptorConvertersAdapter.convertValue(VRaptorConvertersAdapter.java:68)
ognl.OgnlRuntime.getConvertedType(OgnlRuntime.java:1040)
ognl.OgnlRuntime.getConvertedTypes(OgnlRuntime.java:1057)
ognl.OgnlRuntime.getConvertedMethodAndArgs(OgnlRuntime.java:1083)
ognl.OgnlRuntime.getAppropriateMethod(OgnlRuntime.java:1169)
ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:1183)
ognl.OgnlRuntime.setMethodValue(OgnlRuntime.java:1454)
ognl.ObjectPropertyAccessor.setPossibleProperty(ObjectPropertyAccessor.java:85)
ognl.ObjectPropertyAccessor.setProperty(ObjectPropertyAccessor.java:162)
ognl.OgnlRuntime.setProperty(OgnlRuntime.java:2225)
ognl.ASTProperty.setValueBody(ASTProperty.java:127)
ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:220)
ognl.SimpleNode.setValue(SimpleNode.java:279)
ognl.ASTChain.setValueBody(ASTChain.java:227)
ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:220)
ognl.SimpleNode.setValue(SimpleNode.java:279)
ognl.Ognl.setValue(Ognl.java:737)
ognl.Ognl.setValue(Ognl.java:783)
br.com.caelum.vraptor.http.ognl.OgnlParametersProvider.createViaOgnl(OgnlParametersProvider.java:152)
br.com.caelum.vraptor.http.ognl.OgnlParametersProvider.createRoot(OgnlParametersProvider.java:126)
br.com.caelum.vraptor.http.ognl.OgnlParametersProvider.getParametersFor(OgnlParametersProvider.java:102)
br.com.caelum.vraptor.interceptor.ParametersInstantiatorInterceptor.intercept(ParametersInstantiatorInterceptor.java:77)
br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:57)
br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:71)
br.com.caelum.vraptor.interceptor.InstantiateInterceptor.intercept(InstantiateInterceptor.java:54)
br.com.caelum.vraptor.core.InstantiatedInterceptorHandler.execute(InstantiatedInterceptorHandler.java:51)
br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:71)
br.com.caelum.vraptor.interceptor.multipart.MultipartInterceptor.intercept(MultipartInterceptor.java:61)
br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:57)
br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:71)
br.com.caelum.vraptor.interceptor.InterceptorListPriorToExecutionExtractor.intercept(InterceptorListPriorToExecutionExtractor.java:58)
br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:57)
br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:71)
br.com.caelum.vraptor.core.URLParameterExtractorInterceptor.intercept(URLParameterExtractorInterceptor.java:45)
br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:57)
br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:71)
br.com.caelum.vraptor.interceptor.ResourceLookupInterceptor.intercept(ResourceLookupInterceptor.java:70)
br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:57)
br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:71)
br.com.caelum.vraptor.core.DefaultRequestExecution.execute(DefaultRequestExecution.java:71)
br.com.caelum.vraptor.VRaptor$1.insideRequest(VRaptor.java:99)
br.com.caelum.vraptor.ioc.pico.PicoProvider.provideForRequest(PicoProvider.java:182)
br.com.caelum.vraptor.VRaptor.doFilter(VRaptor.java:97)
Obrigado