Search code examples
javajakarta-eestruts2strutsjava-ee-6

Which is better performance wise, s:action or to use static methods on JSP page in struts2 application


I've been wondering which is more better performance wise, calling s:action or calling static method using OGNL in JSP in a struts2 web-application.

I know they both have their own usage, but I want to know which one is better performance wise (faster) and is it possible to cache the s:action result so that it doesn't get called always if the parameters are same, instead the result is directly served from some cache.


Solution

  • <s:action> goes through an S2 request, calling a static method is straight OGNL/Java: for almost everything I can't imagine a request, even an internal one, being faster than what amounts to calling a method.