File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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
Register / Login
JavaRanch » Java Forums » Application Frameworks » Struts
Reply 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: 11945
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 (Manning Publications, 2007) [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: 23635

You need to create a drop down.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Certs: SCEA Part 1, Part 2 & 3 & Core Spring 3, OCAJP
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: 4695

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
 
IntelliJ Java IDE
 
subject: Can I use Struts tags inside plain HTML tags?
 
Threads others viewed
nested struts tags
can somebody take a look at my struts--config file?
still having problem with logic:iterate tags
Question regarding the logic:iterate tag
Problem with the drop down box using Struts tags
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture