Re: Struts access static list
Thanks Chris, It helped a lot in sorting things out. Also thanks to Dave for tossing up "SDO", it sounds interesting and I would certainly consider using it at some place. Thanks musomesa wrote: > > Yes, in between the or tags the object is sitting on > top of the value stack so you can access it with OGNL like you would a > 'normal' action. Handy for things like populating combo boxes which crop > up all > over the place. > Chris M > > > **The Average US Credit Score is 692. See Yours in Just 2 Easy > Steps! > (http://pr.atwola.com/promoclk/100126575x1221421325x1201417411/aol?redir=http:%2F%2Fwww.freecreditreport.com%2Fpm%2Fdefault.aspx%3Fsc%3D668072%26h > mpgID%3D62%26bcd%3DAprilAvgfooterNO62) > > -- View this message in context: http://www.nabble.com/Struts-access-static-list-tp23018571p23033840.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Struts access static list
Yes, in between the or tags the object is sitting on top of the value stack so you can access it with OGNL like you would a 'normal' action. Handy for things like populating combo boxes which crop up all over the place. Chris M **The Average US Credit Score is 692. See Yours in Just 2 Easy Steps! (http://pr.atwola.com/promoclk/100126575x1221421325x1201417411/aol?redir=http:%2F%2Fwww.freecreditreport.com%2Fpm%2Fdefault.aspx%3Fsc%3D668072%26h mpgID%3D62%26bcd%3DAprilAvgfooterNO62)
Re: Struts access static list
Hello Chris, well this is what I was doing yesterday, I have this naive issue here...mainly because of the fact that I am new to it. If we have an action that does the the job for us. I use s:action with actionResult="false" for no html rendering, is there a way if I can use the output as an input for a combobox. I mean call the action class and fetch the output and push it in a combobox or something. I know this is something I should not be asking at this level but being new justify my query :) Thanks musomesa wrote: > > Why not write the code in its own action or pojo and use or > wherever you want it? > Chris M > **The Average US Credit Score is 692. See Yours in Just 2 Easy > Steps! > (http://pr.atwola.com/promoclk/100126575x1221621489x1201450100/aol?redir=http:%2F%2Fwww.freecreditreport.com%2Fpm%2Fdefault.aspx%3Fsc%3D668072%26h > mpgID%3D62%26bcd%3DAprilAvgfooterNO62) > > -- View this message in context: http://www.nabble.com/Struts-access-static-list-tp23018571p23033129.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Struts access static list
Why not write the code in its own action or pojo and use or wherever you want it? Chris M **The Average US Credit Score is 692. See Yours in Just 2 Easy Steps! (http://pr.atwola.com/promoclk/100126575x1221621489x1201450100/aol?redir=http:%2F%2Fwww.freecreditreport.com%2Fpm%2Fdefault.aspx%3Fsc%3D668072%26h mpgID%3D62%26bcd%3DAprilAvgfooterNO62)
Re: Multiple Logic iterate tags and setting indexed properties
Hi Thanuja, Your checkbox tag should be rendered as I don't think logic:iterate supports property as "indexed". Probably you can create above tag using values you have. "bookLists[i].books[j].selected" will be converted as "getBookList().get(i).getBooks().get(j).setSelected(value)" you will have to make sure that none of the getters return null object. Regards, Nikhil On Tue, Apr 14, 2009 at 7:04 AM, thanuja wrote: > > Hi, > > I am using one logic iterate tag inside another. The data set at the inner > loop should update form bean. Following explains what i tried to do. This > way the data displays as I expected. But when I select the check box it > won't update the corresponding 'Book' object. (The form has list of > 'BookList' objects. Each BookList object has set of Book objects. I wanted > to mark Book as selected.) > > class BookList >ArrayList books > > class Book >String name >boolean selected > > class BookInfoForm extends ActionForm{ >ArrayList bookLists; > >public BookList getBookl(int index){ >return bookLists.get(index); >} >public void setBookl(int index,BookList element){ >bookLists.set(index, element); >} >public Book getBook(int index){ > >return bookLists.get(?).getBooks().get(index); >} >public void setBook(int index,Book element){ > >bookLists.get(?).getBooks().set(index,element); >} > > > } > > indexId="i"> > > > /> > > > > > > > Thanks in advance, > Thanuja > > > -- > View this message in context: > http://www.nabble.com/Multiple-Logic-iterate-tags-and-setting-indexed-properties-tp23031690p23031690.html > Sent from the Struts - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > -- Nikhil
Re: Struts access static list
Thanks Guys. Being new to Struts is the only issue I have right now and this is the reason I am not able to use my own ideas to the fuller. Your suggestions have helped a lot. Baran newton.dave wrote: > > mitch gorman wrote: >> Baran wrote: >>> This is about implementing reusability in the actions. I am struggling >>> to >>> identify the ways how we can share some comming functionality between >>> different actions. Lets say I got a list of users i need to use as a >>> combobox list at multiple pages. Right now I have to push the code in >>> every >>> action I need that list displayed for. >>> >>> any idea if I can use that list at multiple places without repeating the >>> code. I guess we need to have it static, but not sure how we can use a >>> list >>> as an static element >> >>it's a matter of reorganizing your Java classes. extract all the >> code that's common to all your user-related classes into a class called >> UserActionSupport, and then have all those user-related classes extend >> from UserActionSupport. > > For another option, consider moving that kind of code into service > objects. I'm not convinced the implementation of that behavior belongs > in the action class unless it's *very* tightly-focused and never used > anywhere else. > > There are various mechanisms that allow us to pull common code into our > actions without inheritance (think DI/IoC). Using them keeps our action > class hierarchy thin and light. > > Putting the code into our actions proper *could* lead to a heavier > action hierarchy than necessary, where we'd use only a small portion of > the functionality at any given time. > > A combination of the two, where we split the app into areas of > functionality, create base classes for each that pull in required > services, and add additional services in sub-classes only when we need > to, may be the most flexible. > > Dave > > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > > -- View this message in context: http://www.nabble.com/Struts-access-static-list-tp23018571p23032982.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Dealing with timezones and local time?
Hi all, I am storing a number of dates within my application internally as epoch, but I need to print them formatted for the local timezone of the client. Is there a standard way of doing this? Using the existing s:date tag is printing things in the timezone local to the server.. Thanks, David - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Multiple Logic iterate tags and setting indexed properties
Hi, I am using one logic iterate tag inside another. The data set at the inner loop should update form bean. Following explains what i tried to do. This way the data displays as I expected. But when I select the check box it won't update the corresponding 'Book' object. (The form has list of 'BookList' objects. Each BookList object has set of Book objects. I wanted to mark Book as selected.) class BookList ArrayList books class Book String name boolean selected class BookInfoForm extends ActionForm{ ArrayList bookLists; public BookList getBookl(int index){ return bookLists.get(index); } public void setBookl(int index,BookList element){ bookLists.set(index, element); } public Book getBook(int index){ return bookLists.get(?).getBooks().get(index); } public void setBook(int index,Book element){ bookLists.get(?).getBooks().set(index,element); } } Thanks in advance, Thanuja -- View this message in context: http://www.nabble.com/Multiple-Logic-iterate-tags-and-setting-indexed-properties-tp23031690p23031690.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Struts Action Issue
Martin Gainty wrote: agreed..docs maintainer please update the documentation ASAP! One way we can help keep the documentation up-to-date is by filing a CLA. When we run across an obviously ancient page we can then delete it, or at the bare minimum file a JIRA issue against the offending page. It's also good to make sure when we post answers that we're posting relevant (and at least marginally current) information. The page in question was deleted almost immediately after you posted the reference (by at least two people, although someone else beat me to the punch): pages with zero incoming links aren't often visited, and we don't always know they're still there until somebody references them for whatever reason. Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: Struts Action Issue
agreed..docs maintainer please update the documentation ASAP! Thanks Martin __ Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung / Note de déni et de confidentialité This message is confidential. If you should not be the intended receiver, then we ask politely to report. Each unauthorized forwarding or manufacturing of a copy is inadmissible. This message serves only for the exchange of information and has no legal binding effect. Due to the easy manipulation of emails we cannot take responsibility over the the contents. Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni. > Date: Mon, 13 Apr 2009 18:07:12 -0400 > Subject: Re: Struts Action Issue > From: musa...@gmail.com > To: user@struts.apache.org > > That doesn't make any sense. That link is outdated (very) from the > webwork days. Forms can use either POST or GET. > > @original poster: add breakpoints to the ParametersInterceptor and see > if your params are getting filtered out by it. > > musachy > > On Mon, Apr 13, 2009 at 4:18 PM, Martin Gainty wrote: > > > > except webwork forms expect method="POST" > > http://cwiki.apache.org/WW/webwork-2-ui-tag-guide.html > > is there any specific reason why you need to implement with method="get" > > > > did you use the FieldExpression-Validator as suggested earlier? > > > > what are the specific errors you are seeing with either scenario > > please post relevant jsp/taglib configs/XML configurations and backend > > Action/Interceptor code > > > > thks > > Martin > > __ > > Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung / Note > > de déni et de confidentialité > > This message is confidential. If you should not be the intended receiver, > > then we ask politely to report. Each unauthorized forwarding or > > manufacturing of a copy is inadmissible. This message serves only for the > > exchange of information and has no legal binding effect. Due to the easy > > manipulation of emails we cannot take responsibility over the the contents. > > Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene > > Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte > > Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht > > dient lediglich dem Austausch von Informationen und entfaltet keine > > rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von > > E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. > > Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le > > destinataire prévu, nous te demandons avec bonté que pour satisfaire > > informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie > > de ceci est interdite. Ce message sert à l'information seulement et n'aura > > pas n'importe quel effet légalement obligatoire. Étant donné que les email > > peuvent facilement être sujets à la manipulation, nous ne pouvons accepter > > aucune responsabilité pour le contenu fourni. > > > > > > > > > > > > > >> Date: Mon, 13 Apr 2009 11:56:42 -0700 > >> From: rachan...@gmail.com > >> To: user@struts.apache.org > >> Subject: RE: Struts Action Issue > >> > >> > >> Hi, > >> > >> I followed the replies but could not resolve the issue. Another update I > >> have is this request is an Ajax.Request with method = 'get'. > >> > >> Can this cause any trouble? Changing get to post however does not help. > >> Please advise. > >> > >> Thanks! > >> > >> mgainty wrote: > >> > > >> > > >> > agree with Rommel > >> > a FieldValidationInterceptor would accomplish this objective > >> > http://struts.apache.org/2.0.14/docs/fieldexpression-validator.html > >> > HINT place validation logic in expression validator e.g. > >> > Date: Thu, 9 Apr 2009 07:23:42 -0700 > >> >> From: charlesmel1...@yahoo.com > >> >> Subject: Re: Struts Action Issue > >> >> To: user@struts.apache.org > >> >> CC: charlesmel1...@yahoo.com > >> >> > >> >> Riya, > >> >> > >> >> I'm sure that if you trace the request submission from JSP to your > >> >> Ac
Re: Struts Action Issue
That doesn't make any sense. That link is outdated (very) from the webwork days. Forms can use either POST or GET. @original poster: add breakpoints to the ParametersInterceptor and see if your params are getting filtered out by it. musachy On Mon, Apr 13, 2009 at 4:18 PM, Martin Gainty wrote: > > except webwork forms expect method="POST" > http://cwiki.apache.org/WW/webwork-2-ui-tag-guide.html > is there any specific reason why you need to implement with method="get" > > did you use the FieldExpression-Validator as suggested earlier? > > what are the specific errors you are seeing with either scenario > please post relevant jsp/taglib configs/XML configurations and backend > Action/Interceptor code > > thks > Martin > __ > Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung / Note > de déni et de confidentialité > This message is confidential. If you should not be the intended receiver, > then we ask politely to report. Each unauthorized forwarding or manufacturing > of a copy is inadmissible. This message serves only for the exchange of > information and has no legal binding effect. Due to the easy manipulation of > emails we cannot take responsibility over the the contents. > Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger > sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung > oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich > dem Austausch von Informationen und entfaltet keine rechtliche > Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen > wir keine Haftung fuer den Inhalt uebernehmen. > Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le > destinataire prévu, nous te demandons avec bonté que pour satisfaire informez > l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci > est interdite. Ce message sert à l'information seulement et n'aura pas > n'importe quel effet légalement obligatoire. Étant donné que les email > peuvent facilement être sujets à la manipulation, nous ne pouvons accepter > aucune responsabilité pour le contenu fourni. > > > > > > >> Date: Mon, 13 Apr 2009 11:56:42 -0700 >> From: rachan...@gmail.com >> To: user@struts.apache.org >> Subject: RE: Struts Action Issue >> >> >> Hi, >> >> I followed the replies but could not resolve the issue. Another update I >> have is this request is an Ajax.Request with method = 'get'. >> >> Can this cause any trouble? Changing get to post however does not help. >> Please advise. >> >> Thanks! >> >> mgainty wrote: >> > >> > >> > agree with Rommel >> > a FieldValidationInterceptor would accomplish this objective >> > http://struts.apache.org/2.0.14/docs/fieldexpression-validator.html >> > HINT place validation logic in expression validator e.g. >> > Date: Thu, 9 Apr 2009 07:23:42 -0700 >> >> From: charlesmel1...@yahoo.com >> >> Subject: Re: Struts Action Issue >> >> To: user@struts.apache.org >> >> CC: charlesmel1...@yahoo.com >> >> >> >> Riya, >> >> >> >> I'm sure that if you trace the request submission from JSP to your Action >> >> class >> >> by debugging it step by step you will find where the culprit will be. I >> >> had one experience >> >> before that took me hours to figure out whats wrong in our JSP page where >> >> its not showing >> >> block of data. After debugging step by step, the logic that checks for >> >> the string to show the block of >> >> data had a trailing empty character. That string was saved in the >> >> database with the trailing space char. >> >> and when we pulled it and check for the matching string, our JSP was >> >> screwed up. So just a note >> >> always trim the data(String) you push to your database. >> >> >> >> Goodluck on the debugging spree :). >> >> >> >> Rommel >> >> >> >> >> >> >> >> >> >> From: Muthu Velappan >> >> To: Struts Users Mailing List >> >> Sent: Thursday, April 9, 2009 5:49:38 AM >> >> Subject: RE: Struts Action Issue >> >> >> >> Out of curiosity, I gave the same value in my application and tested, I >> >> got >> >> the exact junk back in my action not even a truncated one. So, please >> >> check >> >> whether ur action bypasses only this kind of string or even valid string >> >> like "test" or "sample". If it doesn't show valid string then there is >> >> problem with view file field name and action variable name. If valid >> >> strings >> >> are working fine and only this kind of string seems to be a problem then >> >> please generate the issue in a small testcase and send it across. >> >> >> >> Thanks, >> >> Muthu >> >> >> >> -Original Message- >> >> From: riya [mailto:rachan...@gmail.com] >> >> Sent: Thursday, April 09, 2009 2:33 AM >> >> To: user@struts.apache.org >> >> Subject: Struts Action Issue >> >> >> >> >> >> Hi, >> >> >> >> Recently I observed that if in JSP input text I have entered special >> >> characters, le
Re: Struts access static list
mitch gorman wrote: Baran wrote: This is about implementing reusability in the actions. I am struggling to identify the ways how we can share some comming functionality between different actions. Lets say I got a list of users i need to use as a combobox list at multiple pages. Right now I have to push the code in every action I need that list displayed for. any idea if I can use that list at multiple places without repeating the code. I guess we need to have it static, but not sure how we can use a list as an static element it's a matter of reorganizing your Java classes. extract all the code that's common to all your user-related classes into a class called UserActionSupport, and then have all those user-related classes extend from UserActionSupport. For another option, consider moving that kind of code into service objects. I'm not convinced the implementation of that behavior belongs in the action class unless it's *very* tightly-focused and never used anywhere else. There are various mechanisms that allow us to pull common code into our actions without inheritance (think DI/IoC). Using them keeps our action class hierarchy thin and light. Putting the code into our actions proper *could* lead to a heavier action hierarchy than necessary, where we'd use only a small portion of the functionality at any given time. A combination of the two, where we split the app into areas of functionality, create base classes for each that pull in required services, and add additional services in sub-classes only when we need to, may be the most flexible. Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: Struts Action Issue
except webwork forms expect method="POST" http://cwiki.apache.org/WW/webwork-2-ui-tag-guide.html is there any specific reason why you need to implement with method="get" did you use the FieldExpression-Validator as suggested earlier? what are the specific errors you are seeing with either scenario please post relevant jsp/taglib configs/XML configurations and backend Action/Interceptor code thks Martin __ Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung / Note de déni et de confidentialité This message is confidential. If you should not be the intended receiver, then we ask politely to report. Each unauthorized forwarding or manufacturing of a copy is inadmissible. This message serves only for the exchange of information and has no legal binding effect. Due to the easy manipulation of emails we cannot take responsibility over the the contents. Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni. > Date: Mon, 13 Apr 2009 11:56:42 -0700 > From: rachan...@gmail.com > To: user@struts.apache.org > Subject: RE: Struts Action Issue > > > Hi, > > I followed the replies but could not resolve the issue. Another update I > have is this request is an Ajax.Request with method = 'get'. > > Can this cause any trouble? Changing get to post however does not help. > Please advise. > > Thanks! > > mgainty wrote: > > > > > > agree with Rommel > > a FieldValidationInterceptor would accomplish this objective > > http://struts.apache.org/2.0.14/docs/fieldexpression-validator.html > > HINT place validation logic in expression validator e.g. > > Date: Thu, 9 Apr 2009 07:23:42 -0700 > >> From: charlesmel1...@yahoo.com > >> Subject: Re: Struts Action Issue > >> To: user@struts.apache.org > >> CC: charlesmel1...@yahoo.com > >> > >> Riya, > >> > >> I'm sure that if you trace the request submission from JSP to your Action > >> class > >> by debugging it step by step you will find where the culprit will be. I > >> had one experience > >> before that took me hours to figure out whats wrong in our JSP page where > >> its not showing > >> block of data. After debugging step by step, the logic that checks for > >> the string to show the block of > >> data had a trailing empty character. That string was saved in the > >> database with the trailing space char. > >> and when we pulled it and check for the matching string, our JSP was > >> screwed up. So just a note > >> always trim the data(String) you push to your database. > >> > >> Goodluck on the debugging spree :). > >> > >> Rommel > >> > >> > >> > >> > >> From: Muthu Velappan > >> To: Struts Users Mailing List > >> Sent: Thursday, April 9, 2009 5:49:38 AM > >> Subject: RE: Struts Action Issue > >> > >> Out of curiosity, I gave the same value in my application and tested, I > >> got > >> the exact junk back in my action not even a truncated one. So, please > >> check > >> whether ur action bypasses only this kind of string or even valid string > >> like "test" or "sample". If it doesn't show valid string then there is > >> problem with view file field name and action variable name. If valid > >> strings > >> are working fine and only this kind of string seems to be a problem then > >> please generate the issue in a small testcase and send it across. > >> > >> Thanks, > >> Muthu > >> > >> -Original Message- > >> From: riya [mailto:rachan...@gmail.com] > >> Sent: Thursday, April 09, 2009 2:33 AM > >> To: user@struts.apache.org > >> Subject: Struts Action Issue > >> > >> > >> Hi, > >> > >> Recently I observed that if in JSP input text I have entered special > >> characters, lets say: > >> > >> displayIDNumber: #...@#%$!#$%!(*)&*()*(& > >> > >> In the action I get displayIDNumber as "" i.e empty string. > >> > >> Nowhere in the code we are explicitly emptying the string whenever there > >> are > >> special characters in the input string. > >> > >> I puzzled. Can someone please clarify? > >> > >> Thanks in advance!! > >> -- > >> View this message in context: > >> http://www.nab
RE: Struts access static list
I sent this to you already but apparently was lost you can use the spring plugin to create the necessary entities for you e.g. http://www.springframework.org/schema/beans"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xmlns:bean="http://www.springframework.org/schema/util"; xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd";> then in your Action class declare the bean, mutator and accessor e.g. public class BaranAction extends ActionSupport { public com.baran.BaranBean baran_bean; public void setBaranBean(BaranBean baran_bean) { this.baran_bean = baran_bean; } public void getBaranBean() { return this.baran_bean; } }Did you try this? Martin __ Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung / Note de déni et de confidentialité This message is confidential. If you should not be the intended receiver, then we ask politely to report. Each unauthorized forwarding or manufacturing of a copy is inadmissible. This message serves only for the exchange of information and has no legal binding effect. Due to the easy manipulation of emails we cannot take responsibility over the the contents. Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni. > Date: Mon, 13 Apr 2009 09:00:32 -0400 > From: mgor...@shadowtv.com > To: user@struts.apache.org > Subject: Re: Struts access static list > > Baran wrote: > > Hi Guys, > > > > This is about implementing reusability in the actions. I am struggling to > > identify the ways how we can share some comming functionality between > > different actions. Lets say I got a list of users i need to use as a > > combobox list at multiple pages. Right now I have to push the code in every > > action I need that list displayed for. > > > > any idea if I can use that list at multiple places without repeating the > > code. I guess we need to have it static, but not sure how we can use a list > > as an static element >it's a matter of reorganizing your Java classes. extract all the > code that's common to all your user-related classes into a class called > UserActionSupport, and then have all those user-related classes extend > from UserActionSupport. > > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > _ Rediscover Hotmail®: Get quick friend updates right in your inbox. http://windowslive.com/RediscoverHotmail?ocid=TXT_TAGLM_WL_HM_Rediscover_Updates1_042009
Re: Struts access static list
Baran wrote: > Hi Guys, > > This is about implementing reusability in the actions. I am struggling to > identify the ways how we can share some comming functionality between > different actions. Lets say I got a list of users i need to use as a > combobox list at multiple pages. Right now I have to push the code in every > action I need that list displayed for. > > any idea if I can use that list at multiple places without repeating the > code. I guess we need to have it static, but not sure how we can use a list > as an static element it's a matter of reorganizing your Java classes. extract all the code that's common to all your user-related classes into a class called UserActionSupport, and then have all those user-related classes extend from UserActionSupport. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: struts2.1.6 dojo ajax tags conflict with fileupload interceptor?
Eric, It's listed at least here, I don't know where else it is, just FYI: http://struts.apache.org/2.0.14/docs/dojo-head.html M. -Original Message- From: Eric Zhao [mailto:z...@utsc.utoronto.ca] Sent: Monday, April 13, 2009 2:51 PM To: Struts Users Mailing List Subject: Re: struts2.1.6 dojo ajax tags conflict with fileupload interceptor? Thanks, Mike: Just google into this link myself a few minutes ago. Things change quickly with struts :-( http://www.nabble.com/-PROPOSAL--Deprecate-or-remove-Dojo-plugin-td18573704. html It seems for ajax, better learn another tool like JQuery or something. Quite confusing they still have the line "*First-class AJAX support*" on the homepage and no warning in the migration guide from 2.0.x to 2.1.6. Security Management wrote: > I think those tags are deprecated, so I'd be cautious of using them. > > Mike. > > -Original Message- > From: Eric Zhao [mailto:z...@utsc.utoronto.ca] > Sent: Monday, April 13, 2009 1:19 PM > To: Struts Users Mailing List > Subject: struts2.1.6 dojo ajax tags conflict with fileupload interceptor? > > repost, since last one went as a reply under another topic > > I am trying to use struts2.1.6 dojo tags (<%@ taglib prefix="sx" > uri="/struts-dojo-tags" %>) within a multipart form which also uses > fileupload interceptor, but with no success. > > My dojo tags is to populate a second drop down based on selection of > first dropdown. This works fine on regular form. But once the form > becomes mulitpart with file uploads, dojo tags stop working. Core > elements from the form looks like this: > > <%@ taglib prefix="s" uri="/struts-tags" %> > <%@ taglib prefix="sx" uri="/struts-dojo-tags" %> > > > > >function show_courses() { > document.a_form.selected_userid.value = > document.getElementById("for_id_list").value; > dojo.event.topic.publish("show_courses"); > } > > > enctype="multipart/form-data" theme="simple" id="a_form" name="a_form"> > listKey="key" listValue="value" name="scheduledFor" > value="scheduledFor" onchange="show_courses();return false;"/> > > > > formId="a_form" > > > > > There is the normal fileupload code in Action class like below: > > private List uploads = new ArrayList(); > private List uploadFileNames = new ArrayList(); > private List uploadContentTypes = new ArrayList(); > private void uploadFiles() { >try { >if (uploads != null) { >for (int i = 0; i < uploads.size(); i++) { >File theFile = new File(getFileSavingPath() + > uploadFileNames.get(i)); >FileUtils.copyFile(uploads.get(i), theFile); >} >} >} catch (Exception e) { >e.printStackTrace(); >} >} > > Does anyone have experience using dojo tags successfully with file > upload interceptor? Or is there some better approach for ajax in struts2? > > Any suggestions and pointers are greatly appreciated! > > Have a good day! > > -- Eric Zhao - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: Struts Action Issue
Hi, I followed the replies but could not resolve the issue. Another update I have is this request is an Ajax.Request with method = 'get'. Can this cause any trouble? Changing get to post however does not help. Please advise. Thanks! mgainty wrote: > > > agree with Rommel > a FieldValidationInterceptor would accomplish this objective > http://struts.apache.org/2.0.14/docs/fieldexpression-validator.html > HINT place validation logic in expression validator e.g. > Date: Thu, 9 Apr 2009 07:23:42 -0700 >> From: charlesmel1...@yahoo.com >> Subject: Re: Struts Action Issue >> To: user@struts.apache.org >> CC: charlesmel1...@yahoo.com >> >> Riya, >> >> I'm sure that if you trace the request submission from JSP to your Action >> class >> by debugging it step by step you will find where the culprit will be. I >> had one experience >> before that took me hours to figure out whats wrong in our JSP page where >> its not showing >> block of data. After debugging step by step, the logic that checks for >> the string to show the block of >> data had a trailing empty character. That string was saved in the >> database with the trailing space char. >> and when we pulled it and check for the matching string, our JSP was >> screwed up. So just a note >> always trim the data(String) you push to your database. >> >> Goodluck on the debugging spree :). >> >> Rommel >> >> >> >> >> From: Muthu Velappan >> To: Struts Users Mailing List >> Sent: Thursday, April 9, 2009 5:49:38 AM >> Subject: RE: Struts Action Issue >> >> Out of curiosity, I gave the same value in my application and tested, I >> got >> the exact junk back in my action not even a truncated one. So, please >> check >> whether ur action bypasses only this kind of string or even valid string >> like "test" or "sample". If it doesn't show valid string then there is >> problem with view file field name and action variable name. If valid >> strings >> are working fine and only this kind of string seems to be a problem then >> please generate the issue in a small testcase and send it across. >> >> Thanks, >> Muthu >> >> -Original Message- >> From: riya [mailto:rachan...@gmail.com] >> Sent: Thursday, April 09, 2009 2:33 AM >> To: user@struts.apache.org >> Subject: Struts Action Issue >> >> >> Hi, >> >> Recently I observed that if in JSP input text I have entered special >> characters, lets say: >> >> displayIDNumber: #...@#%$!#$%!(*)&*()*(& >> >> In the action I get displayIDNumber as "" i.e empty string. >> >> Nowhere in the code we are explicitly emptying the string whenever there >> are >> special characters in the input string. >> >> I puzzled. Can someone please clarify? >> >> Thanks in advance!! >> -- >> View this message in context: >> http://www.nabble.com/Struts-Action-Issue-tp22959505p22959505.html >> Sent from the Struts - User mailing list archive at Nabble.com. >> >> >> - >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >> For additional commands, e-mail: user-h...@struts.apache.org >> >> >> >> >> - >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >> For additional commands, e-mail: user-h...@struts.apache.org > > _ > Rediscover Hotmail®: Get e-mail storage that grows with you. > http://windowslive.com/RediscoverHotmail?ocid=TXT_TAGLM_WL_HM_Rediscover_Storage1_042009 > -- View this message in context: http://www.nabble.com/Struts-Action-Issue-tp22959505p23026901.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Designing application using Struts
Niklas, I've answered that question from my previous employer and what I did was to basically reuse the form because it was used everywhere in the application. The persistent evil of copy and pasting whoever coded it possessed him because he replicated the same form 17 times. Which means the form was used at 17 different places. I pulled my hair and started designing only 1 form for the entire 17 different places. I coded it and it worked. I've used a Facade Design Pattern that basically implements an interface where it knows what actions are associated with the form of interest. It knows how to pass the parameters to the right Action class. Your mapping forward can go to a different action common to all that can control the behavior of your form page. From you struts.config.xml file you can specify all those different actions to go to this one action that takes care of initializing/setting/routing your form of interest. Hope that gives you some details to start with. Rommel From: Niklas Johansson To: user@struts.apache.org Sent: Monday, April 13, 2009 2:12:17 PM Subject: Designing application using Struts Hello, I got some design questions when using Struts. If this is not the right place to post this kind of questions please let me know and I can create a QuickTopic. I am creating an application that contains several forms. Two of the forms belongs to two different parts which can be considered seperate applications (e.g. one is kind of an incident application). My plan is that I shall create these applications later as stand-alone applications. I am thinking about how to best put this code together. Here is my thoughts: Some high level requirements: R1. I want to make it easy to use the forms at different place in the application. R2. I want to make it easy to apply changes anywhere in the application as the application evolves. Thoughs about the design: D1. Creat my own UI components for each form. D2. Use parameterised Factory pattern for chosing which form to use. The actual tag, or all of them, for the chosen form should be returned in this case. Is this a good way of doing it or are there better ways of doing it? Any suggestions is most appreciated since I am totally new with Struts and I am trying to learn the nature of using it. Thank you in advance! Best Regards, Niklas _ News, entertainment and everything you care about at Live.com. Get it now! http://www.live.com/getstarted.aspx - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: struts2.1.6 dojo ajax tags conflict with fileupload interceptor?
Thanks, Mike: Just google into this link myself a few minutes ago. Things change quickly with struts :-( http://www.nabble.com/-PROPOSAL--Deprecate-or-remove-Dojo-plugin-td18573704.html It seems for ajax, better learn another tool like JQuery or something. Quite confusing they still have the line "*First-class AJAX support*" on the homepage and no warning in the migration guide from 2.0.x to 2.1.6. Security Management wrote: I think those tags are deprecated, so I'd be cautious of using them. Mike. -Original Message- From: Eric Zhao [mailto:z...@utsc.utoronto.ca] Sent: Monday, April 13, 2009 1:19 PM To: Struts Users Mailing List Subject: struts2.1.6 dojo ajax tags conflict with fileupload interceptor? repost, since last one went as a reply under another topic I am trying to use struts2.1.6 dojo tags (<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>) within a multipart form which also uses fileupload interceptor, but with no success. My dojo tags is to populate a second drop down based on selection of first dropdown. This works fine on regular form. But once the form becomes mulitpart with file uploads, dojo tags stop working. Core elements from the form looks like this: <%@ taglib prefix="s" uri="/struts-tags" %> <%@ taglib prefix="sx" uri="/struts-dojo-tags" %>function show_courses() { document.a_form.selected_userid.value = document.getElementById("for_id_list").value;dojo.event.topic.publish("show_courses"); } enctype="multipart/form-data" theme="simple" id="a_form" name="a_form"> listKey="key" listValue="value" name="scheduledFor" value="scheduledFor" onchange="show_courses();return false;"/> formId="a_form" > There is the normal fileupload code in Action class like below: private List uploads = new ArrayList(); private List uploadFileNames = new ArrayList(); private List uploadContentTypes = new ArrayList(); private void uploadFiles() { try { if (uploads != null) { for (int i = 0; i < uploads.size(); i++) { File theFile = new File(getFileSavingPath() + uploadFileNames.get(i)); FileUtils.copyFile(uploads.get(i), theFile); } } } catch (Exception e) { e.printStackTrace(); } } Does anyone have experience using dojo tags successfully with file upload interceptor? Or is there some better approach for ajax in struts2? Any suggestions and pointers are greatly appreciated! Have a good day! -- Eric Zhao - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: struts2.1.6 dojo ajax tags conflict with fileupload interceptor?
I think those tags are deprecated, so I'd be cautious of using them. Mike. -Original Message- From: Eric Zhao [mailto:z...@utsc.utoronto.ca] Sent: Monday, April 13, 2009 1:19 PM To: Struts Users Mailing List Subject: struts2.1.6 dojo ajax tags conflict with fileupload interceptor? repost, since last one went as a reply under another topic I am trying to use struts2.1.6 dojo tags (<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>) within a multipart form which also uses fileupload interceptor, but with no success. My dojo tags is to populate a second drop down based on selection of first dropdown. This works fine on regular form. But once the form becomes mulitpart with file uploads, dojo tags stop working. Core elements from the form looks like this: <%@ taglib prefix="s" uri="/struts-tags" %> <%@ taglib prefix="sx" uri="/struts-dojo-tags" %> function show_courses() { document.a_form.selected_userid.value = document.getElementById("for_id_list").value; dojo.event.topic.publish("show_courses"); } There is the normal fileupload code in Action class like below: private List uploads = new ArrayList(); private List uploadFileNames = new ArrayList(); private List uploadContentTypes = new ArrayList(); private void uploadFiles() { try { if (uploads != null) { for (int i = 0; i < uploads.size(); i++) { File theFile = new File(getFileSavingPath() + uploadFileNames.get(i)); FileUtils.copyFile(uploads.get(i), theFile); } } } catch (Exception e) { e.printStackTrace(); } } Does anyone have experience using dojo tags successfully with file upload interceptor? Or is there some better approach for ajax in struts2? Any suggestions and pointers are greatly appreciated! Have a good day! -- Eric Zhao Application Developer IITS, University of Toronto Scarborough Office#: 416-208-2676 - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Designing application using Struts
Hello, I got some design questions when using Struts. If this is not the right place to post this kind of questions please let me know and I can create a QuickTopic. I am creating an application that contains several forms. Two of the forms belongs to two different parts which can be considered seperate applications (e.g. one is kind of an incident application). My plan is that I shall create these applications later as stand-alone applications. I am thinking about how to best put this code together. Here is my thoughts: Some high level requirements: R1. I want to make it easy to use the forms at different place in the application. R2. I want to make it easy to apply changes anywhere in the application as the application evolves. Thoughs about the design: D1. Creat my own UI components for each form. D2. Use parameterised Factory pattern for chosing which form to use. The actual tag, or all of them, for the chosen form should be returned in this case. Is this a good way of doing it or are there better ways of doing it? Any suggestions is most appreciated since I am totally new with Struts and I am trying to learn the nature of using it. Thank you in advance! Best Regards, Niklas _ News, entertainment and everything you care about at Live.com. Get it now! http://www.live.com/getstarted.aspx - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
struts2.1.6 dojo ajax tags conflict with fileupload interceptor?
repost, since last one went as a reply under another topic I am trying to use struts2.1.6 dojo tags (<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>) within a multipart form which also uses fileupload interceptor, but with no success. My dojo tags is to populate a second drop down based on selection of first dropdown. This works fine on regular form. But once the form becomes mulitpart with file uploads, dojo tags stop working. Core elements from the form looks like this: <%@ taglib prefix="s" uri="/struts-tags" %> <%@ taglib prefix="sx" uri="/struts-dojo-tags" %>function show_courses() { document.a_form.selected_userid.value = document.getElementById("for_id_list").value;dojo.event.topic.publish("show_courses"); } enctype="multipart/form-data" theme="simple" id="a_form" name="a_form"> listKey="key" listValue="value" name="scheduledFor" value="scheduledFor" onchange="show_courses();return false;"/> formId="a_form" > There is the normal fileupload code in Action class like below: private List uploads = new ArrayList(); private List uploadFileNames = new ArrayList(); private List uploadContentTypes = new ArrayList(); private void uploadFiles() { try { if (uploads != null) { for (int i = 0; i < uploads.size(); i++) { File theFile = new File(getFileSavingPath() + uploadFileNames.get(i)); FileUtils.copyFile(uploads.get(i), theFile); } } } catch (Exception e) { e.printStackTrace(); } } Does anyone have experience using dojo tags successfully with file upload interceptor? Or is there some better approach for ajax in struts2? Any suggestions and pointers are greatly appreciated! Have a good day! -- Eric Zhao Application Developer IITS, University of Toronto Scarborough Office#: 416-208-2676 - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Aw: [s2] Using UTF-8 in .properties files
Thank you very much, I think it resolves my problem :) Cristian. On 09/04/2009, at 12:28, Paweł Wielgus wrote: Hi all, try this: http://sourceforge.net/projects/eclipse-rbe/ Best greetings, Paweł Wielgus. 2009/4/9 Cristian Peraferrer : So, is it possible to *really* develop internationalized struts web apps? How can I add chinese or japanese, if the way to internationalize it isn't capable to use other encoding than ASCII? I can't understand that. Any idea? Thanks, Cristian. On 09/04/2009, at 11:39, kindl...@arcor.de wrote: If you look in the Java docs, you will see this is not possible. .properties files are always ASCII. The only possibility to include non-ASCII characters is using the Unicode codes \u. I do hate this. There might be a way to extend the resource bundle framework to support files using other encodings, but I never found a ready-to-use package and writing it myself was never worthwhile. Martin - Original Nachricht Von: Cristian Peraferrer An: user@struts.apache.org Datum: 09.04.2009 11:28 Betreff: [s2] Using UTF-8 in .properties files Hi, How I can use UTF-8 in the .properties files? (I need the .properties files for i18n, so loggically I will need characters other than the contained in ASCII or latin1). Thanks, Cristian. -- GPG Key-ID: 0x564903FA - Jabber ID: corellian at swissjabber.ch - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org -- GPG Key-ID: 0x564903FA - Jabber ID: corellian at swissjabber.ch - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org -- GPG Key-ID: 0x564903FA - Jabber ID: corellian at swissjabber.ch - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
struts2.1.6 dojo ajax tags conflict with fileupload interceptor?
Hello: I am trying to use struts2.1.6 dojo tags (<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>) within a multipart form which also uses fileupload interceptor, but with no success. My dojo tags is to populate a second drop down based on selection of first dropdown. This works fine on regular form. But once the form becomes mulitpart with file uploads, dojo tags stop working. Core elements from the form looks like this: <%@ taglib prefix="s" uri="/struts-tags" %> <%@ taglib prefix="sx" uri="/struts-dojo-tags" %>function show_courses() { document.a_form.selected_userid.value = document.getElementById("for_id_list").value;dojo.event.topic.publish("show_courses"); } enctype="multipart/form-data" theme="simple" id="a_form" name="a_form"> listKey="key" listValue="value" name="scheduledFor" value="scheduledFor" onchange="show_courses();return false;"/> listenTopics="show_courses" formId="a_form" > There is the normal fileupload code in Action class like below: private List uploads = new ArrayList(); private List uploadFileNames = new ArrayList(); private List uploadContentTypes = new ArrayList(); private void uploadFiles() { try { if (uploads != null) { for (int i = 0; i < uploads.size(); i++) { File theFile = new File(getFileSavingPath() + uploadFileNames.get(i)); FileUtils.copyFile(uploads.get(i), theFile); } } } catch (Exception e) { e.printStackTrace(); } } Does anyone have experience using dojo tags successfully with file upload interceptor? Any suggestions and pointers are greatly appreciated! Have a good day! -- Eric Zhao Application Developer IITS, University of Toronto Scarborough Office#: 416-208-2676 - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: [Help] I cannot make the Validation in struts 2.0 works.....
白鹏 wrote: > *The returned html file contains:* > > src="/LearnDataProject/struts/xhtml/validation.js"> > src="/LearnDataProject/struts/utils.js"> > > but *There isn't the folder 'struts' in my App /LearnDataProject .* > ** > *Why this happens??? * Client-side validation requires JavaScript. Struts 2 serves these JavaScript files from the struts2-core library. If you look inside the struts2-core library file you will see them. Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: hi,guys! I wonder the validation framework is ok in the Struts 2.1.6 .
?? wrote: Has anyone use the validation framework of struts 2.1.6?? Yes. Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: hi,guys! I wonder the validation framework is ok in the Struts 2.1.6 .
Hi, mabe You should try to run struts blank app, the one that comes from downloaded zip file, there evrything should work fine and You will have a chance to see what differs from Your app. Best greetings, Paweł Wielgus. 2009/4/13 白鹏 : > Has anyone use the validation framework of struts 2.1.6?? > > ?? > - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org