Re: logic:iterate question
The class Book must have the getter-function getTitle() Minghui Yu schrieb: in Action: ... SetBook books=bdao.findAllBooks(); request.setAttribute(books, books); ... In JSP: logic:present name=books All Books:br/br/ logic:iterate id=book name=books bean:write name=book property=title /br/ /logic:iterate /logic:present - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
logic:iterate question
in Action: ... SetBook books=bdao.findAllBooks(); request.setAttribute(books, books); ... In JSP: logic:present name=books All Books:br/br/ logic:iterate id=book name=books bean:write name=book property=title /br/ /logic:iterate /logic:present -- The line ( bean:write name=book property=title /br/throws an exception: Root Cause: javax.servlet.ServletException: javax.servlet.jsp.JspException: Cannot find bean: book in any scope (there is getTitle method for Book) Any idea why I made mistake? Thanks, Thanks Have a good day, YU, Minghui - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: logic:iterate question
u sure the collection 'books' is not empty? On 11/26/07, Minghui Yu [EMAIL PROTECTED] wrote: in Action: ... SetBook books=bdao.findAllBooks(); request.setAttribute(books, books); ... In JSP: logic:present name=books All Books:br/br/ logic:iterate id=book name=books bean:write name=book property=title /br/ /logic:iterate /logic:present -- The line ( bean:write name=book property=title /br/throws an exception: Root Cause: javax.servlet.ServletException: javax.servlet.jsp.JspException: Cannot find bean: book in any scope (there is getTitle method for Book) Any idea why I made mistake? Thanks, Thanks Have a good day, YU, Minghui - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Fitzwilliam Python [EMAIL PROTECTED]
Re: logic:iterate question
I tried code below, still the same error: logic:present name=books logic:notEmpty name=books logic:iterate id=book name=books indexId=cnt Next element is bean:write name=book property=title/ /logic:iterate /logic:notEmpty logic:empty name=books Database search does not return any result /logic:empty /logic:present On Nov 25, 2007 7:33 PM, Fitzwilliam. Aaron [EMAIL PROTECTED] wrote: u sure the collection 'books' is not empty? On 11/26/07, Minghui Yu [EMAIL PROTECTED] wrote: in Action: ... SetBook books=bdao.findAllBooks(); request.setAttribute(books, books); ... In JSP: logic:present name=books All Books:br/br/ logic:iterate id=book name=books bean:write name=book property=title /br/ /logic:iterate /logic:present -- The line ( bean:write name=book property=title /br/throws an exception: Root Cause: javax.servlet.ServletException: javax.servlet.jsp.JspException: Cannot find bean: book in any scope (there is getTitle method for Book) Any idea why I made mistake? Thanks, Thanks Have a good day, YU, Minghui - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Fitzwilliam Python [EMAIL PROTECTED] -- Thanks Have a good day, YU, Minghui - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: logic:iterate question
I made this change , still does not work bean:define id=abook value=book/bean:define Next element is bean:write name=abook property=title/ Error: No getter method for property: title of bean: abook I do have getTitle method for Book object On Nov 25, 2007 7:33 PM, Fitzwilliam. Aaron [EMAIL PROTECTED] wrote: u sure the collection 'books' is not empty? On 11/26/07, Minghui Yu [EMAIL PROTECTED] wrote: in Action: ... SetBook books=bdao.findAllBooks(); request.setAttribute(books, books); ... In JSP: logic:present name=books All Books:br/br/ logic:iterate id=book name=books bean:write name=book property=title /br/ /logic:iterate /logic:present -- The line ( bean:write name=book property=title /br/throws an exception: Root Cause: javax.servlet.ServletException: javax.servlet.jsp.JspException: Cannot find bean: book in any scope (there is getTitle method for Book) Any idea why I made mistake? Thanks, Thanks Have a good day, YU, Minghui - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Fitzwilliam Python [EMAIL PROTECTED] -- Thanks Have a good day, YU, Minghui - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
logic:iterate - Question
I have following scenario. I have getExSummary() method in exForm which returns a arraylist of A object. How to use logic:iterate tag to print all the values which methods in A object. getACount(),getBCount() are methods in A object. I tried following tag, which is not working. Please suggest me the correct logic:iterate tag. logic:notEmpty name =exForm property=exSummary logic:iterate name =exForm property=exSummary id=e indexId=edx tr td bean:write name=exSummary property=aCount / /td td bean:write name=expSummary property=bCount / /td /tr /logic:iterate /logic:notEmpty /table Error which I am getting Aug 9, 2007 3:52:43 PM IST Error HTTP BEA-101020 [weblogic.servlet.inte [EMAIL PROTECTED] - appName: 'AAA', name: 'aaa', context-path: '/ eem'] Servlet failed with Exception java.lang.NullPointerException at weblogic.logging.commons.LogImpl.doLog(LogImpl.java:95) at weblogic.logging.commons.LogImpl.debug(LogImpl.java:59) at weblogic.logging.commons.LogImpl.debug(LogImpl.java:55) at org.apache.struts.taglib.TagUtils.message(TagUtils.java:1036) at org.apache.struts.taglib.TagUtils.message(TagUtils.java:999) Truncated. see log file for complete stacktrace - Got a little couch potato? Check out fun summer activities for kids.
Re: logic:iterate - Question
you seems to have problems with logging configuration. apparently your weblogic server isn't properly configured which log to use with commons-logging adaptor. On 8/9/07, Mad Shop [EMAIL PROTECTED] wrote: I have following scenario. I have getExSummary() method in exForm which returns a arraylist of A object. How to use logic:iterate tag to print all the values which methods in A object. getACount(),getBCount() are methods in A object. I tried following tag, which is not working. Please suggest me the correct logic:iterate tag. logic:notEmpty name =exForm property=exSummary logic:iterate name =exForm property=exSummary id=e indexId=edx tr td bean:write name=exSummary property=aCount / /td td bean:write name=expSummary property=bCount / /td /tr /logic:iterate /logic:notEmpty /table Error which I am getting Aug 9, 2007 3:52:43 PM IST Error HTTP BEA-101020 [weblogic.servlet.inte [EMAIL PROTECTED] - appName: 'AAA', name: 'aaa', context-path: '/ eem'] Servlet failed with Exception java.lang.NullPointerException at weblogic.logging.commons.LogImpl.doLog(LogImpl.java:95) at weblogic.logging.commons.LogImpl.debug(LogImpl.java:59) at weblogic.logging.commons.LogImpl.debug(LogImpl.java:55) at org.apache.struts.taglib.TagUtils.message(TagUtils.java:1036) at org.apache.struts.taglib.TagUtils.message(TagUtils.java:999) Truncated. see log file for complete stacktrace - Got a little couch potato? Check out fun summer activities for kids. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: logic:iterate - Question
Thanks Leon, We are using log4j for logging. Existing project is working fine and I added the following block for new requirement. when I remove bean:write tags then it won't give any error!!! Leon Rosenberg [EMAIL PROTECTED] wrote: you seems to have problems with logging configuration. apparently your weblogic server isn't properly configured which log to use with commons-logging adaptor. On 8/9/07, Mad Shop wrote: I have following scenario. I have getExSummary() method in exForm which returns a arraylist of A object. How to use logic:iterate tag to print all the values which methods in A object. getACount(),getBCount() are methods in A object. I tried following tag, which is not working. Please suggest me the correct logic:iterate tag. Error which I am getting [weblogic.servlet.inte [EMAIL PROTECTED] - appName: 'AAA', name: 'aaa', context-path: '/ eem'] Servlet failed with Exception java.lang.NullPointerException at weblogic.logging.commons.LogImpl.doLog(LogImpl.java:95) at weblogic.logging.commons.LogImpl.debug(LogImpl.java:59) at weblogic.logging.commons.LogImpl.debug(LogImpl.java:55) at org.apache.struts.taglib.TagUtils.message(TagUtils.java:1036) at org.apache.struts.taglib.TagUtils.message(TagUtils.java:999) Truncated. see log file for complete stacktrace - Got a little couch potato? Check out fun summer activities for kids. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Yahoo! oneSearch: Finally, mobile search that gives answers, not web links.
Re: Basic Logic:iterate question
Logic iterate can be used only over a collection of elements. Check whether the property userRoles in the bean returned by LookUpConstants.SESSION_OBJECT is a collection. Also the property names used in bean:write(role) is different from the property name used in logic:iterate(userRoles) which I feel has some mismatch. hope this info helps. On 5/11/06, josh t [EMAIL PROTECTED] wrote: Greetings everyone: Objective: Retrieve an object from the session that contains a Collection of String for userRoles. Iterate through userRoles, and if one of the roles equals SUPER include a href. So this is what I have, but doesn't seem to be correct: logic:iterate id=role name=%=LookupConstants.SESSION_OBJECT% property=userRoles scope=session logic:equal name=role property=SUPER a href=test.do class=BodyLinkbtest/b/abr / /logic:equal /logic:iterate . Note: I can get the session value just fine, when i do the following: bean:write name=%=LookupConstants.SESSION_OBJECT% property=role scope=session / Can you please let me know what I'm doing wrong within the iterte block? - Get amazing travel prices for air and hotel in one click on Yahoo! FareChase
RE: Basic Logic:iterate question
Hi, If you are using logic equal , you should also use logic not equal. Regards, Nagesh -Original Message- From: siva sajja [mailto:[EMAIL PROTECTED] Sent: Thursday, May 11, 2006 12:08 PM To: Struts Users Mailing List Subject: Re: Basic Logic:iterate question Logic iterate can be used only over a collection of elements. Check whether the property userRoles in the bean returned by LookUpConstants.SESSION_OBJECT is a collection. Also the property names used in bean:write(role) is different from the property name used in logic:iterate(userRoles) which I feel has some mismatch. hope this info helps. On 5/11/06, josh t [EMAIL PROTECTED] wrote: Greetings everyone: Objective: Retrieve an object from the session that contains a Collection of String for userRoles. Iterate through userRoles, and if one of the roles equals SUPER include a href. So this is what I have, but doesn't seem to be correct: logic:iterate id=role name=%=LookupConstants.SESSION_OBJECT% property=userRoles scope=session logic:equal name=role property=SUPER a href=test.do class=BodyLinkbtest/b/abr / /logic:equal /logic:iterate . Note: I can get the session value just fine, when i do the following: bean:write name=%=LookupConstants.SESSION_OBJECT% property=role scope=session / Can you please let me know what I'm doing wrong within the iterte block? - Get amazing travel prices for air and hotel in one click on Yahoo! FareChase The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Basic Logic:iterate question
Greetings everyone: Objective: Retrieve an object from the session that contains a Collection of String for userRoles. Iterate through userRoles, and if one of the roles equals SUPER include a href. So this is what I have, but doesn't seem to be correct: logic:iterate id=role name=%=LookupConstants.SESSION_OBJECT% property=userRoles scope=session logic:equal name=role property=SUPER a href=test.do class=BodyLinkbtest/b/abr / /logic:equal /logic:iterate . Note: I can get the session value just fine, when i do the following: bean:write name=%=LookupConstants.SESSION_OBJECT% property=role scope=session / Can you please let me know what I'm doing wrong within the iterte block? - Get amazing travel prices for air and hotel in one click on Yahoo! FareChase
RE: Basic Logic:iterate question
Hi there As my best knowledge your logic:equal tag is wrong it requir value And logic:equal dosenot support to comparison of strings it only supports for either int or boolean -Original Message- From: josh t [mailto:[EMAIL PROTECTED] Sent: Thursday, May 11, 2006 7:41 AM To: user@struts.apache.org Subject: Basic Logic:iterate question Greetings everyone: Objective: Retrieve an object from the session that contains a Collection of String for userRoles. Iterate through userRoles, and if one of the roles equals SUPER include a href. So this is what I have, but doesn't seem to be correct: logic:iterate id=role name=%=LookupConstants.SESSION_OBJECT% property=userRoles scope=session logic:equal name=role property=SUPER a href=test.do class=BodyLinkbtest/b/abr / /logic:equal /logic:iterate . Note: I can get the session value just fine, when i do the following: bean:write name=%=LookupConstants.SESSION_OBJECT% property=role scope=session / Can you please let me know what I'm doing wrong within the iterte block? - Get amazing travel prices for air and hotel in one click on Yahoo! FareChase - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Basic Logic:iterate question
Thanks. Does anyone know where I can get some good reference material on Struts Tags? Patil, Sheetal [EMAIL PROTECTED] wrote: Hi there As my best knowledge your And supports for either int or boolean -Original Message- From: josh t [mailto:[EMAIL PROTECTED] Sent: Thursday, May 11, 2006 7:41 AM To: user@struts.apache.org Subject: Basic Greetings everyone: Objective: Retrieve an object from the session that contains a Collection of String for userRoles. Iterate through userRoles, and if one of the roles equals SUPER include a href. So this is what I have, but doesn't seem to be correct: name= property=userRoles scope=session test . Note: I can get the session value just fine, when i do the following: scope=session / Can you please let me know what I'm doing wrong within the iterte block? - Get amazing travel prices for air and hotel in one click on Yahoo! FareChase - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Blab-away for as little as 1¢/min. Make PC-to-Phone Calls using Yahoo! Messenger with Voice.
re: Basic Logic:iterate question
why not use logic:match tag instead? josh t [EMAIL PROTECTED] wrote: Greetings everyone: Objective: Retrieve an object from the session that contains a Collection of String for userRoles. Iterate through userRoles, and if one of the roles equals SUPER include a href. So this is what I have, but doesn't seem to be correct: name=%=LookupConstants.SESSION_OBJECT% property=userRoles scope=session test . Note: I can get the session value just fine, when i do the following: Can you please let me know what I'm doing wrong within the iterte block? - Get amazing travel prices for air and hotel in one click on Yahoo! FareChase - 抢注雅虎免费邮箱-3.5G容量,20M附件!
RE: Basic Logic:iterate question
This may help: http://struts.apache.org/struts-action/struts-taglib/index.html You may also want to consider using the jstl tags. i think the struts logic tags may be depreciated in favor of jstl. the jstl tags to solve your problem are c:forEach and c:if and the documentation is here: http://java.sun.com/products/jsp/jstl/reference/docs/index.html dave On Wed, 2006-05-10 at 21:40 -0700, josh t wrote: Thanks. Does anyone know where I can get some good reference material on Struts Tags? Patil, Sheetal [EMAIL PROTECTED] wrote: Hi there As my best knowledge your And supports for either int or boolean -Original Message- From: josh t [mailto:[EMAIL PROTECTED] Sent: Thursday, May 11, 2006 7:41 AM To: user@struts.apache.org Subject: Basic Greetings everyone: Objective: Retrieve an object from the session that contains a Collection of String for userRoles. Iterate through userRoles, and if one of the roles equals SUPER include a href. So this is what I have, but doesn't seem to be correct: name= property=userRoles scope=session test . Note: I can get the session value just fine, when i do the following: scope=session / Can you please let me know what I'm doing wrong within the iterte block? - Get amazing travel prices for air and hotel in one click on Yahoo! FareChase - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Blab-away for as little as 1¢/min. Make PC-to-Phone Calls using Yahoo! Messenger with Voice. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
logic:iterate - question
hi, I've got: ArrayList offices array of office objects. On jsp page i'm showing this array using logic:iterate. But i would like to show just only some objects of this array list, which meet some condition. It is possible? Best Regards, p. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: logic:iterate - question
Sure logic:iterate name=foo type=OfficeObject id=ob logic:equal name=ob property=aProperty value=your_condition_value html render object /logic::equal /logic:iterate -Ursprüngliche Nachricht- Von: peceka [mailto:[EMAIL PROTECTED] Gesendet: Samstag, 30. Juli 2005 20:39 An: user@struts.apache.org Betreff: logic:iterate - question hi, I've got: ArrayList offices array of office objects. On jsp page i'm showing this array using logic:iterate. But i would like to show just only some objects of this array list, which meet some condition. It is possible? Best Regards, p. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
logic:iterate Question
Folks, Thanks in advance for answering this urgent question. I know it's basic, but I'm stumped...your help is appreciated. I am trying to update data displayed via a logic:iterate tag with nested logic:equal tags: logic:iterate id=bean name=assetReportForm property=report.entries scope=session type=package.name.AssetReportEntryValue logic:equal name=bean property=level.name value=Level 1 logic:equal name=bean property=classification.name value=Unclassified tdhtml:text name=bean property=numCorrected indexed=true size=5//td /logic:equal /logic:equal /logic:iterate Whenever I submit the updated form, I expect the 'report.entries[x].numCorrected' bean property to be updated. Instead, the original property value is maintained. I tried setting the bean name to assetReportForm.report, but got the infamous Cannot find bean in any scope error. Any help is appreciated. Thanks, Mike - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]