Но перенаправление не происходит даже после успешной аутентификации B2B. еще более странно, мы могли видеть перенаправленный URL-адрес в браузере, но просмотр не отображался.
Мы новички в jsf и уже давно боремся с этой проблемой. любая помощь будет оценена по достоинству.
Вот наш код
Web.xml
Код: Выделить всё
abc web project
javax.faces.PROJECT_STAGE
${webxml.stage}
javax.faces.FACELETS_LIBRARIES
/WEB-INF/tld/std.taglib.xml;
/WEB-INF/tld/pqr.taglib.xml;
/WEB-INF/tld/pqrabc.taglib.xml;
Comma separated list of URIs of (additional) faces config
files. (e.g. /WEB-INF/my-config.xml) See JSF 1.0 PRD2,
10.3.2 Attention: You do not need to put
/WEB-INF/faces-config.xml in here.
javax.faces.CONFIG_FILES
/WEB-INF/faces/config.xml,
/WEB-INF/faces/bean.xml,
/WEB-INF/faces/navigation.xml
State saving method: "client" or "server" (= default) See
JSF Specification 2.5.3
javax.faces.STATE_SAVING_METHOD
server
Define partial state saving as true/false.
javax.faces.PARTIAL_STATE_SAVING_METHOD
false
javax.faces.VALIDATE_EMPTY_FIELDS
false
javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL
true
javax.faces.FACELETS_SKIP_COMMENTS
true
ilp.faces.VIEW_EXPIRED_REDIRECT_URL
/pages/home.jsf
org.apache.myfaces.SUPPORT_JSP_AND_FACES_EL
false
Only applicable if state saving method is "server" (=
default). Defines the amount (default = 20) of the latest
views are stored in session.
org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION
10
Only applicable if state saving method is "server" (=
default). If true (default) the state will be serialized to
a byte stream before it is written to the session. If false
the state will not be serialized to a byte stream.
org.apache.myfaces.SERIALIZE_STATE_IN_SESSION
false
Only applicable if state saving method is "server" (=
default) and if
org.apache.myfaces.SERIALIZE_STATE_IN_SESSION is true (=
default) If true (default) the serialized state will be
compressed before it is written to the session. If false the
state will not be compressed.
org.apache.myfaces.COMPRESS_STATE_IN_SESSION
false
This parameter tells MyFaces if javascript code should be
allowed in the rendered HTML output. If javascript is
allowed, command_link anchors will have javascript code that
submits the corresponding form. If javascript is not
allowed, the state saving info and nested parameters will be
added as url parameters. Default: "true"
org.apache.myfaces.ALLOW_JAVASCRIPT
true
org.apache.myfaces.DETECT_JAVASCRIPT
false
If true, rendered HTML code will be formatted, so that it is
"human readable". i.e. additional line separators and
whitespace will be written, that do not influence the HTML
code. Default: "true"
org.apache.myfaces.PRETTY_HTML
true
If true, a javascript function will be rendered that is able
to restore the former vertical scroll on every request.
Convenient feature if you have pages with long lists and you
do not want the browser page to always jump to the top if
you trigger a link or button action that stays on the same
page. Default: "false"
org.apache.myfaces.AUTO_SCROLL
false
Used for encrypting view state. Only relevant for client
side state saving. See MyFaces wiki/web site documentation
for instructions on how to configure an application for
diffenent encryption strengths.
org.apache.myfaces.SECRET
NzY1NDMyMTA=
Validate managed beans, navigation rules and ensure that
forms are not nested.
org.apache.myfaces.VALIDATE
${webxml.validateConfig}
Treat readonly same as if disabled attribute was set for
select elements.
org.apache.myfaces.READONLY_AS_DISABLED_FOR_SELECTS
true
Virtual path in the URL which triggers loading of resources
for the MyFaces extended components in the ExtensionFilter.
org.apache.myfaces.RESOURCE_VIRTUAL_PATH
/faces/myFacesExtensionResource
org.apache.myfaces.DISABLE_TOMAHAWK_FACES_CONTEXT_WRAPPER
false
Check if the extensions-filter has been properly configured.
org.apache.myfaces.CHECK_EXTENSIONS_FILTER
false
org.apache.myfaces.RENDER_CLEAR_JAVASCRIPT_FOR_BUTTON
false
org.apache.myfaces.RENDER_HIDDEN_FIELDS_FOR_LINK_PARAMS
false
org.apache.myfaces.SAVE_FORM_SUBMIT_LINK_IE
false
org.apache.myfaces.RENDER_VIEWSTATE_ID
true
org.apache.myfaces.STRICT_XHTML_LINKS
true
org.apache.myfaces.RENDER_FORM_SUBMIT_SCRIPT_INLINE
false
org.apache.myfaces.CONFIG_REFRESH_PERIOD
2
org.apache.myfaces.VIEWSTATE_JAVASCRIPT
false
org.apache.myfaces.REFRESH_TRANSIENT_BUILD_ON_PSS
auto
org.apache.myfaces.REFRESH_TRANSIENT_BUILD_ON_PSS_PRESERVE_STATE
false
org.apache.myfaces.VALIDATE_XML
false
org.apache.myfaces.WRAP_SCRIPT_CONTENT_WITH_XML_COMMENT_TAG
true
org.apache.myfaces.ADD_RESOURCE_CLASS
org.apache.myfaces.renderkit.html.util.DefaultAddResource
org.apache.myfaces.FACES_INITIALIZER
example.business.ilp.faces.core.application.CustomFaceletsInitializer
sessionFilter
example.business.pqr.abcclient.security.AutoLoginFilter
permittedPages
/, /login.jsf, /index.jsp, /error401.jsf, /error403.jsf, /error405.jsf, /error408.jsf, /error500.jsf
permittedGets
/error401.jsf, /error403.jsf, /error405.jsf, /error408.jsf, /error500.jsf, /pages/home.jsf, /pages/selectArbeitsbereich.jsf, /pages/selectArbeitsbereichPA.jsf, /pages/continueSession.jsf, /login.jsf, /pages/webEntry.jsf, /js/jsUtils.js, /css/basic.css, /css/resolution/basic240x320.css
sessionFilter
*.jsf
sessionFilter
*.jsp
sessionFilter
*.xhtml
org.apache.myfaces.webapp.StartupServletContextListener
Index Servlet
example.business.pqr.abcclient.IndexServlet
1
Index Servlet
/index.jsp
Faces Servlet
javax.faces.webapp.FacesServlet
1
Faces Servlet
*.jsf
js
application/x-javascript
index.jsp
401
/error401.jsf
403
/error403.jsf
405
/error405.jsf
408
/error408.jsf
500
/error500.jsf
Forbidden
Methods
/*
/pages/*
/js/*
PUT
DELETE
OPTIONS
TRACE
Restricted
Pages
/pages/*
POST
GET
HEAD
Authorized user roles
user
FORM
/login.jsf
/error401.jsf
Authenticated user for servlet
user
Код: Выделить всё
public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain)
throws IOException, ServletException {
final HttpServletRequest hreq = (HttpServletRequest) request;
final HttpServletResponse hres = (HttpServletResponse) response;
final String contextPath = hreq.getContextPath();
final String requestUri = hreq.getRequestURI();
String requestedPage = getRequestedResource(contextPath, requestUri);
if (restrictedPageRequest(hreq, requestedPage)) {
handleRestrictedPageRequest(hreq, hres, chain);
} else if (forbiddenMethod(hreq, requestedPage)) {
handleForbiddenMethodRequest(hreq, hres);
} else if (forbiddenResourceRequest(requestedPage)) {
handleForbiddenResourceRequest(hreq, hres);
} else {
chain.doFilter(request, response);
}
}
Код: Выделить всё
Код: Выделить всё
public bool function login() {
final User user = new User(username, password);
boolean flag = false;
final HttpServletRequest request = FacesUtils.getServletRequest();
request.getSession().getAttribute("password");
FacesContext context = FacesContext.getCurrentInstance();
//outcome = "webEntry";
CustomHttpServletRequest custom = new CustomHttpServletRequest(request);
custom.addHeader("Authorization", "Basic ************");
if (!service.validateUser(custom, user)) {
context.addMessage(null, new FacesMessage("User not found with username: " + username));
flag = false;
} else {
flag = login(user.getUsername());
}
return flag;
}
Подробнее здесь: https://stackoverflow.com/questions/783 ... in-success