express. evaluation fails using ProductImpl and MyProducImpl
Posted: Fri Nov 22, 2013 10:46 am
Hello
I have extended the ProductImpl into SeaProductImpl adding a field compuzzProduct_UID which is a reference to an external database.
When creating a new product, the admin UI asks me to select one of the following product types: Product, Product Bundle and SeaProductImpl. I choose SeaProductImpl and I can create a product with this new field.
I have then changed the template catalog/product.html to show the new field just below the manufacturer name:
<div id="maker" th:text="*{manufacturer}"></div>
<div id="maker" th:text="*{compuzzProduct_UID}"></div>
When executing the page in the DemoSite on a Product of Type SeaProductImpl, everything is fine and the new info is shown.
When I do the same on a product of type 'ProductImpl' (like a T-shirt), I get the following stack trace:
HTTP ERROR 500
Problem accessing /merchandise/hawt_like_a_habanero_mens. Reason:
Exception evaluating SpringEL expression: "compuzzProduct_UID" (catalog/product:23)
Caused by:
org.thymeleaf.exceptions.TemplateProcessingException: Exception evaluating SpringEL expression: "compuzzProduct_UID" (catalog/product:23)
at org.thymeleaf.spring3.expression.SpelVariableExpressionEvaluator.evaluate(SpelVariableExpressionEvaluator.java:109)
at org.thymeleaf.standard.expression.SelectionVariableExpression.executeSelectionVariable(SelectionVariableExpression.java:107)
at org.thymeleaf.standard.expression.SimpleExpression.executeSimple(SimpleExpression.java:407)
at org.thymeleaf.standard.expression.Expression.execute(Expression.java:229)
This seams quit logical to me as the ProductImpl does not know about that new field.
How can I instruct thymeleaf to test if the current product is of type SeaProductImpl and to remove the tag when it has a different type ?
Thxs for any help or idea
I have extended the ProductImpl into SeaProductImpl adding a field compuzzProduct_UID which is a reference to an external database.
When creating a new product, the admin UI asks me to select one of the following product types: Product, Product Bundle and SeaProductImpl. I choose SeaProductImpl and I can create a product with this new field.
I have then changed the template catalog/product.html to show the new field just below the manufacturer name:
<div id="maker" th:text="*{manufacturer}"></div>
<div id="maker" th:text="*{compuzzProduct_UID}"></div>
When executing the page in the DemoSite on a Product of Type SeaProductImpl, everything is fine and the new info is shown.
When I do the same on a product of type 'ProductImpl' (like a T-shirt), I get the following stack trace:
HTTP ERROR 500
Problem accessing /merchandise/hawt_like_a_habanero_mens. Reason:
Exception evaluating SpringEL expression: "compuzzProduct_UID" (catalog/product:23)
Caused by:
org.thymeleaf.exceptions.TemplateProcessingException: Exception evaluating SpringEL expression: "compuzzProduct_UID" (catalog/product:23)
at org.thymeleaf.spring3.expression.SpelVariableExpressionEvaluator.evaluate(SpelVariableExpressionEvaluator.java:109)
at org.thymeleaf.standard.expression.SelectionVariableExpression.executeSelectionVariable(SelectionVariableExpression.java:107)
at org.thymeleaf.standard.expression.SimpleExpression.executeSimple(SimpleExpression.java:407)
at org.thymeleaf.standard.expression.Expression.execute(Expression.java:229)
This seams quit logical to me as the ProductImpl does not know about that new field.
How can I instruct thymeleaf to test if the current product is of type SeaProductImpl and to remove the tag when it has a different type ?
Thxs for any help or idea