[Stripes-users] Problems when saving action bean in session

2010-09-28 Thread Simon Keen

I have a 2 page solution to a problem but the 2nd page is used by several
beans to solve a similar problem. Also the beans have a lot of information
with them and are used rarely in this 2 page way.So on the 1st page when a
user clicks a button to go to the 2nd page I save the bean in the session.
That all works fine. On return from the 2nd page I have built an
ActionResolver that inherits from NamedActionResolver and overrides the
getActionBean(ActionBeanContext context, String path) method. If it finds a
reference to a dummy bean (SavedActionBean) it extracts the real one form
the session and returns that instead.

This all works fine. The right bean is extracted etc. However, a strange
thing occurs in the jsp. Anywhere I use a jsp expression, e.g.
${actionBean.job.title}, it all works fine. But all the stripes tags, e.g.
s:text name=job.title.../, don't work. They are all empty and it is as
if they do not have a bean to extract information from. If I enable debug
tracing on stripes and the relevant classes the values are never extracted
by the page. If I change the fields so they use the tag body, e.g. s:text
name=job.title...${actionBean.job.title}/, then everything is fine.

I really don't want to change all the pages. I have tried overriding most of
the methods in NamedActionResolver to see what is going on but can't work it
out.

Can anyone help please?

Many Thanks

Simon Keen
-- 
View this message in context: 
http://old.nabble.com/Problems-when-saving-action-bean-in-session-tp29835227p29835227.html
Sent from the stripes-users mailing list archive at Nabble.com.


--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] Stripes tag - disabled=true will bind a null value?

2009-12-10 Thread Simon Keen

I might be wrong but I thought this stops validation but still binds.  I want
the value to bind when it is there but not when it is not.

I will experiment though to see if validation is off it doesn't bind nulls. 
That might give me a work around and if I need validation I can do it in a
validation method.

In many cases I do not have any validation in these anyway.



Ben Gunter-2 wrote:
 
 I know this doesn't exactly solve the problem, but it might help in
 some cases. You can use @Validate(ignore=true) to prevent binding into
 a property.
 
 -Ben
 
 On Wed, Dec 9, 2009 at 12:52 PM, Simon Keen si...@allysystems.com wrote:

 This behaviour is a real problem.  I have been struggling with it for
 some
 time.  It doesn't help that I couldnt' find any mention of this behviour
 in
 the taglib docs or the stripes book.

 Having read the ticket associated with this I am not sure why Stripes has
 to
 bind anything when a value is ommitted from a posted form.  To my small
 brain it would seem better to ignore values that were on the previous
 page
 disbaled and are not in the next request.  This way no value would be
 bound
 fopr disabled fields.  Thus if any data is loaded it would be left alone
 instead of being trampled on.

 For simple fields it is possible to define a read only property on the
 bean
 that is used when it is disabled and a writable property name when it is
 not.  This is a pain but doable.  It gets a lot harder when the property
 is
 on a model class and you are in a foreach loop around a list of them.  It
 is
 not nice to have to corrupt the model classes for the sake of the
 presentation.

 I have alreayd had to spilt forms up but have now run out of ideas for
 one
 form I am working on.
 Seems cheeky to be using opensource software and ask for a fix but it
 would
 be most appreciated.

 Simon



 YEE CHUT NGEOW wrote:

 Hi,

 I have a stripes:select disabled=true tag.
 I just discovered that the disabled=true is setting null to my
 actionBean
 object.

 Is that the intended behavior? Is there a way to disable it?

 Many thanks
 Yee
 
 --
 Return on Information:
 Google Enterprise Search pays you back
 Get the facts.
 http://p.sf.net/sfu/google-dev2dev
 ___
 Stripes-users mailing list
 Stripes-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/stripes-users
 
 

-- 
View this message in context: 
http://old.nabble.com/Stripes-tag---disabled%3D%22true%22-will-bind-a-null-value--tp24160598p26724927.html
Sent from the stripes-users mailing list archive at Nabble.com.


--
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] Stripes tag - disabled=true will bind a null value?

2009-12-09 Thread Simon Keen

This behaviour is a real problem.  I have been struggling with it for some
time.  It doesn't help that I couldnt' find any mention of this behviour in
the taglib docs or the stripes book.

Having read the ticket associated with this I am not sure why Stripes has to
bind anything when a value is ommitted from a posted form.  To my small
brain it would seem better to ignore values that were on the previous page
disbaled and are not in the next request.  This way no value would be bound
fopr disabled fields.  Thus if any data is loaded it would be left alone
instead of being trampled on.

