Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Custom Tag for javascript
Custom Tag for javascript [message #183585] Thu, 30 November 2006 14:25 Go to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 2342
Registered: July 2009
Senior Member
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 WTP, IBM
Re: Custom Tag for javascript [message #183884 is a reply to message #183771] Thu, 07 December 2006 15:39 Go to previous message
Eclipse UserFriend
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
Previous Topic:Add a ejb JAR in my EAR project
Next Topic:Custom Dynamic web project with facet template.
Goto Forum:
  


Current Time: Mon Dec 22 05:36:34 GMT 2014

Powered by FUDForum. Page generated in 0.01758 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software