Unwanted behavior: Action method being called several times

Hello,
I have a managed bean that calls a session ejb which itself does a search. The problem is that it is supposed to retrieve a resultset ONCE and the displayed behavior is that it never stop doing so. It fetches the resultset N TIMES.
Here is the managed bean and the method to look at is the performSearch method:
package arcoiris;
import java.util.ArrayList;
import java.util.List;
import javax.faces.model.SelectItem;
public class SearchManagedBean {
    //Collected from search form
    private String keyword;
    private String country;
    private Integer[] postcode;
    private boolean commentExists;
    private Integer rating;
    private boolean websiteExists;
    //Used to populate form
    private List<SelectItem> availableCountries;
    private List<SelectItem> availablePostcodes;
    private List<SelectItem> availableRatings;
    //Retrieved from ejb tier
    private List<EstablishmentLocal> retrievedEstablishments;
    //Service locator
    private arcoiris.ServiceLocator serviceLocator;
    //Constructor
    public SearchManagedBean() {
        System.out.println("within constructor SearchManagedBean");
    //Getters and setters
    public String getKeyword() {
        return keyword;
    public void setKeyword(String keyword) {
        this.keyword = keyword;
    public String getCountry() {
        return country;
    public void setCountry(String country) {
        this.country = country;
    public boolean isCommentExists() {
        return commentExists;
    public void setCommentExists(boolean commentExists) {
        this.commentExists = commentExists;
    public Integer getRating() {
        return rating;
    public void setRating(Integer rating) {
        this.rating = rating;
    public boolean isWebsiteExists() {
        return websiteExists;
    public void setWebsiteExists(boolean websiteExists) {
        this.websiteExists = websiteExists;
    public List<SelectItem> getAvailableCountries() {
        List<SelectItem> countries = new ArrayList<SelectItem>();
        SelectItem si_1 = new SelectItem();
        SelectItem si_2 = new SelectItem();
        SelectItem si_3 = new SelectItem();
        si_1.setValue("2");
        si_1.setLabel("ecuador");
        si_2.setValue("1");
        si_2.setLabel("colombia");
        si_3.setValue("3");
        si_3.setLabel("peru");
        countries.add(si_1);
        countries.add(si_2);
        countries.add(si_3);
        return countries;
    public void setAvailableCountries(List<SelectItem> countries) {
        this.availableCountries = availableCountries;
    public List<SelectItem> getAvailablePostcodes() {
        List<SelectItem> postcodes = new ArrayList<SelectItem>();
        SelectItem si_1 = new SelectItem();
        SelectItem si_2 = new SelectItem();
        SelectItem si_3 = new SelectItem();
        si_1.setValue(new Integer(75001));
        si_1.setLabel("75001");
        si_2.setValue(new Integer(75002));
        si_2.setLabel("75002");
        si_3.setValue(new Integer(75003));
        si_3.setLabel("75003");
        postcodes.add(si_1);
        postcodes.add(si_2);
        postcodes.add(si_3);
        return postcodes;
    public void setAvailablePostcodes(List<SelectItem> availablePostcodes) {
        this.availablePostcodes = availablePostcodes;
    public List<SelectItem> getAvailableRatings() {
        List<SelectItem> ratings = new ArrayList<SelectItem>();
        SelectItem si_1 = new SelectItem();
        SelectItem si_2 = new SelectItem();
        SelectItem si_3 = new SelectItem();
        si_1.setValue(new Integer(1));
        si_1.setLabel("1");
        si_2.setValue(new Integer(2));
        si_2.setLabel("2");
        si_3.setValue(new Integer(3));
        si_3.setLabel("3");
        ratings.add(si_1);
        ratings.add(si_2);
        ratings.add(si_3);
        return ratings;
    public void setAvailableRatings(List<SelectItem> availableRatings) {
        this.availableRatings = availableRatings;
    public Integer[] getPostcode() {
        return postcode;
    public void setPostcode(Integer[] postcode) {
        this.postcode = postcode;
    public List<EstablishmentLocal> getRetrievedEstablishments() {
        return retrievedEstablishments;
    public void setRetrievedEstablishments(List<EstablishmentLocal> retrievedEstablishments) {
        this.retrievedEstablishments = retrievedEstablishments;
    //Business methods
    public String performSearch(){
        System.out.println("performSearchManagedBean begin");
        SearchRequestDTO searchRequestDto = new SearchRequestDTO(this.keyword,this.country,this.postcode,this.commentExists,this.rating, this.websiteExists);
        System.out.println("java bean "+this.keyword+" "+this.country+" "+this.postcode+" "+this.commentExists+" "+this.rating+" "+this.websiteExists);
        SearchSessionLocal searchSession = lookupSearchSessionBean();
        List<EstablishmentLocal> retrievedEstablishments = searchSession.performSearch(searchRequestDto);
        this.setRetrievedEstablishments(retrievedEstablishments);
        System.out.println("performSearchManagedBean end");
        return "success";
    private arcoiris.ServiceLocator getServiceLocator() {
        if (serviceLocator == null) {
            serviceLocator = new arcoiris.ServiceLocator();
        return serviceLocator;
    private arcoiris.SearchSessionLocal lookupSearchSessionBean() {
        try {
            return ((arcoiris.SearchSessionLocalHome) getServiceLocator().getLocalHome("java:comp/env/ejb/SearchSessionBean")).create();
        } catch(javax.naming.NamingException ne) {
            java.util.logging.Logger.getLogger(getClass().getName()).log(java.util.logging.Level.SEVERE,"exception caught" ,ne);
            throw new RuntimeException(ne);
        } catch(javax.ejb.CreateException ce) {
            java.util.logging.Logger.getLogger(getClass().getName()).log(java.util.logging.Level.SEVERE,"exception caught" ,ce);
            throw new RuntimeException(ce);
}Here is the object request passed:
package arcoiris;
import java.io.Serializable;
public class SearchRequestDTO implements Serializable {
    private String keyword;
    private String country;
    private Integer[] postcode;
    private boolean commentExists;
    private Integer rating;
    private boolean websiteExists;
    public SearchRequestDTO() {
    public SearchRequestDTO(String keyword, String country, Integer[] postcode, boolean commmentExists, Integer rating, boolean websiteExists){
        this.keyword=keyword;
        this.country= country;
        this.postcode = postcode;
        this.commentExists = commentExists;
        this.rating = rating;
        this.websiteExists = websiteExists;
    public String getKeyword() {
        return keyword;
    public void setKeyword(String keyword) {
        this.keyword = keyword;
    public String getCountry() {
        return country;
    public void setCountry(String country) {
        this.country = country;
    public Integer[] getPostcode() {
        return postcode;
    public void setPostcode(Integer[] postcode) {
        this.postcode = postcode;
    public boolean isCommentExists() {
        return commentExists;
    public void setCommentExists(boolean commmentExists) {
        this.commentExists = commmentExists;
    public Integer getRating() {
        return rating;
    public void setRating(Integer rating) {
        this.rating = rating;
    public boolean isWebsiteExists() {
        return websiteExists;
    public void setWebsiteExists(boolean websiteExists) {
        this.websiteExists = websiteExists;
}and here is the session ejb:
package arcoiris;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;
import javax.ejb.*;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.sql.DataSource;
public class SearchSessionBean implements SessionBean, SearchSessionLocalBusiness {
    private SessionContext context;
    private arcoiris.ServiceLocator serviceLocator;
    // <editor-fold defaultstate="collapsed" desc="EJB infrastructure methods. Click the + sign on the left to edit the code.">
    // TODO Add code to acquire and use other enterprise resources (DataSource, JMS, enterprise bean, Web services)
    // TODO Add business methods or web service operations
     * @see javax.ejb.SessionBean#setSessionContext(javax.ejb.SessionContext)
    public void setSessionContext(SessionContext aContext) {
        context = aContext;
     * @see javax.ejb.SessionBean#ejbActivate()
    public void ejbActivate() {
     * @see javax.ejb.SessionBean#ejbPassivate()
    public void ejbPassivate() {
     * @see javax.ejb.SessionBean#ejbRemove()
    public void ejbRemove() {
    // </editor-fold>
     * See section 7.10.3 of the EJB 2.0 specification
     * See section 7.11.3 of the EJB 2.1 specification
    public void ejbCreate() {
        // TODO implement ejbCreate if necessary, acquire resources
        // This method has access to the JNDI context so resource aquisition
        // spanning all methods can be performed here such as home interfaces
        // and data sources.
    // Add business logic below. (Right-click in editor and choose
    // "EJB Methods > Add Business Method" or "Web Service > Add Operation")
    public List<EstablishmentLocal> performSearch(SearchRequestDTO searchRequestDto) {
        System.out.println("within performSearch");
        List<EstablishmentLocal> establishments = new ArrayList<EstablishmentLocal>();
        try {
            Context ctx = new InitialContext();
            DataSource ds = (DataSource)ctx.lookup("java:/guia");
            Connection con = ds.getConnection();
            Statement stm = con.createStatement();
            String query = buildQueryFromSearchRequestDTO(searchRequestDto);
            ResultSet rs = stm.executeQuery(query);
            int rowCount = 0;
            while(rs.next()){
                rowCount = rowCount + 1;
                System.out.println("while");
                try {
                    EstablishmentLocal establishment = lookupEstablishmentBean().findByEstablishmentId(rs.getInt("establishment_id"));
                    establishments.add(establishment);
                    System.out.println("est name "+establishment.getEstablishmentName());
                } catch (FinderException ex) {
                    ex.printStackTrace();
                } catch (SQLException ex) {
                    ex.printStackTrace();
            System.out.println("rowCount = "+rowCount);
            rs.close();
            stm.close();
            con.close();
        catch (SearchRequestMalformedException ex){
            ex.printStackTrace();
        }catch (NamingException ex) {
            ex.printStackTrace();
        }catch (SQLException ex){
            ex.printStackTrace();
        //TODO implement performSearch
        return null;
    private String buildQueryFromSearchRequestDTO(SearchRequestDTO searchRequestDto) throws SearchRequestMalformedException {
        StringBuffer sb = new StringBuffer();
        //Head of the query
        sb.append("SELECT ");
        sb.append("e.establishment_id, ");
        sb.append("e.establishment_name, ");
        sb.append("avg(r.rating) as avg_rating ");
        sb.append("FROM ");
        sb.append("establishment e, ");
        sb.append("rating r, ");
        sb.append("comment com, ");
        sb.append("establishment_country ec, ");
        sb.append("country_ref cou ");
        sb.append("where ");
        sb.append("e.establishment_id=ec.establishment_id and ");
        sb.append("ec.country_id=cou.country_id and ");
        sb.append("e.establishment_id=com.establishment_id and ");
        sb.append("r.establishment_id=e.establishment_id and ");
        //Conditional parts of the query
        //If user wants comment to be present
        if(searchRequestDto.isCommentExists()){
            sb.append("e.establishment_id=com.establishment_id and ");
        //If user has typed in a keyword
        if(!searchRequestDto.getKeyword().equals("") && !searchRequestDto.getKeyword().equals(" ")&& searchRequestDto.getKeyword()!=null){
            sb.append("e.establishment_name like '%"+ searchRequestDto.getKeyword() +"%' and ");
        //If user has choosen a country
        if(searchRequestDto.getCountry()!=null && !searchRequestDto.getCountry().equals("") && !searchRequestDto.getCountry().equals(" ")&& searchRequestDto.getCountry()!=null){
            sb.append("ec.country_id = " + searchRequestDto.getCountry() + " and ");
        //If user wants website to be present
        if(searchRequestDto.isWebsiteExists()){
            sb.append("e.establishment_website is not null and ");
/* conditions
si utilisateur a renseign� un premier code postal "e.establishment_postcode = 'postcode_one' --si racine
        si autre code postal "or e.establishment_postcode = 'postcode_two'
        ainsi de suite
and--vient de si racine
        //Tail of the query
        sb.append("0=0 ");
        sb.append("group by e.establishment_id ");
        //If the user wants a minimum rating
        if(searchRequestDto.getRating() != null && searchRequestDto.getRating().intValue()!=0){
            sb.append("having avg(r.rating) >= " + searchRequestDto.getRating());
        sb.append(" ");
        sb.append("order by e.establishment_id ");
        System.out.println("****************************");
        System.out.println(sb);
        System.out.println("****************************");
        return sb.toString();
    private arcoiris.ServiceLocator getServiceLocator() {
        if (serviceLocator == null) {
            serviceLocator = new arcoiris.ServiceLocator();
        return serviceLocator;
    private EstablishmentLocalHome lookupEstablishmentBean() {
        try {
            return (arcoiris.EstablishmentLocalHome) getServiceLocator().getLocalHome("java:comp/env/ejb/EstablishmentBean");
        } catch(javax.naming.NamingException ne) {
            java.util.logging.Logger.getLogger(getClass().getName()).log(java.util.logging.Level.SEVERE,"exception caught" ,ne);
            throw new RuntimeException(ne);
}I just don't understand why it does so. The peformSearch should be executed ONCE only.
Here is my face config file:
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE faces-config PUBLIC
  "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
  "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
<faces-config>
    <managed-bean>
        <managed-bean-name>SearchManagedBean</managed-bean-name>
        <managed-bean-class>arcoiris.SearchManagedBean</managed-bean-class>
        <managed-bean-scope>request</managed-bean-scope>
    </managed-bean>
    <navigation-rule>
       <description></description>
        <from-view-id>/welcomeJSF.jsp</from-view-id>
        <navigation-case>
        <from-outcome>success</from-outcome>
        <to-view-id>index.jsp</to-view-id>
        </navigation-case>
    </navigation-rule>
</faces-config>Can anyone help?
Thanks in advance,
Julien.

Just reactivating my thread hoping someone will reply to it....
Julien.

Similar Messages

  • Finalize() method being called multiple times for same object?

    I got a dilly of a pickle here.
    Looks like according to the Tomcat output log file that the finalize method of class User is being called MANY more times than is being constructed.
    Here is the User class:
    package com.db.multi;
    import java.io.*;
    import com.db.ui.*;
    import java.util.*;
    * @author DBriscoe
    public class User implements Serializable {
        private String userName = null;
        private int score = 0;
        private SocketImage img = null;
        private boolean gflag = false;
        private Calendar timeStamp = Calendar.getInstance();
        private static int counter = 0;
        /** Creates a new instance of User */
        public User() { counter++;     
        public User(String userName) {
            this.userName = userName;
            counter++;
        public void setGflag(boolean gflag) {
            this.gflag = gflag;
        public boolean getGflag() {
            return gflag;
        public void setScore(int score) {
            this.score = score;
        public int getScore() {
            return score;
        public void setUserName(String userName) {
            this.userName = userName;
        public String getUserName() {
            return userName;
        public void setImage(SocketImage img) {
            this.img = img;
        public SocketImage getImage() {
            return img;
        public void setTimeStamp(Calendar c) {
            this.timeStamp = c;
        public Calendar getTimeStamp() {
            return this.timeStamp;
        public boolean equals(Object obj) {
            try {
                if (obj instanceof User) {
                    User comp = (User)obj;
                    return comp.getUserName().equals(userName);
                } else {
                    return false;
            } catch (NullPointerException npe) {
                return false;
        public void finalize() {
            if (userName != null && !userName.startsWith("OUTOFDATE"))
                System.out.println("User " + userName + " destroyed. " + counter);
        }As you can see...
    Every time a User object is created, a static counter variable is incremented and then when an object is destroyed it appends the current value of that static member to the Tomcat log file (via System.out.println being executed on server side).
    Below is the log file from an example run in my webapp.
    Dustin
    User Queue Empty, Adding User: com.db.multi.User@1a5af9f
    User Dustin destroyed. 0
    User Dustin destroyed. 0
    User Dustin destroyed. 0
    User Dustin destroyed. 0
    User Dustin destroyed. 0
    USER QUEUE: false
    INSIDE METHOD: false
    AFTER METHOD: false
    User Dustin destroyed. 1
    User Dustin destroyed. 1
    User Dustin destroyed. 1
    User Dustin destroyed. 1
    USER QUEUE: false
    INSIDE METHOD: false
    AFTER METHOD: false
    User Dustin destroyed. 2
    User Dustin destroyed. 2
    User Dustin destroyed. 2
    User Dustin destroyed. 2
    User Dustin destroyed. 2
    User Dustin destroyed. 2
    User Dustin destroyed. 2
    User Dustin destroyed. 2
    USER QUEUE: false
    INSIDE METHOD: false
    AFTER METHOD: false
    User Dustin destroyed. 3
    User Dustin destroyed. 3
    User Dustin destroyed. 3
    User Dustin destroyed. 3
    User Dustin destroyed. 3
    User Dustin destroyed. 3
    User Dustin destroyed. 3
    User Dustin destroyed. 3
    User Dustin destroyed. 3
    USER QUEUE: false
    INSIDE METHOD: false
    AFTER METHOD: false
    User Dustin destroyed. 4
    User Dustin destroyed. 4
    User Dustin destroyed. 4
    User Dustin destroyed. 4
    User Dustin destroyed. 4
    User Dustin destroyed. 4
    User Dustin destroyed. 4
    User Dustin destroyed. 4
    User Dustin destroyed. 4
    USER QUEUE: false
    INSIDE METHOD: false
    AFTER METHOD: false
    User Dustin destroyed. 5
    User Dustin destroyed. 5
    User Dustin destroyed. 5
    User Dustin destroyed. 5
    User Dustin destroyed. 5
    User Dustin destroyed. 5
    User Dustin destroyed. 5
    User Dustin destroyed. 5
    User Dustin destroyed. 5
    USER QUEUE: false
    INSIDE METHOD: false
    AFTER METHOD: false
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    User Dustin destroyed. 6
    Joe
    USER QUEUE: false
    INSIDE METHOD: false
    AFTER METHOD: false
    User Dustin pulled from Queue, Game created: Joe
    User Already Placed: Dustin with Joe
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    User Dustin destroyed. 7
    INSIDE METHOD: false
    INSIDE METHOD: false
    USER QUEUE: true
    INSIDE METHOD: false
    INSIDE METHOD: false
    User Dustin destroyed. 9
    User Joe destroyed. 9
    User Dustin destroyed. 9
    User Dustin destroyed. 9
    User Dustin destroyed. 9
    User Dustin destroyed. 9
    INSIDE METHOD: true
    INSIDE METHOD: false
    USER QUEUE: true
    INSIDE METHOD: false
    INSIDE METHOD: false
    INSIDE METHOD: true
    INSIDE METHOD: false
    USER QUEUE: true
    INSIDE METHOD: false
    INSIDE METHOD: false
    It really does seem to me like finalize is being called multiple times for the same object.
    That number should incremement for every instantiated User, and finalize can only be called once for each User object.
    I thought this was impossible?
    Any help is appreciated!

    Thanks...
    I am already thinking of ideas to limit the number of threads.
    Unfortunately there are two threads of execution in the servlet handler, one handles requests and the other parses the collection of User objects to check for out of date timestamps, and then eliminates them if they are out of date.
    The collection parsing thread is currently a javax.swing.Timer thread (Bad design I know...) so I believe that I can routinely check for timestamps in another way and fix that problem.
    Just found out too that Tomcat was throwing me a ConcurrentModificationException as well, which may help explain the slew of mysterious behavior from my servlet!
    The Timer thread has to go. I got to think of a better way to routinely weed out User objects from the collection.
    Or perhaps, maybe I can attempt to make it thread safe???
    Eg. make my User collection volatile?
    Any opinions on the best approach are well appreciated.

  • Action method getting called multiple times.

    Hi All,
    The problem that I am facing is pretty weird.
    The issue is the i have an input field that takes date as input field.
    This field is inside a data taable
    FYI: I tried converter still same problem.
    So when ever I enter wrong data as "asda" inside this date field I get a validation error. which is good. So assume it took me 3 submit clicks to fix all my errors on the page.
    So now when I click the submit for the 4th time.
    The action method gets trigerred 4 times.
    Desperately waiting for a fix.
    Thank you in advance.
                                            <h:dataTable id="disbursementTable"
                                                 value="#{certTemplateBean.disbursements}" var="disbursement"
                                                 binding="#{certTemplateBean.disbursementTable}"
                                                 columnClasses="disburseDate,disburseAmt,disburseAction"
                                                 styleClass="disbursementTable" cellspacing="0" cellpadding="1">
                                                 <h:column >
                                                      <h:inputText id="disburseDate" styleClass="#{certTemplatesListBean.errorHolder.disburseDate} ms" size="10"
                                                                value="#{disbursement.date}">
                                                           <f:validator validatorId="RegExp" />
                                                           <f:attribute name="regexp" value="[0-9]{2}/[0-9]{2}/[0-9]{4}" />                                             
                                                           <f:attribute name="fieldRef" value="Disbursement Date :" />
                                                           <f:attribute name="message" value="Invalid Date" />
                                                           <f:attribute name="bean" value="certTemplatesListBean" />
                                                      </h:inputText>
                                                 </h:column>
                                            </h:dataTable>
                                            <h:commandLink id="addPro"
                                                 action="#{certTemplatesListBean.doAddUpdateCertTemplate}">
                                                 <h:outputText value="Add Profile direct"/>
                                            </h:commandLink>

    Probably got to do with the JSF jar files. I am not sure though. Can you check if the below link is useful?
    http://jira.jboss.com/jira/browse/AJSF-127

  • Strange behavior: action method not called when button submitted

    Hello,
    My JSF app is diplaying a strange behavior: when the submit button is pressed the action method of my managed bean is not called.
    Here is my managed bean:
    package arcoiris;
    import java.util.ArrayList;
    import java.util.List;
    import javax.faces.model.SelectItem;
    public class SearchManagedBean {
        //Collected from search form
        private String keyword;
        private String country;
        private int[] postcode;
        private boolean commentExists;
        private int rating;
        private boolean websiteExists;
        //Used to populate form
        private List<SelectItem> availableCountries;
        private List<SelectItem> availablePostcodes;
        private List<SelectItem> availableRatings;
        //Retrieved from ejb tier
        private List<EstablishmentLocal> retrievedEstablishments;
        //Service locator
        private arcoiris.ServiceLocator serviceLocator;
        //Constructor
        public SearchManagedBean() {
            System.out.println("within constructor SearchManagedBean");
            System.out.println("rating "+this.rating);
        //Getters and setters
        public String getKeyword() {
            return keyword;
        public void setKeyword(String keyword) {
            this.keyword = keyword;
        public String getCountry() {
            return country;
        public void setCountry(String country) {
            this.country = country;
        public boolean isCommentExists() {
            return commentExists;
        public void setCommentExists(boolean commentExists) {
            this.commentExists = commentExists;
        public int getRating() {
            return rating;
        public void setRating(int rating) {
            this.rating = rating;
        public boolean isWebsiteExists() {
            return websiteExists;
        public void setWebsiteExists(boolean websiteExists) {
            this.websiteExists = websiteExists;
        public List<SelectItem> getAvailableCountries() {
            List<SelectItem> countries = new ArrayList<SelectItem>();
            SelectItem si_1 = new SelectItem();
            SelectItem si_2 = new SelectItem();
            SelectItem si_3 = new SelectItem();
            si_1.setValue("2");
            si_1.setLabel("ecuador");
            si_2.setValue("1");
            si_2.setLabel("colombia");
            si_3.setValue("3");
            si_3.setLabel("peru");
            countries.add(si_1);
            countries.add(si_2);
            countries.add(si_3);
            return countries;
        public void setAvailableCountries(List<SelectItem> countries) {
            this.availableCountries = availableCountries;
        public List<SelectItem> getAvailablePostcodes() {
            List<SelectItem> postcodes = new ArrayList<SelectItem>();
            SelectItem si_1 = new SelectItem();
            SelectItem si_2 = new SelectItem();
            SelectItem si_3 = new SelectItem();
            si_1.setValue(75001);
            si_1.setLabel("75001");
            si_2.setValue(75002);
            si_2.setLabel("75002");
            si_3.setValue(75003);
            si_3.setLabel("75003");
            postcodes.add(si_1);
            postcodes.add(si_2);
            postcodes.add(si_3);
            return postcodes;
        public void setAvailablePostcodes(List<SelectItem> availablePostcodes) {
            this.availablePostcodes = availablePostcodes;
        public List<SelectItem> getAvailableRatings() {
            List<SelectItem> ratings = new ArrayList<SelectItem>();
            SelectItem si_1 = new SelectItem();
            SelectItem si_2 = new SelectItem();
            SelectItem si_3 = new SelectItem();
            si_1.setValue(1);
            si_1.setLabel("1");
            si_2.setValue(2);
            si_2.setLabel("2");
            si_3.setValue(3);
            si_3.setLabel("3");
            ratings.add(si_1);
            ratings.add(si_2);
            ratings.add(si_3);
            return ratings;
        public void setAvailableRatings(List<SelectItem> availableRatings) {
            this.availableRatings = availableRatings;
        public int[] getPostcode() {
            return postcode;
        public void setPostcode(int[] postcode) {
            this.postcode = postcode;
        public List<EstablishmentLocal> getRetrievedEstablishments() {
            return retrievedEstablishments;
        public void setRetrievedEstablishments(List<EstablishmentLocal> retrievedEstablishments) {
            this.retrievedEstablishments = retrievedEstablishments;
        //Business methods
        public String performSearch(){
            System.out.println("performSearchManagedBean begin");
            SearchRequestDTO searchRequestDto = new SearchRequestDTO(this.keyword,this.country,this.postcode,this.commentExists,this.rating, this.websiteExists);
            SearchSessionLocal searchSession = lookupSearchSessionBean();
            List<EstablishmentLocal> retrievedEstablishments = searchSession.performSearch(searchRequestDto);
            this.setRetrievedEstablishments(retrievedEstablishments);
            System.out.println("performSearchManagedBean end");
            return "success";
        private arcoiris.ServiceLocator getServiceLocator() {
            if (serviceLocator == null) {
                serviceLocator = new arcoiris.ServiceLocator();
            return serviceLocator;
        private arcoiris.SearchSessionLocal lookupSearchSessionBean() {
            try {
                return ((arcoiris.SearchSessionLocalHome) getServiceLocator().getLocalHome("java:comp/env/ejb/SearchSessionBean")).create();
            } catch(javax.naming.NamingException ne) {
                java.util.logging.Logger.getLogger(getClass().getName()).log(java.util.logging.Level.SEVERE,"exception caught" ,ne);
                throw new RuntimeException(ne);
            } catch(javax.ejb.CreateException ce) {
                java.util.logging.Logger.getLogger(getClass().getName()).log(java.util.logging.Level.SEVERE,"exception caught" ,ce);
                throw new RuntimeException(ce);
    }Here is my jsp page:
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
    <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
       "http://www.w3.org/TR/html4/loose.dtd">
             <html>
                 <head>
                     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
                     <META HTTP-EQUIV="pragma" CONTENT="no-cache">
                     <title>JSP Page</title>
                 </head>
                 <body>
                     <f:view>
                         <h:panelGroup id="body">
                             <h:form id="searchForm">
                                 <h:panelGrid columns="2">
                                     <h:outputText id="keywordLabel" value="enter keyword"/>   
                                     <h:inputText id="keywordField" value="#{SearchManagedBean.keyword}"/>
                                     <h:outputText id="countryLabel" value="choose country"/>   
                                     <h:selectOneListbox id="countryField" value="#{SearchManagedBean.country}">
                                         <f:selectItems id="availableCountries" value="#{SearchManagedBean.availableCountries}"/>
                                     </h:selectOneListbox>
                                     <h:outputText id="postcodeLabel" value="choose postcode(s)"/>   
                                     <h:selectManyListbox id="postcodeField" value="#{SearchManagedBean.postcode}">
                                         <f:selectItems id="availablePostcodes" value="#{SearchManagedBean.availablePostcodes}"/>
                                     </h:selectManyListbox>
                                     <h:outputText id="commentExistsLabel" value="with comment"/>
                                     <h:selectBooleanCheckbox id="commentExistsField" value="#{SearchManagedBean.commentExists}" />
                                     <h:outputText id="ratingLabel" value="rating"/>
                                     <h:selectOneListbox id="ratingField" value="#{SearchManagedBean.rating}">
                                         <f:selectItems id="availableRatings" value="#{SearchManagedBean.availableRatings}"/>
                                     </h:selectOneListbox>
                                     <h:outputText id="websiteExistsLabel" value="with website"/>
                                     <h:selectBooleanCheckbox id="websiteExistsField" value="#{SearchManagedBean.websiteExists}" />
                                     <h:commandButton value="search" action="#{SearchManagedBean.performSearch}"/>
                                 </h:panelGrid>
                             </h:form>
                         </h:panelGroup>
                     </f:view>
                 </body>
             </html>
         here is my faces config file:
    <?xml version='1.0' encoding='UTF-8'?>
    <!DOCTYPE faces-config PUBLIC
      "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
      "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
    <faces-config>
        <managed-bean>
            <managed-bean-name>SearchManagedBean</managed-bean-name>
            <managed-bean-class>arcoiris.SearchManagedBean</managed-bean-class>
            <managed-bean-scope>request</managed-bean-scope>
        </managed-bean>
        <navigation-rule>
           <description></description>
            <from-view-id>/welcomeJSF.jsp</from-view-id>
            <navigation-case>
            <from-outcome>success</from-outcome>
            <to-view-id>index.jsp</to-view-id>
            </navigation-case>
        </navigation-rule>
    </faces-config>The problem occurs when the field ratingField is left blank (which amounts to it being set at 0 since it is an int).
    Can anyone help please?
    Thanks in advance,
    Julien.

    Hello,
    Thanks for the suggestion. I added the tag and it now says:
    java.lang.IllegalArgumentException
    I got that from the log:
    2006-08-17 15:29:16,859 DEBUG [com.sun.faces.el.ValueBindingImpl] setValue Evaluation threw exception:
    java.lang.IllegalArgumentException
         at sun.reflect.GeneratedMethodAccessor118.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at com.sun.faces.el.PropertyResolverImpl.setValue(PropertyResolverImpl.java:178)
         at com.sun.faces.el.impl.ArraySuffix.setValue(ArraySuffix.java:192)
         at com.sun.faces.el.impl.ComplexValue.setValue(ComplexValue.java:171)
         at com.sun.faces.el.ValueBindingImpl.setValue(ValueBindingImpl.java:234)
         at javax.faces.component.UIInput.updateModel(UIInput.java:544)
         at javax.faces.component.UIInput.processUpdates(UIInput.java:442)
         at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:935)
         at javax.faces.component.UIForm.processUpdates(UIForm.java:196)
         at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:935)
         at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:935)
         at javax.faces.component.UIViewRoot.processUpdates(UIViewRoot.java:363)
         at com.sun.faces.lifecycle.UpdateModelValuesPhase.execute(UpdateModelValuesPhase.java:81)
         at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
         at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
         at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
         at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
         at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
         at java.lang.Thread.run(Thread.java:595)
    2006-08-17 15:29:16,875 DEBUG [com.sun.faces.context.FacesContextImpl] Adding Message[sourceId=searchForm:ratingField,summary=java.lang.IllegalArgumentException)Do you see where the problem comes from??
    Julien.

  • LoginModule login() method being called multiple times

    I have a J2EE application that is deployed in Oracle 10g 10.1.2.0.2 that implements a cutom login module. The custom class (MyClassLoginModule) implements the LoginModule interface. Everything works great if the username and password entered by an end user are correct. However, it appears that if a user enters an incorrect password after failing authentication the container executes the MyClassLoginModule.login() method again. In some cases, it calls it serveral time each failing authentication.
    This wouldn't be a problem however, the username and password are also the end users workstation accounts. This behaviour is capable of locking their accounts in one failed attempt.
    Any help or insight would be greatly appreciated.

    We're using FORM based authentication. The problem is not with multiple requests, but appears to be an issue with the container. See the following for more info:
    LoginModule login method called twice on unsuccessful logins

  • Using rendered= stops action method being called on commandButton

    Help help help please.
    I have a managed-bean defined at "request" scope. This bean contains an encodedId field which is a string. This string is present in the form as a hidden field. On submit of the form, this setEncodedId is called on my bean, which then decodes the string and does setup of the bean.
    The problem I have is that if I use a commandButton with rendered="#{MyBean.renderNextButton}" and the result of isRenderNextButton() is dependent on encodedId from the submit, then the button IS correctly rendered, but the action tied to the button fails to be called and the same page reloads when the button is clicked.
    However, if I hardcode 'true' as the return value of isRenderNextButton() then the button renders and the action is called correctly.
    I've also noticed that isRenderNextButton() is called four or more times on each submit even through I've only got one button using this rendered expression.
    Any ideas anyone?

    Without spending lots of time investigating, could I
    write my own implementation of commandButton that
    could have the render state encoded in the state
    information I see encoded in the form?I can't understand the reason why you insist to hold the information in the component,
    while the only you should do is to use a session scope bean to hold it using the standard JSF mechanism.

  • How to find the number of times method being called.....

    hi,
    can any one pls tell me how to find the number of times the method being called......herez the example....
    Refrence ref = new Refrence();
    for(int i = 0;i < arr.length; i++){
    if(somecondition){
    ref.getMethod();
    here i want to know how many times the getMethod() is calling...Is there any method to do this.. i have seen StrackTraceElement class..but not sure about that....pls tell me the solution....

    can any one pls tell me how to find the number of times the method being called......
    herez the example.... http://www.catb.org/~esr/faqs/smart-questions.html#writewell
    How To Ask Questions The Smart Way
    Eric Steven Raymond
    Rick Moen
    Write in clear, grammatical, correctly-spelled language
    We've found by experience that people who are careless and sloppy writers are usually also careless and sloppy at thinking and coding (often enough to bet on, anyway). Answering questions for careless and sloppy thinkers is not rewarding; we'd rather spend our time elsewhere.
    So expressing your question clearly and well is important. If you can't be bothered to do that, we can't be bothered to pay attention. Spend the extra effort to polish your language. It doesn't have to be stiff or formal ? in fact, hacker culture values informal, slangy and humorous language used with precision. But it has to be precise; there has to be some indication that you're thinking and paying attention.
    Spell, punctuate, and capitalize correctly. Don't confuse "its" with "it's", "loose" with "lose", or "discrete" with "discreet". Don't TYPE IN ALL CAPS; this is read as shouting and considered rude. (All-smalls is only slightly less annoying, as it's difficult to read. Alan Cox can get away with it, but you can't.)
    More generally, if you write like a semi-literate b o o b you will very likely be ignored. So don't use instant-messaging shortcuts. Spelling "you" as "u" makes you look like a semi-literate b o o b to save two entire keystrokes.

  • On Execute operation, the bean getter is being called multiple times

    Hi,
    I have a JCR data control, i am trying to write a method that returns predicate, but this method is being called multiple times, when executing the advanced search operation.
      public List<Predicate> getPredicates() {
      ArrayList<Predicate> predicates = new ArrayList<Predicate>();
       // predicates.add(new Predicate("jcr:content/idc:metadata/idc:xScope",Operator.EQUALS,"GLOBAL"));
      DCBindingContainer bc=(DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
      JUCtrlListBinding attrBinding=(JUCtrlListBinding)  bc.findCtrlBinding("StateId");
      Object stateId= attrBinding.getSelectedValue();
      if(stateId instanceof Row){
      predicates.add(new Predicate("jcr:content/idc:metadata/idc:xState"
      , Operator.EQUALS
      ,((Row)stateId).getAttribute("StateId").toString()));
      attrBinding=(JUCtrlListBinding)  bc.findCtrlBinding("DistrictId");
      Object districtId=attrBinding.getSelectedValue();
      if(districtId instanceof Row){
          predicates.add(new Predicate("jcr:content/idc:metadata/idc:xDistrict",Operator.EQUALS,((Row)districtId).getAttribute("DistrictId").toString()));
        attrBinding=(JUCtrlListBinding)  bc.findCtrlBinding("Scope");
        Object scopeId=attrBinding.getSelectedValue();
        if(scopeId instanceof Row){
            predicates.add(new Predicate("jcr:content/idc:metadata/idc:xScope",Operator.EQUALS,((Row)scopeId).getAttribute("ScopeType")));
        AttributeBinding tempAttrBinding=(AttributeBinding)bc.findCtrlBinding("CreatedDate");
        Object createdDate=tempAttrBinding.getInputValue();
        if(createdDate!=null){
            predicates.add(new Predicate("jcr:content/jcr:created",Operator.EQUALS,createdDate.toString()));
        if (predicates.size()>0){
          return predicates;
      return Collections.emptyList();
      } The problem is while it's being called multiple times different list's are being returned which is causing the method not to work . The bean is in pageFlowScope .

    That is bc ADF life cicle... Is always executing 2 times...

  • CommandLink in dataTable rendered method is called multiple times

    I have a dataTable in which one of the columns contains a commandLink. The commandLink has the "rendered" option bound to a backing bean method. When the page is submitted, the backing bean method gets called 8 times for each row in the table if the value returned is "true" and 3 times per row if the value returned is "false". Since the page is designed to "navigate" back to itself, I can understand it getting called more than once, but 8 times??? What's up with that?

    Because you have a bug in your code.
    If you want further help post a Short, Self Contained, Compilable and Executable, Example Program ([url http://homepage1.nifty.com/algafield/sscce.html]SSCCE) that demonstrates the problem.
    And don't forget to use [url http://forum.java.sun.com/help.jspa?sec=formatting]code formatting when posting code.

  • HT5622 When updating my apps am being asked several times for my appleId password and even when providing it, it keeps asking and still doesn't update anything, any suggestions?

    When updating my apps am being asked several times for my appleId password and even when providing it, it keeps asking and still doesn't update anything, any suggestions?

    Does the username and password you try to use have administrator privileges? You must input an admin username and password to install. 

  • Action method not called in Backing Bean

    I am using <x:inputFileUpload> tag inside my jsp page. I am trying to call action method when clicking button, but action method not called.
    My jsp page:
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <%@ taglib uri="http://myfaces.apache.org/extensions" prefix="x"%>
    <html>
         <head>
              <title>File upload Test</title>
         </head>
         <body>
              <f:view>
                   <h:form id="form1" enctype="multipart/form-data">
                        <h:messages id="asdghsda"/>          
                        <h:outputText value="This is file upload page functionlaity POC" />                                   
                        <h:inputText value="#{fileUploadBean.textField}" />
                        <x:inputFileUpload id="myFileId" value="#{fileUploadBean.myFile}" storage="file" required="true"/>                    
                        <h:commandButton action="#{fileUploadBean.storeFile}" value="Enter here" />                    
                        <h:commandLink value="Clicl Here!!" action="#{fileUploadBean.storeFile}"></h:commandLink>
                   </h:form>               
              </f:view>
         </body>     
    </html>
    My backing bean:
    package com.beans;
    import java.io.BufferedInputStream;
    import java.io.File;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    import org.apache.log4j.Logger;
    import org.apache.myfaces.custom.fileupload.UploadedFile;
    public class FileUploadBean {     
         private static Logger logger = Logger.getLogger(FileUploadBean.class.getName());
         private String textField;
         private UploadedFile myFile;
         public UploadedFile getMyFile() {
              logger.info("inside get method");
         return myFile;
         public void setMyFile(UploadedFile myFile) {
              logger.info("inside set method");
              this.myFile = myFile;
         public void storeFile(){          
              logger.info("Inside the storeFile method");
              logger.info("The text field value: " + getTextField());
              try {
                   InputStream in = new BufferedInputStream(myFile.getInputStream());
                   logger.info("The string is: " + in.read());
                   System.out.println(in.read());
                   File f = new File("D:\\share\\sample.txt");               
                   OutputStream out = new FileOutputStream(f);
                   out.write(in.read());
              } catch (IOException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              logger.info("Exit from the storeFile method");
         public String getTextField() {
              return textField;
         public void setTextField(String textField) {
              this.textField = textField;
    My web.xml file:
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    <display-name>MyJSFProject</display-name>
    <context-param>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>server</param-value>
    </context-param>
    <filter>
    <filter-name>ExtensionsFilter</filter-name>
    <filter-class>org.apache.myfaces.component.html.util.ExtensionsFilter</filter-class>
    <init-param>
    <param-name>uploadMaxFileSize</param-name>
    <param-value>10m</param-value>
    </init-param>
    <init-param>
    <param-name>uploadThresholdSize</param-name>
    <param-value>100k</param-value>
    </init-param>
    </filter>
    <filter-mapping>
    <filter-name>ExtensionsFilter</filter-name>
    <servlet-name>FacesServlet</servlet-name>
    </filter-mapping>
    <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.jsf</url-pattern>
    </servlet-mapping>
    </web-app>
    Can someone help me on this? I need urgently.

    One straight and simple answer which i can give you method associated to action attributes always returns a java.lang.String Object.
    REF :
    action:
    =====
    If specified as a string: Directly specifies an outcome used by the navigation handler to determine the JSF page to load next as a result of activating the button or link If specified as a method binding: The method has this signature: String methodName(); the string represents the outcome
    source : http://horstmann.com/corejsf/jsf-tags.html#Table4_15
    therefore
    change
    public void storeFile(){
    logger.info("Inside the storeFile method");
    logger.info("The text field value: " + getTextField());
    try {
    InputStream in = new BufferedInputStream(myFile.getInputStream());
    logger.info("The string is: " + in.read());
    System.out.println(in.read());
    File f = new File("D:\\share\\sample.txt");
    OutputStream out = new FileOutputStream(f);
    out.write(in.read());
    } catch (IOException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    logger.info("Exit from the storeFile method");
    }to
    public String storeFile(){
    logger.info("Inside the storeFile method");
    logger.info("The text field value: " + getTextField());
    try {
    InputStream in = new BufferedInputStream(myFile.getInputStream());
    logger.info("The string is: " + in.read());
    System.out.println(in.read());
    File f = new File("D:\\share\\sample.txt");
    OutputStream out = new FileOutputStream(f);
    out.write(in.read());
    } catch (IOException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    logger.info("Exit from the storeFile method");
    return "success";
    }else where you can make use of actionlistener property in the following senario.
    but the method signature has to be void storeFile(ActionEvent ae)
    and could be use like
    <h:commandButton actionlistener="#{fileUploadBean.storeFile}" action="success" value="SUBMIT" /> Hope that might help :)
    REGARDS,
    RaHuL

  • TS3367 facetime doesn't work well after upgrading to ios8. I need to make a call several times to connect.

    Facetime doesn't work well after upgrading to ios8.
    When I make a facetime call, it doesn't sound some times on the other side.
    When it rings on the other side and is answered, it says (connecting), but it is still ringing on my side and never connected.
    After that, I disconnect and make a second call, it sometimes connects, but not everytime.
    I need to call several times to connect. It is really hard to connect through facetime after upgrading to ios8.
    I purchased three iPad so far because of this good feature (facetime).
    Please fix this issue as soon as possible.
    Thanks.

    Hi,
    There are two easy fixes to this.
    One, you can set up Family Sharing, in which you can have two different iCloud Accounts, yet still share the same apps, music, media etc.
    Two, go to Settings and turn-off "Handoff". This can be found under the General page.
    Hope this helps!

  • Since updating the new iOS7, I am receiving a call several times a day from a number listed as "unknown" and nobody is on the other end of the line when I answer.  Any advise to block this call from coming to my phone?

    Since updating to the new iOS7, I receive a call several times a day listed as "unknown" and nobody is on the line.  Any advise as to why this is happening and how I can block this call?

    Update - made an appointment at Genius bar today (chadstone, Victoria, Australia).
    Genius examined phone, replicated the issue and identified a malfunctioning main microphone. He noted that the reason I could still talk to the other party when I activated the 'speakerphone' function is that the speakerphone has a (second) noise cancelling microphone/speaker at the top of the handset. He replaced the phone under warranty, and offered to help me to set up the new phone. In and out in less than 15 minutes, with new phone operational.
    Very knowledgable, very polite and just great service.. Thank you Apple team at Chadstone.

  • H:commandLink and an Action being called multiple times.

    Hi everyone. I'm more or less relatively new in terms of JSF, though I've had to do a lot of "catching up" recently.
    I've been reading that with managed-beans, the getters/setters are not gaurenteed to be called once. http://www.jsf-faq.com/faqs/faces-misc.html#106
    My question is, are there any reasons why an action method would get called twice? An example of my jsp page.
    <h:commandLink action="#{exploreCaseAction.exploreCase}" >                    
         <h:outputText value="#{case.caseNumber}"/>
         <f:param name="caseId" value="#{case.caseId}"/>
    </h:commandLink>My faces-config
    <managed-bean>
       <managed-bean-name>exploreCaseAction</managed-bean-name>
       <managed-bean-class>com.unyric.cias.cm.web.action.ExploreCaseAction</managed-bean-class>
       managed-bean-scope>request</managed-bean-scope>
       <managed-property>
          <property-name>caseTreeHelper</property-name>
             <value>#{caseTreeHelper}</value>
       </managed-property>
       <managed-property>
          <property-name>caseId</property-name>
             <value>#{param.caseId}</value>
       </managed-property>     
       <managed-property>
          <property-name>sessionManager</property-name>
             <value>#{sessionManager}</value>
       </managed-property>               
    </managed-bean>When I click on one of the links and set a breakpoint, it comes up twice. Here's the crazy part. if I use <af:commandLink> then it only runs once.
    Personally I'd rather not use oracles components (I know it got donated and is/will be Trinidad).
    Anyone with any ideas?

    Would you be willing to try the RI (1.1_02) [1] to see if you have the same problem?
    [1] https://javaserverfaces.dev.java.net/servlets/ProjectDocumentList?folderID=5225&expandFolder=5225&folderID=0

  • AwakeFromNib called several times

    Hi,
    I have two Nib files in a project, the mainMenu.Nib has a controller class which was also used in the second.Nib as custom class of File's Owner. I use NSBundle loadNibNamed to load the second.Nib. when the mainMenuNib is loaded, i notice controller's awakeFromNib is called which is normal, but when the second.Nib is loaded, awakeFromNib is called again, is this the normal behavior ? if yes, then it is not advisable to initialize variables in the awakeFromNib as it might be initialized several times when other Nib is loaded during runtime?

    Hi!!
    To avoid that kind of things, you should initialize all the app variables and things you want in an "init" method and specific ones in the awakeFromNib. This method is generical used when you want to initialize things from the GUI (graphical user interface). I mean, objects from the interface: buttons, etc to give them an initial behavior.
    Hope you get my idea
    C U!!

Maybe you are looking for

  • How to enter a website name in smartform

    Hi, I want to enter a website name in hypertext format. Can anyone tell me how to do this in smartform. Thanks, Rose.

  • Function Module for splitting(field) in CO02 t-code

    Function Module or enhancement for splitting(field) in CO02 t-code Need function module for inserting a value in field(Max No of splits) in Transaction CO02 Message was edited by:         Mohan Kumar

  • What is an "sit" file?

    I have pictures in an Olympus RAW format (.ORF I think) from an Olympus 5050 Zoom Camera. I installed the Camedia Master 4.1 software and then went to the Olympus website to download the latest update (4.2). The file downloaded and displayed in the d

  • PC Suite with vista:Synchronise calendar

    Hi, Is there any way to sync the phone calendar with Vista's Windows Calendar or any other calendar option available in vista. I can sync the contacts but not my calendar. cheers

  • How to avoid the Blank elemts in the List Item

    Dear All, I am using a List Item List Elements List Item Value Yes 1 No 2 Only two elements in this List Item.But at Run time there is one Blank element. I need to display only two elements from the List Item .How to avoid the Blank. Thanks and Regar