You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by fikar <jh...@gmail.com> on 2008/08/28 23:04:40 UTC

Regarding Struts 2 Feature

*
Hello Struts2 Dev Group*

I was wondering to find a feature in Struts2 where we can specify our logic
(basically our if conditions) to prevent an element from displaying.

Basically i wanted to have a feature as like the below:

*Existing Feature:*

<s:if test="userExists">
   <s:text name="label.userHelloMessage" />
</s:if>

*My Proposing Feature:*

<s:text name="label.userHelloMessage" onlyIftest="userExists"/>

*What am i proposing for this new approach?*

Currently in most of the web applications we need to maintain the business
flow by keeping so many if else ladders and it is hard to maintain the JSP
Pages. By having the condition check inside the custom tag, we can achieve a
high level of maintenance.
*
*Can you please tell me how can i go about it to create this functionality
or is there any functionality exists already? Please let me know how we can
go about it.

*Note: *label.userHelloMessage=Hello User, A good day for you!

*With regards
Jhulfikar Ali. A* | *Software Engineer | Bangalore | Mobile: 09900110860 |*

Re: Regarding Struts 2 Feature

Posted by Zart Colwing <za...@wanadoo.fr>.

fikar wrote:
> 
> *
> Hello Struts2 Dev Group*
> 
> I was wondering to find a feature in Struts2 where we can specify our
> logic
> (basically our if conditions) to prevent an element from displaying.
> [...]
> *My Proposing Feature:*
> 
> <s:text name="label.userHelloMessage" onlyIftest="userExists"/>
> 
> *What am i proposing for this new approach?*
> 
> Currently in most of the web applications we need to maintain the business
> flow by keeping so many if else ladders and it is hard to maintain the JSP
> Pages. By having the condition check inside the custom tag, we can achieve
> a
> high level of maintenance.
> 

This is an excellent idea, but the name you propose (“onlyIftest”) is
terrible.
May I suggest that you use “rendered='condition'” as in the JSF tags.
It all the best if we can make JSP tags and JSF tags converge as most as
possible especially on those pesky tag attribute name.

Regards,
ZC.
-- 
View this message in context: http://www.nabble.com/Regarding-Struts-2-Feature-tp19209143p19215911.html
Sent from the Struts - Dev mailing list archive at Nabble.com.


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


Re: Regarding Struts 2 Feature

Posted by Bob Tiernay <bt...@hotmail.com>.
I would say a tag file would be a better bet and you would have more control 
over it.

--------------------------------------------------
From: "fikar" <jh...@gmail.com>
Sent: Thursday, August 28, 2008 5:04 PM
To: <de...@struts.apache.org>; <de...@webwork.dev.java.net>
Subject: Regarding Struts 2 Feature

> *
> Hello Struts2 Dev Group*
>
> I was wondering to find a feature in Struts2 where we can specify our 
> logic
> (basically our if conditions) to prevent an element from displaying.
>
> Basically i wanted to have a feature as like the below:
>
> *Existing Feature:*
>
> <s:if test="userExists">
>   <s:text name="label.userHelloMessage" />
> </s:if>
>
> *My Proposing Feature:*
>
> <s:text name="label.userHelloMessage" onlyIftest="userExists"/>
>
> *What am i proposing for this new approach?*
>
> Currently in most of the web applications we need to maintain the business
> flow by keeping so many if else ladders and it is hard to maintain the JSP
> Pages. By having the condition check inside the custom tag, we can achieve 
> a
> high level of maintenance.
> *
> *Can you please tell me how can i go about it to create this functionality
> or is there any functionality exists already? Please let me know how we 
> can
> go about it.
>
> *Note: *label.userHelloMessage=Hello User, A good day for you!
>
> *With regards
> Jhulfikar Ali. A* | *Software Engineer | Bangalore | Mobile: 09900110860 
> |*
> 

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