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 8377397
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:39:43+00:00 2026-06-09T15:39:43+00:00

I’m creating a project with Spring 3.2.0, PrimeFaces 3.3.1, Mojarra 2.1.11 and then Spring

  • 0

I’m creating a project with Spring 3.2.0, PrimeFaces 3.3.1, Mojarra 2.1.11 and then Spring Security 3.1.1.

My problem is the whenever an ajax call is fired by PrimeFaces, like for example in table pagination, the screen components are not refreshed.

EDIT #4

Whenever an ajax called is fired, an status 302 is returned from the server and the page is refreshed

I think the problem is related to Spring security, this are my settings:

 <security:http entry-point-ref="authenticationEntryPoint" pattern="/spring/**">
    <security:anonymous />
    <security:http-basic />
    <security:custom-filter position="FORM_LOGIN_FILTER" ref="authenticationProcessingFilter" />
    <security:logout logout-url="/spring/logout" logout-success-url="/spring/login?logout=true" />
    <security:intercept-url pattern="/spring/login" access="ROLE_ANONYMOUS,ROLE_USER,ROLE_ADMIN" />
    <security:intercept-url pattern="/spring/logoutSuccess" access="ROLE_ANONYMOUS,ROLE_USER,ROLE_CLIENT" />
    <security:intercept-url pattern="/spring/intro" access="ROLE_ANONYMOUS,ROLE_USER"  />
    <security:intercept-url pattern="/spring/flows/admin_main_flow/**" access="ROLE_ADMIN" />
    <security:intercept-url pattern="/spring/flows/client_main_flow/**" access="ROLE_CLIENT" />
 </security:http>
 
 <security:http security="none" pattern="/javax.faces.resource/**" />
 <security:http security="none" pattern="/ajax/**" />
 <security:http security="none" pattern="/static/**" />
 <security:http security="none" pattern="/resources/**" />

This happen just after the login so I don’t think the session should be already expired.

EDIT #4 end

I stripped down the application to a minimum and tried this code:

<h:form id="testAjax" >
    <h:panelGrid columns="4" cellpadding="5">  
        <h:outputLabel for="test" value="test:" style="font-weight:bold"/>  
    <p:inputText id="test" value="#{testBean.test}" />
    <p:commandButton value="Submit" update="@form"/>
    <h:outputText value="#{testBean.test}" id="display" />  
</h:panelGrid>  
</h:form>

note that I double checked that no forms are nested, I tried both "process" and "update" with @form or the elements id.

What happens is that the setter of TestBean is called, the attribute setted, but then the getter is never called again to display the new value. This are the logs on server side:

org.springframework.web.servlet.DispatcherServlet  - DispatcherServlet with name 'Spring MVC Dispatcher Servlet' processing POST request for [/TryAjax/spring/WEB-INF/login.xhtml]
org.springframework.web.servlet.handler.SimpleUrlHandlerMapping  - Mapping [/WEB-INF/login.xhtml] to HandlerExecutionChain with handler [org.springframework.web.servlet.mvc.UrlFilenameViewController@2f46ccac] and 1 interceptor
org.springframework.web.servlet.mvc.UrlFilenameViewController  - Returning view name 'WEB-INF/login' for lookup path [/WEB-INF/login.xhtml]
org.springframework.web.servlet.DispatcherServlet  - Rendering view [org.springframework.faces.mvc.JsfView: name 'WEB-INF/login'; URL [/WEB-INF/WEB-INF/login.xhtml]] in DispatcherServlet with name 'Spring MVC Dispatcher Servlet'
org.springframework.faces.support.RequestLoggingPhaseListener  - Entering JSF Phase: RESTORE_VIEW 1
org.springframework.faces.mvc.JsfView  - Asking faces lifecycle to render
org.springframework.faces.support.RequestLoggingPhaseListener  - Entering JSF Phase: RENDER_RESPONSE 6
org.springframework.faces.mvc.JsfView  - View rendering complete
org.springframework.web.servlet.DispatcherServlet  - Successfully completed request

I fear is a problem of configuration, I followed the basic instruction but then made some modifications to correct some errors, here’s the web.xml stripped of some not relevant part

