Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Struts 2 »

S2: What do you forward to after a response writer?

Scott Nesbitt

2007-03-26

Replies:


I am moving an app from S1 to S2 that has a
third-party grid component. In S1 it looked like
this:

public ActionForward perform(
 ActionMapping     mapping,
 ActionForm       form,
 HttpServletRequest req,
 HttpServletResponse resp)
{
 try
 {
   GetHandler myGetHandler = new GetHandler(resp,
null);
.
.
.
   myGetHandler.writeToClient("ISO-8859-1",
resp.getWriter());
 }

 return mapping.findForward("success");
}

In S2 I am doing the following:


public class PopulateGridAction extends ActionSupport
implements ParameterAware, ServletResponseAware
{  

public String execute() throws Exception
{  
   HttpServletResponse resp = getServletResponse();
   GetHandler myGetHandler = new GetHandler(resp,
null);
.
.
.
   myGetHandler.writeToClient("ISO-8859-1",
resp.getWriter());

 return SUCCESS;
}

In S1 it populated the grid fine, but in S2 it does
not send back the XML to the grid like it should. I
guess I do not know what I should specify in the S2
struts.xml file for the SUCCESS forward. I do not
want it to be the JSP that invoked the above code
because that reloads the grid, and I cannot specify
null.

Thanks for any tips or pointers,

Scott



____________________________________________________________________________________
No need to miss a message. Get email on-the-go
with Yahoo! Mail for Mobile. Get started.
http://mobile.yahoo.com/mail

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.