I can see what you're trying to say and it would be truly flexible if 
you could do that.

But I can already foresee the reaction from the die-hards, and that is 
that it would give the person doing the markup "too" much power. 
Probably get at some things that shouldn't be gotten at, like MyBean.wait().

Nice idea, wouldn't get past the committing committee I'm afraid.

And the fact is, if you want to get that sort of power, you may as well 
script it. There's plenty of ways to get a hold of your object for 
scripting. The MVC model is to decouple a the model. Having access to a 
specific api isn't decoupling.


Arron.

c tang wrote:

>Creating a wrapper class may get rid of scriptlet in
>JSP. But that means for every public api (such as
>Collection.size(), Object.toString()) that does not
>fit get/set pattern, a wrapper class has to be created
>in order to avoid scriptlet using struts.  IMHO, that
>is worse than just using scriptlet because it bloats
>the class number significantly.
>
>ct
>
>--- Arron Bates <[EMAIL PROTECTED]> wrote:
>
>>A getter method like...
>>
>>public int getMyListSize() {
>>return this.myList.getSize();
>>}
>>
>>with a tag like...
>><bean:write name="myForm" property="myListSize" />
>>...maybe?
>>
>>
>>Arron.
>>
>>
>>c tang wrote:
>>
>>>I agree with Alex that current strut taglib has a
>>>
>>big
>>
>>>deficiency.  It allows only access through get/set
>>>methods of a property.  How do I write the size of
>>>collection object to a page without resorting
>>>scriptlet or <%=?  How do I write toString() output
>>>
>>to
>>
>>>a page without resorting scriptlet or <%=?
>>>
>>>I had a proposal to allow x.y expression to get y
>>>in the this order:
>>>(1) x.getY()
>>>(2) x.y()
>>>(3) x.y
>>>
>>>In this way, to write toString of x object to a
>>>
>>page,
>>
>>>simply use
>>><bean:write name="x" property="toString"/>
>>>
>>>This proposal is shotdown.  Without this, scriptlet
>>>has to be used in jsp.
>>>
>>>ct
>>>
>>>
>>>--- Arron Bates <[EMAIL PROTECTED]> wrote:
>>>
>>>>For one, I recommend getting your properties into
>>>>getter/setter 
>>>>methodology. Simply so you can use the wealth that
>>>>is the Struts tagging 
>>>>system (as it's (the bean spec Struts runs against
>>>>for it's model 
>>>>components) kind of what it's all about).
>>>>
>>>>By "'raw' String" do you mean the object's
>>>>"toString()" method?... Any 
>>>>property that yields and object to be written out
>>>>will have it's 
>>>>"toString()" method called to write it to the
>>>>output.
>>>>
>>>>I'm also curious about your "null pointer" issue
>>>>with the nested 
>>>>extension (for some reason :).
>>>>Can I get a hold of the bean and JSP you were
>>>>
>>trying
>>
>>>>to run it with?...
>>>>
>>>>Arron.
>>>>
>>>>
>>>>Alex Paransky wrote:
>>>>
>>>>>I am pretty new with struts and wrote the
>>>>>
>>following
>>
>>>>.JSP code.  Is there a
>>>>
>>>>>better way to write this?  I could not find a tag
>>>>>
>>>>in STRUTS to let me just
>>>>
>>>>>get the property from the object.  My object does
>>>>>
>>>>not have get/set methods,
>>>>
>>>>>so I had to resort to using <%= tag.  Is there a
>>>>>
>>>>tag in STRUTS that would
>>>>
>>>>>just access the "raw" String attribute of the
>>>>>
>>>>object instead of calling
>>>>
>>>>>get/set?
>>>>>
>>>>>I also tried using the keyboardmonkey nested
>>>>>
>>>>library, but kept getting
>>>>
>>>>>NullPointerExceptions when nested:iterate would
>>>>>
>>>>execute
>>>>
>>>>><jsp:useBean id="profileHeaders"
>>>>>
>>>class="com.myprofiles.client.web.bean.MemberProfileHeadersBean"
>>>
>>>>/>
>>>>
>>>>><logic:iterate id="profile" name="profileHeaders"
>>>>>
>>>>property="profiles"
>>>>
>>>type="com.myprofiles.service.common.ProfileHeaderValue">
>>>
>>>>><%=profile.name%>
>>>>><%=profile.description%>
>>>>></logic:iterate>
>>>>>
>>>>>Thanks.
>>>>>
>>>>>
>>>>>-AP_
>>>>>www: http://www.alexparansky.com
>>>>>
>>>>>
>>>>>--
>>>>>To unsubscribe, e-mail:  
>>>>>
>>><mailto:[EMAIL PROTECTED]>
>>>
>>>>>For additional commands, e-mail:
>>>>>
>>>><mailto:[EMAIL PROTECTED]>
>>>>
>>>>
>>>>--
>>>>To unsubscribe, e-mail:  
>>>>
>>><mailto:[EMAIL PROTECTED]>
>>>
>>>>For additional commands, e-mail:
>>>><mailto:[EMAIL PROTECTED]>
>>>>
>>>
>>>__________________________________________________
>>>Do You Yahoo!?
>>>Send FREE video emails in Yahoo! Mail!
>>>http://promo.yahoo.com/videomail/
>>>
>>>--
>>>To unsubscribe, e-mail:  
>>>
>><mailto:[EMAIL PROTECTED]>
>>
>>>For additional commands, e-mail:
>>>
>><mailto:[EMAIL PROTECTED]>
>>
>>>
>>
>>
>>--
>>To unsubscribe, e-mail:  
>><mailto:[EMAIL PROTECTED]>
>>For additional commands, e-mail:
>><mailto:[EMAIL PROTECTED]>
>>
>
>
>__________________________________________________
>Do You Yahoo!?
>Send FREE video emails in Yahoo! Mail!
>http://promo.yahoo.com/videomail/
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to