<?xml version = '1.0'?>
<web-app 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" 
  version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee">
    <context-param>  
        <param-name>log4jConfigLocation</param-name>  
        <param-value>/WEB-INF/log4j.xml</param-value>  
    </context-param>  
    <listener>  
        <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>  
    </listener>  
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/spring_context.xml</param-value>
    </context-param>
    <servlet>
        <servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value></param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
        <url-pattern>/spring/*</url-pattern>
    </servlet-mapping>
    <listener>
        <listener-class>org.springframework.security.web.session.HttpSessionEventPublisher</listener-class>
    </listener>    
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
    <listener>
        <listener-class>org.springframework.web.context.request.RequestContextListener </listener-class>
    </listener>
    <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>*.faces</url-pattern>
    </servlet-mapping>
    <servlet-mapping> 
        <servlet-name>Faces Servlet</servlet-name> 
        <url-pattern>*.xhtml</url-pattern> 
    </servlet-mapping>
    <context-param>
        <param-name>facelets.LIBRARIES</param-name>
        <param-value>/WEB-INF/tags/synaptic.taglib.xml</param-value>
    </context-param>
    <filter>
        <filter-name>openSessionInViewFilter</filter-name>
        <filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
        <init-param>
            <param-name>flushMode</param-name>
            <param-value>AUTO</param-value>
        </init-param>
    </filter>
    <context-param>
        <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
        <param-value>.xhtml</param-value>
    </context-param>
    <context-param>
        <param-name>javax.faces.PROJECT_STAGE</param-name>
        <param-value>Production</param-value>
    </context-param>
    <context-param>
        <param-name>facelets.SKIP_COMMENTS</param-name>
        <param-value>true</param-value>
    </context-param>
    <servlet>
        <servlet-name>Resources Servlet</servlet-name>
        <servlet-class>org.springframework.js.resource.ResourceServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
            <servlet-name>Resources Servlet</servlet-name>
            <url-pattern>/resources/*</url-pattern>
    </servlet-mapping>
</web-app>

Faces config

<?xml version="1.0" encoding="UTF-8"?>
<faces-config xmlns="http://java.sun.com/xml/ns/javaee" 
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
              version="2.0"> 
    <application>
        <el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver>
    </application>
</faces-config>

other spring flow configuration

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" 
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:tx="http://www.springframework.org/schema/tx" 
       xmlns:mvc="http://www.springframework.org/schema/mvc" 
       xmlns:webflow="http://www.springframework.org/schema/webflow-config" 
       xmlns:faces="http://www.springframework.org/schema/faces"
       xsi:schemaLocation="http://www.springframework.org/schema/beans 
        http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 
        http://www.springframework.org/schema/context 
        http://www.springframework.org/schema/context/spring-context-3.0.xsd
        http://www.springframework.org/schema/tx 
        http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
        http://www.springframework.org/schema/webflow-config 
        http://www.springframework.org/schema/webflow-config/spring-webflow-config-2.3.xsd 
        http://www.springframework.org/schema/faces 
        http://www.springframework.org/schema/faces/spring-faces-2.2.xsd
        http://www.springframework.org/schema/mvc
        http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd">
    <faces:resources />
    <context:annotation-config />
     <context:component-scan base-package="com.synaptic"/>
    <bean class="org.springframework.faces.webflow.JsfFlowHandlerAdapter">
        <property name="flowExecutor" ref="flowExecutor" />
    </bean>
    <bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
        <property name="mappings">
            <value>
                /flows/*=flowController
            </value>
        </property>
        <property name="defaultHandler">
            <bean class="org.springframework.web.servlet.mvc.UrlFilenameViewController"/>
        </property>
    </bean>
    <bean  class="org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter">
    </bean>
    <bean id="faceletsViewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver">
         <property name="viewClass" value="org.springframework.faces.mvc.JsfView"/>
         <property name="prefix" value="/WEB-INF/"/>
         <property name="suffix" value=".xhtml"/>
    </bean>
    <bean id="flowController" class="org.springframework.webflow.mvc.servlet.FlowController">
      <property name="flowExecutor" ref="flowExecutor"/>
    </bean>
    <webflow:flow-executor id="flowExecutor" flow-registry="flowRegistry">
        <webflow:flow-execution-listeners> 
            <webflow:listener ref="flowFacesContextLifecycleListener" /> 
            <!--  <webflow:listener ref="facesContextListener"/>-->
        </webflow:flow-execution-listeners> 
    </webflow:flow-executor> 
    <bean id="flowFacesContextLifecycleListener" class="org.springframework.faces.webflow.FlowFacesContextLifecycleListener" /> 
    <webflow:flow-registry id="flowRegistry" flow-builder-services="facesFlowBuilderServices">
        <webflow:flow-location-pattern value="/WEB-INF/flows/**/*.xml"/>
    </webflow:flow-registry>
    <bean id="conversionService" class="org.springframework.faces.model.converter.FacesConversionService"/>
    <bean id="expressionParser" class="org.springframework.webflow.expression.el.WebFlowELExpressionParser">
         <constructor-arg>
             <bean class="org.jboss.el.ExpressionFactoryImpl"/>    
         </constructor-arg>
         <property name="conversionService" ref="conversionService"/>
     </bean>        
    <faces:flow-builder-services id="facesFlowBuilderServices" expression-parser="expressionParser" conversion-service="conversionService"/>
