Struts 2 Aware Interfaces Tutorial

Struts 2 Aware interfaces are used to put information into the request, response, context or session object.

The action class must implement these interfaces to store information so that it can be retrieved from other action class.

The four aware interfaces are:

  1. org.apache.struts2.interceptor.SessionAware
  2. org.apache.struts2.util.ServletContextAware
  3. org.apache.struts2.interceptor.ServletRequestAware
  4. org.apache.struts2.interceptor.ServletResponseAware

What is next?

ServletActionContext class

Here, we will learn how to get request, response, context and session objects from another action class.

SessionAware Interface example

Here, we will how to store and get information from the session scope.

ServletContextAware Interface example

Here, we will how to store and get information from the application scope.





Latest Courses