Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » JSP validation foobar'd by my syntax
JSP validation foobar'd by my syntax [message #207677] Tue, 29 January 2008 11:43 Go to next message
Eclipse User
Originally posted by: adam.hardy.no.spam.cyberspaceroad.spam

Eclipse's latest JSP validator with WTP 2.0.1.v20070911 is great and has dealt
with most of the stuff I throw at it.

I finally put a spanner in the works with this piece of JSP and the JSP
validator doesn't like it at all. The minimum test case I could reduce it to is
the following:

<%@ taglib prefix="a" uri="http://www.permacode.org/taglib/atomic-1.0" %>
<input type="submit" id="speciesSubmit"
value="${a:translate('general.submit.button')}"
name="method:save" />
<input type="reset" value="${a:translate('general.reset.button')}"/>
<input type="submit" name="method:cancel"
value="${a:translate('general.cancel.button')}"/>

The errors don't make sense:

Syntax error on token "throws", delete this token

or

Syntax error on token ",", . expected

or a combination of up to 6!

Is this a bug or is any of the syntax I'm using just not accepted by the validator?


Thanks
Adam
Re: JSP validation foobar'd by my syntax [message #207731 is a reply to message #207677] Tue, 29 January 2008 13:34 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin Dahyabhai
Messages: 2142
Registered: July 2009
Senior Member
adam hardy wrote:
> Eclipse's latest JSP validator with WTP 2.0.1.v20070911 is great and has
> dealt with most of the stuff I throw at it.
>
> I finally put a spanner in the works with this piece of JSP and the JSP
> validator doesn't like it at all. The minimum test case I could reduce
> it to is the following:
>
> <%@ taglib prefix="a"
> uri="http://www.permacode.org/taglib/atomic-1.0" %>
> <input type="submit" id="speciesSubmit"
> value="${a:translate('general.submit.button')}"
> name="method:save" />
> <input type="reset" value="${a:translate('general.reset.button')}"/>
> <input type="submit" name="method:cancel"
> value="${a:translate('general.cancel.button')}"/>
>
> The errors don't make sense:
>
> Syntax error on token "throws", delete this token
>
> or
>
> Syntax error on token ",", . expected
>
> or a combination of up to 6!
>
> Is this a bug or is any of the syntax I'm using just not accepted by the
> validator?

It doesn't cause any validation messages that I can see, but I do
not have the tag library you're using. Does it vary with the amount
of EL you're using?

---
Nitin Dahyabhai
Eclipse WTP Source Editing
IBM Rational


---
Nitin Dahyabhai
Eclipse WTP, IBM
Re: JSP validation foobar'd by my syntax [message #207746 is a reply to message #207731] Tue, 29 January 2008 14:06 Go to previous messageGo to next message
Eclipse User
Originally posted by: adam.hardy.no.spam.cyberspaceroad.spam

Nitin Dahyabhai on 29/01/08 18:34, wrote:
> adam hardy wrote:
>> Eclipse's latest JSP validator with WTP 2.0.1.v20070911 is great and
>> has dealt with most of the stuff I throw at it.
>>
>> I finally put a spanner in the works with this piece of JSP and the
>> JSP validator doesn't like it at all. The minimum test case I could
>> reduce it to is the following:
>>
>> <%@ taglib prefix="a"
>> uri="http://www.permacode.org/taglib/atomic-1.0" %>
>> <input type="submit" id="speciesSubmit"
>> value="${a:translate('general.submit.button')}"
>> name="method:save" />
>> <input type="reset" value="${a:translate('general.reset.button')}"/>
>> <input type="submit" name="method:cancel"
>> value="${a:translate('general.cancel.button')}"/>
>>
>> The errors don't make sense:
>>
>> Syntax error on token "throws", delete this token
>>
>> or
>>
>> Syntax error on token ",", . expected
>>
>> or a combination of up to 6!
>>
>> Is this a bug or is any of the syntax I'm using just not accepted by
>> the validator?
>
> It doesn't cause any validation messages that I can see, but I do not
> have the tag library you're using. Does it vary with the amount of EL
> you're using?

Maybe my validation error is because of my taglibrary - I replaced the function
calls with JSTL standard fn:length() and the errors vanished.

I was unable to find anything more than rudimentary documentation about writing
functions in taglibraries, so I don't know what goes on to validate or process
them.

This ${a:translate()} must require some more config than I have given it. I
simply wrote the class and included it in my TLD like this:

<function>
<name>translate</name>
<function-class>org.permacode.atomic.JspFunctionLibrary</function-class >
<function-signature>
java.lang.String translate(java.lang.String)
</function-signature>
</function>

What more is required? Is there a URL to documentation on this that provides
more than the JEE 1.5 tutorial?

Thanks
Adam
Re: JSP validation foobar'd by my syntax [message #208457 is a reply to message #207746] Mon, 11 February 2008 11:21 Go to previous message
Eclipse User
Originally posted by: adam.hardy.no.spam.cyberspaceroad.spam

adam hardy on 29/01/08 19:06, wrote:
> Nitin Dahyabhai on 29/01/08 18:34, wrote:
>> adam hardy wrote:
>>> <%@ taglib prefix="a"
>>> uri="http://www.permacode.org/taglib/atomic-1.0" %>
>>> <input type="submit" id="speciesSubmit"
>>> value="${a:translate('general.submit.button')}"
>>> name="method:save" />
>>> <input type="reset" value="${a:translate('general.reset.button')}"/>
>>> <input type="submit" name="method:cancel"
>>> value="${a:translate('general.cancel.button')}"/>
>>>
>>> The errors don't make sense:
>>>
>>> Syntax error on token "throws", delete this token
>>>
>>> or
>>>
>>> Syntax error on token ",", . expected
>>>
>>> or a combination of up to 6!
>>>
>>> Is this a bug or is any of the syntax I'm using just not accepted by
>>> the validator?
>>
>> It doesn't cause any validation messages that I can see, but I do not
>> have the tag library you're using. Does it vary with the amount of EL
>> you're using?
>
> Maybe my validation error is because of my taglibrary - I replaced the
> function calls with JSTL standard fn:length() and the errors vanished.
>
> I was unable to find anything more than rudimentary documentation about
> writing functions in taglibraries, so I don't know what goes on to
> validate or process them.
>
> This ${a:translate()} must require some more config than I have given
> it. I simply wrote the class and included it in my TLD like this:
>
> <function>
> <name>translate</name>
>
> <function-class>org.permacode.atomic.JspFunctionLibrary</function-class >
> <function-signature>
> java.lang.String translate(java.lang.String)
> </function-signature>
> </function>
>
> What more is required? Is there a URL to documentation on this that
> provides more than the JEE 1.5 tutorial?

I'm hoping that someone will be able to tell me what the JSP validator is
inspecting behind the scenes which causes it to throw a validation error with my
taglib.

Thanks in advance,
Adam
Previous Topic:Problem using wizardPages extension point - custom page does not display
Next Topic:import JSP from an other project in the build path
Goto Forum:
  


Current Time: Thu Apr 24 11:34:37 EDT 2014

Powered by FUDForum. Page generated in 0.01712 seconds