Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7797801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T23:48:15+00:00 2026-06-01T23:48:15+00:00

Have an issue with a Java Web App when using JSF + PrettyFaces to

  • 0

Have an issue with a Java Web App when using JSF + PrettyFaces to handle navigation and bean actions.

using versions:

JSF – 2.1
PrettyFaces – 3.3.3

Error happens when handling navigation using PrettyFaces Filter from link:

             <div class="product_img">
                <pretty:link mappingId="viewProduct">
                    <img src="#{request.contextPath}/image?id=#{product.mainImage.fileReference.id}" />                                             
                    <f:param value="#{productMB.filters.productCategoryName}" />
                    <f:param value="#{product.name}" />                                                                         
                </pretty:link>                                                   
             </div>                                                          

pretty-config.xml mapping is:

  <url-mapping id="viewProduct">
      <pattern value="/shop/product/#{ productCategoryName : productMB.filters.productCategoryName }/#{ productName : productMB.filters.productName }/" />
      <view-id value="/pages/productDetails.faces" />
      <action>#{productMB.openProductDetails}</action>
  </url-mapping>

bean action:

public String openProductDetails() {

    if (filters.getProductCategoryName() != null && !filters.getProductName().equals("")) {         
        loadProductDetailsByName(filters.getProductCategoryName());
    }

    return "/pages/productDetails.faces";
}

User lands in Product Details Page where he can select product Features like color, size, etc…

    <ui:fragment rendered="#{productMB.productVO.featureColorAvailable}">
        <span class="productFeatureLabel">#{msg.color}</span>

        <h:selectOneMenu id="colorSelect"
            value="#{productMB.productVO.colorSelected}"
            valueChangeListener="#{productMB.colorSelectedValueChanged}">
            <f:selectItem itemLabel="#{msg['select']}" noSelectionOption="true" />
            <f:selectItems value="#{productMB.productFeatureAvailableApplMap['color']}" var="colorItem" itemValue="#{colorItem}"
                itemLabel="#{msg[colorItem.name]}"  />
            <f:ajax event="valueChange"             
            listener="#{productMB.colorSelectedValueChanged}"   
                render="@this productDetailImage productSubImage productSubImage2 productSubImage3 sizeSelect"></f:ajax>
        </h:selectOneMenu>      
    </ui:fragment>

//… Bean action methods

  public void colorSelectedValueChanged(ValueChangeEvent event) {

        if (null != event.getNewValue()) {
            ProductFeatureAppl prodFeatureAppl = (ProductFeatureAppl) event.getNewValue();
            filterProductFeatureSelectItem(AppConstants.SIZE, prodFeatureAppl.getProductFeature().getName() );
        } else {
            filterProductFeatureSelectItem(AppConstants.SIZE, null );
        }
    }   

  public void colorSelectedValueChanged(AjaxBehaviorEvent event) throws javax.faces.event.AbortProcessingException {

      try {
            if (null != productVO.getColorSelected()) {
                ProductFeatureAppl prodFeatureAppl = productVO.getColorSelected(); 
                filterProductFeatureSelectItem(AppConstants.SIZE, prodFeatureAppl.getProductFeature().getName() );

                String prodFeatName = prodFeatureAppl.getProductFeature().getName();

                // switch selected pics.
                productVO.setCurrentDetailImageName(productVO.getProduct().getProductImageByTypeAndFeatureName(
                        NameConstants.DETAIL, prodFeatName).getFileReference().getId());

                productVO.setCurrentBigImageName(productVO.getProduct().getProductImageByTypeAndFeatureName(
                        NameConstants.BIG, prodFeatName).getFileReference().getId());

            } else {
                filterProductFeatureSelectItem(AppConstants.SIZE, null );
                filterProductFeatureSelectItem(AppConstants.COLOR, null );

                // reset to default
                productVO.setCurrentDetailImageName(productVO.getProduct().getProductImageByType(ProductImageType.DETAIL1.toString()).getFileReference().getId());
                productVO.setCurrentBigImageName(productVO.getProduct().getProductImageByType(ProductImageType.BIG1.toString()).getFileReference().getId());                                                
            }       

      } catch (Exception ex) {
            addErrorMessage(getMessage("error"));
            if (screenComponent.isDisplayException()) {
                addErrorMessage(ex.getMessage());
            }
        }

  } 

After first navigation to product details page, whenever selecting a value from
selectOneMenu id=”colorSelect” the valueChangeListener and ajax listener aren’t called. Besides that, productMB.openProductDetails action is called.

The ajax call is completed with no errors I can see in the logs but no listener methods are called.
Does someone know why these JSF ajax listeners are being skipped ?

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T23:48:16+00:00Added an answer on June 1, 2026 at 11:48 pm

    Does the page work if you access it directly from the URL? Does it work if PrettyFaces is disabled?

    I doubt this is an issue with the link or with PrettyFaces. I’m betting that it has more to do with AJAX and partial-state-saving.

    It’s possible that it has to do with this:

    public String openProductDetails() {
        if (filters.getProductCategoryName() 
                != null && !filters.getProductName().equals("")) {         
            loadProductDetailsByName(filters.getProductCategoryName());
        }
    
        return "/pages/productDetails.faces"; // why is this being returned?
    }
    

    You are returning a page name there. PrettyFaces may actually try to navigate on this String. If you wish to display the page that you have configured in your mapping, simply return null, return “” empty string, or return nothing.

    Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing a java EE web app using JSF with a shopping cart style
I have the following issue using java 1.4 I try to display a very
I am developing a Java Application (not a web app, no server etc) using
I have a mobile web application built using the following versions :- JQuery Mobile
I am building a Java web app, using the Play! Framework . I'm hosting
Used this command to start the web app using jetty-runner java -jar prject123/web/target/dependency/jetty-runner.jar project123/web/target/*.war
So we ran into an interesting issue today. We have a Java EE web
I am using Tomcat web container. I have an admin console app implemented. When
I have the following issue: A java object contains two arrays of core datastore
I have a issue with my java code. i asked the same question yesterday.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.