my dog learned polymorphism*
The moose likes Portals and Portlets and the fly likes Tag library Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Portals and Portlets
Bookmark "Tag library" Watch "Tag library" New topic
Author

Tag library

Dorothy Taylor
Ranch Hand

Joined: Nov 26, 2007
Posts: 104
Hello everyone

I am developing STruts 1.1 based JSR portlets in RAD 6.
For writing the jsp's what should be used : the c tags(JSTL) or teh Struts logic tags.

We can do same things in both. So what is the difference

Thanks
Nhat Nguyen
Greenhorn

Joined: Jan 09, 2008
Posts: 9
I haven't written any portlet using RAD but I know that you can use both JSTL and Struts tags in your JSPs. JSTL tags are used to control the flow of the page like: <c:if>, <c:choose>, ... and Struts tags are used to display information like: <logic:iterator>, ...
Dorothy Taylor
Ranch Hand

Joined: Nov 26, 2007
Posts: 104
Yes, but we can do the same thing using either of the two. So does this mean that if we are using struts, then using struts taglib is preferable.

When should we choose to use c tags if application is struts based?
Nhat Nguyen
Greenhorn

Joined: Jan 09, 2008
Posts: 9
Some time, using JSTL is more convenient than using Struts taglib (like: <c:if> and <logic resent>, ...)
Some time, you want to perform an action but JSTL doesn't support (like loop, message resource, ...)
...
So, using JSTL or Struts taglib must be very flexible.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60781
    
  65

Originally posted by Nhat Nguyen:
... but JSTL doesn't support (like loop, message resource,
I think you'd better bone up on what JSTL supports. Looping? Of course. Messaging? Yes.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Nhat Nguyen
Greenhorn

Joined: Jan 09, 2008
Posts: 9
Oh, I'm sorry! I got mistakes. JSTL has loop, message and many features ... Thank Bear Bibeault!
Dorothy Taylor
Ranch Hand

Joined: Nov 26, 2007
Posts: 104
So which one should be preferred?
Or we can just go with anything of our choice. I think that if we are developing struts based portlets, then we should use struts taglib only. Please let me know if this is wrong
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tag library
 
Similar Threads
logic and nested
what is the difference between struts tag and jstl?
what HTML tag library to use
What is the use of <html:input name>
if else in struts tags