<commit_before>/*
 * Copyright 2001-2012 <NAME>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package woko.facets.builtin.containerauth;

import net.sourceforge.jfacets.annotations.FacetKey;
import net.sourceforge.stripes.action.*;
import woko.facets.BaseResolutionFacet;
import woko.facets.builtin.Login;
import woko.facets.builtin.WokoFacets;

@FacetKey(name= WokoFacets.login, profileId="all")
public class LoginImpl extends BaseResolutionFacet implements Login {

  public Resolution getResolution(ActionBeanContext abc) {
    abc.getMessages().add(new LocalizableMessage("woko.login.success"));
    return new RedirectResolution("/home");
  }


}
<commit_msg>#153 : container-auth doc<commit_after>/*
 * Copyright 2001-2012 <NAME>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package woko.facets.builtin.containerauth;

import net.sourceforge.jfacets.annotations.FacetKey;
import net.sourceforge.stripes.action.*;
import woko.facets.BaseResolutionFacet;
import woko.facets.builtin.Login;
import woko.facets.builtin.WokoFacets;

/**
 * <code>login</code> facet that simply redirects to <code>/home</code>. When using container authentication
 * the <code>/login</code> URL is supposed to be protected (in web.xml) so that container will
 * prompt for authentication before the user can reach this facet.
 */
@FacetKey(name= WokoFacets.login, profileId="all")
public class LoginImpl extends BaseResolutionFacet implements Login {

  public Resolution getResolution(ActionBeanContext abc) {
    abc.getMessages().add(new LocalizableMessage("woko.login.success"));
    return new RedirectResolution("/home");
  }


}

{'fraction_non_alphanumeric': 0.0929619872036131, 'fraction_numerical': 0.010161836657884832, 'mean_word_length': 4.572327044025157, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 1}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2146449', 'n_tokens_mistral': 754, 'n_tokens_neox': 731, 'n_words': 263}