For simple fields it is possible to define a read only property on the bean
that is used when it is disabled and a writable property name when it is
not.  This is a pain but doable.  It gets a lot harder when the property is
on a model class and you are in a foreach loop around a list of them.  It is
not nice to have to corrupt the model classes for the sake of the
presentation.

I have alreayd had to spilt forms up but have now run out of ideas for one
form I am working on.
Seems cheeky to be using opensource software and ask for a fix but it would
be most appreciated.

Simon



YEE CHUT NGEOW wrote:
 
 Hi,
 
 I have a stripes:select disabled=true tag.
 I just discovered that the disabled=true is setting null to my
 actionBean
 object.
 
 Is that the intended behavior? Is there a way to disable it?
 
 Many thanks
 Yee
 
 --
 Are you an open source citizen? Join us for the Open Source Bridge
 conference!
 Portland, OR, June 17-19. Two days of sessions, one day of unconference:
 $250.
 Need another reason to go? 24-hour hacker lounge. Register today!
 http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
 ___
 Stripes-users mailing list
 Stripes-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/stripes-users
 
 

-- 
View this message in context: 
http://old.nabble.com/Stripes-tag---disabled%3D%22true%22-will-bind-a-null-value--tp24160598p26714556.html
Sent from the stripes-users mailing list archive at Nabble.com.


--
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] Feature Request for label selection

2009-11-27 Thread Simon Keen

Many thanks.  I did consider all of your suggestions.  I don't want to use
Javascript at present for a variety of reasons, not least the impact it has
on screen readers used by the visually impaired.

I agree I could use HTML but I decided in the end to create another event. 
It was just a suggestion for a new feature.  A better suggestion , as it
applies to several tags, might be to be able to alter the value resolution
order in the tag.  So I could put in a value attribute or body (as one of
the suggestion was but it won't work) and force the tag to use that instead
of the normal resolution order.  This would be useful for other tags as
well, e.g.g when collecting a value and altering it to pass on (say a flag
that indicated read only but needs to be switched to the opposite). I
currently do this by declaring a write-only property that in fact alters its
readonly variant.


-- 
View this message in context: 
http://old.nabble.com/Feature-Request-for-label-selection-tp26525265p26540671.html
Sent from the stripes-users mailing list archive at Nabble.com.


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


[Stripes-users] Problem with required field validation in indexed properties

2009-11-13 Thread Simon Keen

I have serached the forum and found mentions of a possible bug but I wanted
to know if there I am doing something stupid before I write a custom
validation.

I have a number of properties on my action bean with validation of the
following form:

@ValidateNestedProperties({
 @Validate(field=afield required=true)
})
protected ListSomeObject property;

public SomeObject getProperty() {
   return property;
}

public void setProperty(ListSomeObject property) {
   this.property = property;
}

When the list is empty or it contains entries that are not updated, I get a
validation error saying the field is required.  The values in the list are
all valid.

Any suggestions as to why this is happening?

It only seems to have a problem with indexed properties.


-- 
View this message in context: 
http://old.nabble.com/Problem-with-required-field-validation-in-indexed-properties-tp26335210p26335210.html
Sent from the stripes-users mailing list archive at Nabble.com.


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] Can not get Stripes to read properties files

2009-10-29 Thread Simon Keen

I have now identified that it is a stripes issue as JSTL is happily using the
properties file to resolve its locales.

I have attached my web.xml file in case anyone can see the silly mistake I
might have made.  I am sure it must be in the param where I tell stripes
about the localisation bundle.

Simon http://www.nabble.com/file/p26107480/web.xml web.xml 
-- 
View this message in context: 
http://www.nabble.com/Can-not-get-Stripes-to-read-properties-files-tp26074042p26107480.html
Sent from the stripes-users mailing list archive at Nabble.com.


--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users


Re: [Stripes-users] Can not get Stripes to read properties files

2009-10-27 Thread Simon Keen

Thanks. I will try your suggestions.

I have already tried using the default properties file an dthat didnt do
anything.  I have checked my locale picker is returning a valid locale but I
will turn it off and see what happens, I susepct nothing.  The error appears
to be coming from java.util.ResourceBundle.getBundle (see stack trace
below).  Which suggests to me that it can't find the properties file.  Also
as you can see it spots the correct properties file to use and I have made
sure there is a default one there with no locale to fail safe.

Elsewhere in my code I load other properties files that are in the same
directory and that works fine.  Also I have checked the files are in
WEB-INF/classes and they are.

java.util.MissingResourceException: Could not find the form field resource
bundle needed by Stripes. This almost certainly means that a properties file
called 'fieldlabels.properties' could not be found in the classpath. This
properties file is needed to lookup form field names. Please ensure the file
exists in WEB-INF/classes or elsewhere in your classpath.
at java.util.ResourceBundle.throwMissingResourceException(Unknown 
Source)
at java.util.ResourceBundle.getBundleImpl(Unknown Source)
at java.util.ResourceBundle.getBundle(Unknown Source)
at
net.sourceforge.stripes.localization.DefaultLocalizationBundleFactory.getFormFieldBundle(DefaultLocalizationBundleFactory.java:113)
at
net.sourceforge.stripes.localization.LocalizationUtility.getLocalizedFieldName(LocalizationUtility.java:66)
at
net.sourceforge.stripes.tag.InputTagSupport.getLocalizedFieldName(InputTagSupport.java:269)
at
net.sourceforge.stripes.tag.InputTagSupport.getLocalizedFieldName(InputTagSupport.java:238)
at
net.sourceforge.stripes.tag.InputButtonSupportTag.doEndInputTag(InputButtonSupportTag.java:75)
at
net.sourceforge.stripes.tag.InputTagSupport.doEndTag(InputTagSupport.java:442)
at
org.apache.jsp.jsp.enduser.Login_jsp._jspx_meth_s_005fsubmit_005f0(Login_jsp.java:597)
at
org.apache.jsp.jsp.enduser.Login_jsp._jspx_meth_s_005fform_005f0(Login_jsp.java:468)
at
org.apache.jsp.jsp.enduser.Login_jsp._jspx_meth_s_005flayout_002dcomponent_005f3(Login_jsp.java:393)
at
org.apache.jsp.jsp.enduser.Login_jsp._jspx_meth_s_005flayout_002drender_005f0(Login_jsp.java:188)
at org.apache.jsp.jsp.enduser.Login_jsp._jspService(Login_jsp.java:106)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
at 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
at
org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
at
net.sourceforge.stripes.action.ForwardResolution.execute(ForwardResolution.java:110)
at
net.sourceforge.stripes.controller.DispatcherHelper$7.intercept(DispatcherHelper.java:483)
at
net.sourceforge.stripes.controller.ExecutionContext.proceed(ExecutionContext.java:158)
at
net.sourceforge.stripes.controller.HttpCacheInterceptor.intercept(HttpCacheInterceptor.java:99)
at
net.sourceforge.stripes.controller.ExecutionContext.proceed(ExecutionContext.java:155)
at
net.sourceforge.stripes.controller.BeforeAfterMethodInterceptor.intercept(BeforeAfterMethodInterceptor.java:113)
at
net.sourceforge.stripes.controller.ExecutionContext.proceed(ExecutionContext.java:155)
at
net.sourceforge.stripes.controller.ExecutionContext.wrap(ExecutionContext.java:74)
at
net.sourceforge.stripes.controller.DispatcherHelper.executeResolution(DispatcherHelper.java:477)
at
net.sourceforge.stripes.controller.DispatcherServlet.executeResolution(DispatcherServlet.java:286)
at
net.sourceforge.stripes.controller.DispatcherServlet.service(DispatcherServlet.java:170)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at

Re: [Stripes-users] Can not get Stripes to read properties files

2009-10-27 Thread Simon Keen

I built a very simple test as you suggested.  Just one action bean and I
copied it to the classes directory so it wasn't in a jar.  It found the bean
but could not resolve the StripesResources.properties file for field labels
or to give me the validation error.

Below is the log that I get out from Stripes.  Also attached is the
ActionBean and the form although these are reall simple.

INFO Thread-1 net.sourceforge.stripes.util.ResolverUtil - Scanning for
classes in [/C:/Program Files/Apache Software Foundation/Tomcat
6.0/webapps/etrs/WEB-INF/classes/com/allysystems/etrs/ui/] matching
criteria: is assignable to ActionBean
INFO Thread-1 net.sourceforge.stripes.util.ResolverUtil - Scanning for
classes in [/C:/Program Files/Apache Software Foundation/Tomcat
6.0/webapps/etrs/WEB-INF/classes/com/allysystems/etrs/ui/] matching
criteria: is assignable to ActionBean
DEBUG Thread-1 net.sourceforge.stripes.controller.UrlBindingFactory - Wiring
path /Test.action to com.allysystems.etrs.ui.enduser.action.TestActionBean @
/Test.action
DEBUG Thread-1 net.sourceforge.stripes.controller.UrlBindingFactory - Wiring
path /Test.action to com.allysystems.etrs.ui.enduser.action.TestActionBean @
/Test.action
DEBUG Thread-1 net.sourceforge.stripes.controller.UrlBindingFactory - Wiring
path /Test.action/ to com.allysystems.etrs.ui.enduser.action.TestActionBean
@ /Test.action
DEBUG Thread-1 net.sourceforge.stripes.controller.UrlBindingFactory - Wiring
path /Test.action/ to com.allysystems.etrs.ui.enduser.action.TestActionBean
@ /Test.action
DEBUG Thread-1 net.sourceforge.stripes.controller.UrlBindingFactory - Wiring
prefix /Test.action/* to
com.allysystems.etrs.ui.enduser.action.TestActionBean @ /Test.action
DEBUG Thread-1 net.sourceforge.stripes.controller.UrlBindingFactory - Wiring
prefix /Test.action/* to
com.allysystems.etrs.ui.enduser.action.TestActionBean @ /Test.action
DEBUG Thread-1
net.sourceforge.stripes.controller.AnnotatedClassActionResolver - Bound:
TestActionBean.test() == /Test.action?test
DEBUG Thread-1
net.sourceforge.stripes.controller.AnnotatedClassActionResolver - Bound:
TestActionBean.test() == /Test.action?test
DEBUG Thread-1 net.sourceforge.stripes.controller.UrlBindingFactory - Wiring
path /controller/DefaultView.action to
net.sourceforge.stripes.controller.DefaultViewActionBean @
/controller/DefaultView.action
DEBUG Thread-1 net.sourceforge.stripes.controller.UrlBindingFactory - Wiring
path /controller/DefaultView.action to
net.sourceforge.stripes.controller.DefaultViewActionBean @
/controller/DefaultView.action
DEBUG Thread-1 net.sourceforge.stripes.controller.UrlBindingFactory - Wiring
path /controller/DefaultView.action/ to
net.sourceforge.stripes.controller.DefaultViewActionBean @
/controller/DefaultView.action
DEBUG Thread-1 net.sourceforge.stripes.controller.UrlBindingFactory - Wiring
path /controller/DefaultView.action/ to
net.sourceforge.stripes.controller.DefaultViewActionBean @
/controller/DefaultView.action
DEBUG Thread-1 net.sourceforge.stripes.controller.UrlBindingFactory - Wiring
prefix /controller/DefaultView.action/* to
net.sourceforge.stripes.controller.DefaultViewActionBean @
/controller/DefaultView.action
DEBUG Thread-1 net.sourceforge.stripes.controller.UrlBindingFactory - Wiring
prefix /controller/DefaultView.action/* to
net.sourceforge.stripes.controller.DefaultViewActionBean @
/controller/DefaultView.action
DEBUG Thread-1
net.sourceforge.stripes.controller.AnnotatedClassActionResolver - Bound:
DefaultViewActionBean.view() == /controller/DefaultView.action?view
DEBUG Thread-1
net.sourceforge.stripes.controller.AnnotatedClassActionResolver - Bound:
DefaultViewActionBean.view() == /controller/DefaultView.action?view
INFO Thread-1 net.sourceforge.stripes.localization.DefaultLocalePicker - No
locale list specified, defaulting to single locale: en_GB
INFO Thread-1 net.sourceforge.stripes.localization.DefaultLocalePicker - No
locale list specified, defaulting to single locale: en_GB
DEBUG Thread-1 net.sourceforge.stripes.format.DefaultFormatterFactory -
Clearing formatter cache
DEBUG Thread-1 net.sourceforge.stripes.format.DefaultFormatterFactory -
Clearing formatter cache
DEBUG Thread-1 net.sourceforge.stripes.format.DefaultFormatterFactory -
Clearing formatter cache
DEBUG Thread-1 net.sourceforge.stripes.format.DefaultFormatterFactory -
Clearing formatter cache
DEBUG Thread-1 net.sourceforge.stripes.format.DefaultFormatterFactory -
Clearing formatter cache
DEBUG Thread-1 net.sourceforge.stripes.format.DefaultFormatterFactory -
Clearing formatter cache
INFO Thread-1 net.sourceforge.stripes.config.BootstrapPropertyResolver -
Class implementing/extending PopulationStrategy found in web.xml:
net.sourceforge.stripes.tag.BeanFirstPopulationStrategy
INFO Thread-1 net.sourceforge.stripes.config.BootstrapPropertyResolver -
Class implementing/extending PopulationStrategy found in web.xml:
net.sourceforge.stripes.tag.BeanFirstPopulationStrategy
DEBUG Thread-1