Announcement Announcement Module
Collapse
No announcement yet.
struts & tiles plugin & webflow Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • struts & tiles plugin & webflow

    Hi guys,
    I'm trying arround with webflow and want to integrate into an existing struts/tiles application. One issue I had was that the tiles plugin does not allow any requestprocessors which do not extend from TilesRequestProcessor (ASF bug 22828). That wasn't that hard to solve, I simply copied your bindingRequestProcessor and make it extend the tilesrequestprocessor. Not very nice and futureproof but it works for now.

    Now I face another tiles exception and I don't have a clue how to recover from this:
    Code:
    314142 [P1-2] WARN  xyz - /register.html: 
    javax.servlet.jsp.JspException: ServletException in '/WEB-INF/jsp/register_step1.jspf': The errors instance must be set on this action form in order to access form properties
    	at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:921)
    	at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:460)
    	at org.apache.jsp.WEB_002dINF.jsp.layouts.DefaultLayout_jsp._jspx_meth_tiles_insert_3(DefaultLayout_jsp.java:609)
    	at org.apache.jsp.WEB_002dINF.jsp.layouts.DefaultLayout_jsp._jspx_meth_html_html_0(DefaultLayout_jsp.java:305)
    	at org.apache.jsp.WEB_002dINF.jsp.layouts.DefaultLayout_jsp._jspService(DefaultLayout_jsp.java:116)
    	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
    	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
    	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
    	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
    	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:427)
    	at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:496)
    	at org.mortbay.jetty.servlet.Dispatcher.dispatch(Dispatcher.java:263)
    	at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:157)
    	at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1056)
    	at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:261)
    	at org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(TilesRequestProcessor.java:237)
    	at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:300)
    	at com.xyz.tst.webapp.struts.CustomBindingRequestProcessor.process(CustomBindingRequestProcessor.java:131)
    	at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
    	at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:397)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
    	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:427)
    	at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:822)
    	at net.sf.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:300)
    	at net.sf.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:84)
    	at net.sf.acegisecurity.intercept.web.SecurityEnforcementFilter.doFilter(SecurityEnforcementFilter.java:181)
    	at net.sf.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:311)
    	at net.sf.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:372)
    	at net.sf.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:311)
    	at net.sf.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:217)
    	at net.sf.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:311)
    	at net.sf.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:179)
    	at net.sf.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:125)
    	at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter(WebApplicationHandler.java:813)
    	at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:494)
    	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:569)
    	at org.mortbay.http.HttpContext.handle(HttpContext.java:1482)
    	at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:624)
    	at org.mortbay.http.HttpContext.handle(HttpContext.java:1434)
    	at org.mortbay.http.HttpServer.service(HttpServer.java:896)
    	at org.mortbay.http.HttpConnection.service(HttpConnection.java:814)
    	at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:981)
    	at org.mortbay.http.HttpConnection.handle(HttpConnection.java:831)
    	at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
    	at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:366)
    	at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
    As there a lot of config files I'm not sure which one are relevant for you. Basically this happend after loading the first view. That means the following steps in the workflow were executed, and the first view in the wizard (step1) started to display (until the exception):

    Code:
    	<action-state id="setupForm">
    		<action bean="registerFormAction"/>
    		<transition on="success" to="formView"/>
    	</action-state>
    	
    	<!--
    		Display the input form view.
    	-->
    	<view-state id="formView" view="page.register.step1">
    		<transition on="submit" to="bindAndValidateForm"/>
    	</view-state>
    My struts-config looks like:

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE struts-config PUBLIC
        "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
        "http&#58;//jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
    
    <struts-config>
    
    	<!-- ======================================== Form Bean Definitions -->
    	<form-beans>
    		<!-- A single action form adapter for your entire app is all you need, if you
    		 wish to take advantage of Spring's POJO-based data binding and validation. -->
    		<form-bean name="actionForm" type="org.springframework.web.struts.BindingActionForm"/>
    	</form-beans>
    
    	<!-- =================================== Global Exception Definitions -->
    	<global-exceptions>
    		<exception key="error.required"
    			type="org.springframework.dao.DataAccessException"
    			path="page.error.dataAccessFailure" />
    	</global-exceptions>
    
    	<!-- =================================== Global Forward Definitions -->
    
    	<global-forwards></global-forwards>
    
    	<!-- =================================== Action Mapping Definitions -->
    
    	<action-mappings>
    
    		
    		<!-- flow actions -->
    		<action path="/register"
    			type="org.springframework.web.flow.struts.FlowAction"
    			name="actionForm" scope="request" 
    			className="org.springframework.web.flow.struts.FlowActionMapping">
    			<set-property property="flowId" value="registerFlow" />
    		</action>
    		
    	</action-mappings>
    
    <!-- A custom request processor is neccessary for deferred, POJO-based binding and validation
    		 No more Action Form proliferation! &#58;-&#41; -->
        <!-- controller processorClass="org.springframework.web.struts.BindingRequestProcessor"/ -->
         <controller processorClass="com.example.app.webapp.struts.CustomBindingRequestProcessor"/>
    
    	<!-- ================================ Message Resources Definitions -->
    
    	<message-resources parameter="messages" />
    
    	<!-- ======================================= Plug Ins Configuration -->
    
    	<!-- plugin neccessary for making Commons BeanUtils aware of the BindingActionForm adapter -->
        <plug-in className="org.springframework.web.struts.BindingPlugin"/>
    
    	<plug-in
    		className="org.springframework.web.struts.ContextLoaderPlugIn">
    	</plug-in>
    
    	<!-- plug-in className="org.apache.struts.validator.ValidatorPlugIn">
    		<set-property property="pathnames"
    			value="/WEB-INF/validator-rules.xml,
                       /WEB-INF/validation.xml" />
    	</plug-in -->
    
    	<plug-in className="org.apache.struts.tiles.TilesPlugin">
    		<set-property property="definitions-config"
    			value="/WEB-INF/tiles-defs.xml" />
    		<set-property property="definitions-debug" value="0" />
    		<set-property property="definitions-parser-details" value="1" />
    		<set-property property="definitions-parser-validate"
    			value="true" />
    	</plug-in>
    </struts-config>
    In my Action I set the POJO formobject as follows:

    Code:
        public RegisterFormAction&#40;&#41; &#123;
            super&#40;&#41;;
        	// use you could also do this in the application context XML ofcourse
    		setFormObjectName&#40;"RegisterActionForm"&#41;;
    		setFormObjectClass&#40;RegisterFlowActionForm.class&#41;;
    		setValidator&#40;new RegisterFormValidator&#40;&#41;&#41;;
        &#125;
    
    	public Event calculateAge&#40;RequestContext context&#41; throws Exception &#123;
    		// pull the date from the model
    		RegisterFlowActionForm flowForm = &#40;RegisterFlowActionForm&#41;context.getRequestScope&#40;&#41;.get&#40;"RegisterActionForm"&#41;;
    		// put it in the model for display by the view
    		//context.getRequestScope&#40;&#41;.setAttribute&#40;AGE_NAME, ageStr&#41;;
    		return success&#40;&#41;;
    	&#125;

    As it is a little bit unclear to me how the object is mapped to the actionForm definition in the struts-config and the settings in the Action class I changed the name from "RegisterActionForm" to "actionForm" but this resulted into a
    Code:
    60467 &#91;P1-9&#93; ERROR org.apache.struts.taglib.tiles.InsertTag  - ServletException in '/WEB-INF/jsp/register_step1.jspf'&#58; null
    org.apache.jasper.JasperException
    	at org.apache.jasper.servlet.JspServletWrapper.service&#40;JspServletWrapper.java&#58;372&#41;
    	at org.apache.jasper.servlet.JspServlet.serviceJspFile&#40;JspServlet.java&#58;292&#41;
    So, that's all I have. It's not simple to explain as I have yet started with the webflow. Can't you use my description?

    Thanks,
    Markus

  • #2
    Yeah its unfortunate you have to subclass RequestProcessor to customize it.

    Hmmmm... the error you're getting is coming from the BindingActionForm class - the Errors instance it adapts to the ActionForm model is not set, so it's complaining. It is expected that it be set before the ActionForward is returned when a ViewState is entered -- see the code in FlowAction that does it:

    Code:
    protected FlowExecutionListener createActionFormAdapter&#40;final HttpServletRequest request, final ActionForm form&#41; &#123;
      return new FlowExecutionListenerAdapter&#40;&#41; &#123;
        public void requestProcessed&#40;RequestContext context, Event triggeringEvent&#41; &#123;
          if &#40;context.isFlowExecutionActive&#40;&#41;&#41; &#123;
            if &#40;form instanceof BindingActionForm&#41; &#123;
              BindingActionForm bindingForm = &#40;BindingActionForm&#41;form;
              bindingForm.setErrors&#40;&#40;Errors&#41;context.getRequestScope&#40;&#41;.getAttribute&#40;FormObjectAccessor.FORM_OBJECT_ATTRIBUTE_NAME, Errors.class&#41;&#41;;
              bindingForm.setRequest&#40;request&#41;;
            &#125;
          &#125;
       &#125;;
    &#125;
    Hmm... this looks incorrect, actually, looking at it. Essentially what the above code is doing is exporting a Spring Errors instance in the model for use by the BindingActionForm after the flow request is processed. This allows Struts to delegate to the Spring data binding and validation subsystem.

    However, I see two problems: 1st there is no fallback if the instance is not set, and second, it looks like the FORM_OBJECT_ATTRIBUTE_NAME property is just wrong -- it should be FORM_OBJECT_ERRORS_ATTRIBUTE_NAME. That looks like a bug.

    I'll look at correcting this promptly.

    Comment


    • #3
      I just committed a fix for this problem: can you try it out in about 24 hrs? You'll need to checkout the spring project from CVS and build the 'webflow.jar' target to create the spring-webflow.jar with the fix. It'll also be in PR3, but it'd be great to see if this problem is resolved in a Struts/Tiles environment.

      Comment


      • #4
        Hi keith,
        Your fix solved the problem that I previously had.

        But it leaves me with another one. I get this error:

        Code:
        1226663 &#91;P1-8&#93; ERROR org.apache.struts.taglib.tiles.InsertTag  - ServletException in '/WEB-INF/jsp/register_step3.jspf'&#58; null
        org.apache.jasper.JasperException
        	at org.apache.jasper.servlet.JspServletWrapper.service&#40;JspServletWrapper.java&#58;372&#41;
        	at org.apache.jasper.servlet.JspServlet.serviceJspFile&#40;JspServlet.java&#58;292&#41;
        	at org.apache.jasper.servlet.JspServlet.service&#40;JspServlet.java&#58;236&#41;
        	at javax.servlet.http.HttpServlet.service&#40;HttpServlet.java&#58;688&#41;
        	at org.mortbay.jetty.servlet.ServletHolder.handle&#40;ServletHolder.java&#58;427&#41;
        	at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch&#40;WebApplicationHandler.java&#58;496&#41;
        	at org.mortbay.jetty.servlet.Dispatcher.dispatch&#40;Dispatcher.java&#58;263&#41;
        	at org.mortbay.jetty.servlet.Dispatcher.include&#40;Dispatcher.java&#58;149&#41;
        	at org.apache.jasper.runtime.JspRuntimeLibrary.include&#40;JspRuntimeLibrary.java&#58;966&#41;
        	at org.apache.jasper.runtime.PageContextImpl.include&#40;PageContextImpl.java&#58;581&#41;
        	at org.apache.struts.tiles.TilesUtilImpl.doInclude&#40;TilesUtilImpl.java&#58;101&#41;
        	at org.apache.struts.tiles.TilesUtil.doInclude&#40;TilesUtil.java&#58;137&#41;
        	at org.apache.struts.taglib.tiles.InsertTag.doInclude&#40;InsertTag.java&#58;758&#41;
        	at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag&#40;InsertTag.java&#58;890&#41;
        	at org.apache.struts.taglib.tiles.InsertTag.doEndTag&#40;InsertTag.java&#58;460&#41;
        	at org.apache.jsp.WEB_002dINF.jsp.layouts.DefaultLayout_jsp._jspx_meth_tiles_insert_3&#40;DefaultLayout_jsp.java&#58;613&#41;
        	at org.apache.jsp.WEB_002dINF.jsp.layouts.DefaultLayout_jsp._jspx_meth_html_html_0&#40;DefaultLayout_jsp.java&#58;308&#41;
        	at org.apache.jsp.WEB_002dINF.jsp.layouts.DefaultLayout_jsp._jspService&#40;DefaultLayout_jsp.java&#58;119&#41;
        	at org.apache.jasper.runtime.HttpJspBase.service&#40;HttpJspBase.java&#58;94&#41;
        	at javax.servlet.http.HttpServlet.service&#40;HttpServlet.java&#58;688&#41;
        	at org.apache.jasper.servlet.JspServletWrapper.service&#40;JspServletWrapper.java&#58;324&#41;
        	at org.apache.jasper.servlet.JspServlet.serviceJspFile&#40;JspServlet.java&#58;292&#41;
        	at org.apache.jasper.servlet.JspServlet.service&#40;JspServlet.java&#58;236&#41;
        	at javax.servlet.http.HttpServlet.service&#40;HttpServlet.java&#58;688&#41;
        	at org.mortbay.jetty.servlet.ServletHolder.handle&#40;ServletHolder.java&#58;427&#41;
        	at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch&#40;WebApplicationHandler.java&#58;496&#41;
        	at org.mortbay.jetty.servlet.Dispatcher.dispatch&#40;Dispatcher.java&#58;263&#41;
        	at org.mortbay.jetty.servlet.Dispatcher.forward&#40;Dispatcher.java&#58;157&#41;
        	at org.apache.struts.action.RequestProcessor.doForward&#40;RequestProcessor.java&#58;1056&#41;
        	at org.apache.struts.tiles.TilesRequestProcessor.doForward&#40;TilesRequestProcessor.java&#58;261&#41;
        	at org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition&#40;TilesRequestProcessor.java&#58;237&#41;
        	at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig&#40;TilesRequestProcessor.java&#58;300&#41;
        	at com.zys.xyz.webapp.struts.CustomBindingRequestProcessor.process&#40;CustomBindingRequestProcessor.java&#58;131&#41;
        	at org.apache.struts.action.ActionServlet.process&#40;ActionServlet.java&#58;1164&#41;
        	at org.apache.struts.action.ActionServlet.doPost&#40;ActionServlet.java&#58;415&#41;
        	at javax.servlet.http.HttpServlet.service&#40;HttpServlet.java&#58;615&#41;
        	at javax.servlet.http.HttpServlet.service&#40;HttpServlet.java&#58;688&#41;
        	at org.mortbay.jetty.servlet.ServletHolder.handle&#40;ServletHolder.java&#58;427&#41;
        	at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter&#40;WebApplicationHandler.java&#58;822&#41;
        	at net.sf.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter&#40;FilterChainProxy.java&#58;300&#41;
        	at net.sf.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke&#40;FilterSecurityInterceptor.java&#58;84&#41;
        	at net.sf.acegisecurity.intercept.web.SecurityEnforcementFilter.doFilter&#40;SecurityEnforcementFilter.java&#58;181&#41;
        	at net.sf.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter&#40;FilterChainProxy.java&#58;311&#41;
        	at net.sf.acegisecurity.ui.AbstractProcessingFilter.doFilter&#40;AbstractProcessingFilter.java&#58;372&#41;
        	at net.sf.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter&#40;FilterChainProxy.java&#58;311&#41;
        	at net.sf.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter&#40;HttpSessionContextIntegrationFilter.java&#58;217&#41;
        	at net.sf.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter&#40;FilterChainProxy.java&#58;311&#41;
        	at net.sf.acegisecurity.util.FilterChainProxy.doFilter&#40;FilterChainProxy.java&#58;179&#41;
        	at net.sf.acegisecurity.util.FilterToBeanProxy.doFilter&#40;FilterToBeanProxy.java&#58;125&#41;
        	at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter&#40;WebApplicationHandler.java&#58;813&#41;
        	at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch&#40;WebApplicationHandler.java&#58;494&#41;
        	at org.mortbay.jetty.servlet.ServletHandler.handle&#40;ServletHandler.java&#58;569&#41;
        	at org.mortbay.http.HttpContext.handle&#40;HttpContext.java&#58;1482&#41;
        	at org.mortbay.jetty.servlet.WebApplicationContext.handle&#40;WebApplicationContext.java&#58;624&#41;
        	at org.mortbay.http.HttpContext.handle&#40;HttpContext.java&#58;1434&#41;
        	at org.mortbay.http.HttpServer.service&#40;HttpServer.java&#58;896&#41;
        	at org.mortbay.http.HttpConnection.service&#40;HttpConnection.java&#58;814&#41;
        	at org.mortbay.http.HttpConnection.handleNext&#40;HttpConnection.java&#58;981&#41;
        	at org.mortbay.http.HttpConnection.handle&#40;HttpConnection.java&#58;831&#41;
        	at org.mortbay.http.SocketListener.handleConnection&#40;SocketListener.java&#58;244&#41;
        	at org.mortbay.util.ThreadedServer.handle&#40;ThreadedServer.java&#58;366&#41;
        	at org.mortbay.util.ThreadPool$PoolThread.run&#40;ThreadPool.java&#58;534&#41;
        1238040 &#91;P1-8&#93; WARN  xyz  - /register.html&#58; 
        javax.servlet.jsp.JspException&#58; ServletException in '/WEB-INF/jsp/register_step3.jspf'&#58; null
        	at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag&#40;InsertTag.java&#58;921&#41;
        	at org.apache.struts.taglib.tiles.InsertTag.doEndTag&#40;InsertTag.java&#58;460&#41;
        	at org.apache.jsp.WEB_002dINF.jsp.layouts.DefaultLayout_jsp._jspx_meth_tiles_insert_3&#40;DefaultLayout_jsp.java&#58;613&#41;
        	at org.apache.jsp.WEB_002dINF.jsp.layouts.DefaultLayout_jsp._jspx_meth_html_html_0&#40;DefaultLayout_jsp.java&#58;308&#41;
        	at org.apache.jsp.WEB_002dINF.jsp.layouts.DefaultLayout_jsp._jspService&#40;DefaultLayout_jsp.java&#58;119&#41;
        	at org.apache.jasper.runtime.HttpJspBase.service&#40;HttpJspBase.java&#58;94&#41;
        	at javax.servlet.http.HttpServlet.service&#40;HttpServlet.java&#58;688&#41;
        	at org.apache.jasper.servlet.JspServletWrapper.service&#40;JspServletWrapper.java&#58;324&#41;
        	at org.apache.jasper.servlet.JspServlet.serviceJspFile&#40;JspServlet.java&#58;292&#41;
        	at org.apache.jasper.servlet.JspServlet.service&#40;JspServlet.java&#58;236&#41;
        	at javax.servlet.http.HttpServlet.service&#40;HttpServlet.java&#58;688&#41;
        	at org.mortbay.jetty.servlet.ServletHolder.handle&#40;ServletHolder.java&#58;427&#41;
        	at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch&#40;WebApplicationHandler.java&#58;496&#41;
        	at org.mortbay.jetty.servlet.Dispatcher.dispatch&#40;Dispatcher.java&#58;263&#41;
        	at org.mortbay.jetty.servlet.Dispatcher.forward&#40;Dispatcher.java&#58;157&#41;
        	at org.apache.struts.action.RequestProcessor.doForward&#40;RequestProcessor.java&#58;1056&#41;
        	at org.apache.struts.tiles.TilesRequestProcessor.doForward&#40;TilesRequestProcessor.java&#58;261&#41;
        	at org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition&#40;TilesRequestProcessor.java&#58;237&#41;
        	at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig&#40;TilesRequestProcessor.java&#58;300&#41;
        	at com.zys.xyz.webapp.struts.CustomBindingRequestProcessor.process&#40;CustomBindingRequestProcessor.java&#58;131&#41;
        	at org.apache.struts.action.ActionServlet.process&#40;ActionServlet.java&#58;1164&#41;
        	at org.apache.struts.action.ActionServlet.doPost&#40;ActionServlet.java&#58;415&#41;
        	at javax.servlet.http.HttpServlet.service&#40;HttpServlet.java&#58;615&#41;
        	at javax.servlet.http.HttpServlet.service&#40;HttpServlet.java&#58;688&#41;
        	at org.mortbay.jetty.servlet.ServletHolder.handle&#40;ServletHolder.java&#58;427&#41;
        	at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter&#40;WebApplicationHandler.java&#58;822&#41;
        	at net.sf.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter&#40;FilterChainProxy.java&#58;300&#41;
        	at net.sf.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke&#40;FilterSecurityInterceptor.java&#58;84&#41;
        	at net.sf.acegisecurity.intercept.web.SecurityEnforcementFilter.doFilter&#40;SecurityEnforcementFilter.java&#58;181&#41;
        	at net.sf.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter&#40;FilterChainProxy.java&#58;311&#41;
        	at net.sf.acegisecurity.ui.AbstractProcessingFilter.doFilter&#40;AbstractProcessingFilter.java&#58;372&#41;
        	at net.sf.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter&#40;FilterChainProxy.java&#58;311&#41;
        	at net.sf.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter&#40;HttpSessionContextIntegrationFilter.java&#58;217&#41;
        	at net.sf.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter&#40;FilterChainProxy.java&#58;311&#41;
        	at net.sf.acegisecurity.util.FilterChainProxy.doFilter&#40;FilterChainProxy.java&#58;179&#41;
        	at net.sf.acegisecurity.util.FilterToBeanProxy.doFilter&#40;FilterToBeanProxy.java&#58;125&#41;
        	at org.mortbay.jetty.servlet.WebApplicationHandler$CachedChain.doFilter&#40;WebApplicationHandler.java&#58;813&#41;
        	at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch&#40;WebApplicationHandler.java&#58;494&#41;
        	at org.mortbay.jetty.servlet.ServletHandler.handle&#40;ServletHandler.java&#58;569&#41;
        	at org.mortbay.http.HttpContext.handle&#40;HttpContext.java&#58;1482&#41;
        	at org.mortbay.jetty.servlet.WebApplicationContext.handle&#40;WebApplicationContext.java&#58;624&#41;
        	at org.mortbay.http.HttpContext.handle&#40;HttpContext.java&#58;1434&#41;
        	at org.mortbay.http.HttpServer.service&#40;HttpServer.java&#58;896&#41;
        	at org.mortbay.http.HttpConnection.service&#40;HttpConnection.java&#58;814&#41;
        	at org.mortbay.http.HttpConnection.handleNext&#40;HttpConnection.java&#58;981&#41;
        	at org.mortbay.http.HttpConnection.handle&#40;HttpConnection.java&#58;831&#41;
        	at org.mortbay.http.SocketListener.handleConnection&#40;SocketListener.java&#58;244&#41;
        	at org.mortbay.util.ThreadedServer.handle&#40;ThreadedServer.java&#58;366&#41;
        	at org.mortbay.util.ThreadPool$PoolThread.run&#40;ThreadPool.java&#58;534&#41;
        The odd thing was that this exception does sometimes disappear if I used an exception breakpoint on the ServletException.

        After investigating I found that the exception is thrown in the Tiles InsertTag line 890 (Struts 1.2).
        This seems related to the known tiles bug/enhancement http://issues.apache.org/bugzilla/show_bug.cgi?id=21972

        There seem to be some flushing issues. Before using webflow I never experienced this error. Even with the combination struts/tiles/struts-validator/webflow I don't have this issue (I removed the bindingcontrollers and stuff from the struts-config). So I think it has something to do with how things are handled by the struts/validator adapter. It makes the struts/tiles combination unusable. A possible workaround would be to precompile the jsps I think. But that would contradict our "rapid and easy JSP changes" developement philosophy.

        I would love to use the more flexible spring validator as the struts validator is not flexible enough for the flow I have in mind.

        Any thoughts towards this?
        BTW, thanks for doing this work. Webflow really looks like a promising piece of software.

        Markus

        Comment


        • #5
          Ok, so you're saying it works except when you use the BindingActionForm adapter?

          What a wonderful error message tiles is providing!

          Comment


          • #6
            yup. I think it works. But I'm fighting with a lot of issues in the moment. But this is caused more by my lack of knowledge about webflow. I will inform you about my progress ;-)

            Comment


            • #7
              what I forgot: Currently the bindingformadapter works for me. I have no clue why it does know.
              After having the problems I switched to a strutsvalidator/webflow combination which works fine. Then I deleted the jetty jsp cache and tried the version with the bindingformadapter again and it works fine now. Don't ask me why.
              So your adapter seems to work even in a struts/tiles environment. Not sure if there is a "hidden cache" so the jsps must not compile again. Or, and that's what I hope, clearing the JSP cache (and adding flush=false to the tiles:insert tag) resolved the issue for me.
              Time (or the next jsps I have to touch) will tell what' s the issue with this.

              Comment


              • #8
                Me again. I encountered an mismatch between the ways the validator of struts put errors in the request and the bindingformadaptor from webflow does.

                I faced the problem when I tried to display the errormessage generated from a webflow validator in my jsp with the following statement (which worked perfectly with the struts validator):
                Code:
                <%-- Error Messages --%>
                <logic&#58;messagesPresent>
                    <div class="error">
                        <html&#58;messages id="error">
                            $&#123;error&#125;<br/>
                         </html&#58;messages>
                    </div>
                </logic&#58;messagesPresent>
                
                <%-- Success Messages --%>
                <logic&#58;messagesPresent message="true">
                    <div class="message">
                        <html&#58;messages id="message" message="true">
                            $&#123;message&#125;<br/>
                        </html&#58;messages>
                    </div>
                </logic&#58;messagesPresent>
                Nothing is displayed dispact the fact that there is an actionerror in the request. I did a quick System.out on request.getAttribute(org.apache.struts.Globals.ERR OR_KEY)
                and found the following difference:

                Code:
                struts validator&#58;
                &#123;lastName=&#91;errors.required&#91;Lastname, null, null, null&#93;&#93;&#125;
                
                webflow validator&#58;
                &#123;lastName=&#91;Lastname must not be null&#91;&#93;&#93;&#125;
                In the latest CVS you removed the error handling from the birthday example. How would you do the errorhandling especially if you don't want to loose the ability to mark the wrong fields in the form?

                Thanks,
                Markus

                Comment


                • #9
                  Markus,

                  I checked Birthdate and the errors handling is still there:
                  Code:
                  <TR>
                    <TD colspan="2">
                     <html&#58;errors/>
                    </TD>
                  </TR>
                  I'd recommend turning on the debug log level for the org.springframwork.web.struts.BindingActionForm class. It will show you exactly the process it is going through to resolve error message key to use with the ActionError.

                  Comment


                  • #10
                    sorry keith for bothering. I had overlooked it completely. I was fixed on finding something more verbose.

                    I had also solved my problem why the errors aren't displayed by the struts tags. Using freetext instead of keys in the error descriptions(as I tried because I was too lazy to look for a key and then had to search the bug for hours) causes problems. Struts will not show the errormessage because it could not resolve it in its properties. That is working for me:

                    Code:
                    errors.reject&#40;"street","register.mustExist"&#41;;

                    Comment

                    Working...
                    X