Hi,
I'm having a problem rendering jspx in webflow environment because of the following error:
Using the same tag in a Spring MVC environment works fine (the converter is used as expected).Code:SEVERE: Servlet.service() for servlet jsp threw exception org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from 'domain.shared.Status' to 'java.lang.String' at org.springframework.core.convert.support.GenericConversionService.convert(GenericConversionService.java:181) at org.springframework.expression.spel.support.StandardTypeConverter.convertValue(StandardTypeConverter.java:66) at org.springframework.expression.common.ExpressionUtils.convertTypedValue(ExpressionUtils.java:67) at org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:98) at org.springframework.web.servlet.tags.EvalTag.doEndTag(EvalTag.java:122) at org.apache.jsp.tag.web.form.fields.display_tagx._jspx_meth_spring_005feval_005f0(display_tagx.java:794) at org.apache.jsp.tag.web.form.fields.display_tagx._jspx_meth_c_005fotherwise_005f0(display_tagx.java:767) at org.apache.jsp.tag.web.form.fields.display_tagx._jspx_meth_c_005fchoose_005f0(display_tagx.java:562) at org.apache.jsp.tag.web.form.fields.display_tagx._jspx_meth_c_005fif_005f0(display_tagx.java:283) at org.apache.jsp.tag.web.form.fields.display_tagx.doTag(display_tagx.java:230)
I'm working with:
Spring Roo 1.1
Spring 3.0.5
Spring webflow 2.2.1
Tiles
The relevant webflow configuration is:
Using the debugger, I can see the problem is the conversion service is not found by the EvalTag in the PageContext, so a new one is created and used (with the default converters only):Code:... <webflow:flow-builder-services id="flowBuilderServices" view-factory-creator="mvcViewFactoryCreator" conversion-service="webflowConversionService" development="true" /> <bean id="coreConversionService" class="org.springframework.format.support.FormattingConversionServiceFactoryBean"> <property name="converters"> <set> <bean class="converter.StatusConverter" /> <-- my converter </set> </property> </bean> <bean id="webflowConversionService" class="org.springframework.binding.convert.service.DefaultConversionService"> <constructor-arg ref="coreConversionService"/> </bean> ...
EvalTag class:
in the snippet above, the problem is that "getConversionService(PageContext)" returns null when the JSP is rendered in webflow. In Spring MVC, the same method returns the "coreConversionService".Code:private EvaluationContext createEvaluationContext(PageContext pageContext) { StandardEvaluationContext context = new StandardEvaluationContext(); context.addPropertyAccessor(new JspPropertyAccessor(pageContext)); context.setBeanResolver(new BeanFactoryResolver(getRequestContext().getWebApplicationContext())); ConversionService conversionService = getConversionService(pageContext); if (conversionService != null) { context.setTypeConverter(new StandardTypeConverter(conversionService)); } return context; } private ConversionService getConversionService(PageContext pageContext) { return (ConversionService) pageContext.getRequest().getAttribute(ConversionService.class.getName()); }
Do you know why? What am I missing?
I also tried to define an ExpressionParser wired with my conversion service (that I think is not needed), but didn't work...
Code:<bean id="webflowExpressionParser" class="org.springframework.webflow.expression.spel.WebFlowSpringELExpressionParser"> <constructor-arg> <bean class="org.springframework.expression.spel.standard.SpelExpressionParser" /> </constructor-arg> <constructor-arg ref="webflowConversionService" /> </bean>
Thanks you.


Reply With Quote
