struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Natta Wang <>
Subject Struts 1 -> Struts 2 migration session parameters not found
Date Thu, 27 Aug 2020 09:16:05 GMT
I start to migrate from Struts 1 to Struts 2 and found a problem that I want to ask for help
with the session.

In Struts 1 web.xml, I have a Filter class that maps to servlet and when it be called, it
will set a parameter with an object.

All Struts 1 JSP pages can access the session that has those parameters, and what I did to
the new Action class of Struts 2 is implements with SessionAware,
in the class if found session object by ServletActionContext.getRequest().getSession(), but
cannot found the parameter with the parameter name that I expected it has.

What I tried is added new filter-mapping in the web.xml file, which map url-pattern to Struts
2 Action class (same with that mapped to servlet I mentioned above), hope it will be called
when opening with a specific URL but I failed as it comes out like the not set version.

Can someone guide me on how to make the session and all parameters visible in the Action class
and JSP page?

And one more thing, I use <s:include> the header page and header page also refers to
those session parameters. Do I need to implement any configuration to make header JSP can
access the session?

Any help or suggestion are appreciated.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message