This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Can I use Struts tags inside plain HTML tags?  RSS feed

 
kay lin
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All:
I am just wondering

Can I use <logic:iterate> with plain <html> tags?

is the following valid?



In general, can you combine struts tags within your HTML tags? pls let me know. I am new to struts.

Many thanks.
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by dog lin:
In general, can you combine struts tags within your HTML tags?
Yes, you can. The JSP compiler treats any tags it doesn't recognize as a taglib as "print this stuff as-is into the output stream".
 
kay lin
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
okay..thnx...
but the above code shoud work correctly right? with STRUTS tag and HTML tags, i mean, the above code is suppose to generate a drop down box , correct? let me konw.

Many thanks
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 37180
515
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to create a drop down.
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Can I use <logic:iterate> with plain <html> tags?
[/quote

You can use any Struts tags together with HTML tag in the JSP, if you have defined what taglibs you are going to use inside the JSP. Such as:



Nick
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Remember though that making the page's components regular html tags instead of struts tags loses the automatic prepopulation benefits.
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anyway, as Lasse said in another thread, it is recommended to use standard JSTL as much as possible that the Struts tags, unless you really need, like the Struts Form tag.

Nick
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!