Boa Noite Pessoal,
Alguem ja uso a validação usando a classe abstrata ViewHandler?
Eu estendi ela, mas quando eu chamao um página, ela da um erro estranho. Não consegui resolver!!!!
Estou usando o seguinte:
myfaces 1.1.4
tomahawk 1.1.3
/**
*
*/
package com.fretadoalphaville.view;
import java.io.IOException;
import java.util.Locale;
import javax.faces.FacesException;
import javax.faces.application.ViewHandler;
import javax.faces.component.UIViewRoot;
import javax.faces.context.FacesContext;
import com.fretadoalphaville.entities.User;
import com.fretadoalphaville.navigation.NavigationJSPKeys;
/**
* @author Leonardo
*
*/
public class AuthenticatingViewHandler extends ViewHandler{
private final ViewHandler base;
public AuthenticatingViewHandler(ViewHandler base) {
this.base = base;
}
@Override
public UIViewRoot createView(FacesContext facesContext, String s) {
User user = (User) facesContext.getExternalContext().getSessionMap().get("user");
if (user == null)
s = NavigationJSPKeys.USER_LOGIN;
return base.createView(facesContext, s);
}
@Override
public Locale calculateLocale(FacesContext arg0) {
return this.calculateLocale(arg0);
}
@Override
public String calculateRenderKitId(FacesContext arg0) {
return this.calculateRenderKitId(arg0);
}
@Override
public String getActionURL(FacesContext arg0, String arg1) {
return this.getActionURL(arg0, arg1);
}
@Override
public String getResourceURL(FacesContext arg0, String arg1) {
return this.getResourceURL(arg0, arg1);
}
@Override
public void renderView(FacesContext arg0, UIViewRoot arg1) throws IOException, FacesException {
this.renderView(arg0, arg1);
}
@Override
public UIViewRoot restoreView(FacesContext arg0, String arg1) {
return this.restoreView(arg0,arg1);
}
@Override
public void writeState(FacesContext arg0) throws IOException {
this.writeState(arg0);
}
}
exception
javax.servlet.ServletException
javax.faces.webapp.FacesServlet.service(FacesServlet.java:156)
org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:97)
org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:144)
root cause
java.lang.StackOverflowError
com.fretadoalphaville.view.AuthenticatingViewHandler.calculateLocale(AuthenticatingViewHandler.java:40)
Alguem sabe como resolver isso?