</beans>

Please if you see anything wrong or you have any idea help me, this issue is bugging me from days. Thank you!

EDIT #1

I add the code for the backing bean and the webflow code where I declare it:

public class TestBean implements Serializable {
    private String test = "xxx";
    public String getTest() {
        return test;
    }
    public void setTest(String test) {
        this.test = test;
    }
}

<view-state id="home" view="../views/adminHome.xhtml">
    <on-entry>
        <evaluate expression="textManager.getTest()" result="viewScope.test"/>
    </on-entry>
</view-state>

Now this of testBean is just the simplest test case I can make that doesn’t work, the main problem I have is that no ajax call works, for example pagination for tables, adding or removing or modifying an element of a datatable, tabView etc.

I generally create the beans for the page and put them in the viewScope or flowScope, this also for lists of data coming from the database. I tryed also having the bean managed by Spring with scope Session but it doesn’t work neither. Another note is that the default value display on the page correctly.

EDIT #2

using firebug and the eclipse debug i see this:

Initial value of TestBean.test is "xxx", I change to aaa and press submit.

An ajax post request is sent to the server:

javax.faces.ViewState   e2s1
javax.faces.partial.ajax    true
javax.faces.partial.execu...    @all
javax.faces.partial.rende...    testAjax testAjax:display
javax.faces.source  testAjax:testButton
testAjax    testAjax
testAjax:test   aaa
testAjax:testButton testAjax:testButton

When the POST is sent I firt debug a call to TestBean.getTest() and then a call to TestBean.setTest("aaa") that has the correct value.

At this point I would expect another call to TestBean.getTest() when the response is built but the call does not happens and the response does not contain the correct value but the old value "xxx".

If now I refresh the page the getter is called and the new value "aaa" is displayed correctly.

EDIT #3

I still can sort this out. I noticed now with firebug an unexpected behaviour:

when I click the command button 2 requests are sent to the server, a POST and a GET.

The POST is sent first and return an status "302 Moved Temporarily", then the GET start and return a response without the updated data. Anyone knows what status 302 means in this case and what could be the cause?

Debugging in the same way the primefaces demo only a POST request is fired that return no status 302

Thank you

  • 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-09T15:39:48+00:00Added an answer on June 9, 2026 at 3:39 pm

    You need to add a parameter to the flow-executor to disable the redirect to the same state. The configuration becomes:

    <webflow:flow-executor id="flowExecutor" flow-registry="flowRegistry">
        <webflow:flow-execution-listeners> 
            <webflow:listener ref="flowExecutionListener" /> 
            <webflow:listener ref="facesContextListener"/>
            <!--  <webflow:listener ref="flowFacesContextLifecycleListener" />-->
        </webflow:flow-execution-listeners> 
        <webflow:flow-execution-attributes>
            <webflow:redirect-in-same-state value="false"/>
        </webflow:flow-execution-attributes>
    </webflow:flow-executor> 
    

    This prevents the flow executor to refresh the page completely after the ajax request is sent.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
I've got a string that has curly quotes in it. I'd like to replace
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am trying to render a haml file in a javascript response like so:
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

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.