Struts has a number of helpful custom JSP tags, and Struts-EL adds much needed EL support. I'm looking for thoughts on relative merits of using Struts/Strut-EL tags where available vs. just using JSTL tags.
Struts Tags vs. JSTL
Simple:
- Struts Tags are only available to projects that use Struts
- JSTL tags can be used anywhere and can even co-operate with other frameworks such as Spring or JSF
...which would render your app a bit more portable. –
Palmore
Struts tags are simply used with in struts framework, but you can not use in others. JSTL is totally different, we can use this in any other rendering page. Mostly some time we want to make custom tags as per out business logic , we can achieve this by JSTL tags: EX :
Simple
<c:set var="delUrl" value="CustInfo.do?type=6&acId=0"></c:set>
Custom
<ab-c:set var="delUrl" value="CustInfo.do?type=6&acId=0"></ab-c:set>
we can perform some logic(URL encryption ) on value as per requirement.
It depends on your usage of custom tags - some tags, like those that create an option dropdown list, are much easier to use and read than the equivalent c:foreach loop tag. However, JSTL is common across many apps, so if you stopped using the struts custom tags in a different webapp, you'd probably still have access to the JSTL.
© 2022 - 2024 — McMap. All rights reserved.