How can I redirect in a struts 1.2.9 LookupDispatchAction?

L

lightning

It's in a LookupDispatchAction's subclass,and it's very simple,when
user click "cancle",
go to the referer url:
code:


@Override
protected ActionForward cancelled(ActionMapping mapping, ActionForm
form, HttpServletRequest request, HttpServletResponse response) throws
Exception {

response.sendRedirect(request.getHeader("Referer"));
return null;
}

but struts give the exception:

java.lang.IllegalStateException: Cannot forward after response has
been committed


how can I do that?
 
L

lightning

Oh,I found ActionRedirect....

ActionRedirect f=new ActionRedirect(request.getHeader("Referer"));
return f;

It works...hmmm~~
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,742
Latest member
AshliMayer

Latest Threads

Top