Skip to content

Tag: struts2

Getting Result type in Interceptor

I have Struts 2 actions with different (HTML and JSON ) result types. They use common interceptor. If needed to intercept the request, how to return a result based on given action result type? For example, my Action.ERROR forwards to JSP page. If action is JSON type I want to forward JSON error instead. Answe…

How to put variable in OGNL tag

In this code questions is a list which contain questions object with In my program, I will make it appears in browser like The list may contain multiple question objects so I made it to show 5 question per page. My problem is (for example) the user may go from page 4 to page 2 and I want to refill

Struts2 Tags Radio button

I have this iterator that loops through an object. where answer is a boolean value, that I am trying to set through radio buttons. but the problem is, upon on the generated html, teh radio buttons. is like this It did not have the indice/index. it only gave me the %{#key.index} Answer you have to use property…

NoSuchMethodError when using submitting form in Struts 2

I’m currently working through the tutorial found on the Apache Struts website. Currently, whenever I press submit on the form, or when I click the Bruce Philips hyperlink, I get a NoSuchMethodError. I’m not too sure what the issue is either and I believe I’ve included everything the tutorial…