Hello,
 
I did not find an answer in the archives and did not spot anything in
CVS that solves the issue I am having.
 
I am one of the AndroMDA developers, I wrote the bpm4struts cartridge
that enables users to generate deployable/running Struts applications
from UML without any manual coding.
 
Bpm4Struts supports AFAIK all of Struts' features, but I am having some
difficulty with at least one of them, I am using a Struts 1.2.1 dev
snapshot. 
 
The problem is in the javascript tag from the html taglib; when
rendering validation routines in XHTML mode you might have some thing
like this (XHTML and cdata="true"):
 
<script type="text/javascript">
<![CDATA[
 
. javascript here
 
]]>
</script>
 
this is all fine for XHTML, but the browser's javascript engine does not
seem to like it.. Firefox complains silently (you can check it on the
Javascript console) and IE shows a dialog (unless you unchecked that
option), the problem is that the CDATA is being interpreted as
javascript
 
to make sure the javascript parser does not try to read the CDATA
element we would need to add it into javascript comment like this:
 
<script type="text/javascript">
//<![CDATA[
 
. javascript here
 
//]]>
</script>
 
 
this works fine on both browser and is backwards compatible with most
earlier version.
 
I have tested this on my own machine but personally I would like to see
this in the actual release because it would save me a lot of hassle.
 
I fixed it by opening the JavascriptValidatorTag.java source code:
Method getJavascriptBegin:
sb.append("<![CDATA[\r\n");
sb.append("//<![CDATA[\r\n");
Method getJavascriptEnd:
sb.append("//]]>\r\n");
sb.append("//]]>\r\n");
 
 
there is of course the alternative of having this fix via a boolean
attribute or something on the javascript element itself . just in case
someone really wants it without the comments
 
can someone please let me know if this can be fixed, do I need to submit
a bug for this or can my issue be resolved otherwise ?
 
many thanks
-- Wouter
 
 

Reply via email to