• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSTL in struts 2

 
Davie Lin
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys, I haven't have time to try it out yet, but if you use JSTL in struts 2 do I still have to download JSTL.jar into my classpath?
or does struts 2 already have it included, that would be awesome if it does. anyone know?

Thanks
 
Leonardo Carreira
Ranch Hand
Posts: 494
Eclipse IDE Java Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
AFAIK in struts2 distribution version 2.0.12 the JSTL.jar it doesn't included..
so you have to download it..

i don't know about the higher versions..
Thank's..
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
S2 doesn't include any JSTL libraries.
 
Nishan Patel
Ranch Hand
Posts: 689
Eclipse IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Hi,

Struts 2.0 not include JSTL.

If you are using J2EE 5.0 with your project configuration then you get JSTL included at your class path.

 
Davie Lin
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
would the S2 tags enough for use so I don't really need to include JSTL? for my S2 project?

Thanks
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The S2 tags cover most (if not all) of JSTL functionality. Which to use is a matter of opinion and debate.
 
Nishan Patel
Ranch Hand
Posts: 689
Eclipse IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi,

As David says,

The S2 tags cover most (if not all) of JSTL functionality. Which to use is a matter of opinion and debate.


Yes, that is true, but what about when we use third party tool.


Like inside display tag can we use Struts 2 tag ??

 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by "inside display tag"?
 
Nishan Patel
Ranch Hand
Posts: 689
Eclipse IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi David,

what i mean inside display tag,


if we use <display:column headerClass="Table-Head" property="<s:property name="email />" autolink="true" titleKey="label.system.Email" class="navi-link" />

As i bold, in display column can i use this way ???

That's what i mean ......


 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, you can't nest custom tags. (Running it would have answered that question a lot faster.)
 
Nishan Patel
Ranch Hand
Posts: 689
Eclipse IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi David,

So that's why JSTL need.

That's what i mean.

Because custom tag accept your jsp, screptlet, and JSTL tag. But not accept Struts 2 tag.


SO, some times i think you have to use old technology.

 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, you can *never* nest custom tags, it doesn't matter what tags they are. You'd need to use JSP EL notation, ${}, which in S2 will check the value stack first.
 
Davie Lin
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi David

if I didn't download JSTL.jar, can I still use JSP EL ${} or do I use OGNL using '%'?
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't use OGNL expressions in places that aren't expecting OGNL.

JSTL is a tag library, not an expression language: if your container supports JSP EL (JSP 2+) then you can use JSP EL. You may want to continue non-Struts questions over in the JSP forum.
 
vishwa venkat
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
With Struts2 if you want to use Display Tag extend the TableDecorator and populate the table properties with Struts2 objects.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic