You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Andrew J Snodgrass <an...@pointlander.info> on 2007/09/14 02:24:52 UTC

[PATCH] jasper - enum support for tag libs

The attached patch adds support for the direct use of enums in the 
attributes of tags.

Assume there is the enum:

public enum LoginType {
   account, manager, reseller;
}

and a setter for a tag called 'page':

public void setLogin_required_type( LoginType login_required_type ) { ...

then the jsp code:

<ez:page login_required_type="account"/>

would result in the generation of the java code:

page_tag_instance.setLogin_required_type(LoginType.account);


Andrew J Snodgrass

Re: [PATCH] jasper - enum support for tag libs

Posted by Remy Maucherat <re...@apache.org>.
Yoav Shapira wrote:
> Hey,
> 
> On 9/13/07, Andrew J Snodgrass <an...@pointlander.info> wrote:
>> The attached patch adds support for the direct use of enums in the
>> attributes of tags.
> 
> Cool idea.  Is it in Bugzilla?

I agree it seems like a good idea, but if it is not in the 
specification, then there's no way to include those custom syntax 
improvements.

Rémy

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: [PATCH] jasper - enum support for tag libs

Posted by Remy Maucherat <re...@apache.org>.
David Blevins wrote:
> 
> On Sep 14, 2007, at 10:34 AM, Filip Hanik - Dev Lists wrote:
> 
>>> - adding methods or altering the signature of the javax. APIs is 
>>> clearly illegal
>> yes, that would not be spec compliant, that's essentially what spec 
>> compliant means, that we pass the signature test (which we haven't 
>> done for a couple of years, until the Geronimo guy submitted the patches)
> 
> On that note, is the issue with the annotations-api compliance cleared 
> up.  Happy to submit a patch if not.
> 
> We're running into this in the OpenEJB 3.0 / Tomcat 6 integration and 
> have to add "delete this jar, add this one instead, restart" to the 
> setup instructions.
> 
> If it is cleared up, any idea what release it might show up in -- just 
> looking for something to mention in the docs.

I did apply patches which were submitted to me (and that I did not 
forget). Is the current code still not good ?

However, I would still keep in your instructions to replace this JAR if 
you have another JAR including them along with additional JEE APIs.

Rémy

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: [PATCH] jasper - enum support for tag libs

Posted by David Blevins <da...@visi.com>.
On Sep 14, 2007, at 10:34 AM, Filip Hanik - Dev Lists wrote:

>> - adding methods or altering the signature of the javax. APIs is  
>> clearly illegal
> yes, that would not be spec compliant, that's essentially what spec  
> compliant means, that we pass the signature test (which we haven't  
> done for a couple of years, until the Geronimo guy submitted the  
> patches)

On that note, is the issue with the annotations-api compliance  
cleared up.  Happy to submit a patch if not.

We're running into this in the OpenEJB 3.0 / Tomcat 6 integration and  
have to add "delete this jar, add this one instead, restart" to the  
setup instructions.

If it is cleared up, any idea what release it might show up in --  
just looking for something to mention in the docs.

-- 
David Blevins




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: [PATCH] jasper - enum support for tag libs

Posted by Filip Hanik - Dev Lists <de...@hanik.com>.
Remy Maucherat wrote:
> Filip Hanik - Dev Lists wrote:
>> Yoav Shapira wrote:
>>> Hey,
>>>
>>> On 9/13/07, Andrew J Snodgrass <an...@pointlander.info> wrote:
>>>  
>>>> The attached patch adds support for the direct use of enums in the
>>>> attributes of tags.
>>>>     
>>>
>>> Cool idea.  Is it in Bugzilla?
>>>   
>> I agree, think it is very useful. Would you mind opening a bugzilla,
>> http://issues.apache.org/bugzilla/enter_bug.cgi?product=Tomcat%206
>>
>> Spec or not spec, Tomcat's goal is to be compliant with the JSP spec, 
>> not restricted by it. And this is a useful feature
>
> There are a number of situations:
> - adding flags to allow previous behaviors for unclear portions of the 
> specification (which used pass the relevant TCK); I think this is 
> acceptable
> - adding methods or altering the signature of the javax. APIs is 
> clearly illegal
yes, that would not be spec compliant, that's essentially what spec 
compliant means, that we pass the signature test (which we haven't done 
for a couple of years, until the Geronimo guy submitted the patches)
Filip
> - adding language constructs in JSP, elements in JCP DTDs or xsds is 
> quite similar to that one, and I don't know if it's legal
>
> Rémy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: [PATCH] jasper - enum support for tag libs

Posted by Remy Maucherat <re...@apache.org>.
Filip Hanik - Dev Lists wrote:
> Yoav Shapira wrote:
>> Hey,
>>
>> On 9/13/07, Andrew J Snodgrass <an...@pointlander.info> wrote:
>>  
>>> The attached patch adds support for the direct use of enums in the
>>> attributes of tags.
>>>     
>>
>> Cool idea.  Is it in Bugzilla?
>>   
> I agree, think it is very useful. Would you mind opening a bugzilla,
> http://issues.apache.org/bugzilla/enter_bug.cgi?product=Tomcat%206
> 
> Spec or not spec, Tomcat's goal is to be compliant with the JSP spec, 
> not restricted by it. And this is a useful feature

There are a number of situations:
- adding flags to allow previous behaviors for unclear portions of the 
specification (which used pass the relevant TCK); I think this is acceptable
- adding methods or altering the signature of the javax. APIs is clearly 
illegal
- adding language constructs in JSP, elements in JCP DTDs or xsds is 
quite similar to that one, and I don't know if it's legal

Rémy

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: [PATCH] jasper - enum support for tag libs

Posted by Filip Hanik - Dev Lists <de...@hanik.com>.
Yoav Shapira wrote:
> Hey,
>
> On 9/13/07, Andrew J Snodgrass <an...@pointlander.info> wrote:
>   
>> The attached patch adds support for the direct use of enums in the
>> attributes of tags.
>>     
>
> Cool idea.  Is it in Bugzilla?
>   
I agree, think it is very useful. Would you mind opening a bugzilla,
http://issues.apache.org/bugzilla/enter_bug.cgi?product=Tomcat%206

Spec or not spec, Tomcat's goal is to be compliant with the JSP spec, 
not restricted by it. And this is a useful feature

Filip

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: [PATCH] jasper - enum support for tag libs

Posted by Yoav Shapira <yo...@apache.org>.
Hey,

On 9/13/07, Andrew J Snodgrass <an...@pointlander.info> wrote:
> The attached patch adds support for the direct use of enums in the
> attributes of tags.

Cool idea.  Is it in Bugzilla?

Yoav

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org