Basically, my question is simple but it requires someone that knows Struts 1.1 and is still alive.
What I try to build looks like this in Pseudo-Code:
IF element.method1 = true THEN
IF element.method2 = true THEN
COLOR.GREEN, PRINT element.prop1
ELSE
COLOR.RED, PRINT element.prop1
END
ELSE
COLOR.BLACK, PRINT element.prop1
END
The whole thing would happen inside a iteration. So here what is currently working but not yet the goal:
<nested:equal property="method1" value="true">
<nested:write property="prop1" />
</nested:equal>
<nested:notEqual property="method1" value="true">
<nested:write property="prop1" />
</nested:notEqual>
Now what really drives me crazy is that this works as well:
<nested:equal property="method1" value="true">
<nested:equal property="method2" value="true">
</nested:equal>
</nested:equal>
<nested:notEqual property="method1" value="true">
<nested:write property="prop1" />
</nested:notEqual>
But whenever I insert something between the two inner nested:equal
tags it wont compile.
So my final solution (see below) wont compile complaining "Missing Endtag for nested:write."
<nested:equal property="method1" value="true">
<nested:equal property="method2" value="true">
<nested:write property="element.prop1" />
</nested:equal>
</nested:equal>
<nested:notEqual property="method1" value="true">
<nested:write property="element.prop1" />
</nested:notEqual>
After about 4 hours I still don't have a idea how I could manage this so any suggestions would be really appreciated and helps even 2 weeks after this post because my next step is to dig into Struts 1.1 Documentation.
2条答案
按热度按时间hc2pp10m1#
虽然Roman C的解决方案工作得很好,但我也设法将它与嵌套标记放在一起。
很遗憾,我不允许发布原始源代码,但这是什么&它是如何工作的,现在:
lsmd5eda2#
用途
代码如下所示