You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Barry Volpe <st...@childrencare.com> on 2003/09/19 18:30:50 UTC

[OT] JAVA question in tiles controller

Hi,

In the following:

I declare myString outside of the execute and perform methods

I Initialize myString to "TEST"; in execute()  and check the value of
myString in perform() method and it is not initialized to "TEST".
Why?
What is missing???


HERE IS THE CODE:

public class LoadUserCategoriesController extends Action implements Controller{



private String myString;

public ActionForward execute( ComponentContext tilesContext,

ActionMapping mapping,ActionForm form,HttpServletRequest request,
                                          HttpServletResponse response) throws Exception

{

        myString="TEST";      

       perform( tilesContext, request, response, getServlet().getServletContext() );

}

public void perform(ComponentContext tilesContext,HttpServletRequest request,HttpServletResponse response,
                                    ServletContext servletContext)throws ServletException, IOException{ 

   //myString does not equal "TEST"

  WHY?

}