wood burning stoves 2.0*
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Regarding html:text  tags" Watch "Regarding html:text  tags" New topic
Author

Regarding html:text tags

Buddha Raju
Greenhorn

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
Raj


Raju
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="http://www.luckycouple.com" target="_blank" rel="nofollow">luckycouple.com</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
Greenhorn

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: http://aspose.com/file-tools
 
subject: Regarding html:text tags
 
Similar Threads
Pro Jakarta Struts, Second Edition : Development Question
how to use javascript in struts jsp
How to assign these 3 values to form bean
regarding Html tags in Struts
Struts: Can we have a html:text tag without a html:form tag outside it.