Custom Tag for javascript [message #183585] |
Thu, 30 November 2006 14:25 |
Eclipse User |
|
|
|
Originally posted by: virtroli.gmx.at
Hello,
we have implemented a custom tag for javascript:
In this Tag Body we can write Javascript anywhere in the JSP Body, and it
appears in the Head of the resulting HTML.
Example
<ctag:javascript .....>
function testAlertJS() {
if (5 < 4) {
alert("Thats not possible");
}
}
</ctag:javascript>
This Taghandler works fine with oc4j!
But Eclipse WTP detects errors in the JSP page, because it does not
recognize,
that the Body of the Custom Tag contains javascript.
If i would write my code in the default style it would be OK for WTP:
<script language="javascript">
function testAlertJS() {
if (5 < 4) {
alert("Thats not possible");
}
}
</script>
Here my Question:
Is there a way to say eclipse WTP that the tag <ctag:javascript .....> is
equal <script ....> Tag?
thanks,
roland
|
|
|
Re: Custom Tag for javascript [message #183595 is a reply to message #183585] |
Thu, 30 November 2006 15:18 |
Eclipse User |
|
|
|
Originally posted by: mohsen.siahe.com
Perhaps making the script CDATA, solves the problem.
"Roli" <virtroli@gmx.at> wrote in message
news:ekmpk8$8bl$1@utils.eclipse.org...
> Hello,
>
> we have implemented a custom tag for javascript:
> In this Tag Body we can write Javascript anywhere in the JSP Body, and it
> appears in the Head of the resulting HTML.
> Example
> <ctag:javascript .....>
> function testAlertJS() {
> if (5 < 4) {
> alert("Thats not possible");
> }
> }
> </ctag:javascript>
>
> This Taghandler works fine with oc4j!
> But Eclipse WTP detects errors in the JSP page, because it does not
> recognize,
> that the Body of the Custom Tag contains javascript.
>
> If i would write my code in the default style it would be OK for WTP:
> <script language="javascript">
> function testAlertJS() {
> if (5 < 4) {
> alert("Thats not possible");
> }
> }
> </script>
>
> Here my Question:
> Is there a way to say eclipse WTP that the tag <ctag:javascript .....> is
> equal <script ....> Tag?
>
> thanks,
> roland
>
|
|
|
Re: Custom Tag for javascript [message #183771 is a reply to message #183585] |
Wed, 06 December 2006 06:00 |
|
Roli wrote:
> Hello,
>
> we have implemented a custom tag for javascript:
> In this Tag Body we can write Javascript anywhere in the JSP Body, and
> it appears in the Head of the resulting HTML.
> Example
> <ctag:javascript .....>
....
> This Taghandler works fine with oc4j!
> But Eclipse WTP detects errors in the JSP page, because it does
not recognize,
> that the Body of the Custom Tag contains javascript.
....
> Here my Question:
> Is there a way to say eclipse WTP that the tag <ctag:javascript .....>
> is equal <script ....> Tag?
Not currently, as there's nothing in the JSP spec that I know of
that does so. If tag declares that its bodycontent is
"tagdependent", then editor will correctly ignore the contents, but
there's no way to further tell it that the contents are JavaScript.
What error messages are you seeing?
--
Nitin Dahyabhai
Structured Source Editor
_
Nitin Dahyabhai
Eclipse Web Tools Platform
|
|
|
Re: Custom Tag for javascript [message #183884 is a reply to message #183771] |
Thu, 07 December 2006 15:39 |
Eclipse User |
|
|
|
Originally posted by: virtroli.gmx.at
I see not really errormessages,
but the whole JSP after this Start Tag is underlined red.
This seems to cause eclipse workbench to use 100% of cpu power,
the cursor stops, workbench is inaccessable for aprox 20 sec.
and this occurs sometimes on each Character you write.
Short Keys for copy and so on do not function anymore.
when i change the custom tag to the default <script Tag,
the jsp is editable in normal way
therefor i think this red underlined causes eclipse to becom instable
"Nitin Dahyabhai" <nitind@us.ibm.com> schrieb im Newsbeitrag
news:el5m9m$kje$1@utils.eclipse.org...
> Roli wrote:
>> Hello,
>>
>> we have implemented a custom tag for javascript:
>> In this Tag Body we can write Javascript anywhere in the JSP Body, and it
>> appears in the Head of the resulting HTML.
>> Example
>> <ctag:javascript .....>
> ...
> > This Taghandler works fine with oc4j!
> > But Eclipse WTP detects errors in the JSP page, because it does
> not recognize,
> > that the Body of the Custom Tag contains javascript.
> ...
>> Here my Question:
>> Is there a way to say eclipse WTP that the tag <ctag:javascript .....> is
>> equal <script ....> Tag?
>
> Not currently, as there's nothing in the JSP spec that I know of that does
> so. If tag declares that its bodycontent is "tagdependent", then editor
> will correctly ignore the contents, but there's no way to further tell it
> that the contents are JavaScript. What error messages are you seeing?
>
> --
> Nitin Dahyabhai
> Structured Source Editor
|
|
|
Powered by
FUDForum. Page generated in 0.20128 seconds