aspose file tools*
The moose likes Struts and the fly likes Can I use Struts tags inside plain HTML tags? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Can I use Struts tags inside plain HTML tags?" Watch "Can I use Struts tags inside plain HTML tags?" New topic
Author

Can I use Struts tags inside plain HTML tags?

kay lin
Ranch Hand

Joined: May 20, 2004
Posts: 132
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

Joined: Jan 23, 2002
Posts: 11962
    
    5
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".


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
kay lin
Ranch Hand

Joined: May 20, 2004
Posts: 132
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
internet detective
Marshal

Joined: May 26, 2003
Posts: 29249
    
139

You need to create a drop down.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Nicholas Cheung
Ranch Hand

Joined: Nov 07, 2003
Posts: 4982

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


SCJP 1.2, OCP 9i DBA, SCWCD 1.3, SCJP 1.4 (SAI), SCJD 1.4, SCWCD 1.4 (Beta), ICED (IBM 287, IBM 484, IBM 486), SCMAD 1.0 (Beta), SCBCD 1.3, ICSD (IBM 288), ICDBA (IBM 700, IBM 701), SCDJWS, ICSD (IBM 348), OCP 10g DBA (Beta), SCJP 5.0 (Beta), SCJA 1.0 (Beta), MCP(70-270), SCBCD 5.0 (Beta), SCJP 6.0, SCEA for JEE5 (in progress)
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

Remember though that making the page's components regular html tags instead of struts tags loses the automatic prepopulation benefits.


A good workman is known by his tools.
Nicholas Cheung
Ranch Hand

Joined: Nov 07, 2003
Posts: 4982
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can I use Struts tags inside plain HTML tags?
 
Similar Threads
still having problem with logic:iterate tags
Question regarding the logic:iterate tag
can somebody take a look at my struts--config file?
nested struts tags
Problem with the drop down box using Struts tags