3 Replies Latest reply on Oct 28, 2008 3:35 PM by Val Sw

    Process for disabling Login, steps to take care

    Val Sw Expert

      I have generated CRUD application using seam generate-ui, it looks great....

      However, I would like to know correct process to disable logging functionality, example whenever I try to create it asks for login.

      I am doing the following to disable logging, please check if it is correct as per seam framework and what else I should change..

      a) components.xml
      Comment the following:
      <drools:rule-base name="securityRules">

      <security:identity security-rules="#{securityRules}" authenticate-method="#{authenticator.authenticate}" remember-me="true"/>

      <event type="org.jboss.seam.security.notLoggedIn">
         <action execute="#{redirect.captureCurrentView}"/>
      <event type="org.jboss.seam.security.loginSuccessful">
         <action execute="#{redirect.returnToCapturedView}"/>

      b) xxxxEdit.page.xml
      These files were generated by seam generate-ui, I should change to login-required="false"

      example StudyEdit.page.xml
      <?xml version="1.0" encoding="UTF-8"?>
      <page xmlns="http://jboss.com/products/seam/pages"
        xsi:schemaLocation="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.0.xsd"

      <begin-conversation join="true"/>
      <action execute="#{studyHome.wire}"/>
        • 1. Re: Process for disabling Login, steps to take care
          Val Sw Expert
          Please suggest on the above requset when I use login-required="false" in XXXX.page.xml as in point (b) above, sometimes it still asks for log-in.

          Please suggest the steps and changes I should do to so that user is never asked for login.

          • 2. Re: Process for disabling Login, steps to take care
            Ingo Jobling Master

            Try calling the static method Identity.setSecurityEnabled(false) to disable security checks

            • 3. Re: Process for disabling Login, steps to take care
              Val Sw Expert
              Where should I call this method, will it be home class...

              This is sample home for Reagent entity.. pls suggest

              public class ReagentHome extends EntityHome<Reagent> {

                   @In(create = true)
                   TreatmentHome treatmentHome;

                   public void setReagentHjid(Long id) {

                   public Long getReagentHjid() {
                        return (Long) getId();

                   protected Reagent createInstance() {
                        Reagent reagent = new Reagent();
                        return reagent;

                   public void wire() {
                        Treatment treatment = treatmentHome.getDefinedInstance();
                        if (treatment != null) {

                   public boolean isWired() {
                        return true;

                   public Reagent getDefinedInstance() {
                        return isIdDefined() ? getInstance() : null;