user3778690
user3778690

Reputation: 111

How to convert custom code using Struts tags to Spring MVC 4.0?

I have some custom code using Struts library, which we are porting to Spring MVC.

I need to replace

SkinTagUtils.findInScope("value1",pageContext) 

and

SkinTagUtils.putToScope("key", key, "page", pageContext)

lines to Spring MVC or JSP.

Upvotes: 0

Views: 965

Answers (1)

Roman C
Roman C

Reputation: 1

If you have pageContext object then you can use it to find a variable in the scopes.

pageContext.findAttribute("value1");

or set it to the page scope

pageContext.setAttribute("key", key);

Note, there's also other convenient methods of JspContext to retrieve an attribute from the specified scope and set attribute to the specified scope.

Upvotes: 1

Related Questions