Migrated selected beans to Request Scope.

This commit is contained in:
tim holloway 2024-02-03 06:50:23 -05:00
parent fa16c0bf9a
commit a792f5d2b7
2 changed files with 19 additions and 17 deletions

View File

@ -2,35 +2,37 @@ package com.mousetech.gourmetj;
import java.io.Serializable; import java.io.Serializable;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import jakarta.annotation.PostConstruct; import java.util.List;
import jakarta.faces.event.AjaxBehaviorEvent;
import jakarta.faces.model.DataModel;
import jakarta.faces.model.ListDataModel;
import jakarta.faces.view.ViewScoped;
import jakarta.inject.Inject;
import jakarta.inject.Named;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.mousetech.gourmetj.persistence.model.Recipe; import com.mousetech.gourmetj.persistence.model.Recipe;
import com.mousetech.gourmetj.persistence.service.RecipeService; import com.mousetech.gourmetj.persistence.service.RecipeService;
import jakarta.annotation.PostConstruct;
import jakarta.enterprise.context.RequestScoped;
import jakarta.faces.event.AjaxBehaviorEvent;
import jakarta.faces.model.DataModel;
import jakarta.faces.model.ListDataModel;
import jakarta.inject.Inject;
import jakarta.inject.Named;
/** /**
* Main control panel backing bean. * Main control panel backing bean.
* *
* The rare and fabled RequestScope, which is otherwise
* useless 90% of the time. Here we maintain no session
* state. so we can better support the session timeout
* for editing functions.
*
* @author timh * @author timh
* @since Jun 28, 2012 * @since Jun 28, 2012
*/ */
@Named @Named
@ViewScoped @RequestScoped
public class AdminMainBean implements Serializable { public class AdminMainBean implements Serializable {
/** /**

View File

@ -17,17 +17,17 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import jakarta.annotation.PostConstruct; import jakarta.annotation.PostConstruct;
import jakarta.faces.view.ViewScoped; import jakarta.enterprise.context.RequestScoped;
import jakarta.inject.Named; import jakarta.inject.Named;
/** /**
* Caching object for cookie data persistence. * Request caching object for cookie data persistence.
* *
* @author timh * @author timh
* @since Jan 31, 2024 * @since Jan 31, 2024
*/ */
@Named @Named
@ViewScoped @RequestScoped
public class CookieBean { public class CookieBean {
private static final String KEY_DISPLAY_ROWS = "displayRows"; private static final String KEY_DISPLAY_ROWS = "displayRows";