views:

201

answers:

1

I am using Stripes but i'm not sure if this problem is because of that. I have an actionBean with a setter method setSearchView. In this setter, I set a cookie. The problem I'm seeing is that if i call that method from my jsp, the cookie does not get set (i have debugged the code and it does go through the code). If i call the same setSearchView from an action handler, the cookie is set.

Is there something I'm missing? Is this a Stripes thing or a jsp/javabean thing?

+1  A: 

I think you are misunderstanding the programming model, I'm guessing you are coming from a CGI/Php background.

Setters/getters on Stripes action beans are used to allow the ActionBean to receive the request parameters (URL parameters in the case of GET requests, form parameters in the case of POST requests) from the browser.

You wouldn't set them manually from JSPs because you wouldn't be putting controller logic in the JSPs but in the ActionBean.

The JSP will only be used to display ('View') any data provided by the controller from the model/view-model and to display input elements to allow the user to provide input. (See MVC on Wikipedia)

Redbeard