[Stripes-users] Problem with value binding

Subject:   [Stripes-users] Problem with value binding (find more)
From:   Florian Falkner <hidden> (find more)
Date:   Jan 20, 2006 11:00

Hello,

I got a problem with stripes' value binding. If I want to edit an existing
record, the current values are not set in the HTML Tags.

I used the following approach:

Snippet of user jsp Site:
<td align="left" width="400">
<stripes:text size="25" class="normalInput" name="lastname"/></td>
<td align="left" width="100" class="textBold">Firstname/td>
<td align="left" width="400">
<stripes:text  class="normalInput" name="firstname"/>
</td>

With a bean wich initializes the data to display with the following method:    
@DontValidate
@HandlesEvent("InitEditCaller")
public Resolution initEditCaller() {
      currentCaller = getContext().getSelectedCalller();
      service.lock(currentCaller);
      return new ForwardResolution("createCaller.jsp");
}

The current caller is extracted from session and set in the bean, which has
delegate Methods for the needed properties.

It's possible to access all values via EL ${actionBean.lastname} in the JSP
site, but the <stripes:text> fields aren't populated automatically, like in
the bugzooky app.

Another less important thing I noticed, is that <stripes:errors> only works
out! of a <stripes:form> element, otherwise no errors are displayed.
Furthermore the stylesheets aren't changed when an validation error occured,
but the validation is made.

The layout of the JSP is rather complex, with nested <layout-components> and
<layout-render> elements. The mentioned <stripes:text> input fields are all
located in a component, which is loaded into the layout.

The application uses Hibernate, Spring.
Springs OpenSessionInView filter for accessing properties from the view is
configured.

Here is my web.xml (Sorry for the large post):
=snip
<context-param>
  <param-name>contextConfigLocation</param-name>
  <param-value>/WEB-INF/applicationContext.xml</param-value>
 </context-param>
 <listener>
  <listener-class>
   org.springframework.web.context.ContextLoaderListener
  </listener-class>
 </listener>
 <filter>
        <description>
            Provides essential configuration and request processing services
            for the Stripes framework.
        </description>
        <display-name>Stripes Filter</display-name>
        <filter-name>StripesFilter</filter-name>
 <filter-class>net.sourceforge.stripes.controller.StripesFilter</filter-class>
        <!-- Optional init parameters for the Stripes Filter. -->
        <init-param>
            <param-name>ActionResolver.UrlFilters</param-name>
            <param-value>WEB-INF/classes</param-value>
        </init-param>
        <init-param>
            <param-name>ActionResolver.PackageFilters</param-name>
            <param-value>reco.*</param-value>
        </init-param>
        <init-param>
            <param-name>Configuration.Class</param-name>   
<param-value>net.sourceforge.stripes.config.RuntimeConfiguration</param-value>
        </init-param>
  <init-param>
   <param-name>ActionResolver.Class</param-name>
   <param-value>
    net.sourceforge.stripes.integration.spring.SpringAwareActionResolver
   </param-value>
  </init-param>
  <init-param>
      <param-name>ActionBeanContext.Class</param-name>
      <param-value>reco.view.RecoActionBeanContext</param-value>
  </init-param>
  <init-param>
   <param-name>TagErrorRendererFactory.Class</param-name>  
<param-value>net.sourceforge.stripes.tag.DefaultTagErrorRendererFactory</param-value>
  </init-param>
 </filter>
 <filter-mapping>
  <filter-name>StripesFilter</filter-name>
  <url-pattern>*.jsp</url-pattern>
  <dispatcher>REQUEST</dispatcher>
 </filter-mapping>
 <filter-mapping>
  <filter-name>StripesFilter</filter-name>
  <servlet-name>StripesDispatcher</servlet-name>
  <dispatcher>REQUEST</dispatcher>
 </filter-mapping>
 <filter>
     <filter-name>sessionFilter</filter-name>
<filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
   </filter>
   <filter-mapping>
  <filter-name>sessionFilter</filter-name>
  <url-pattern>*.action</url-pattern>
 </filter-mapping>
 <servlet>
  <servlet-name>StripesDispatcher</servlet-name>
  <servlet-class>
   net.sourceforge.stripes.controller.DispatcherServlet
  </servlet-class>
  <load-on-startup>1</load-on-startup>
 </servlet>
 <servlet-mapping>
  <servlet-name>StripesDispatcher</servlet-name>
  <url-pattern>*.action</url-pattern>
 </servlet-mapping>
=snip

Has something to be configured, or is there a needed order for the
ServletFilters?

I'm totally stuck here and would appreciate any help.
Thank you for your hard work, making J2EE developement bearable again :-)

bye,
foldrian


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Stripes-users mailing list
hidden
https://lists.sourceforge.net/lists/listinfo/stripes-users
Entire Thread (Showing 2 of 3)

  • [Stripes-users] Problem with value binding Florian Falkner <hidden>