File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Regarding html:text  tags Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Regarding html:text  tags" Watch "Regarding html:text  tags" New topic

Regarding html:text tags

Buddha Raju

Joined: Jun 01, 2005
Posts: 15
Dear All.
What are all the advantages of using the struts html tags like the following. Instead we can use the plan html tags
<html:text property="text1" size="5"/>
<html:checkbox property="myCheckBox"/> ect.

Can any body let me know why do we use �logic� tag in struts

Thanks in advance

alan do
Ranch Hand

Joined: Apr 14, 2005
Posts: 354
use them or be sorry later...

1. auto populating field values from form beans; otherwise, you'll have to do painful form values populating manually. this is especially important in failed validations.
2. indexed properties support (can be done w/ plain, but urgh..)
3. support for LookupDispatchAction.
4. additional tags like html ptions helps with commonly used form elements tremendously.

i made this rookie mistake of using plain HTML form tags 2 years ago. the good thing is someone else is paying dearly for it right now

-/a<br />certified slacker...yes, my last name is 'do' - <a href="" target="_blank" rel="nofollow"></a>
Karl Beowulph
Ranch Hand

Joined: May 31, 2004
Posts: 130
I usually use struts tags, but for complex elements you're probably going to want to use HTML tags since struts tags are limited when it comes to inserting java code (<%= %> etc) within them.

So long as you give it the correct name, you're fine.

When you say logic tags, do you mean in comparison to the core.tld or inserting Java (<% if... %> )?
RukminiP Nagalla

Joined: Jun 15, 2005
Posts: 3
I hve used html text tag for initializing the text values dynamically i.e through expr eg:<%= varname %> without any problems.
Karl Beowulph
Ranch Hand

Joined: May 31, 2004
Posts: 130
Simple ones like that are fine.

It's when you start doing things like passing Java arguements to JS functions in the "onchange" method (or others like it) and having calculations within the tag where it starts to get a little screwy.
I agree. Here's the link:
subject: Regarding html:text tags
It's not a secret anymore!