• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Advantage of struts-html tag library ?

 
limaye satish
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Bartender
Posts: 7480
50
Android Eclipse IDE IntelliJ IDE Java Linux Mac Scala Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
limaye satish
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One thing the html tags do that I like is automatically URL encode your links. I used to hate doing this manually!
-Pat
 
Jeremy Davis
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic