Re: [Stripes-users] how to check if error collections not empty
Hi, There is no such function for messages. But you can do that easily in EL. For example, if you save your message like this: LocalizableMessage message = new LocalizableMessage(some_message); context.getMessages(my_key).add(message); Then the EL will look like this: ${!empty request['my_key']} I think this will work even after a redirect since messages are saved in FlashScope. Christian De : Chris Cheshire [mailto:cheshira...@gmail.com] Envoyé : July-30-13 5:29 PM À : Stripes Users List Objet : Re: [Stripes-users] how to check if error collections not empty *facepalm* I didn't even see that and I've had the JDoc open for the last couple of days. What about for the messages collection? I don't see anything analogous to it there. Chris On Tue, Jul 30, 2013 at 2:41 PM, Freddy Daoud xf2...@fastmail.fmmailto:xf2...@fastmail.fm wrote: Hi Chris, Perhaps use the hasErrors() JSP function from the Stripes taglib? http://stripes.sourceforge.net/docs/current/taglib/stripes/hasErrors.fn.html Hope that helps, Freddy On Tue, Jul 30, 2013, at 02:36 PM, Chris Cheshire wrote: In my JSP page, how do I check if the errors for a field that are rendered by the stripes:errors tag is not empty? In some places I need to display them under the field and use a line break before them, and in some places I need to display them next to the field without the line break. Due to this I can't use the stripes.fieldErrors.X properties because it affects everything. What I need to do is conditionally insert the line breaks in the places where it is appropriate. I am assuming they are hidden as a request attribute, but what is the key for them? What about the collection that stripes:messages renders? Thanks Chris --- --- Get your SQL database under version control now! Version control is standard for application code, but databases havent caught up. So what steps can you take to put your SQL databases under version control? Why should you start doing it? Read more to find out. [1]http://pubads.g.doubleclick.net/gampad/clk?id=49501711iu=/4140/ostg .clktrk ___ Stripes-users mailing list [2]Stripes-users@lists.sourceforge.netmailto:Stripes-users@lists.sourceforge.net [3]https://lists.sourceforge.net/lists/listinfo/stripes-users References 1. http://pubads.g.doubleclick.net/gampad/clk?id=49501711iu=/4140/ostg.clktrk 2. mailto:Stripes-users@lists.sourceforge.netmailto:Stripes-users@lists.sourceforge.net 3. https://lists.sourceforge.net/lists/listinfo/stripes-users -- Get your SQL database under version control now! Version control is standard for application code, but databases havent caught up. So what steps can you take to put your SQL databases under version control? Why should you start doing it? Read more to find out. http://pubads.g.doubleclick.net/gampad/clk?id=49501711iu=/4140/ostg.clktrk ___ Stripes-users mailing list Stripes-users@lists.sourceforge.netmailto:Stripes-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/stripes-users -- Get your SQL database under version control now! Version control is standard for application code, but databases havent caught up. So what steps can you take to put your SQL databases under version control? Why should you start doing it? Read more to find out. http://pubads.g.doubleclick.net/gampad/clk?id=49501711iu=/4140/ostg.clktrk___ Stripes-users mailing list Stripes-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/stripes-users
Re: [Stripes-users] how to check if error collections not empty
Hi, You can also check for errors using: c:if test=${not empty actionBean.context.validationErrors} s:errors / /c:if Similarly using the following code may also work for messages (not tested): c:if test=${not empty actionBean.context.messages} s:messages / /c:if -- Samuel Santos http://www.samaxes.com/ On Wed, Jul 31, 2013 at 1:42 PM, Poitras Christian christian.poit...@ircm.qc.ca wrote: Hi, ** ** There is no such function for messages. But you can do that easily in EL.* *** ** ** For example, if you save your message like this: LocalizableMessage message = *new* LocalizableMessage(some_message); context.getMessages(“my_key”).add(message); ** ** Then the EL will look like this: ${!empty request[‘my_key’]} ** ** I think this will work even after a redirect since messages are saved in FlashScope. ** ** Christian ** ** *De :* Chris Cheshire [mailto:cheshira...@gmail.com] *Envoyé :* July-30-13 5:29 PM *À :* Stripes Users List *Objet :* Re: [Stripes-users] how to check if error collections not empty* *** ** ** *facepalm* I didn't even see that and I've had the JDoc open for the last couple of days. What about for the messages collection? I don't see anything analogous to it there. Chris ** ** On Tue, Jul 30, 2013 at 2:41 PM, Freddy Daoud xf2...@fastmail.fm wrote:* *** Hi Chris, Perhaps use the hasErrors() JSP function from the Stripes taglib? http://stripes.sourceforge.net/docs/current/taglib/stripes/hasErrors.fn.html Hope that helps, Freddy On Tue, Jul 30, 2013, at 02:36 PM, Chris Cheshire wrote: In my JSP page, how do I check if the errors for a field that are rendered by the stripes:errors tag is not empty? In some places I need to display them under the field and use a line break before them, and in some places I need to display them next to the field without the line break. Due to this I can't use the stripes.fieldErrors.X properties because it affects everything. What I need to do is conditionally insert the line breaks in the places where it is appropriate. I am assuming they are hidden as a request attribute, but what is the key for them? What about the collection that stripes:messages renders? Thanks Chris --- --- Get your SQL database under version control now! Version control is standard for application code, but databases havent caught up. So what steps can you take to put your SQL databases under version control? Why should you start doing it? Read more to find out. [1]http://pubads.g.doubleclick.net/gampad/clk?id=49501711iu=/4140/ostg .clktrk ___ Stripes-users mailing list [2]Stripes-users@lists.sourceforge.net [3]https://lists.sourceforge.net/lists/listinfo/stripes-users References 1. http://pubads.g.doubleclick.net/gampad/clk?id=49501711iu=/4140/ostg.clktrk 2. mailto:Stripes-users@lists.sourceforge.net 3. https://lists.sourceforge.net/lists/listinfo/stripes-users -- Get your SQL database under version control now! Version control is standard for application code, but databases havent caught up. So what steps can you take to put your SQL databases under version control? Why should you start doing it? Read more to find out. http://pubads.g.doubleclick.net/gampad/clk?id=49501711iu=/4140/ostg.clktrk ___ Stripes-users mailing list Stripes-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/stripes-users ** ** -- Get your SQL database under version control now! Version control is standard for application code, but databases havent caught up. So what steps can you take to put your SQL databases under version control? Why should you start doing it? Read more to find out. http://pubads.g.doubleclick.net/gampad/clk?id=49501711iu=/4140/ostg.clktrk ___ Stripes-users mailing list Stripes-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/stripes-users -- Get your SQL database under version control now! Version control is standard for application code, but databases havent caught up. So what steps can you take to put your SQL databases under version control? Why should you start doing it? Read more to find out. http://pubads.g.doubleclick.net/gampad/clk?id=49501711iu=/4140/ostg.clktrk___ Stripes-users mailing list Stripes-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/stripes-users
Re: [Stripes-users] how to check if error collections not empty
Hi Chris, Perhaps use the hasErrors() JSP function from the Stripes taglib? http://stripes.sourceforge.net/docs/current/taglib/stripes/hasErrors.fn.html Hope that helps, Freddy On Tue, Jul 30, 2013, at 02:36 PM, Chris Cheshire wrote: In my JSP page, how do I check if the errors for a field that are rendered by the stripes:errors tag is not empty? In some places I need to display them under the field and use a line break before them, and in some places I need to display them next to the field without the line break. Due to this I can't use the stripes.fieldErrors.X properties because it affects everything. What I need to do is conditionally insert the line breaks in the places where it is appropriate. I am assuming they are hidden as a request attribute, but what is the key for them? What about the collection that stripes:messages renders? Thanks Chris --- --- Get your SQL database under version control now! Version control is standard for application code, but databases havent caught up. So what steps can you take to put your SQL databases under version control? Why should you start doing it? Read more to find out. [1]http://pubads.g.doubleclick.net/gampad/clk?id=49501711iu=/4140/ostg .clktrk ___ Stripes-users mailing list [2]Stripes-users@lists.sourceforge.net [3]https://lists.sourceforge.net/lists/listinfo/stripes-users References 1. http://pubads.g.doubleclick.net/gampad/clk?id=49501711iu=/4140/ostg.clktrk 2. mailto:Stripes-users@lists.sourceforge.net 3. https://lists.sourceforge.net/lists/listinfo/stripes-users -- Get your SQL database under version control now! Version control is standard for application code, but databases havent caught up. So what steps can you take to put your SQL databases under version control? Why should you start doing it? Read more to find out. http://pubads.g.doubleclick.net/gampad/clk?id=49501711iu=/4140/ostg.clktrk ___ Stripes-users mailing list Stripes-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/stripes-users
Re: [Stripes-users] how to check if error collections not empty
*facepalm* I didn't even see that and I've had the JDoc open for the last couple of days. What about for the messages collection? I don't see anything analogous to it there. Chris On Tue, Jul 30, 2013 at 2:41 PM, Freddy Daoud xf2...@fastmail.fm wrote: Hi Chris, Perhaps use the hasErrors() JSP function from the Stripes taglib? http://stripes.sourceforge.net/docs/current/taglib/stripes/hasErrors.fn.html Hope that helps, Freddy On Tue, Jul 30, 2013, at 02:36 PM, Chris Cheshire wrote: In my JSP page, how do I check if the errors for a field that are rendered by the stripes:errors tag is not empty? In some places I need to display them under the field and use a line break before them, and in some places I need to display them next to the field without the line break. Due to this I can't use the stripes.fieldErrors.X properties because it affects everything. What I need to do is conditionally insert the line breaks in the places where it is appropriate. I am assuming they are hidden as a request attribute, but what is the key for them? What about the collection that stripes:messages renders? Thanks Chris --- --- Get your SQL database under version control now! Version control is standard for application code, but databases havent caught up. So what steps can you take to put your SQL databases under version control? Why should you start doing it? Read more to find out. [1]http://pubads.g.doubleclick.net/gampad/clk?id=49501711iu=/4140/ostg .clktrk ___ Stripes-users mailing list [2]Stripes-users@lists.sourceforge.net [3]https://lists.sourceforge.net/lists/listinfo/stripes-users References 1. http://pubads.g.doubleclick.net/gampad/clk?id=49501711iu=/4140/ostg.clktrk 2. mailto:Stripes-users@lists.sourceforge.net 3. https://lists.sourceforge.net/lists/listinfo/stripes-users -- Get your SQL database under version control now! Version control is standard for application code, but databases havent caught up. So what steps can you take to put your SQL databases under version control? Why should you start doing it? Read more to find out. http://pubads.g.doubleclick.net/gampad/clk?id=49501711iu=/4140/ostg.clktrk ___ Stripes-users mailing list Stripes-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/stripes-users -- Get your SQL database under version control now! Version control is standard for application code, but databases havent caught up. So what steps can you take to put your SQL databases under version control? Why should you start doing it? Read more to find out. http://pubads.g.doubleclick.net/gampad/clk?id=49501711iu=/4140/ostg.clktrk___ Stripes-users mailing list Stripes-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/stripes-users