Domanda

Is there a way to make a struts action do nothing? I don't want to do anything after my action is performed. Every single action in the project I inherited (794 of them) are redirectAction. But I don't want to redirect. I just want to stay on the same page.

What can I do to just stay on the same page? I want like

<result name="success" type="doNothing"></result>

Is there something I can do to get this behavior? Or even fake it?

È stato utile?

Soluzione

Return ActionSupport.NONE.

What's the usecase? What would an action do that wouldn't return anything?

Altri suggerimenti

Try making the ActionForward execute method return null where you would normally have returned. For example, mapping.findForward("something"); - just return null; instead.

Http is a request/response protocol, you have to send something. When I have a similair situation on an ajax page, I simply map the SUCCESS return code to an HttpResultHeader type with a return code of 200.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top