This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Struts and the fly likes Advantage of struts-html tag library ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Advantage of struts-html tag library ?" Watch "Advantage of struts-html tag library ?" New topic

Advantage of struts-html tag library ?

limaye satish

Joined: Apr 28, 2003
Posts: 5
Hello ,
I am a beginner so pardon me if this question appears dumb .
I was wondering as to what is the advantage of using this library rather than using just plain old HTML code ?
I can understand the use of other libraries such as "struts-logic" where we do not intend to mix scriptlets in UI
However I do not seem to come up with any reasons why I should use the HTML library .
Could someone explain under what circumstances it would be useful ?
Thanks in advance ,
-satish limaye
Junilu Lacar

Joined: Feb 26, 2001
Posts: 6529

If you use plain old HTML tags, you'll have to resort to scriptlets to get the values out of the form bean and into the html fields. The html tags work with the Struts framework to automagically populate html fields from your form bean fields and this results in JSPs that are cleaner and easier to maintain.

Junilu - [How to Ask Questions] [How to Answer Questions]
limaye satish

Joined: Apr 28, 2003
Posts: 5
Hello ,
Thanks for the reply .
Also as an afterthought ( and actually repeating the same question to my colleagues ) someone came up with the availability of the special tag
<html:errors> as one of the advantages of this tag library
Once again thanks for your answer
-satish limaye
Pat Wallwork
Ranch Hand

Joined: Sep 23, 2001
Posts: 72
One thing the html tags do that I like is automatically URL encode your links. I used to hate doing this manually!
Jeremy Davis

Joined: Feb 07, 2003
Posts: 17
Here are a couple more:
Using <html:link /> allows you to keep track of your links in the struts-config.xml file which means you can change directory structures and make your navigation changes in one place. Of course, this means you have to use <html:base /> as well.
<html:image /> allows you to use i18n images, which can be very usefull.
I agree. Here's the link:
subject: Advantage of struts-html tag library ?
It's not a secret anymore!