Re: banned
Few mature individuals who are well-grounded in a spiritual sense have any fear of what newcomers and troublemakers can do to reputation or to effectiveness. Those who yell, those who take up space, those who talk strange and even with evil in their hearts, those who are burdened with mental twists, those who rebel, and those who trade on the list's reputation, all such people seldom harm at all and, if at all, not for long. Some of these will become our best and most respected list members, if not a part of the holy table of committers. Some leave, some remain to try our patience. Others seem to just drift away. The troublemakers should be regarded not as menaces but as our teachers. They oblige us to cultivate patience, tolerance, and some humility. If they are sick, they are only sicker than us at worst. Those that openly condemn them are the Pharisees whose false righteousness does the list more and deeper damage. Some of these are, as is usual in such matters, our elder statesmen. I am very sorry you lost your job, Mark. I cannot imagine this is likely to better you. But, please know that there are out here people who do understand that however sick or outrageous you might be, you deserve your dignity too. I wish that did not sound so high-and-mighty, and that is what Craig, for reasons only he can explain, finds so objectionable about me, I guess. But, this is a time, I think, to be high-and-mighty. I do want to say that Niall displayed great courage in admitting his error, and I certainly respect that. On 7/6/05, Craig McClanahan [EMAIL PROTECTED] wrote: On 7/6/05, Brian Lee [EMAIL PROTECTED] wrote: Wow, this is shockingly lame. Like amazingly lame. To mess with someone's livlihood because you think they are an jerk is inexcusable. Keep in mind that, if Mark indeed did get fired (he has *no* credibility with me, so I don't believe anything he says without corroboration) then he has only himself, and his own behavior, to blame. Acting the way he does, on a public mailing list (which is certainly accessible to his boss whether or not someone points him at it) is incredibly stupid, and doing so from his employer's email system is way beyond stupid -- and it was only a matter of time before he got called on it. I didn't forward the email trail, but I can absolutely understand Niall's frustration with the behavior of an idiot. I'll take Niall with one fit of frustration lapse *any* day over several of the people that think the Struts user mailing list is their private playground to have a I can be more outrageous and infantile than you can pissing contest. The next time around, I'm going to be inclined to ban people soon after a spate of continuous crap like this (assuming requests to change behavior don't work). It's a losing battle against a determined jerk (because its easy to just get a new address) -- but (since Mark got it wrong yet again) -- I didn't ban him, but I would not complain if one of the other mailing list moderators had (they didn't ban his gmail address, or you wouldn't have been able to see his latest comment). Actually, as I told him, it would suit me just fine if he simply went away. I know there are a few people here who find Mark to be funny (I'm *not* a part of that group). That's fine ... it's a free world ... but please go find him funny somewhere else. There are ***lots*** of people who find him annoying and disruptive instead of helpful -- and, to the extent that this behavior encourages others to leave the list, it harms the Struts community as a whole. Craig McClanahan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- You can lead a horse to water but you cannot make it float on its back. ~Dakota Jack~ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How to access ACL
Hi, I am using ACL authentication, how can I get the user name from the ACL inside my action class Regards, Senthil
Re: How to access ACL
Senthilrajan VS wrote: Hi, I am using ACL authentication, how can I get the user name from the ACL inside my action class Regards, Senthil request.getRemoteuser() - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: RE: Question re html:select on the client
You can use the following code to dynamically generate the action where the submit is to happen. function linkEditClick() { document.formName.action=/editAction?id= + document.formName.comboName.value; document.formName.submit(); } function linkAddClick() { document.formName.action=/addAction?id= + document.formName.comboName.value; document.formName.submit(); } function linkDeleteClick() { document.formName.action=/deleteAction?id= + document.formName.comboName.value; document.formName.submit(); } these functions can be called on the onclick event of the respective links. Avjit On Thu, 07 Jul 2005 Nitesh Naveen wrote : You could use JavaScript to submit the form on clicking the link. Have a hidden field to track which link is clicked. For e.g.. Use this function in the link... function clickLink(linkId) { document.formName.hiddenElementName.value=linkId; document.formName.submit(); } PS: you need to make sure there are no fields in your form with the name - submit HTH, Nitesh _ Disclaimer: Information contained and transmitted by this e-mail is confidential, proprietary, and legally privileged data of Cordiant Technologies that is intended for use only by the addressee. If you are not the intended recipient, you are notified that any dissemination, distribution, or copying of this e-mail is strictly prohibited and you are requested to delete this e-mail immediately and notify the originator. Any views expressed by an individual do not necessarily reflect the view of Cordiant Technologies. The recipient should scan this email and any attachments for viruses as Cordiant Technologies is not liable for the presence of viruses in this email. Cordiant Technologies does not accept liability for any errors or omissions as the internet communications cannot be guaranteed to be timely, secure, error or virus-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete. To know more about Cordiant Technologies, please visit http://www.cordiant.com _ -Original Message- From: Kent Boogaart [mailto:[EMAIL PROTECTED] Sent: Thursday, July 07, 2005 10:20 AM To: user@struts.apache.org Subject: Question re html:select on the client Hello, I have an html:select populated from a collection. Alongside the select box I have links to add, edit and delete items. I'm just wondering what the best way is to handle passing the ID of the selected item to the edit and delete actions. For example, if the user selects the option with value 12, I'd like to forward to something like /editAction?id=12. Is there some way to tell the html:link tag to dynamically construct the querystring on the client? Thanks, Kent - 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]
ot: Struts 1.3
so... when? .V - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Accessing Cookie information
Hello Guys, I have this code... bean:cookie name=%= Konstants.COOKIE_USERNAME % id=username/ . . down the line i need to access the bean and set it to an input field. . . html:text property=usernamesize=20 value= / previously i was using EL but the webapp was deployed in an older version of tomcat where EL is not working . I tried this %= pageContext.getAttribute(username) % but its not working. Please help. Thanks Richard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Vignette V6 Struts-based web application
Hello every one, I am new to Vignette CMS and was wandering that if someone could help me out how a Struts-based web application can fit into Vignette CM model ? I'm working on a Strut-based project and am told that I have to let Vignette JSP controller to handle all JSPs rendering/forwarding and throw away existing Struts framework, which uses its own action controller to handle all JSP presentation. Is this true? Any workarounds? or Can Vignette just manage Struts actions url pattern /do/MyAction instead of /pages/MyPage.jsp? Many thanks in advance, Kareem
Re: [OT] banned
Well, despite Mark's apparent bigotry (intended or not), I hope he doesn't get prosecuted as he mentioned he might. As for Niall, wow. Extreme. Glad you admitted it though. I in my unavoidably racist subconcious was blaming someone with a non-English name. Adam [EMAIL PROTECTED] on 07/07/05 05:58, wrote: You did not fire him. Maybe his boss didn't appreciate him enough to stick up for him. Maybe he'll get a better job because of it. Or maybe his boss will change his mind. I'm sorry it all turned out this way. Erik -Original Message- From: Niall Pemberton [EMAIL PROTECTED] Sent: Jul 6, 2005 10:10 PM To: Struts Users Mailing List user@struts.apache.org Subject: Re: banned I cc'd them on the message I sent to this list in a moment of madness at the rubbish arriving in my inbox and which I now regret. http://www.mail-archive.com/user%40struts.apache.org/msg29119.html Niall - Original Message - From: blah blah blah [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Thursday, July 07, 2005 2:06 AM Subject: Re: banned I am absolutely NOT kidding. The point is NOT that I was using my government email address to subscribe to a technical mail list. Nor is it that I was posting irreverent nonsense. The point is that somebody on this list copied selective posts with my government email address in the subject line and then notified the State agency in which I was employed. The archive clearly show who did this, and was a dispicable act and violation of Net ethos. Never before in 20 years of using the Internet for communication have I heard of anybody doing something like this. I signed back on to struts-user to find out what is happening with struts these days. Those of you who have known me on this list (and others, and personally) for years know that my sense of humor (or lack thereof) is abrasive, but never was any harm meant. What is next? DOS attacks on IP addresses by people who disagree with the committers? I was helping people learn struts on this list before most of the present subscribers knew Java; I have an acknowledgement in Chuck Cavaness' O'Reilly book, Programming Struts; I'm the one who started the [FRIDAY] humor posts, remember? Look in the archive for the subject with [EMAIL PROTECTED] in it and you can see for yourself who did this. Watch what you say and where you say it from - you could be next. It looks like I have been banned from the list; Craig says he approves. ~mark James Mitchell wrote: You are kidding right? -- James Mitchell Software Engineer / Open Source Evangelist Consulting / Mentoring / Freelance EdgeTech, Inc. http://www.edgetechservices.net/ 678.910.8017 AIM: jmitchtx Yahoo: jmitchtx MSN: [EMAIL PROTECTED] Skype: jmitchtx On Jul 6, 2005, at 10:19 AM, Mark Galbreath wrote: Thanks to whomever emailed last weeks nonsense thread to the Director of the Board of Elections. It made me look like a racist and I was fired this morning. The State is also looking into whether my use of an official email address for that discussion is in violation of state law. You did your work well, you low-life bastard. Signing off Mark On 6/30/05, Thai Dang Vu [EMAIL PROTECTED] wrote: 3) Struts! It's not just for H-1Bs! So, I can get a H1B just by learning Struts and use it decently? :) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] Re: Struts and .NET?
On 6/30/05, Rafael Taboada [EMAIL PROTECTED] wrote: Hi folks I've been reading all mails about VS.NET http://VS.NET. I have a question. Is it true that software in ASP.NET http://ASP.NET is faster than in Struts???.. HOw true is this opinion? I heard about a tool that it can convert a ASP.NET http://ASP.NET soft in a .war so it can be runned in Tomcat... Is it true? what tool is it? Thanks for ur xperiencie sharing. I haven't heard about the tool for converting an application. Though, if you wanted to run a ASP.NET application on a Linux box, the open source Mono platform does that out of the box. In terms of processing speed, it's really very, very hard to come up with relevant benchmarks. Benchmarks are like bikinis or speedos; they seem to reveal a lot, but all the best bits are covered up. If anyone is truly concerned with processing speed, the only way to tell for sure is to code a representative part of your application with each choice, and then compare the two, head to head, on your own hardware on your own network. If someone doesn't care enough to do this, then they really don't care, and you can just flip a coin. It's usually not a difference that makes a difference anyway. In terms of development speed, C# and Java are very much alike, and the core ASP.NET/ADO libraries are very much like the J2SE equivalents. ASP.NET comes bundled with some components that make use of a built-in request-processing cycle, not unllike Struts, but all the usual suspects, like Request and Session, are there too. A great number of our favorite Java libraries are an easy port to C#, and have found a welcome home with C# developers. Apache Logging is a run-away favorite right now, along with NAnt. Other libraries like Lucene.NET, iBATIS.NET, and Spring.NET are also gaining acceptance. In my own work, I use the Resharper IDEA plugin, the Anhk Subversion plugin, and MySQL for the database, along with iBATIS.NET and Spring.NET. I really don't feel like I've changed environments at all :) Most ASP.NET teams also use a visual editor, like Visual Studio, to design the pages. Visual editors, regardless of what platform you use, tend to be a faster way to *create* pages, but a slower way to *maintain* pages. But, if you are in a fixed-cost, waterfall-design environment, shipping the pages quickly can be the primary concern. If client wants to make changes later, they can update the design docs and pay for a new page. This approach does work for many people (though not so much for me). There is a *huge* difference in programming styles between ASP.NET and Java teams. The most obvious difference is the attitude toward stored procedures. Most Java developers only use stored procedures if they must. Most .NET developers only use stored procedures :) One reason people tend to disagree over these things is that they want to compare apples and oranges. If you are working in a fixed-cost, waterfall design environment, then cranking out pages quickly with stored procedures and a visual editor is the way to go. And, if client changes the requirements, then it's back to the drawing board. OTOH, if you are working on an open-ended, agile design environment, and you want to be able to write code that you can test and refactor over time, then a visual editor is not going to be much help. While there will always been a difference between waterfall teams and agile teams, eventually, I think the differences between the platforms will become less and less stark. Which is a good thing. It shouldn't be about the tools, it should be about the geeks using the tools. My own vision is to create a Struts framework that can be used on any platform, Java, ASP.NET, Mono, PHP, Ruby, whatever. Of course, it's not a far-fetched idea. Teams like Maverick and FuseBox already have multiplatform frameworks. But, it is the sort of idea that worries the marketing peeps, who thirst for product differentation :) -Ted. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ot: Struts 1.3
On 7/7/05, netsql [EMAIL PROTECTED] wrote: so... when? At this point, there is not so much as a Release Plan for 1.3.x * http://wiki.apache.org/struts/StrutsReleasePlans so it's not possile to say. Personally, I'll be working in ASP.NET until at least November, so my own voulnteer hours are going into a C# framework that I can use with my own work. From what I can see, all of the other committers are deep into maintenance mode right now. Struts 1.2.x solved their problems last year, and, apparently, they are still solving the same problems this year. We have been bringing on new committers every few months. But, so far, bringing on new volunteers hasn't seemed to help much.. IMHO, the key problem is that all we have is very part-time volunteers. AFAIK, none of the committers are working on Struts as part of their regular jobs. It's only what few minutes are left after work and family. -Ted. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Re: Fired???? was...Re: Struts Books Recommendations [OT]
Good Morning Brian: In a global economy keep in mind that a business can locate anywhere.. Tying up resources in a situation such as what you described could be interpreted (in a rather loose sense) as 'anti-business' and *might* force the company to look at other locations which provide more 'business-friendly' environments. Please feel free to contact me offline as this topic can be easily construed as 'O/T'. Best, M- - Original Message - From: Brian Lee [EMAIL PROTECTED] To: user@struts.apache.org Sent: Wednesday, July 06, 2005 10:39 PM Subject: Re: [OT] Re: Fired was...Re: Struts Books Recommendations [OT] Actually, in the US we have laws against age discrimination or discrimination based on race, religion, creed or nationality. These are termed protected groups under US labor law. If you were fired for one of these reasons, gather up some evidence and sue your way to wealth in the civil courts. BAL From: Martin Gainty [EMAIL PROTECTED] Reply-To: Martin Gainty [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Subject: Re: [OT] Re: Fired was...Re: Struts Books Recommendations [OT] Date: Wed, 6 Jul 2005 20:14:51 -0400 Unfortunately in the US you can be canned for being too old or having the wrong religious views we have a ton of laws on the books but they are unenforced My question is how do I (an older engineer with politically incorrect views) get work in Germany Vielen Danke, Martin- - Original Message - From: Christian Bollmeyer [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Wednesday, July 06, 2005 7:31 PM Subject: Re: [OT] Re: Fired was...Re: Struts Books Recommendations [OT] On Wednesday 06 July 2005 19:48, Rick Reumann wrote: Hi, Daniel Perry wrote the following on 7/6/2005 12:49 PM: Hah, it's the business use of web/email they fire you for. Go read your terms of employment, and the reference to IT acceptible use policy that you inadvertantly agreed to. (the below has nothing to do with Mark).. For the record, I'm not against an employer firing an employee for 'whatever' reason they deem fit. If they don't like the way you wear your hair, I think they should have the right to fire you if they want. (The public also has a right to know about it based on the use of the press etc). Now though I'm clearly not in the position to get fired anytime soon, I still think as long as I'm doing my job right and don't blame the company I work for, what I do in my leisure time is not my employer's business. Including my haircut, age, religious beliefs or whatever. What I sell are my skills, work performance and last but not least a significant part of my lifetime, but neither my soul nor my private life. In Germany, it's not quite that easy to get rid of someone who, lets say, just got older because of working for you. And I think this is just. Stealing silver spoons, including deliberately breaking company rules in terms of e-mail usage and the like is another issue. Personally, if I owned a company and someone was using the company email domain name to post on sites such as swingers or transvestitepride, I think I should have right to terminate his or her's employment. What I have a problem with is ... 1) The inconsistency in what is protected. For example everyone today talks about tolerance. But what does this mean? What it ends up meaning is There are no moral absolutes so the only valid belief system protected is one that doesn't espouse moral judgments. But what about being tolerant to the idea that someone might feel otherwise? Why is state sanctioned secularism the only valid religion (and yes secularism is a belief system - a religion). It's sort of funny that those whom often claim to be the most 'tolerant' are often the most vicious when it comes to attacking someone that disagrees with their view of tolerance. There are many views I could state that would get me labeled as being 'intolerant,' yet, somehow it's supposedly not offensive to state All views on X,Y,orZ are equally acceptable. To me, and many others, that later position can be considered extremely offensive. Why is only one view (secular humanism) considered 'non offensive' but other religious views are some how bigoted and intolerant. It's pure hypocrisy. In Germany, in a major part thanks to the US (I mean it!), religious freedom, for instance, is granted to everyone in our Constitutional Law (Art. 4 GG). Getting fired just because of one's religious views is impossible by law. So I, who believes in Jesus Christ as my personal saviour and follows the Bible as his above-all-worldly-wisdom guide can happily work together with Hindus and common atheists, in- cluding my boss. I can even tell them if they're on the road to eternal doom, the same as they may tell me I'm ridiciously wrong, and still keep my job. And in fact, the Bible is quite intolerant when confronted with modern secularism, but what's my
Re: (OT) Re: Struts vs .NET???
John Henry Xu wrote: Now I can focus on my job and be more productive by not having to write getters and setters manually. Only when I wrote million line codes I realized how insane to write something machine can produce perfectly to you. The choice of a methodology like Model Driven development is totally independent with the framework you use. I use struts but never write a single form or action for search or CRUD operations. Just my 0.2. Manos - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts Books Recommendations
On 6/30/05, John Henry Xu [EMAIL PROTECTED] wrote: I would say Jakarta Struts Cookbook Struts Recipes as the books. Yes, both of these have great coverage of 1.2.x, and the best part is that they don't overlap. These two are also excellent choices for anyone who is already working in Struts. They don't cover the basics, only the stuff you need to know once you've gotten started. For the basics, my all-time favorite is still Jakarta Struts for Dummies. If anyone is ordering Struts books online, please consider shopping through the Apache Bookstore: * http://opensource.atlassian.com/confluence/oss/display/BOOKS/Home -Ted. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Re: Struts and .NET?
I could not agree more with Ted on this comparison. In my experience with asp.net, this is incredibly accurate. Cranking out a page is pretty quick, but modifying it later can be a PITA. Larry On 7/7/05, Ted Husted [EMAIL PROTECTED] wrote: On 6/30/05, Rafael Taboada [EMAIL PROTECTED] wrote: Hi folks I've been reading all mails about VS.NET http://VS.NET. I have a question. Is it true that software in ASP.NET http://ASP.NET is faster than in Struts???.. HOw true is this opinion? I heard about a tool that it can convert a ASP.NET http://ASP.NET soft in a .war so it can be runned in Tomcat... Is it true? what tool is it? Thanks for ur xperiencie sharing. I haven't heard about the tool for converting an application. Though, if you wanted to run a ASP.NET application on a Linux box, the open source Mono platform does that out of the box. In terms of processing speed, it's really very, very hard to come up with relevant benchmarks. Benchmarks are like bikinis or speedos; they seem to reveal a lot, but all the best bits are covered up. If anyone is truly concerned with processing speed, the only way to tell for sure is to code a representative part of your application with each choice, and then compare the two, head to head, on your own hardware on your own network. If someone doesn't care enough to do this, then they really don't care, and you can just flip a coin. It's usually not a difference that makes a difference anyway. In terms of development speed, C# and Java are very much alike, and the core ASP.NET/ADO libraries are very much like the J2SE equivalents. ASP.NET comes bundled with some components that make use of a built-in request-processing cycle, not unllike Struts, but all the usual suspects, like Request and Session, are there too. A great number of our favorite Java libraries are an easy port to C#, and have found a welcome home with C# developers. Apache Logging is a run-away favorite right now, along with NAnt. Other libraries like Lucene.NET, iBATIS.NET, and Spring.NET are also gaining acceptance. In my own work, I use the Resharper IDEA plugin, the Anhk Subversion plugin, and MySQL for the database, along with iBATIS.NET and Spring.NET. I really don't feel like I've changed environments at all :) Most ASP.NET teams also use a visual editor, like Visual Studio, to design the pages. Visual editors, regardless of what platform you use, tend to be a faster way to *create* pages, but a slower way to *maintain* pages. But, if you are in a fixed-cost, waterfall-design environment, shipping the pages quickly can be the primary concern. If client wants to make changes later, they can update the design docs and pay for a new page. This approach does work for many people (though not so much for me). There is a *huge* difference in programming styles between ASP.NET and Java teams. The most obvious difference is the attitude toward stored procedures. Most Java developers only use stored procedures if they must. Most .NET developers only use stored procedures :) One reason people tend to disagree over these things is that they want to compare apples and oranges. If you are working in a fixed-cost, waterfall design environment, then cranking out pages quickly with stored procedures and a visual editor is the way to go. And, if client changes the requirements, then it's back to the drawing board. OTOH, if you are working on an open-ended, agile design environment, and you want to be able to write code that you can test and refactor over time, then a visual editor is not going to be much help. While there will always been a difference between waterfall teams and agile teams, eventually, I think the differences between the platforms will become less and less stark. Which is a good thing. It shouldn't be about the tools, it should be about the geeks using the tools. My own vision is to create a Struts framework that can be used on any platform, Java, ASP.NET, Mono, PHP, Ruby, whatever. Of course, it's not a far-fetched idea. Teams like Maverick and FuseBox already have multiplatform frameworks. But, it is the sort of idea that worries the marketing peeps, who thirst for product differentation :) -Ted. - 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]
[OT] FYI Ugly Tomcat Bug
Hi, after 3 hours of searching and debuging I just discovered an ugly tomcat bug and wanted to provide this information in case someone else is suffering from a similar behaviour too. init-param param-nametrimSpaces/param-name param-valuetrue/param-value /init-param This parameter in the definition of the JSPServlet in the web.xml can have a very ugly behaviour: The page in question is a simple container for different tiles: logic:iterate name=elements type=...ProfileElementBean id=element logic:notEqual name=element property=decorator value=none bean:define toScope=page id=_decorator type=java.lang.Stringprofiles.decorator.edit.bean:write name=element property=decorator//bean:define bean:define toScope=request id=_element type=.ProfileElementBean name=element/ tiles:insert definition=%=_decorator% flush=false / /logic:notEqual /logic:iterate So the page just iterates over a list of elements and inserts a proper decorator (a tile) for each of the elements. One of the decorators in question looks like: %@ page contentType=text/html;charset=iso-8859-1 session=true %jsp:include page=/do/prfEditDatasafe flush=false/ so it includes an action. Now after the iterate passes over this decorator it crashes in the logic.iterate tag (unfortunately without stack trace, but we was able to find with debug output that it's the end of the iteration, where it crashes), the only output is: 2005-07-07 14:40:15 ApplicationDispatcher[/dating] Servlet.service() for servlet jsp threw exception java.lang.NullPointerException Unfortunately, after this, the tomcat is totally screwed up. Nearly any other request ends with: 005-07-07 14:40:15 ApplicationDispatcher[/dating] Servlet.service() for servlet jsp threw exception java.io.IOException: Stream closed at org.apache.jasper.runtime.BodyContentImpl.ensureOpen(BodyContentImpl.java:576) at org.apache.jasper.runtime.BodyContentImpl.write(BodyContentImpl.java:140) at org.apache.jasper.runtime.BodyContentImpl.write(BodyContentImpl.java:157) ... There is also no possibility to catch the error somewhere else (and we tried every line in every jsp :-)) Since the code works fine with resin we assume that it's a tomcat bug :-) we are using tomcat 5.0.25 (but the bug is reproduceable in all 5.0.x versions) and struts 1.1 regards Leon P.S. Without the above configuration lines the code works fine (or at least do not crash). - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] M Galbreath
Fogleson, Allen wrote: Actually there would not have to be an ethics clause. Maryland is a right to work state so the employer can fire you at any time for any reason. Aren't most states this way? No, only 22 according to http://www.nrtw.org/rtws.org - however, they don't include Maryland, and it hasn't been updated since 2003, it seems. I don't think that you're describing a right to work state - it's something more extreme - an employer's rights state. Right to work just says that nobody (almost) can be forced to join a union. -- derek - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts Tiles Question
All, I am using Struts Tiles to layout my site. I have a vboxmenu design which contains 4 menu levels: definition name=doc.menu.main path=/common/jsp/layout/vboxLayout.jsp putList name=list add value=common.menu.home / add value=common.menu.authenticated/ add value=common.menu.admin / add value=common.menu.logout / /putList /definition I am wanting to control when the Authenticated menu and the Admin Menu are displayed. For example, only display the admin menu if the user is in the Admin Role. I know that the taglib tld has a role attribute, but the dtd for tiles-def does not. Has anyone created anything simular with tiles?
Getter/Setter
hi All Any idea how to write setter / getter methods for multiple form elements ? Regards Vijay - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [offlist] Re: Newbie Help
On 7/6/05, Frasso, Anthony [EMAIL PROTECTED] wrote: Thanks for your help, Rahul. My current web.xml file looks like this: ?xml version=1.0? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app ... According to the wiki, it seems that I should be changing it to this: ?xml version=1.0? web-app xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd; version=2.4 ... Do I have this right? It seems that the web-app tag attributes substitute for the dtd definition file. Is there a good reference for the web-app tag attribute definitions? snip/ Yes, that will indicate to Tomcat you're meaning to use the Servlet 2.4 / JSP 2.0 specs. The attributes (that I think you are refering to) are really XML artifacts, so Iook for XML and W3C XML Schema tutorials, here is one [ http://www.xml.com/pub/a/2000/11/29/schemas/part1.html ] -Rahul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts-config.xml Digester endElement problem
Got this stack trace while deploying my struts 1.2.7 app into WebLogic 8.1.4. It seems to relate to Digester complaining something about struts-config.xml. Adding Xerces 2.5 into the WAR file does not help. Can someone point a direction of where to look? Thanks. Jul 7, 2005 9:11:26 AM org.apache.commons.digester.Digester endElement SEVERE: End event threw exception java.lang.IllegalArgumentException: argument type mismatch at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39 ) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl .java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:216) at org.apache.commons.digester.SetNextRule.end(SetNextRule.java:208) at org.apache.commons.digester.Rule.end(Rule.java:228) at org.apache.commons.digester.Digester.endElement(Digester.java:1067) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) at org.apache.xerces.impl.dtd.XMLNSDTDValidator.endNamespaceScope(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknown Source) at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatc her.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.commons.digester.Digester.parse(Digester.java:1572) at org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionServlet.j ava:738) at org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.java:6 87) at org.apache.struts.action.ActionServlet.init(ActionServlet.java:333) at javax.servlet.GenericServlet.init(GenericServlet.java:258) at weblogic.servlet.internal.ServletStubImpl$ServletInitAction.run(ServletStubI mpl.java:1018) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubjec t.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118) at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl.java :894) at weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStubImpl.ja va:873) at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.jav a:812) at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletC ontext.java:3281) at weblogic.servlet.internal.WebAppServletContext.preloadServlets(WebAppServlet Context.java:3226) at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServle tContext.java:3207) at weblogic.servlet.internal.WebAppServletContext.setStarted(WebAppServletConte xt.java:5737) at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:874) at weblogic.j2ee.J2EEApplicationContainer.start(J2EEApplicationContainer.java:2 106) at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.jav a:2147) at weblogic.management.deploy.slave.SlaveDeployer$ComponentActivateTask.activat eContainer(SlaveDeployer.java:2434) at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.doCommit(SlaveDe ployer.java:2352) at weblogic.management.deploy.slave.SlaveDeployer$Task.commit(SlaveDeployer.jav a:2136) at weblogic.management.deploy.slave.SlaveDeployer$Task.checkAutoCommit(SlaveDep loyer.java:2235) at weblogic.management.deploy.slave.SlaveDeployer$Task.prepare(SlaveDeployer.ja va:2130) at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.prepare(SlaveDep loyer.java:2315) at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeplo yer.java:866) at weblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDeployer.ja va:594) at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.j ava:508) at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.ja va:25) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178) Jul 7, 2005 9:11:26 AM org.apache.struts.action.ActionServlet handleConfigException SEVERE: Parsing error processing resource path /WEB-INF/struts-config.xml
RE: Getter/Setter
Open the source in Eclipse; right-click on a variable; -source- -generate getter/setter-; choose the attributes you want, set the options and submit... hth Alexander -Original Message- From: Vijay K Anand [mailto:[EMAIL PROTECTED] Sent: Thursday, July 07, 2005 3:23 PM To: Struts Users Mailing List Subject: Getter/Setter hi All Any idea how to write setter / getter methods for multiple form elements ? Regards Vijay - 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]
Tomcat5.exe Holds Onto Struts.jar
Hi: Perhaps this is a Tomcat question but it applies only to Struts. I have Tomcat 5.5 running under Windows 2000 with Eclipse as the IDE. Ant is used to assemble, compile and deploy the applications. However, the process Tomcat5.exe accesses the struts.jar at /WEB-INF/lib/struts.jar. The result is that when we run Ant and try to undeploy the application all files but the struts.jar are removed and the deployment process fails. Although Tomcat has access to all the jars in the various libs (common, shared and server) it only has access to the struts jars in the application libs. We use Process Explorer to verify this. There seem to be several threads reporting similar behavior. Our present solution is to operate with unpacked wars (it works) but we would like to improve the performance with unpacked wars. Any thoughts? Regards, Bob Nicholls MIT Lincoln Laboratory - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts-config.xml Digester endElement problem
Hello, Could you post struts-config.xml? Regards marco -Original Message- From: Sher, Allen - BLS CTR [mailto:[EMAIL PROTECTED] Sent: 07 July 2005 14:35 To: 'Struts Users Mailing List' Subject: Struts-config.xml Digester endElement problem Got this stack trace while deploying my struts 1.2.7 app into WebLogic 8.1.4. It seems to relate to Digester complaining something about struts-config.xml. Adding Xerces 2.5 into the WAR file does not help. Can someone point a direction of where to look? Thanks. Jul 7, 2005 9:11:26 AM org.apache.commons.digester.Digester endElement SEVERE: End event threw exception java.lang.IllegalArgumentException: argument type mismatch at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav a:39 ) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor Impl .java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:2 16) at org.apache.commons.digester.SetNextRule.end(SetNextRule.java:208) at org.apache.commons.digester.Rule.end(Rule.java:228) at org.apache.commons.digester.Digester.endElement(Digester.java:1067) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) at org.apache.xerces.impl.dtd.XMLNSDTDValidator.endNamespaceScope(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown Source) at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknown Source) at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDis patc her.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unkno wn Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.commons.digester.Digester.parse(Digester.java:1572) at org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionServl et.j ava:738) at org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.ja va:6 87) at org.apache.struts.action.ActionServlet.init(ActionServlet.java:333) at javax.servlet.GenericServlet.init(GenericServlet.java:258) at weblogic.servlet.internal.ServletStubImpl$ServletInitAction.run(ServletS tubI mpl.java:1018) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSu bjec t.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118 ) at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl. java :894) at weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStubImp l.ja va:873) at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl .jav a:812) at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServ letC ontext.java:3281) at weblogic.servlet.internal.WebAppServletContext.preloadServlets(WebAppSer vlet Context.java:3226) at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppSe rvle tContext.java:3207) at weblogic.servlet.internal.WebAppServletContext.setStarted(WebAppServletC onte xt.java:5737) at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:874) at weblogic.j2ee.J2EEApplicationContainer.start(J2EEApplicationContainer.ja va:2 106) at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer .jav a:2147) at weblogic.management.deploy.slave.SlaveDeployer$ComponentActivateTask.act ivat eContainer(SlaveDeployer.java:2434) at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.doCommit(Sla veDe ployer.java:2352) at weblogic.management.deploy.slave.SlaveDeployer$Task.commit(SlaveDeployer .jav a:2136) at weblogic.management.deploy.slave.SlaveDeployer$Task.checkAutoCommit(Slav eDep loyer.java:2235) at weblogic.management.deploy.slave.SlaveDeployer$Task.prepare(SlaveDeploye r.ja va:2130) at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.prepare(Slav eDep loyer.java:2315) at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveD eplo yer.java:866) at weblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDeploye r.ja va:594) at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeploy er.j ava:508) at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandle r.ja va:25)
Re: banned
Good point, assuming that what Mark says is true, that he was fired, this is all bad. I recognize your need to ban people and if it helps improve the signal to noise ratio on this list, I'm all for it. I also recognize that we are all responsible for what we say here. Both the first time around through email and the second time around in the archives. But in this instance, Mark doesn't have only himself to blame. Someone sent his comments to his workplace and resulted in him being fired. I've worked will some major jerks over the years who wrote great code, slung great servers, etc etc. Just because someone's has unpopular views or is terribly annoying or extremely frustrating or whatever does not justify maliciously alerting their employers. This just leaves a bad taste in my mouth. All you need to do is to create a filter and individuals can ban anyone they want. The email to MD dept of elections is spiteful and childish and way more damaging to the struts community than any bigoted and/or stupid posts. BAL From: Craig McClanahan [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org CC: Niall Pemberton [EMAIL PROTECTED] Subject: Re: banned Date: Wed, 6 Jul 2005 20:24:14 -0700 On 7/6/05, Brian Lee [EMAIL PROTECTED] wrote: Wow, this is shockingly lame. Like amazingly lame. To mess with someone's livlihood because you think they are an jerk is inexcusable. Keep in mind that, if Mark indeed did get fired (he has *no* credibility with me, so I don't believe anything he says without corroboration) then he has only himself, and his own behavior, to blame. Acting the way he does, on a public mailing list (which is certainly accessible to his boss whether or not someone points him at it) is incredibly stupid, and doing so from his employer's email system is way beyond stupid -- and it was only a matter of time before he got called on it. I didn't forward the email trail, but I can absolutely understand Niall's frustration with the behavior of an idiot. I'll take Niall with one fit of frustration lapse *any* day over several of the people that think the Struts user mailing list is their private playground to have a I can be more outrageous and infantile than you can pissing contest. The next time around, I'm going to be inclined to ban people soon after a spate of continuous crap like this (assuming requests to change behavior don't work). It's a losing battle against a determined jerk (because its easy to just get a new address) -- but (since Mark got it wrong yet again) -- I didn't ban him, but I would not complain if one of the other mailing list moderators had (they didn't ban his gmail address, or you wouldn't have been able to see his latest comment). Actually, as I told him, it would suit me just fine if he simply went away. I know there are a few people here who find Mark to be funny (I'm *not* a part of that group). That's fine ... it's a free world ... but please go find him funny somewhere else. There are ***lots*** of people who find him annoying and disruptive instead of helpful -- and, to the extent that this behavior encourages others to leave the list, it harms the Struts community as a whole. Craig McClanahan - 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]
RE: Struts-config.xml Digester endElement problem
Hello, Haven't used struts 1.2, just 1.1 1.3(in dev), but as far as I know You should have a 'type' attribute associated with each action element... And I bet that hasn't been changed between different versions of struts... Regards marco -Original Message- From: Sher, Allen - BLS CTR [mailto:[EMAIL PROTECTED] Sent: 07 July 2005 15:26 To: 'Struts Users Mailing List' Subject: RE: Struts-config.xml Digester endElement problem Here is the struts-config.xml ?xml version = 1.0 encoding = ISO-8859-1? !DOCTYPE struts-config PUBLIC -//Apache Software Foundation//DTD Struts Configuration 1.2//EN http://struts.apache.org/dtds/struts-config_1_2.dtd; struts-config !-- == Data Source Configuration == -- data-sources / !-- == Form Bean Definitions = -- form-beans type = gov.bls.cpi.sms.webApp.SmsForm form-bean name=smsForm type=gov.bls.cpi.sms.webApp.SmsForm /form-bean form-bean name=noteForm type=gov.bls.cpi.sms.webApp.NoteForm /form-bean /form-beans !-- == Global Exceptions === -- global-exceptions / !-- == Global Forward Definitions == -- global-forwards forward name = logoff path = /logoff.do/ forward name = logon path = /logon.jsp/ forward name = main path = /showPlan.do/ forward name = successpath = /showPlan.do/ forward name = failurepath = /error.jsp/ forward name = error path = /error.jsp/ /global-forwards !-- == Action Mapping Definitions == -- action-mappings !-- Logon -- action path = /logon forward=/showPlan.do /action !-- Logoff -- action path = /logoff forward=/welcome.jsp /action !-- Show a production production -- action path = /showPlan forward=/productionPlan.jsp /action !-- Production Workflow Help -- action path = /workflowHelp forward=/workflowHelp.jsp /action !-- Show the Notes of a Run -- action path = /notes forward=/notes.jsp /action !-- Add notes to a Run -- action path=/addNote className=gov.bls.cpi.sms.webApp.SmsController name=noteForm scope=request validate=false forward name=success path=/addNote.do redirect=true / /action !-- Show the job log -- action path = /showJobLog forward=/jobLog.jsp /action !-- Roll back the previous Action of a Run -- action path = /backtrack forward=/toDo.jsp /action !-- Set the Production Cycle -- action path = /setCycle forward=/listCycles.jsp /action !-- Start a new Production Cycle -- action path = /startCycle forward=/startCycle.jsp /action !-- Confirm starting an (automatic) Activity -- action path = /confirmStartActivity forward=/confirm.jsp /action !-- Start an (automatic) Activity -- action path = /startActivity forward=/toDo.jsp /action !-- Confirm signing off a (manual) Activity -- action path = /confirmSignOffActivity forward=/confirm.jsp /action !-- Sign off a (manual) Activity -- action path = /signOffActivity forward=/toDo.jsp /action !-- Confirm an Activity -- action path = /confirm forward=/showPlan.do /action !-- Show the list of Reports -- action path = /listReports forward=/listReports.jsp /action !-- Show the selected Report -- action path = /showReport forward=/report.jsp /action !-- Edit Data -- action path = /editData forward=/toDo.jsp /action /action-mappings /struts-config - 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]
RE: Two Forms, Two Form Beans, One JSP
To simplify your code, I would have one ActionForm, and one processing action. Depending on which submit button or whatever is pressed I'd redirect to the correct page. By the way you can only have one struts action form per action and per jsp page. Regards, Abdullah -Original Message- From: Andrew Tomaka [mailto:[EMAIL PROTECTED] Sent: Thursday, July 07, 2005 9:26 AM To: user@struts.apache.org Subject: Two Forms, Two Form Beans, One JSP Hey all, I'm attempting to create a JSP that is made up of two forms. Each form needs a different form bean and is processed by a different action. The catch is that the first form returns back to the JSP and the action responsible for this needs the name attribute set to the Form Bean of the first form. When the JSP is loaded after the processing of the first form, both the form tags are assigned the name of the first Form Bean. Is it possible to assign Form Beans to a form instead of assigning them to an action? Thanks, ~ Andrew Tomaka - 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]
Re: Two Forms, Two Form Beans, One JSP
Andrew Tomaka wrote the following on 7/7/2005 10:26 AM: I'm attempting to create a JSP that is made up of two forms. Each form needs a different form bean and is processed by a different action. The catch is that the first form returns back to the JSP and the action responsible for this needs the name attribute set to the Form Bean of the first form. When the JSP is loaded after the processing of the first form, both the form tags are assigned the name of the first Form Bean. I'm confused what you are trying to do. Possibly you can describe the user requirements? -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Accessing Cookie information
From: Richard Reyes [EMAIL PROTECTED] I have this code... bean:cookie name=%= Konstants.COOKIE_USERNAME % id=username/ down the line i need to access the bean and set it to an input field. html:text property=usernamesize=20 value= / previously i was using EL but the webapp was deployed in an older version of tomcat where EL is not working . What version are you on now? I assume you've gone from Tomcat 5 back to Tomcat 4.1. If so, then JSTL and Struts-EL will get you close to what you had. You can also read the cookie and set the form property in the Action, before forwarding to the JSP. Without testing it, I don't see anything wrong with the code you posted, though. What does it print? Does it give error messages? -- Wendy Smoak - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Two Forms, Two Form Beans, One JSP
On 7/7/05, Andrew Tomaka [EMAIL PROTECTED] wrote: Hey all, I'm attempting to create a JSP that is made up of two forms. Each form needs a different form bean and is processed by a different action. The catch is that the first form returns back to the JSP and the action responsible for this needs the name attribute set to the Form Bean of the first form. When the JSP is loaded after the processing of the first form, both the form tags are assigned the name of the first Form Bean. Is it possible to assign Form Beans to a form instead of assigning them to an action? Thanks, ~ Andrew Tomaka If you do not have prejudice against form bean with session scope, you can use Struts Dialogs and create two JSP Controls. Each JSP Control contains an action class and a form bean. For action class you either can directly use DialogAction, or you may have to subclass it. Include both controls (that is, their actions) into your JSP using jsp:include. The submit request is sent directly to each control. You need to set up action mapping for each control to set the target/reload location. For the first control this would be you JSP page, in which you embed the controls. Struts Dialogs home page: http://struts.sourceforge.net/strutsdialogs JSP control how-to: http://struts.sourceforge.net/strutsdialogs/dialogaction-logincontrolsample.html Live demo of JSP control: http://www.superinterface.com/strutsdialog/embeddedmasterpage-tomcat.do In the live demo the Sign In box is a JSP control. The catch: if you use Tomcat, you cannot forward from action to JSP to render a control, Tomcat closes response writer right after forward. So you would need to design forward to JSP in regular way, then run your app, Jasper will generate Java source code for your JSP, then you need to copy that source code to your project. See the samples, they contain all needed code. This issue will be addressed in next SRV spec. It is a little hassle, but result worth it ;) Michael. -- Dialogs for Struts http://struts.sourceforge.net/strutsdialogs - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: prepopulating the form again
Tony Dahbura wrote the following on 7/6/2005 11:09 PM: So I have a setup action. How do I in this setup action setup my ActionForm values so when I forward control to the form they are there and present for display. This form is being used to allow updating data and I want to prepopulate the fields for the user. My form is an editUserForm that has an editUser action as well. Should I in my editUser action call the setters of the editUserForm and set the values? Then just call the jsp page that will reference these through the editUserForm? I agree using reset is not proper given the documentation-just not sure how I should do this... The editUserForm is in request scope as well not in session scope Ok Tony, before Michael replies with the use of another framework (joking sort of:), this is very easy to do with Struts and as a side note, I really don't see why people have to constantly make Struts more confusing than it needs to me. You can accomplish 99% of what you want with this simple design (and then I'll address your issue directly). For the sake of this discussion I'm going to assume you are using a DispatchAction. In case you don't know, a DispatchAction just lets you combine similar types of behaviors into one Controller... so rather than have an UpdateUserAction, DeleteUserAction, etc.. you have one Action... UserAction with methods in it update(..), delete(...), etc. So typically here's what I do and it covers 'almost' all of my scenarios. I find it easier to work with examples and your User is a good example to work with. Lets say we want to CRUD (create, retrieve, update, delete) for a User. 1) Step 1 Create a UserActionForm For simplicity it has just two main properties... String userName; Integer userID; Also though we are going to provide the dispatch (or action) as a property to give it default value of add String dispatch = add This way if we go right to the page it'll have 'add' by default 2) Step 2 Have a BusinessObject back reprsenting your User. I like to pass Business objects (not tied to Struts to my backend), so you'll have in this case a simple: UserVO (value object.. could just call it User but for this discussion seeing VO helps you understand what it is) String userName; Integer userID; //NOTE: it helps if the properties of the VO and the ActionForm have the same name. Not a requirement but makes things easier which I'll show 3) Create a UserDispatchAction This will have the following methods: (all with signature public ActionForward methodName (ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) setUpForEdit(..) setUpForAdd(..) add(...) edit(...) delete(...) getUsers(...) Before I get to the setUpForEdit() lets just handle the others... In all cases you will be submitting either a form or a link but in the struts-config file this will map to our UserAction where we also include the name of our UserActionForm, so our UserActionForm is always populated. So our Add method in our Action... //**ADD public ActionForward add(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { UserActionForm userForm = (UserActionForm)form; UserVO user = new UserVO(): //copy our form properties into the VO PropertyUtils.copyProperties( user, userForm ); ourBackendDelegate.addUser( user ); return mapping.findForward(to_form); } // UPDATE and DELETE... Same as above except for use of... ourBackendDelegate.deleteUser( user ); ourBackendDelegate.updateUser( user ); // THE SET UP FOR EDIT Ok, this is the one you were asking about. Now you have to think about how you would get here? Typically you'd get to an edit page by clicking on a user record to say Hey, I want to edit this guy's user information So imagine a case where we have a list of users and 'userID for each in the list, they click on the link and they'll come to this method which will get our user and then forward them to a page to do the editing. The method will look like... public ActionForward setUpForEdit(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { UserActionForm userForm = (UserActionForm)form; //userID is set in this form when the user clicked on the link //lets get our real business object of this user, based on ID.. UserVO user = ourBackendDelegate.addUser( userForm.getUserID() ); //copy the other way this time, from UserVO to our Form... PropertyUtils.copyProperties( userForm, user ); //finally we are going to reuse or form for add and edit, so //we will set up our dispatch/action parameter userForm.setDispatch(edit); return mapping.findForward(to_form); } //The get users - this will display our users on the page public ActionForward getUsers(ActionMapping mapping,
Refresher for newbies...
I posted this in reply to Tony's post, but figured this stuff comes up all the time and to those new to Struts, this below might help You can accomplish 99% of what you want with this simple design For the sake of this discussion I'm going to assume you are using a DispatchAction. In case you don't know, a DispatchAction just lets you combine similar types of behaviors into one Controller... so rather than have an UpdateUserAction, DeleteUserAction, etc.. you have one Action... UserAction with methods in it update(..), delete(...), etc. So typically here's what I do and it covers 'almost' all of my scenarios. I find it easier to work with examples and your User is a good example to work with. Lets say we want to CRUD (create, retrieve, update, delete) for a User. 1) Step 1 Create a UserActionForm For simplicity it has just two main properties... String userName; Integer userID; Also though we are going to provide the dispatch (or action) as a property to give it default value of add String dispatch = add This way if we go right to the page it'll have 'add' by default 2) Step 2 Have a BusinessObject back reprsenting your User. I like to pass Business objects (not tied to Struts to my backend), so you'll have in this case a simple: UserVO (value object.. could just call it User but for this discussion seeing VO helps you understand what it is) String userName; Integer userID; //NOTE: it helps if the properties of the VO and the ActionForm have the same name. Not a requirement but makes things easier which I'll show 3) Create a UserDispatchAction This will have the following methods: (all with signature public ActionForward methodName (ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) setUpForEdit(..) setUpForAdd(..) add(...) edit(...) delete(...) getUsers(...) Before I get to the setUpForEdit() lets just handle the others... In all cases you will be submitting either a form or a link but in the struts-config file this will map to our UserAction where we also include the name of our UserActionForm, so our UserActionForm is always populated. So our Add method in our Action... //**ADD public ActionForward add(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { UserActionForm userForm = (UserActionForm)form; UserVO user = new UserVO(): //copy our form properties into the VO PropertyUtils.copyProperties( user, userForm ); ourBackendDelegate.addUser( user ); return mapping.findForward(to_form); } // UPDATE and DELETE... Same as above except for use of... ourBackendDelegate.deleteUser( user ); ourBackendDelegate.updateUser( user ); // THE SET UP FOR EDIT Ok, this is the one you were asking about. Now you have to think about how you would get here? Typically you'd get to an edit page by clicking on a user record to say Hey, I want to edit this guy's user information So imagine a case where we have a list of users and 'userID for each in the list, they click on the link and they'll come to this method which will get our user and then forward them to a page to do the editing. The method will look like... public ActionForward setUpForEdit(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { UserActionForm userForm = (UserActionForm)form; //userID is set in this form when the user clicked on the link //lets get our real business object of this user, based on ID.. UserVO user = ourBackendDelegate.addUser( userForm.getUserID() ); //copy the other way this time, from UserVO to our Form... PropertyUtils.copyProperties( userForm, user ); //finally we are going to reuse or form for add and edit, so //we will set up our dispatch/action parameter userForm.setDispatch(edit); return mapping.findForward(to_form); } //The get users - this will display our users on the page public ActionForward getUsers(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { //lets say pass in companyID Integer companyID = Integer.valueOf( request.getParameter(companyID)); //get our list of users to display on page List users = ourBackendDelegate.getUsers( companyID ); request.setAttribute(users, users ); return mapping.findForward(to_display); } 4) sample config... action path=/userMaintenance type=com.foobar.UserAction name=userActionForm scope=request validate=false parameter=dispatch forward name=to_form path=/userForm.jsp/ forward name=to_display path=/displayUsers.jsp/ /action 5) Sample form html:form action=/userMaintenance Name: html:text property=name/br/ html:hidden property=userID/ html:hidden property=dispatch/
Re: Two Forms, Two Form Beans, One JSP
I imagine I've over complicated the problem, so I've taken a step back and am looking at it from the beginning again. The following are my basic requirements: When the user makes the first request, they are taken to a page with a drop down menu. This drop down menu is built from information stored in a database so I need to do some pre-processing. After that, the user chooses an option from the drop down menu and chooses to search. This returns a page that has the same form that was built in the first request on top and then a second form that lists the results of their drop down. This allows users to choose which of the results to edit. At this point the user can either use the drop down menu and have the bottom list rebuilt or choose a result to edit and proceed. My problem is that I have a PreAction to do the processing on the form. This requires the page to have the form bean assigned to it. Since I have two different forms doing two different things, I should have two different form beans, but I don't see how I can accomplish that. This is going to be a common thing to do throughout my entire application so I am hoping a simple design solution will pop up. Let me know if you need any other clarifications. I appreciate the help so far! ~ Andrew Tomaka On 7/7/05, Rick Reumann [EMAIL PROTECTED] wrote: Andrew Tomaka wrote the following on 7/7/2005 10:26 AM: I'm attempting to create a JSP that is made up of two forms. Each form needs a different form bean and is processed by a different action. The catch is that the first form returns back to the JSP and the action responsible for this needs the name attribute set to the Form Bean of the first form. When the JSP is loaded after the processing of the first form, both the form tags are assigned the name of the first Form Bean. I'm confused what you are trying to do. Possibly you can describe the user requirements? -- Rick - 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]
Re: Refresher for newbies...
Rick Reumann wrote the following on 7/7/2005 11:58 AM: This will have the following methods: (all with signature public ActionForward methodName (ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) setUpForEdit(..) setUpForAdd(..) Sorry you don't need the setUpForAdd()... I gave the dispatch a default add value. Just ignore that method... you don't need it in this example. -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Two Forms, Two Form Beans, One JSP
I had a similar situation and I used only one form, with the bottom part(result) inside a div, which is only visible depending on the action you took on the top part(search param part), otherwise it's invisible. It worked for me, even though it might not be the best solution. Thanks, -Original Message- From: Andrew Tomaka [mailto:[EMAIL PROTECTED] Sent: Thursday, July 07, 2005 12:00 PM To: Struts Users Mailing List Subject: Re: Two Forms, Two Form Beans, One JSP I imagine I've over complicated the problem, so I've taken a step back and am looking at it from the beginning again. The following are my basic requirements: When the user makes the first request, they are taken to a page with a drop down menu. This drop down menu is built from information stored in a database so I need to do some pre-processing. After that, the user chooses an option from the drop down menu and chooses to search. This returns a page that has the same form that was built in the first request on top and then a second form that lists the results of their drop down. This allows users to choose which of the results to edit. At this point the user can either use the drop down menu and have the bottom list rebuilt or choose a result to edit and proceed. My problem is that I have a PreAction to do the processing on the form. This requires the page to have the form bean assigned to it. Since I have two different forms doing two different things, I should have two different form beans, but I don't see how I can accomplish that. This is going to be a common thing to do throughout my entire application so I am hoping a simple design solution will pop up. Let me know if you need any other clarifications. I appreciate the help so far! ~ Andrew Tomaka On 7/7/05, Rick Reumann [EMAIL PROTECTED] wrote: Andrew Tomaka wrote the following on 7/7/2005 10:26 AM: I'm attempting to create a JSP that is made up of two forms. Each form needs a different form bean and is processed by a different action. The catch is that the first form returns back to the JSP and the action responsible for this needs the name attribute set to the Form Bean of the first form. When the JSP is loaded after the processing of the first form, both the form tags are assigned the name of the first Form Bean. I'm confused what you are trying to do. Possibly you can describe the user requirements? -- Rick - 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] - This email transmission and any accompanying attachments may contain CSX privileged and confidential information intended only for the use of the intended addressee. Any dissemination, distribution, copying or action taken in reliance on the contents of this email by anyone other than the intended recipient is strictly prohibited. If you have received this email in error please immediately delete it and notify sender at the above CSX email address. Sender and CSX accept no liability for any damage caused directly or indirectly by receipt of this email. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: prepopulating the form again
On 7/7/05, Rick Reumann [EMAIL PROTECTED] wrote: Tony Dahbura wrote the following on 7/6/2005 11:09 PM: So I have a setup action. How do I in this setup action setup my ActionForm values so when I forward control to the form they are there and present for display. This form is being used to allow updating data and I want to prepopulate the fields for the user. My form is an editUserForm that has an editUser action as well. Should I in my editUser action call the setters of the editUserForm and set the values? Then just call the jsp page that will reference these through the editUserForm? I agree using reset is not proper given the documentation-just not sure how I should do this... The editUserForm is in request scope as well not in session scope Ok Tony, before Michael replies with the use of another framework (joking sort of:), this is very easy to do with Struts [skipped] No, I did not have intention to reply, because I already did yesterday, and also because Tony clealry stated that he wants (for whatever reasons, probaly religions ones, but we are being tolerable here, aren't we?) to use request scope instead of session scope for his form beans, and also because he wants to go by the book. My stuff works with session scope only by design, and it is not in the book yet. and as a side note, I really don't see why people have to constantly make Struts more confusing than it needs to me. Hopefully, this side note does not relate to my library. If it does, you probably have not tried it yet ;-) or you do not see any added value in the goals that it solves. Michael. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Two Forms, Two Form Beans, One JSP
From: Andrew Tomaka [EMAIL PROTECTED] My problem is that I have a PreAction to do the processing on the form. This requires the page to have the form bean assigned to it. Since I have two different forms doing two different things, I should have two different form beans, but I don't see how I can accomplish that. There's nothing wrong with sharing one form across multiple Actions. I do it for an accounting reporting webapp. All of the forms ask for similar things, such as account numbers and dates, and this makes it simple for all the HTML forms to remember their selections. (The form is in session scope, so it happens naturally.) Just wanted to point out that there is no ironclad one-to-one relationship between HTML forms and form beans. -- Wendy Smoak - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Refresher for newbies (part 2)
After reading the initial newbie post, you then might come across a situation where you need to have some things like lists on the page that aren't related to your ActionForm. For example, in the User example just given, imagine you need the person using the form to select a Department that the user belongs in. You thus need a way to make sure that a List of department is available on the page for the user to select from. Now before we get a ton of responses about how here's why I came up with this for Struts, and here's my solution..., I understand that many of the ideas that many of you have come up with our very ingenious and very practical once you understand the framework. I believe, however, for someone new to Struts that it's better to Keep Things Simple and keep things fairly consistent with what they are used to. For this reason I suggest you do things this way In your DispatchAction simply provide a prep( HtttpServletRequest request) method. In there you simply do any preparation of things your form might need. *NOTE* *NOTE* NOTE*: This is NOT, NOT, NOT where you do things like populate the form with user information etc. This is only where you would do things like provide lists for drop down so they are in scope. The next more advanced question is well what happens if you are using validation and validation fails, how are these going to be in scope? I believe the answer is quite simple... just call validate from your Action class versus relying on Struts to call it based on your struts config setting! I have more on this here http://www.reumann.net/struts/articles/request_lists.jsp The benefit to the prep() and the calling validate manually is everything is quite simple... you are using a standard DispatchAction which is easy for people to understand PLUS everything is all in one place. When dealing with editing Users you can look in your UserDispatchAction and see what's going on. No need to look at a bunch of xml config settings, AspectJ inserts, or some other hidden stuff. Granted yes, the newer frameworks handle all of this more gracefully, but the problem is not that big of a deal with Struts. I've written some pretty complex applications and the above has been working fine and it becomes so simple to do. -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Refresher for newbies...
Any reason in getUsers() that you are going directly to request to get the companyID parameter, as opposed to getting it from the form? It might be worth noting that some people dislike the use of DispatchAction in most cases, me included. This is a fairly minor point as the actual code you wrote would be essentially unchanged without DispathAction, just housed in individual classes. I'm not sure one answer is really better than the other, it's been debated at various points, but as long as people understand there's nothing that says you have to do this in a DispatchAction, then it's all good :) (For any newbies reading this, the difference that matters is that with a DispatchAction, you have a single entry in struts-config, but you have to pass a parameter with each request. With plain Actions, you would have multiple mappings like /setupForAdd, /setupForEdit, /add, /delete and so on in this case, but no parameter to pass around. There are pluses and minuses to each approach, but they get you to the same basic place in the end.) -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com On Thu, July 7, 2005 11:58 am, Rick Reumann said: I posted this in reply to Tony's post, but figured this stuff comes up all the time and to those new to Struts, this below might help You can accomplish 99% of what you want with this simple design For the sake of this discussion I'm going to assume you are using a DispatchAction. In case you don't know, a DispatchAction just lets you combine similar types of behaviors into one Controller... so rather than have an UpdateUserAction, DeleteUserAction, etc.. you have one Action... UserAction with methods in it update(..), delete(...), etc. So typically here's what I do and it covers 'almost' all of my scenarios. I find it easier to work with examples and your User is a good example to work with. Lets say we want to CRUD (create, retrieve, update, delete) for a User. 1) Step 1 Create a UserActionForm For simplicity it has just two main properties... String userName; Integer userID; Also though we are going to provide the dispatch (or action) as a property to give it default value of add String dispatch = add This way if we go right to the page it'll have 'add' by default 2) Step 2 Have a BusinessObject back reprsenting your User. I like to pass Business objects (not tied to Struts to my backend), so you'll have in this case a simple: UserVO (value object.. could just call it User but for this discussion seeing VO helps you understand what it is) String userName; Integer userID; //NOTE: it helps if the properties of the VO and the ActionForm have the same name. Not a requirement but makes things easier which I'll show 3) Create a UserDispatchAction This will have the following methods: (all with signature public ActionForward methodName (ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) setUpForEdit(..) setUpForAdd(..) add(...) edit(...) delete(...) getUsers(...) Before I get to the setUpForEdit() lets just handle the others... In all cases you will be submitting either a form or a link but in the struts-config file this will map to our UserAction where we also include the name of our UserActionForm, so our UserActionForm is always populated. So our Add method in our Action... //**ADD public ActionForward add(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { UserActionForm userForm = (UserActionForm)form; UserVO user = new UserVO(): //copy our form properties into the VO PropertyUtils.copyProperties( user, userForm ); ourBackendDelegate.addUser( user ); return mapping.findForward(to_form); } // UPDATE and DELETE... Same as above except for use of... ourBackendDelegate.deleteUser( user ); ourBackendDelegate.updateUser( user ); // THE SET UP FOR EDIT Ok, this is the one you were asking about. Now you have to think about how you would get here? Typically you'd get to an edit page by clicking on a user record to say Hey, I want to edit this guy's user information So imagine a case where we have a list of users and 'userID for each in the list, they click on the link and they'll come to this method which will get our user and then forward them to a page to do the editing. The method will look like... public ActionForward setUpForEdit(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { UserActionForm userForm = (UserActionForm)form; //userID is set in this form when the user clicked on the link //lets get our real business object of this user, based on ID.. UserVO user = ourBackendDelegate.addUser( userForm.getUserID() );
Re: [OT] Using connection pools - security
You could also just use one pool per user role and look up the db user and the role that user is in, then pull the connection from the pool that you have for that role. If your DB doesn't support roles for users you could create a user/role table. I think it might be overkill to create an actual user in your database for each user in your application. If that is your requirement though then that is your requirement. Michael On 7/6/05, Craig McClanahan [EMAIL PROTECTED] wrote: A couple of considerations are relevant here: * Is a single user ever going to really use more than one connection from the pool? If not, wouldn't it be better to create a *connection* for them, instead of a *pool*? (Note in particular that transactions don't cross connection boundaries, so if you want all or nothing commits, you need to do them on a single connection anyway). * Creating even one connection per user is going to require more active connections to your database than sharing the same pool for all users. In the cases where you are using the DB to restrict access to things (by username), one approach would be to use something like Oracle's database roles instead. That way, the code that retrieves a generic connection from an application wide pool could also do a SET ROLE (or whatever the appropriate command is -- it's been a few years since I was this deep into databases) that established the restrictions for the currently logged on user. That way, you could continue to share a single pool across all your users, and minimize the number of connections your DB has to support to just the number of currently active requests. Of course, the latter solution depends on your database having the capability to do this -- I know Oracle does, but don't know about others. Craig On 7/6/05, Tamas Szabo [EMAIL PROTECTED] wrote: I guess I could use any implementation of a connection pool for a simple implementation. I just need to use a connection pool for every user (of course using a smaller number of connections than usually). The connection pool object will be created only when the user logs in (if it doesn't exist already). Maybe it would be nice however to return the first connection quickly and then create the others in a background thread. Since there could be a lot of users I should have a max-connection-pools config-param. When is reached I will remove the connection pools of user's who haven't used the object recently. But if there is no implementation of this already, probably this is a not so good idea after all :-). That's why I asked on the list before I want to use it. Tamas On Wed, 2005-07-06 at 21:40 -0600, Larry Meadors wrote: I do not know of any, but it is possible to create one using something like proxool. Larry On 7/6/05, Tamas Szabo [EMAIL PROTECTED] wrote: Hi, I have a question regarding connection pools and DB user rights. When you use connection pool objects you specify an user who will be the owner of all the Connection objects in the pool. I guess that the most usual case is to specify an user which has the DB permissions to execute all the DB operations that needs to be executed from the application. You also create users, add them to roles. The users login to the application and authorization is configured for the parts of the application, but underneath all the users use connections with rights to execute all the DB operations. I don't want to create users and roles in my webapp. I would like to allow the user to enter a real DB/password which I want to use to make the DB connection so the rights of the user to make a given DB operation will be configured in the DB. Is there a support for this or am I on my own to implement a solution for it? Thank you, Tamas - 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] - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Two Forms, Two Form Beans, One JSP
I did consider using a single form bean for both forms, but it didn't really sit well with me from a design stand point. We have two different forms doing two different things so there should be two different beans. Heck, if I had it my way, the two forms would be on separate pages (wizard style), but the customer says otherwise. I do have an issue with using a single form. The top list is a list of program ids. When a program id is selected, it brings up all the different sheets for that program id. The user can then select a sheet to edit, via radio button, and submit that request. With this request, I need to pass the program id that was selected (via hidden field). I can't rely on the program id in the drop down box because if a user performs a search, changes the drop down box and then selects a sheet to edit, we have a mismatch between the intended program id to edit and the actual program id to edit (if that makes any sense). ~ Andrew Tomaka On 7/7/05, Wendy Smoak [EMAIL PROTECTED] wrote: From: Andrew Tomaka [EMAIL PROTECTED] My problem is that I have a PreAction to do the processing on the form. This requires the page to have the form bean assigned to it. Since I have two different forms doing two different things, I should have two different form beans, but I don't see how I can accomplish that. There's nothing wrong with sharing one form across multiple Actions. I do it for an accounting reporting webapp. All of the forms ask for similar things, such as account numbers and dates, and this makes it simple for all the HTML forms to remember their selections. (The form is in session scope, so it happens naturally.) Just wanted to point out that there is no ironclad one-to-one relationship between HTML forms and form beans. -- Wendy Smoak - 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]
Re: banned
See Mark post stupid comments Seen Mark get fired Don't be a Mark. [End of Story] On 7/7/05, Brian Lee [EMAIL PROTECTED] wrote: Good point, assuming that what Mark says is true, that he was fired, this is all bad. I recognize your need to ban people and if it helps improve the signal to noise ratio on this list, I'm all for it. I also recognize that we are all responsible for what we say here. Both the first time around through email and the second time around in the archives. But in this instance, Mark doesn't have only himself to blame. Someone sent his comments to his workplace and resulted in him being fired. I've worked will some major jerks over the years who wrote great code, slung great servers, etc etc. Just because someone's has unpopular views or is terribly annoying or extremely frustrating or whatever does not justify maliciously alerting their employers. This just leaves a bad taste in my mouth. All you need to do is to create a filter and individuals can ban anyone they want. The email to MD dept of elections is spiteful and childish and way more damaging to the struts community than any bigoted and/or stupid posts. BAL From: Craig McClanahan [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org CC: Niall Pemberton [EMAIL PROTECTED] Subject: Re: banned Date: Wed, 6 Jul 2005 20:24:14 -0700 On 7/6/05, Brian Lee [EMAIL PROTECTED] wrote: Wow, this is shockingly lame. Like amazingly lame. To mess with someone's livlihood because you think they are an jerk is inexcusable. Keep in mind that, if Mark indeed did get fired (he has *no* credibility with me, so I don't believe anything he says without corroboration) then he has only himself, and his own behavior, to blame. Acting the way he does, on a public mailing list (which is certainly accessible to his boss whether or not someone points him at it) is incredibly stupid, and doing so from his employer's email system is way beyond stupid -- and it was only a matter of time before he got called on it. I didn't forward the email trail, but I can absolutely understand Niall's frustration with the behavior of an idiot. I'll take Niall with one fit of frustration lapse *any* day over several of the people that think the Struts user mailing list is their private playground to have a I can be more outrageous and infantile than you can pissing contest. The next time around, I'm going to be inclined to ban people soon after a spate of continuous crap like this (assuming requests to change behavior don't work). It's a losing battle against a determined jerk (because its easy to just get a new address) -- but (since Mark got it wrong yet again) -- I didn't ban him, but I would not complain if one of the other mailing list moderators had (they didn't ban his gmail address, or you wouldn't have been able to see his latest comment). Actually, as I told him, it would suit me just fine if he simply went away. I know there are a few people here who find Mark to be funny (I'm *not* a part of that group). That's fine ... it's a free world ... but please go find him funny somewhere else. There are ***lots*** of people who find him annoying and disruptive instead of helpful -- and, to the extent that this behavior encourages others to leave the list, it harms the Struts community as a whole. Craig McClanahan - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Refresher for newbies...
Thanks Rick, I'd like to clarify something here. UserActionForm userForm = (UserActionForm)form; //userID is set in this form when the user clicked on the link So, even though the jsp containing the list of users and the links to edit each of them doesnot contain a form tag, your userForm will still be created and assigned a userID? I guess that is the case due to the fact that the UserForm is defined for the DispatchUserAction and has a request scope so the form will always be created when the action is invoked. James --- Rick Reumann [EMAIL PROTECTED] wrote: I posted this in reply to Tony's post, but figured this stuff comes up all the time and to those new to Struts, this below might help You can accomplish 99% of what you want with this simple design For the sake of this discussion I'm going to assume you are using a DispatchAction. In case you don't know, a DispatchAction just lets you combine similar types of behaviors into one Controller... so rather than have an UpdateUserAction, DeleteUserAction, etc.. you have one Action... UserAction with methods in it update(..), delete(...), etc. So typically here's what I do and it covers 'almost' all of my scenarios. I find it easier to work with examples and your User is a good example to work with. Lets say we want to CRUD (create, retrieve, update, delete) for a User. 1) Step 1 Create a UserActionForm For simplicity it has just two main properties... String userName; Integer userID; Also though we are going to provide the dispatch (or action) as a property to give it default value of add String dispatch = add This way if we go right to the page it'll have 'add' by default 2) Step 2 Have a BusinessObject back reprsenting your User. I like to pass Business objects (not tied to Struts to my backend), so you'll have in this case a simple: UserVO (value object.. could just call it User but for this discussion seeing VO helps you understand what it is) String userName; Integer userID; //NOTE: it helps if the properties of the VO and the ActionForm have the same name. Not a requirement but makes things easier which I'll show 3) Create a UserDispatchAction This will have the following methods: (all with signature public ActionForward methodName (ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) setUpForEdit(..) setUpForAdd(..) add(...) edit(...) delete(...) getUsers(...) Before I get to the setUpForEdit() lets just handle the others... In all cases you will be submitting either a form or a link but in the struts-config file this will map to our UserAction where we also include the name of our UserActionForm, so our UserActionForm is always populated. So our Add method in our Action... //**ADD public ActionForward add(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { UserActionForm userForm = (UserActionForm)form; UserVO user = new UserVO(): //copy our form properties into the VO PropertyUtils.copyProperties( user, userForm ); ourBackendDelegate.addUser( user ); return mapping.findForward(to_form); } // UPDATE and DELETE... Same as above except for use of... ourBackendDelegate.deleteUser( user ); ourBackendDelegate.updateUser( user ); // THE SET UP FOR EDIT Ok, this is the one you were asking about. Now you have to think about how you would get here? Typically you'd get to an edit page by clicking on a user record to say Hey, I want to edit this guy's user information So imagine a case where we have a list of users and 'userID for each in the list, they click on the link and they'll come to this method which will get our user and then forward them to a page to do the editing. The method will look like... public ActionForward setUpForEdit(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { UserActionForm userForm = (UserActionForm)form; //userID is set in this form when the user clicked on the link //lets get our real business object of this user, based on ID.. UserVO user = ourBackendDelegate.addUser( userForm.getUserID() ); //copy the other way this time, from UserVO to our Form... PropertyUtils.copyProperties( userForm, user ); //finally we are going to reuse or form for add and edit, so //we will set up our dispatch/action parameter userForm.setDispatch(edit); return mapping.findForward(to_form); } //The get users - this will display our users on the page public ActionForward getUsers(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { //lets say
Re: banned
I hope you didn't spend too much time composing this puerile gibberish. -Dennis Brandon Goodin [EMAIL PROTECTED] 07/07/2005 12:52 PM Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org cc Subject Re: banned See Mark post stupid comments Seen Mark get fired Don't be a Mark. [End of Story] On 7/7/05, Brian Lee [EMAIL PROTECTED] wrote: Good point, assuming that what Mark says is true, that he was fired, this is all bad. I recognize your need to ban people and if it helps improve the signal to noise ratio on this list, I'm all for it. I also recognize that we are all responsible for what we say here. Both the first time around through email and the second time around in the archives. But in this instance, Mark doesn't have only himself to blame. Someone sent his comments to his workplace and resulted in him being fired. I've worked will some major jerks over the years who wrote great code, slung great servers, etc etc. Just because someone's has unpopular views or is terribly annoying or extremely frustrating or whatever does not justify maliciously alerting their employers. This just leaves a bad taste in my mouth. All you need to do is to create a filter and individuals can ban anyone they want. The email to MD dept of elections is spiteful and childish and way more damaging to the struts community than any bigoted and/or stupid posts. BAL From: Craig McClanahan [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org CC: Niall Pemberton [EMAIL PROTECTED] Subject: Re: banned Date: Wed, 6 Jul 2005 20:24:14 -0700 On 7/6/05, Brian Lee [EMAIL PROTECTED] wrote: Wow, this is shockingly lame. Like amazingly lame. To mess with someone's livlihood because you think they are an jerk is inexcusable. Keep in mind that, if Mark indeed did get fired (he has *no* credibility with me, so I don't believe anything he says without corroboration) then he has only himself, and his own behavior, to blame. Acting the way he does, on a public mailing list (which is certainly accessible to his boss whether or not someone points him at it) is incredibly stupid, and doing so from his employer's email system is way beyond stupid -- and it was only a matter of time before he got called on it. I didn't forward the email trail, but I can absolutely understand Niall's frustration with the behavior of an idiot. I'll take Niall with one fit of frustration lapse *any* day over several of the people that think the Struts user mailing list is their private playground to have a I can be more outrageous and infantile than you can pissing contest. The next time around, I'm going to be inclined to ban people soon after a spate of continuous crap like this (assuming requests to change behavior don't work). It's a losing battle against a determined jerk (because its easy to just get a new address) -- but (since Mark got it wrong yet again) -- I didn't ban him, but I would not complain if one of the other mailing list moderators had (they didn't ban his gmail address, or you wouldn't have been able to see his latest comment). Actually, as I told him, it would suit me just fine if he simply went away. I know there are a few people here who find Mark to be funny (I'm *not* a part of that group). That's fine ... it's a free world ... but please go find him funny somewhere else. There are ***lots*** of people who find him annoying and disruptive instead of helpful -- and, to the extent that this behavior encourages others to leave the list, it harms the Struts community as a whole. Craig McClanahan - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Two Forms, Two Form Beans, One JSP
Does the ActionForm for the bottom form only come into play when a selection is made in the upper form? If so, you could always instantiate the ActionForm yourself, populate it as appropriate in the Action that fires when that selection is made, shove it in request and deal with it manually. One exceedingly hacky way to do this, and I'm not sure it would work but it would be a neat experiment, is something like this: In the Action: -- MyLowerActionForm m = new MyLowerActionForm(); // Populate ActionForm as appropriate request.setAttribute(m, m); (of course you wouldn't use m as the key, but you get the idea!) Then in your JSP, have the upper form that is exactly like it probably is now, then, right before the lower form, add this line: % request.setAttribute(, request.getAttribute(m)); % is the key that the ActionForm would be found under if the lower form was the only one involved. Then code your form as usual. What I'm thinking is that you'd want to use the same usual tags for both forms, and allow Struts to do its thing as far as populating and such goes... this obviously won't work if the upper form requires a different ActionForm than the bottom, but if you overwrite the ActionForm that would be in request at that point for the upper form with the one you manually added to request for the bottom form, that might work. *IF* that does work, I'm not at all sure it's a good idea, but it's an intersting thought. -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com On Thu, July 7, 2005 12:46 pm, Andrew Tomaka said: I did consider using a single form bean for both forms, but it didn't really sit well with me from a design stand point. We have two different forms doing two different things so there should be two different beans. Heck, if I had it my way, the two forms would be on separate pages (wizard style), but the customer says otherwise. I do have an issue with using a single form. The top list is a list of program ids. When a program id is selected, it brings up all the different sheets for that program id. The user can then select a sheet to edit, via radio button, and submit that request. With this request, I need to pass the program id that was selected (via hidden field). I can't rely on the program id in the drop down box because if a user performs a search, changes the drop down box and then selects a sheet to edit, we have a mismatch between the intended program id to edit and the actual program id to edit (if that makes any sense). ~ Andrew Tomaka On 7/7/05, Wendy Smoak [EMAIL PROTECTED] wrote: From: Andrew Tomaka [EMAIL PROTECTED] My problem is that I have a PreAction to do the processing on the form. This requires the page to have the form bean assigned to it. Since I have two different forms doing two different things, I should have two different form beans, but I don't see how I can accomplish that. There's nothing wrong with sharing one form across multiple Actions. I do it for an accounting reporting webapp. All of the forms ask for similar things, such as account numbers and dates, and this makes it simple for all the HTML forms to remember their selections. (The form is in session scope, so it happens naturally.) Just wanted to point out that there is no ironclad one-to-one relationship between HTML forms and form beans. -- Wendy Smoak - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Two Forms, Two Form Beans, One JSP
Andrew, if the data being edited in the two forms are related, then for the child data you could use a nested bean as an attribute on the form. The parent data would remain as usual directly in the form. Adam Andrew Tomaka on 07/07/05 17:46, wrote: I did consider using a single form bean for both forms, but it didn't really sit well with me from a design stand point. We have two different forms doing two different things so there should be two different beans. Heck, if I had it my way, the two forms would be on separate pages (wizard style), but the customer says otherwise. I do have an issue with using a single form. The top list is a list of program ids. When a program id is selected, it brings up all the different sheets for that program id. The user can then select a sheet to edit, via radio button, and submit that request. With this request, I need to pass the program id that was selected (via hidden field). I can't rely on the program id in the drop down box because if a user performs a search, changes the drop down box and then selects a sheet to edit, we have a mismatch between the intended program id to edit and the actual program id to edit (if that makes any sense). ~ Andrew Tomaka On 7/7/05, Wendy Smoak [EMAIL PROTECTED] wrote: From: Andrew Tomaka [EMAIL PROTECTED] My problem is that I have a PreAction to do the processing on the form. This requires the page to have the form bean assigned to it. Since I have two different forms doing two different things, I should have two different form beans, but I don't see how I can accomplish that. There's nothing wrong with sharing one form across multiple Actions. I do it for an accounting reporting webapp. All of the forms ask for similar things, such as account numbers and dates, and this makes it simple for all the HTML forms to remember their selections. (The form is in session scope, so it happens naturally.) Just wanted to point out that there is no ironclad one-to-one relationship between HTML forms and form beans. -- Wendy Smoak - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Refresher for newbies...
Frank W. Zammetti wrote the following on 7/7/2005 12:43 PM: Any reason in getUsers() that you are going directly to request to get the companyID parameter, as opposed to getting it from the form? For a full blown app, I'd probably have a CompanyActionForm which would hold companyID and I'd use that to be consistant. But you aren't required to use an ActionForm for 'everything.' For a single ID nothing 'that' bad about pulling it straight from the Request. It might be worth noting that some people dislike the use of DispatchAction in most cases, me included. This is a fairly minor point as the actual code you wrote would be essentially unchanged without DispathAction, just housed in individual classes. Agreed. I think I mentioned you could use invidual Actions just as easily, if I didn't I apologize. (If using separate related Actions I still 'might' inherit from a BaseUserAction though to keep certain things like a prep() method in the Base, but that's not a firm requirement). (For any newbies reading this, the difference that matters is that with a DispatchAction, you have a single entry in struts-config, but you have to pass a parameter with each request. With plain Actions, you would have multiple mappings like /setupForAdd, /setupForEdit, /add, /delete and so on in this case, but no parameter to pass around. There are pluses and minuses to each approach, but they get you to the same basic place in the end.) Yup. Both have plusses and minuses. Since so little really goes on in the methods of the dispatch action, I just tend to prefer it but I also the valid claim that separate Actions are good and 'maybe' more OO as well (although that could be debated). -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Refresher for newbies...
klute wrote the following on 7/7/2005 12:56 PM: UserActionForm userForm = (UserActionForm)form; //userID is set in this form when the user clicked on the link So, even though the jsp containing the list of users and the links to edit each of them doesnot contain a form tag, your userForm will still be created and assigned a userID? I guess that is the case due to the fact that the UserForm is defined for the DispatchUserAction and has a request scope so the form will always be created when the action is invoked. More specifically it's due to the fact that the URL path for the link is defined in the struts-config action mapping, so yes the ActionForm will be instantiated by Struts. This is a good point to bring up because many think you 'have' to use a html form in order to get an ActionForm populated, but as you have noticed, this is NOT the case. A URL will work just as well. Good observation. -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Two Forms, Two Form Beans, One JSP
Andrew Tomaka wrote the following on 7/7/2005 12:00 PM: I imagine I've over complicated the problem, Yes, I think you are:) My problem is that I have a PreAction to do the processing on the form. This requires the page to have the form bean assigned to it. Since I have two different forms doing two different things, I should have two different form beans, but I don't see how I can accomplish that. Here is a case where I don't believe you need to have these different ActionForms. If you just need an id from one drop down list, simply sumbit to the Action and pull that id out of the request. Nothing forcing you to have to have ActionForm's hold everything. If you want an ActionForm, make just one and provide... Integer searchID; Integer programID; I don't feel this breaks desing principals since the intended use of the ActionForm is to collect user input data from a page - in this case you do have user data (in two lists) on one page. -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Two Forms, Two Form Beans, One JSP
Using a nested form bean may actually be a viable solution that I'll have to look in to. Ideally though, I'd be able to treat the two different forms as two separate pages that just happen to share the same screen space. I guess that's the downside to using a framework: you can't always get what you want. Anyway, I have a drawing of the flow that I'll upload when I am at home. Unfortunately, the proxy here doesn't allow me to write to any FTP space. ~ Andrew Tomaka On 7/7/05, Adam Hardy [EMAIL PROTECTED] wrote: Andrew, if the data being edited in the two forms are related, then for the child data you could use a nested bean as an attribute on the form. The parent data would remain as usual directly in the form. Adam Andrew Tomaka on 07/07/05 17:46, wrote: I did consider using a single form bean for both forms, but it didn't really sit well with me from a design stand point. We have two different forms doing two different things so there should be two different beans. Heck, if I had it my way, the two forms would be on separate pages (wizard style), but the customer says otherwise. I do have an issue with using a single form. The top list is a list of program ids. When a program id is selected, it brings up all the different sheets for that program id. The user can then select a sheet to edit, via radio button, and submit that request. With this request, I need to pass the program id that was selected (via hidden field). I can't rely on the program id in the drop down box because if a user performs a search, changes the drop down box and then selects a sheet to edit, we have a mismatch between the intended program id to edit and the actual program id to edit (if that makes any sense). ~ Andrew Tomaka On 7/7/05, Wendy Smoak [EMAIL PROTECTED] wrote: From: Andrew Tomaka [EMAIL PROTECTED] My problem is that I have a PreAction to do the processing on the form. This requires the page to have the form bean assigned to it. Since I have two different forms doing two different things, I should have two different form beans, but I don't see how I can accomplish that. There's nothing wrong with sharing one form across multiple Actions. I do it for an accounting reporting webapp. All of the forms ask for similar things, such as account numbers and dates, and this makes it simple for all the HTML forms to remember their selections. (The form is in session scope, so it happens naturally.) Just wanted to point out that there is no ironclad one-to-one relationship between HTML forms and form beans. -- Wendy Smoak - 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] - 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]
Re: Two Forms, Two Form Beans, One JSP
You could use frames for the bottom portion. Then you really *could* treat them as two separate pages because, well, they are! -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com On Thu, July 7, 2005 1:32 pm, Andrew Tomaka said: Using a nested form bean may actually be a viable solution that I'll have to look in to. Ideally though, I'd be able to treat the two different forms as two separate pages that just happen to share the same screen space. I guess that's the downside to using a framework: you can't always get what you want. Anyway, I have a drawing of the flow that I'll upload when I am at home. Unfortunately, the proxy here doesn't allow me to write to any FTP space. ~ Andrew Tomaka On 7/7/05, Adam Hardy [EMAIL PROTECTED] wrote: Andrew, if the data being edited in the two forms are related, then for the child data you could use a nested bean as an attribute on the form. The parent data would remain as usual directly in the form. Adam Andrew Tomaka on 07/07/05 17:46, wrote: I did consider using a single form bean for both forms, but it didn't really sit well with me from a design stand point. We have two different forms doing two different things so there should be two different beans. Heck, if I had it my way, the two forms would be on separate pages (wizard style), but the customer says otherwise. I do have an issue with using a single form. The top list is a list of program ids. When a program id is selected, it brings up all the different sheets for that program id. The user can then select a sheet to edit, via radio button, and submit that request. With this request, I need to pass the program id that was selected (via hidden field). I can't rely on the program id in the drop down box because if a user performs a search, changes the drop down box and then selects a sheet to edit, we have a mismatch between the intended program id to edit and the actual program id to edit (if that makes any sense). ~ Andrew Tomaka On 7/7/05, Wendy Smoak [EMAIL PROTECTED] wrote: From: Andrew Tomaka [EMAIL PROTECTED] My problem is that I have a PreAction to do the processing on the form. This requires the page to have the form bean assigned to it. Since I have two different forms doing two different things, I should have two different form beans, but I don't see how I can accomplish that. There's nothing wrong with sharing one form across multiple Actions. I do it for an accounting reporting webapp. All of the forms ask for similar things, such as account numbers and dates, and this makes it simple for all the HTML forms to remember their selections. (The form is in session scope, so it happens naturally.) Just wanted to point out that there is no ironclad one-to-one relationship between HTML forms and form beans. -- Wendy Smoak - 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] - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Refresher for newbies...
On 7/7/05, Rick Reumann [EMAIL PROTECTED] wrote: I posted this in reply to Tony's post, but figured this stuff comes up all the time and to those new to Struts, this below might help You can accomplish 99% of what you want with this simple design Ok, Rick, lets pull out and compare :-) But before I go into presenting my approach, could you tell me, what happens in your app when a user clicks Refresh? Or Back? For the sake of this discussion I'm going to assume you are using a DispatchAction. In case you don't know, a DispatchAction just lets you combine similar types of behaviors into one Controller... so rather than have an UpdateUserAction, DeleteUserAction, etc.. you have one Action... UserAction with methods in it update(..), delete(...), etc. I will use my DialogAction, which subclasses DispatchAction, adding an important feature to it: two-phase request processing aka Redirect-after-Post. It helps to avoid resubmits, and makes the whole process of input/change state/render view much easier. So typically here's what I do and it covers 'almost' all of my scenarios. I find it easier to work with examples and your User is a good example to work with. Lets say we want to CRUD (create, retrieve, update, delete) for a User. 1) Step 1 Create a UserActionForm For simplicity it has just two main properties... String userName; Integer userID; Fine with me. I use abstract items with ID, strvalue and numvalue. Also though we are going to provide the dispatch (or action) as a property to give it default value of add String dispatch = add This way if we go right to the page it'll have 'add' by default My DialogAction or its subclass CRUDAction (thanks for this great example, I have action exactly for this use case) does not have any default values. If you navigate to the action, it simply shows current data for current state. So, as you see, my actionform has session scope to be stateful. 2) Step 2 Have a BusinessObject back reprsenting your User. I like to pass Business objects (not tied to Struts to my backend), so you'll have in this case a simple: UserVO (value object.. could just call it User but for this discussion seeing VO helps you understand what it is) String userName; Integer userID; //NOTE: it helps if the properties of the VO and the ActionForm have the same name. Not a requirement but makes things easier which I'll show I don't care much about how VO/BO is mapped to actionform. Basically, if you want values to be populated from request, and to be used in JSP, either create setter/getters in the actionform, or set VO/BO as nested property of the actionform. 3) Create a UserDispatchAction This will have the following methods: (all with signature public ActionForward methodName (ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) setUpForEdit(..) setUpForAdd(..) add(...) edit(...) delete(...) getUsers(...) I have generic CRUDAction, which has create(), duplicate(), edit(), view() and delete() methods. And of course, getView(), which renders a proper page. Before I get to the setUpForEdit() lets just handle the others... In all cases you will be submitting either a form or a link DispatchAction and its subclasses accepts input as form submission only (POST), because it detects input phase or render phase by request type. I think, this is a reasonable limitation. but in the struts-config file this will map to our UserAction where we also include the name of our UserActionForm, so our UserActionForm is always populated. So our Add method in our Action... //**ADD public ActionForward add(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { UserActionForm userForm = (UserActionForm)form; UserVO user = new UserVO(): //copy our form properties into the VO PropertyUtils.copyProperties( user, userForm ); ourBackendDelegate.addUser( user ); return mapping.findForward(to_form); } The corresponding create() method in CRUDAction from Struts Dialogs looks like this: public ActionForward onCreate (ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { // Action Form must implement ICRUDForm ICRUDForm crudForm = (ICRUDForm) form; // Create new business object (item), and get back errors if any ActionMessages messages = crudForm.crudCreate(); // Successfully created new object and initialized action form if ((messages == null) || messages.isEmpty()) { // Need to handle this forward object in struts-config.xml return
Re: Refresher for newbies...
Rick, Can you clarify how you give the dispatch action default add value? Is it meber attribute of add on the action itself? Thanks, James --- Rick Reumann [EMAIL PROTECTED] wrote: Rick Reumann wrote the following on 7/7/2005 11:58 AM: This will have the following methods: (all with signature public ActionForward methodName (ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) setUpForEdit(..) setUpForAdd(..) Sorry you don't need the setUpForAdd()... I gave the dispatch a default add value. Just ignore that method... you don't need it in this example. -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Sell on Yahoo! Auctions no fees. Bid on great items. http://auctions.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Refresher for newbies...
On 7/7/05, Frank W. Zammetti [EMAIL PROTECTED] wrote: (For any newbies reading this, the difference that matters is that with a DispatchAction, you have a single entry in struts-config, but you have to pass a parameter with each request. With plain Actions, you would have multiple mappings like /setupForAdd, /setupForEdit, /add, /delete and so on in this case, but no parameter to pass around. There are pluses and minuses to each approach, but they get you to the same basic place in the end.) Not really, unless you use mod_rewrite. Using single action allows you to serve all pages from one location, which, combined with redirect, usually makes a nice user experience. Most browsers put only one entry in the page history because the location is always the same for all response pages. Michael. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: banned
Nope. I likely took the same amount of time as you took to spin your word of the day insult. :) On 7/7/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I hope you didn't spend too much time composing this puerile gibberish. -Dennis Brandon Goodin [EMAIL PROTECTED] 07/07/2005 12:52 PM Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org cc Subject Re: banned See Mark post stupid comments Seen Mark get fired Don't be a Mark. [End of Story] On 7/7/05, Brian Lee [EMAIL PROTECTED] wrote: Good point, assuming that what Mark says is true, that he was fired, this is all bad. I recognize your need to ban people and if it helps improve the signal to noise ratio on this list, I'm all for it. I also recognize that we are all responsible for what we say here. Both the first time around through email and the second time around in the archives. But in this instance, Mark doesn't have only himself to blame. Someone sent his comments to his workplace and resulted in him being fired. I've worked will some major jerks over the years who wrote great code, slung great servers, etc etc. Just because someone's has unpopular views or is terribly annoying or extremely frustrating or whatever does not justify maliciously alerting their employers. This just leaves a bad taste in my mouth. All you need to do is to create a filter and individuals can ban anyone they want. The email to MD dept of elections is spiteful and childish and way more damaging to the struts community than any bigoted and/or stupid posts. BAL From: Craig McClanahan [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org CC: Niall Pemberton [EMAIL PROTECTED] Subject: Re: banned Date: Wed, 6 Jul 2005 20:24:14 -0700 On 7/6/05, Brian Lee [EMAIL PROTECTED] wrote: Wow, this is shockingly lame. Like amazingly lame. To mess with someone's livlihood because you think they are an jerk is inexcusable. Keep in mind that, if Mark indeed did get fired (he has *no* credibility with me, so I don't believe anything he says without corroboration) then he has only himself, and his own behavior, to blame. Acting the way he does, on a public mailing list (which is certainly accessible to his boss whether or not someone points him at it) is incredibly stupid, and doing so from his employer's email system is way beyond stupid -- and it was only a matter of time before he got called on it. I didn't forward the email trail, but I can absolutely understand Niall's frustration with the behavior of an idiot. I'll take Niall with one fit of frustration lapse *any* day over several of the people that think the Struts user mailing list is their private playground to have a I can be more outrageous and infantile than you can pissing contest. The next time around, I'm going to be inclined to ban people soon after a spate of continuous crap like this (assuming requests to change behavior don't work). It's a losing battle against a determined jerk (because its easy to just get a new address) -- but (since Mark got it wrong yet again) -- I didn't ban him, but I would not complain if one of the other mailing list moderators had (they didn't ban his gmail address, or you wouldn't have been able to see his latest comment). Actually, as I told him, it would suit me just fine if he simply went away. I know there are a few people here who find Mark to be funny (I'm *not* a part of that group). That's fine ... it's a free world ... but please go find him funny somewhere else. There are ***lots*** of people who find him annoying and disruptive instead of helpful -- and, to the extent that this behavior encourages others to leave the list, it harms the Struts community as a whole. Craig McClanahan - 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] - 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]
Shale Users
Hey All, I've been using MyFaces JSF and I have been keeping up with Shale off and on. How are things looking with Shale? Is it in a good state to begin expirementing with? Brandon - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: banned
How exactly does dispatching a collection of spite-filled e-mails become damaging to the Struts community, because I sure don't see it. Will it reduce participation on this mailing list? If people think twice about making bigoted or unprofessional posts it's a positive. People are calling him a victim, but don't forget, Mark was the *originator* of this nonsense. He has only himself to blame, and he was just asking for trouble spewing that kind of bile from a work account. It's unfortunate that it affected his job, but again, the situation was under his control from the beginning. -ed On 7/7/05, Brian Lee [EMAIL PROTECTED] wrote: Good point, assuming that what Mark says is true, that he was fired, this is all bad. I recognize your need to ban people and if it helps improve the signal to noise ratio on this list, I'm all for it. I also recognize that we are all responsible for what we say here. Both the first time around through email and the second time around in the archives. But in this instance, Mark doesn't have only himself to blame. Someone sent his comments to his workplace and resulted in him being fired. I've worked will some major jerks over the years who wrote great code, slung great servers, etc etc. Just because someone's has unpopular views or is terribly annoying or extremely frustrating or whatever does not justify maliciously alerting their employers. This just leaves a bad taste in my mouth. All you need to do is to create a filter and individuals can ban anyone they want. The email to MD dept of elections is spiteful and childish and way more damaging to the struts community than any bigoted and/or stupid posts. BAL From: Craig McClanahan [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org CC: Niall Pemberton [EMAIL PROTECTED] Subject: Re: banned Date: Wed, 6 Jul 2005 20:24:14 -0700 On 7/6/05, Brian Lee [EMAIL PROTECTED] wrote: Wow, this is shockingly lame. Like amazingly lame. To mess with someone's livlihood because you think they are an jerk is inexcusable. Keep in mind that, if Mark indeed did get fired (he has *no* credibility with me, so I don't believe anything he says without corroboration) then he has only himself, and his own behavior, to blame. Acting the way he does, on a public mailing list (which is certainly accessible to his boss whether or not someone points him at it) is incredibly stupid, and doing so from his employer's email system is way beyond stupid -- and it was only a matter of time before he got called on it. I didn't forward the email trail, but I can absolutely understand Niall's frustration with the behavior of an idiot. I'll take Niall with one fit of frustration lapse *any* day over several of the people that think the Struts user mailing list is their private playground to have a I can be more outrageous and infantile than you can pissing contest. The next time around, I'm going to be inclined to ban people soon after a spate of continuous crap like this (assuming requests to change behavior don't work). It's a losing battle against a determined jerk (because its easy to just get a new address) -- but (since Mark got it wrong yet again) -- I didn't ban him, but I would not complain if one of the other mailing list moderators had (they didn't ban his gmail address, or you wouldn't have been able to see his latest comment). Actually, as I told him, it would suit me just fine if he simply went away. I know there are a few people here who find Mark to be funny (I'm *not* a part of that group). That's fine ... it's a free world ... but please go find him funny somewhere else. There are ***lots*** of people who find him annoying and disruptive instead of helpful -- and, to the extent that this behavior encourages others to leave the list, it harms the Struts community as a whole. Craig McClanahan - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Refresher for newbies...
I don't understand your argument Michael. Can you expand and/or clarify? Specifically, how is multiple Actions not serving from the same location? It's not the same URL, granted, is that what you meant? -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com On Thu, July 7, 2005 1:44 pm, Michael Jouravlev said: On 7/7/05, Frank W. Zammetti [EMAIL PROTECTED] wrote: (For any newbies reading this, the difference that matters is that with a DispatchAction, you have a single entry in struts-config, but you have to pass a parameter with each request. With plain Actions, you would have multiple mappings like /setupForAdd, /setupForEdit, /add, /delete and so on in this case, but no parameter to pass around. There are pluses and minuses to each approach, but they get you to the same basic place in the end.) Not really, unless you use mod_rewrite. Using single action allows you to serve all pages from one location, which, combined with redirect, usually makes a nice user experience. Most browsers put only one entry in the page history because the location is always the same for all response pages. Michael. - 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]
Re: Two Forms, Two Form Beans, One JSP
This is what I've ended up doing for now. I have my one form bean for both forms since the data is related. What if the data isn't related though? Does Struts provide a simple solution or is just an area to hack around? I can accept the latter since it's expected when using a framework. Either way, thanks for all the help guys. I've gotten my forms in working condition with a design that I can put up with! ~ Andrew Tomaka On 7/7/05, Rick Reumann [EMAIL PROTECTED] wrote: Andrew Tomaka wrote the following on 7/7/2005 12:00 PM: I imagine I've over complicated the problem, Yes, I think you are:) My problem is that I have a PreAction to do the processing on the form. This requires the page to have the form bean assigned to it. Since I have two different forms doing two different things, I should have two different form beans, but I don't see how I can accomplish that. Here is a case where I don't believe you need to have these different ActionForms. If you just need an id from one drop down list, simply sumbit to the Action and pull that id out of the request. Nothing forcing you to have to have ActionForm's hold everything. If you want an ActionForm, make just one and provide... Integer searchID; Integer programID; I don't feel this breaks desing principals since the intended use of the ActionForm is to collect user input data from a page - in this case you do have user data (in two lists) on one page. -- Rick - 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]
Resend : Multiple Struts-config files, multiple properties and validator
Hi I m using struts 1.2 mulitple struts-config files multiple properties files and now I have a validation.xml file for input validation of the form Ques 1. How do I get the keys defined in properties files in validation.xml 's field's arg0's key attribute Ques 2. Even if I get all the error messages in 1 files , I still get NoSuchMethod Exception ( I using the latest struts files) Thanks ___ Too much spam in your inbox? Yahoo! Mail gives you the best spam protection for FREE! http://in.mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
embedding forms
Hi there, I am having a problem, trying to embed one ValidatorForm inside of another --- specifically this is the situation: I have a class InstitutionForm and a class DnaForm -- I am trying to do the following public class InstitutionForm extends ValidatorForm { private DnaForm dnaForm; private String institution_name; public String getInstitution_name() { return institution_name; } public void setInstitution_name(String institution_name) { this.institution_name = institution_name; } public DnaForm getDnaForm() { return dnaForm; } public void setDnaForm(DnaForm dnaForm) { this.dnaForm = dnaForm; } } public class DnaForm extends ValidatorForm { private String first_name; public String getFirst_name() { return first_name; } public void setFirst_name(String first_name) { this.first_name = first_name; } } In my JSP, I have the following: html:form action=/processRequestAccess method=POST table border=1 tr tdbean:message key=institution-name //td tdhtml:text property=institution_name //td tdbean:message key=title //td td/td /tr tr tdbean:message key=address1 //td td/td tdbean:message key=first-name //td tdhtml:text property=dnaForm.first_name //td !-- DOESN'T LIKE THIS -- /tr . /html:form the rendered JSP produces this: 12:25:33,653 INFO [TilesRequestProcessor] Tiles definition factory found for request processor ''. 12:25:36,567 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception javax.servlet.jsp.JspException: Invalid argument looking up property dnaForm.first_name of bean org.apache.struts.taglib.html.BEAN at org.apache.struts.taglib.TagUtils.lookup(TagUtils.java:1017) at org.apache.struts.taglib.html.BaseFieldTag.renderInputElement( BaseFieldTag.java:153) at org.apache.struts.taglib.html.BaseFieldTag.doStartTag(BaseFieldTag.java :96) at org.apache.jsp.WEB_002dINF.jsp.common.request_005faccess_jsp._jspx_meth_html_text_1 (org.apache.jsp.WEB_002dINF.jsp.common.request_005faccess_jsp:342) at org.apache.jsp.WEB_002dINF.jsp.common.request_005faccess_jsp._jspx_meth_html_form_0 (org.apache.jsp.WEB_002dINF.jsp.common.request_005faccess_jsp:154) at org.apache.jsp.WEB_002dINF.jsp.common.request_005faccess_jsp._jspService( org.apache.jsp.WEB_002dINF.jsp.common.request_005faccess_jsp:81) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) I am using JBoss 4.x It is obvious, that the jsp rendering does not 'like' the dnaForm.first_name--- is there a decent way of embedding these Validatorform, one inside of the other, or should I just do a InstutionForm extends DnaForm instead?? Thanks, Alex.
Re: Two Forms, Two Form Beans, One JSP
You can have multiple forms on the same page. I am using Tiles. I put some forms in the header/footer and they work just fine. I had to use different actions for the two forms, and I had to use session scope for one of them in order to retain state for it. Request scope is the reason for the one-form limit you are suggesting, right? Michael Taylor TXE Systems, Inc. [EMAIL PROTECTED] Abdullah Jibaly wrote: To simplify your code, I would have one ActionForm, and one processing action. Depending on which submit button or whatever is pressed I'd redirect to the correct page. By the way you can only have one struts action form per action and per jsp page. Regards, Abdullah -Original Message- From: Andrew Tomaka [mailto:[EMAIL PROTECTED] Sent: Thursday, July 07, 2005 9:26 AM To: user@struts.apache.org Subject: Two Forms, Two Form Beans, One JSP Hey all, I'm attempting to create a JSP that is made up of two forms. Each form needs a different form bean and is processed by a different action. The catch is that the first form returns back to the JSP and the action responsible for this needs the name attribute set to the Form Bean of the first form. When the JSP is loaded after the processing of the first form, both the form tags are assigned the name of the first Form Bean. Is it possible to assign Form Beans to a form instead of assigning them to an action? Thanks, ~ Andrew Tomaka - 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]
Re: Refresher for newbies...
Typo: I wrote DispatchAction and its subclasses accepts input as form submission only (POST). Must read as DialogAction and its subclasses accepts input as form submission only (POST) Also, two other methods for completeness. This one is called when a user submits new/updated item to persist it. This is input phase. public ActionForward onSave (ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { HttpSession session = request.getSession(); ICRUDForm crudForm = (ICRUDForm) form; // Validate input data ActionMessages messages = form.validate(mapping, request); // Input data is not valid if (messages != null messages.size() 0) { session.setAttribute(Globals.ERROR_KEY, messages); return mapping.findForward(CRUDConstants.MAPPING_ON_INVALID_DATA); // Input data is valid } else { // Try to persist form data ActionMessages storeMessages = crudForm.crudStore(); // Could not persist form data if (storeMessages != null storeMessages.size() 0) { session.setAttribute(Globals.ERROR_KEY, storeMessages); return mapping.findForward(CRUDConstants.MAPPING_ON_STORE_FAILURE); // Successfully persisted } else { return mapping.findForward(CRUDConstants.MAPPING_ON_STORE_SUCCESS); } } } Another forwards to a proper page, this is render phase. This particular implementation uses CRUD mode for page mapping. public ActionForward getDialogView(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { ICRUDForm crudForm = (ICRUDForm) form; String uiMode = crudForm.getCrudUIMode(); return mapping.findForward(uiMode); } Michael. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Getter/Setter
If you mean writing a single method that handles multiple elements, then the way to handle this is with DynaBeans. Struts uses BeanUtils to populate the forms, and the DynaBean interface provides support for a set of generic set/get methods that can handle normal, indexed, and mapped properties. Thus, you can build a bean backed by a map, a result set, etc. To make this work for a form see DynaForm and override some of the get/set methods, or use it as an example and make your own variant. Cheers, Mike Michael Taylor TXE Systems, Inc. [EMAIL PROTECTED] Vijay K Anand wrote: hi All Any idea how to write setter / getter methods for multiple form elements ? Regards Vijay - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Resend : Multiple Struts-config files, multiple properties and validator
Use latest validator-rules.xml and use latest tld's use bundle this way field property=user_name depends=required arg key=userEdit.user_name.displayname bundle=user/ /field -Original Message- From: Sagar Naik [mailto:[EMAIL PROTECTED] Sent: Thu 7/7/2005 1:58 PM To: user@struts.apache.org Cc: Subject:Resend : Multiple Struts-config files, multiple properties and validator Hi I m using struts 1.2 mulitple struts-config files multiple properties files and now I have a validation.xml file for input validation of the form Ques 1. How do I get the keys defined in properties files in validation.xml 's field's arg0's key attribute Ques 2. Even if I get all the error messages in 1 files , I still get NoSuchMethod Exception ( I using the latest struts files) Thanks ___ Too much spam in your inbox? Yahoo! Mail gives you the best spam protection for FREE! http://in.mail.yahoo.com - 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]
Re: Refresher for newbies...
Rick Reumann wrote the following on 7/7/2005 11:58 AM: // THE SET UP FOR EDIT Ok, this is the one you were asking about. Now you have to think about how you would get here? Typically you'd get to an edit page by clicking on a user record to say Hey, I want to edit this guy's user information So imagine a case where we have a list of users and 'userID for each in the list, they click on the link and they'll come to this method which will get our user and then forward them to a page to do the editing. The method will look like... public ActionForward setUpForEdit(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { UserActionForm userForm = (UserActionForm)form; //userID is set in this form when the user clicked on the link //lets get our real business object of this user, based on ID.. UserVO user = ourBackendDelegate.addUser( userForm.getUserID() ); !!!THE ABOVE SHOULD BE ourBackendDelegate.getUser( userForm.getUserID() ); Thanks Michael for catching that. -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Refresher for newbies...
This is exactly what I mean. If you recall the definition, Location != URL. Instead, Location == URL + request params. Most browsers build up page history using locations, of the browsers known to me, only Opera uses actual responses. That means, that if you load the same page five times in Opera, it will put five entries into page history. But most other browsers do not do that, they put only one entry in page history, because all pages has the same location. Another trick is using redirection. Browsers forget location, which preceds redirected request. If you redirect from each POST to result page, result page is loaded with GET, this is how browsers work. Say, you submit the same form three times, you have the following request sequence: POST-GET-POST-GET-POST-GET, right? Three pairs of POST-GET What goes to the page history? The answer is, that requests preceding redirected request do not go, so it would be GET-GET-GET. This is what sucky Opera is doing. They explain this by 13.13 chapter of HTTP1.1 spec. Whatever. Other browsers do not do that, and also consider themselves compliant to HTTP spec. So, other browsers see that all GET in the GET-GET-GET point to the same location (see definition above). So, they just throw all of them but one, because they consider it the same resource. Now you get your page history: -GET- That is all! Now, combine that with non-cachable pages, and you can serve different content from the same locaiton, which is stored in the same history slot. This is how you get your single-page application or what I call it, a web island. You cannot go Back, because there is nowhere to go back, and your page is always in sync with the server. This is what DialogAction does, besides other things ;-)) I think I need to put web island chapter back into my article on JSP controls... Michael. On 7/7/05, Frank W. Zammetti [EMAIL PROTECTED] wrote: I don't understand your argument Michael. Can you expand and/or clarify? Specifically, how is multiple Actions not serving from the same location? It's not the same URL, granted, is that what you meant? -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com On Thu, July 7, 2005 1:44 pm, Michael Jouravlev said: On 7/7/05, Frank W. Zammetti [EMAIL PROTECTED] wrote: (For any newbies reading this, the difference that matters is that with a DispatchAction, you have a single entry in struts-config, but you have to pass a parameter with each request. With plain Actions, you would have multiple mappings like /setupForAdd, /setupForEdit, /add, /delete and so on in this case, but no parameter to pass around. There are pluses and minuses to each approach, but they get you to the same basic place in the end.) Not really, unless you use mod_rewrite. Using single action allows you to serve all pages from one location, which, combined with redirect, usually makes a nice user experience. Most browsers put only one entry in the page history because the location is always the same for all response pages. Michael. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Two Forms, Two Form Beans, One JSP
I read this post several times. If I understood it, the key is this line: ...the action responsible for this needs the name attribute set to the Form Bean of the first form... If I read this to mean you want a post to form A to update form B so that it has access to the state of submission to form A, then I would suggest that you use session scope and have the action for form A retrieve form B from the session and update it as needed. You can give it a reference to the other form if you like, or you can copy the data you nead from one form to the other. Is that what you are looking for? Cheers, Mike Michael Taylor TXE Systems, Inc. [EMAIL PROTECTED] Andrew Tomaka wrote: Hey all, I'm attempting to create a JSP that is made up of two forms. Each form needs a different form bean and is processed by a different action. The catch is that the first form returns back to the JSP and the action responsible for this needs the name attribute set to the Form Bean of the first form. When the JSP is loaded after the processing of the first form, both the form tags are assigned the name of the first Form Bean. Is it possible to assign Form Beans to a form instead of assigning them to an action? Thanks, ~ Andrew Tomaka - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Refresher for newbies...
I understand the PRG pattern. I don't see how it is relevant to the Action vs. DispatchAction point. Perhaps I'm just being dense... I am reviewing 3 gigs of server logs today and my eyes feel like they are about to explode, and my brain is about to turn to mush, moreso than usual I mean ;) -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com On Thu, July 7, 2005 2:17 pm, Michael Jouravlev said: This is exactly what I mean. If you recall the definition, Location !URL. Instead, Location == URL + request params. Most browsers build up page history using locations, of the browsers known to me, only Opera uses actual responses. That means, that if you load the same page five times in Opera, it will put five entries into page history. But most other browsers do not do that, they put only one entry in page history, because all pages has the same location. Another trick is using redirection. Browsers forget location, which preceds redirected request. If you redirect from each POST to result page, result page is loaded with GET, this is how browsers work. Say, you submit the same form three times, you have the following request sequence: POST-GET-POST-GET-POST-GET, right? Three pairs of POST-GET What goes to the page history? The answer is, that requests preceding redirected request do not go, so it would be GET-GET-GET. This is what sucky Opera is doing. They explain this by 13.13 chapter of HTTP1.1 spec. Whatever. Other browsers do not do that, and also consider themselves compliant to HTTP spec. So, other browsers see that all GET in the GET-GET-GET point to the same location (see definition above). So, they just throw all of them but one, because they consider it the same resource. Now you get your page history: -GET- That is all! Now, combine that with non-cachable pages, and you can serve different content from the same locaiton, which is stored in the same history slot. This is how you get your single-page application or what I call it, a web island. You cannot go Back, because there is nowhere to go back, and your page is always in sync with the server. This is what DialogAction does, besides other things ;-)) I think I need to put web island chapter back into my article on JSP controls... Michael. On 7/7/05, Frank W. Zammetti [EMAIL PROTECTED] wrote: I don't understand your argument Michael. Can you expand and/or clarify? Specifically, how is multiple Actions not serving from the same location? It's not the same URL, granted, is that what you meant? -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com On Thu, July 7, 2005 1:44 pm, Michael Jouravlev said: On 7/7/05, Frank W. Zammetti [EMAIL PROTECTED] wrote: (For any newbies reading this, the difference that matters is that with a DispatchAction, you have a single entry in struts-config, but you have to pass a parameter with each request. With plain Actions, you would have multiple mappings like /setupForAdd, /setupForEdit, /add, /delete and so on in this case, but no parameter to pass around. There are pluses and minuses to each approach, but they get you to the same basic place in the end.) Not really, unless you use mod_rewrite. Using single action allows you to serve all pages from one location, which, combined with redirect, usually makes a nice user experience. Most browsers put only one entry in the page history because the location is always the same for all response pages. Michael. - 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]
Re: Refresher for newbies...
On 7/7/05, Frank W. Zammetti [EMAIL PROTECTED] wrote: I understand the PRG pattern. I don't see how it is relevant to the Action vs. DispatchAction point. Perhaps I'm just being dense... Perhaps. Or perhaps I cannot explain my thoughts cleanly enough. Please, reread the email and pay attention, that this is not just PRG, where GET can point to *any* address. I tell you about improved PRG, where all GETs point to the *same* location. See the difference? You probably already did it twice or even more, but nevertheless, the same dreaded live demo: http://www.superinterface.com/strutsdialog/logincomponent.html use any link to bring up a form. See the address in the address bar. Click Back, you return back to page with links. Nothing special right? Now, bring up the login form, use guest/guest and log in. Now it shows Logged In form with Log Out button. Check the address, it is the same as for login form. Click Back browser button. You are not brought to login page, you are brought to page with links. See? Because both login and logout pages are served from the same location. Michael. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Refresher for newbies...
On 7/7/05, Michael Jouravlev [EMAIL PROTECTED] wrote: Just a clarification: Now, bring up the login form, use guest/guest and log in. Now it shows Logged In form with Log Out button. Check the address, it is the same as for login form. Click Back browser button. You are not brought to login page, you are brought to page with links. See? Because both login and logout pages are served from the same location. This same location is one DispatchAction. The point is that one action accepts different inputs and responds with different pages. DispatchAction is convenient to accept different inputs, but of course you can use any action. But you need to use *only one* action, otherwise the locations of different pages would be different. Michael. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
dialog stuff (was) Re: Refresher for newbies...
(moved to new topic heading, but keeping seem referenceID for those threading).. Michael Jouravlev wrote the following on 7/7/2005 1:40 PM: Ok, Rick, lets pull out and compare :-) But before I go into presenting my approach, could you tell me, what happens in your app when a user clicks Refresh? Or Back? Sure. No problem. It depends on the application. If it's a requirement that data does not get submitted twice I simply use the token approach that is very easy to implement. It doesn't take much at all to ensure duplicate entries do not get entered. If the user hits 'back' on their browser button most of the time that page info displayed is cached by the browser. If it's critical that the page always show fresh data (which usually it is not) then ther are ways to ensure that also (doing the pragma, no-cache stuff like you do in your DialogAction). I will use my DialogAction, which subclasses DispatchAction, adding an important feature to it: two-phase request processing aka Redirect-after-Post. It helps to avoid resubmits, and makes the whole process of input/change state/render view much easier. Like I said if resubmits are in issue just use the Token approach. It's super easy and documented. My DialogAction or its subclass CRUDAction (thanks for this great example, I have action exactly for this use case) does not have any default values. If you navigate to the action, it simply shows current data for current state. So, as you see, my actionform has session scope to be stateful. My DispatchAction doesn't have default values either. I'm not sure what you are talking about here. If I want to keep state, I simply give my ActionForm session scope and or if I want list of users to have state I put it in session scope. What's new about giving an ActionForm session scope? I don't care much about how VO/BO is mapped to actionform. Basically, if you want values to be populated from request, and to be used in JSP, either create setter/getters in the actionform, or set VO/BO as nested property of the actionform. Agreed. I often do the same (nest a VO/BO in my ActionForm, although this wouldn't be the initial approach I'd give someone just starting out). I have generic CRUDAction, which has create(), duplicate(), edit(), view() and delete() methods. And of course, getView(), which renders a proper page. Yes I see that. DispatchAction and its subclasses accepts input as form submission only (POST), because it detects input phase or render phase by request type. I think, this is a reasonable limitation. Not true. I pass stuff with a get all the time using a URL. The corresponding create() method in CRUDAction from Struts Dialogs looks like this: public ActionForward onCreate (ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { // Action Form must implement ICRUDForm ICRUDForm crudForm = (ICRUDForm) form; // Create new business object (item), and get back errors if any ActionMessages messages = crudForm.crudCreate(); // Successfully created new object and initialized action form if ((messages == null) || messages.isEmpty()) { // Need to handle this forward object in struts-config.xml return mapping.findForward(CRUDConstants.MAPPING_ON_CREATE_SUCCESS); // On error save messages into session. Struts 1.2.6+ has // a special method for it; this code saves errors directly // to session for compatibility with older Struts versions. } else { HttpSession session = request.getSession(); session.setAttribute(Globals.ERROR_KEY, messages); // Handle this forward object in struts-config.xml return mapping.findForward(CRUDConstants.MAPPING_ON_CREATE_FAILURE); } } Yes, I saw this in the code I download. I see what you are doing - basically have a generic Action that tells the form to update, delete, etc. Again, I think this is pretty 'cool' but I don't think it is that much of a time saver and it is definitely a totally different paradigm from all the Struts stuff out there. Not saying it's not a good concept, I'm just stating that is more difficult to grasp at first since it's not how Struts was desgined. You are free to mold it however you want and that's the beauty of open source, but I don't see your solution as that much more of a time saver or any easier to understand than the basic approaches. ALSO I will amost GUARANTEE you that in reality you will almost always end up having to do other things when an update/edit/delete takes place... maybe you'l have requirements that you need to stuff something else into the request, maybe something else into the session - you'll say do this all in your the CRUDForm
Re: Which request is used in Validation when the requirements aren't met?
If your input attribute identifies an Action instead of a JSP page, you can do whatever you need to do within that Action. On 7/7/05, Thai Dang Vu [EMAIL PROTECTED] wrote: Hello everybody, This is my action declaration in struts-config.xml action path=/add_provider type=AddProviderAction name=addProviderForm input=/WEB-INF/provider/addprovider.jsp validate=true scope=request /action In addprovider.jsp page, when I click 'Submit' and the requirements aren't met, the request is forwarded to the input (which is /WEB-INF/provider/addprovider.jsp). How and where can I get the request before the input page appears (so that I can put something in the request to make the input displays correctly)? Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
execute instead of get and post
Is there a good reason why Struts does not distinguish between GET and POST requests and tunnels both through execute()? It seems like it would make sense to have both so that you can use GET to set up a particular form and POST to process that form. Instead, I'd have to look at the request to see what was invoked and then conditionally do some processing. James Sell on Yahoo! Auctions no fees. Bid on great items. http://auctions.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: execute instead of get and post
klute wrote the following on 7/7/2005 3:07 PM: It seems like it would make sense to have both so that you can use GET to set up a particular form and POST to process that form. Instead, I'd have to look at the request to see what was invoked and then conditionally do some processing. No need for conditional process based on GET or POST, you should be either directing control based on either... A) Separate mappings that point to different Action classes /setUpEdit.do /edit.do or B) pass in a dispatch parameter if using a DispatchAction (You can still use separate mappings also if you want also). -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Which request is used in automatic Validation when the requirements aren't met?
Perhaps I stated it unclearly. I am using automatic validation, not manual validation (which uses validate method of the form bean). If the requirements aren't met, Struts will lead us to the input page (in my case the /WEB-INF/provider/addprovider.jsp) without going to the execute method of the AddProviderAction class. So my question is: is there any place I can interrupt the request before the addprovider.jsp appears and displays the errors (I use html:errors/ in that page)? [EMAIL PROTECTED] 7/7/2005 3:01:34 PM If your input attribute identifies an Action instead of a JSP page, you can do whatever you need to do within that Action. On 7/7/05, Thai Dang Vu [EMAIL PROTECTED] wrote: Hello everybody, This is my action declaration in struts-config.xml action path=/add_provider type=AddProviderAction name=addProviderForm input=/WEB-INF/provider/addprovider.jsp validate=true scope=request /action In addprovider.jsp page, when I click 'Submit' and the requirements aren't met, the request is forwarded to the input (which is /WEB-INF/provider/addprovider.jsp). How and where can I get the request before the input page appears (so that I can put something in the request to make the input displays correctly)? Thanks. - 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]
Re: Shale Users
Things in Shale are going pretty well -- with David's checkin of the integration with standalone Tiles (from the Struts sandbox), Shale is now pretty much feature complete with respect to Struts 1.x, while offering some ease of development benefits due to JSF and it's own features. The only functional areas I still want to flesh out some more before a milestone release are: * Making it possible to have multiple dialogs active at the same time (for a dialog in each Tile, for popups, etc) * On the remoting support, make the JSF lifecycle available so you can use things like value binding and method binding expressions while creating the response. I don't anticipate that either of these changes will cause any fundamental breakage in the APIs, so it's definitely worth some experimentation time. Craig On 7/7/05, Brandon Goodin [EMAIL PROTECTED] wrote: Hey All, I've been using MyFaces JSF and I have been keeping up with Shale off and on. How are things looking with Shale? Is it in a good state to begin expirementing with? Brandon - 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]
RE: Two Forms, Two Form Beans, One JSP
No, I actually meant that Struts will only process and associate one form with the action processing that request, and therefore any validation, etc. So only one html form will get associated with the current ActionForm, even with session scope, although you may have several html forms in that page. Regards, Abdullah -Original Message- From: Michael Taylor [mailto:[EMAIL PROTECTED] Sent: Thursday, July 07, 2005 1:02 PM To: Struts Users Mailing List Cc: Andrew Tomaka Subject: Re: Two Forms, Two Form Beans, One JSP You can have multiple forms on the same page. I am using Tiles. I put some forms in the header/footer and they work just fine. I had to use different actions for the two forms, and I had to use session scope for one of them in order to retain state for it. Request scope is the reason for the one-form limit you are suggesting, right? Michael Taylor TXE Systems, Inc. [EMAIL PROTECTED] Abdullah Jibaly wrote: To simplify your code, I would have one ActionForm, and one processing action. Depending on which submit button or whatever is pressed I'd redirect to the correct page. By the way you can only have one struts action form per action and per jsp page. Regards, Abdullah -Original Message- From: Andrew Tomaka [mailto:[EMAIL PROTECTED] Sent: Thursday, July 07, 2005 9:26 AM To: user@struts.apache.org Subject: Two Forms, Two Form Beans, One JSP Hey all, I'm attempting to create a JSP that is made up of two forms. Each form needs a different form bean and is processed by a different action. The catch is that the first form returns back to the JSP and the action responsible for this needs the name attribute set to the Form Bean of the first form. When the JSP is loaded after the processing of the first form, both the form tags are assigned the name of the first Form Bean. Is it possible to assign Form Beans to a form instead of assigning them to an action? Thanks, ~ Andrew Tomaka - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Which request is used in automatic Validation when therequirements aren't met?
Good Afternoon Thai Here is an example of building ActionErrors object inside execute() method of your Action class http://publib.boulder.ibm.com/infocenter/wsad512/index.jsp?topic=/com.ibm.etools.struts.doc/topics/rstrdoc009.html NOTE: If a message is required, this saves the specified key(s) into the request for use to be reported out by struts:errors tag. HTH, Martin- - Original Message - From: Thai Dang Vu [EMAIL PROTECTED] To: user@struts.apache.org Sent: Thursday, July 07, 2005 3:45 PM Subject: Which request is used in automatic Validation when therequirements aren't met? Perhaps I stated it unclearly. I am using automatic validation, not manual validation (which uses validate method of the form bean). If the requirements aren't met, Struts will lead us to the input page (in my case the /WEB-INF/provider/addprovider.jsp) without going to the execute method of the AddProviderAction class. So my question is: is there any place I can interrupt the request before the addprovider.jsp appears and displays the errors (I use html:errors/ in that page)? [EMAIL PROTECTED] 7/7/2005 3:01:34 PM If your input attribute identifies an Action instead of a JSP page, you can do whatever you need to do within that Action. On 7/7/05, Thai Dang Vu [EMAIL PROTECTED] wrote: Hello everybody, This is my action declaration in struts-config.xml action path=/add_provider type=AddProviderAction name=addProviderForm input=/WEB-INF/provider/addprovider.jsp validate=true scope=request /action In addprovider.jsp page, when I click 'Submit' and the requirements aren't met, the request is forwarded to the input (which is /WEB-INF/provider/addprovider.jsp). How and where can I get the request before the input page appears (so that I can put something in the request to make the input displays correctly)? Thanks. - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts-config.xml Digester endElement problem
This is what I think could be causing your problem: !-- == Form Bean Definitions = -- form-beans type = gov.bls.cpi.sms.webApp.SmsForm form-bean name=smsForm type=gov.bls.cpi.sms.webApp.SmsForm /form-bean The type of class you pass for the type of form-beans is different from the one you pass to type of an individual form-bean. You're using the same class for these; that would cause you problems somewhere, and could be what you're seeing now. Hubert - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: dialog stuff (was) Re: Refresher for newbies...
On 7/7/05, Rick Reumann [EMAIL PROTECTED] wrote: (moved to new topic heading, but keeping seem referenceID for those threading).. Michael Jouravlev wrote the following on 7/7/2005 1:40 PM: Ok, Rick, lets pull out and compare :-) But before I go into presenting my approach, could you tell me, what happens in your app when a user clicks Refresh? Or Back? Sure. No problem. It depends on the application. If it's a requirement that data does not get submitted twice I simply use the token approach that is very easy to implement. It doesn't take much at all to ensure duplicate entries do not get entered. Yes, it does not take much. But it is not the best solution. Token works *after* POST request has been resubmitted. It can help to prevent *data resubmission* on business/persisntence layer, but it does nothing to prevent browser message: Do you want to resend POSTDATA? What? What is POSTDATA? I don't care what it is, and I don't know do I want to resend it or not, just show the damn page. The simple send POST, get page approach results in horrible UI, like I had to go through when I was ordering parts for my car. Car make-POST form. Model-POST form. Year-POST form. Suspension part-POST form. Struts (no put intended)-POST form - (looking for Tokico struts, don't see any). Go Back. Do you want to resend POSTDATA? - No - I see the same page. Back again. Do you want to resend POSTDATA? - Yes - The previous page is reloaded with the same POST, running the same query on the server. Same happens three or four more times. I wanted to strangle the programmer who desinged that. Right, if pages were cachable, it would help. Or if I used Opera. But this is only one example of many. In other cases Opera does not help, it gets in the way. Another example. You want to log in. You enter name, it is incorrect, it is redisplayed. Again, and again, and again. You decided to drop the idea, and to return back. How many times you need to click Back? Also, token does knows nothing about your business data. You are shopping in the online store. You selected item, clicked Add to cart, it was added, and you forwarded to another page. Then you realised that you need two of them. You click Back, see the same item again and click Add to cart. Now it tells you that you cannot do this, because you are resubmitting the same request, apparently by mistake. Your webapp can prove it to you, it has the token. But it is not a mistake, you actually want to add the same item again. So, tokens better than nothing, like Yugo comparing to bike. But it is still a Yugo. (I am not selling Lexus here, merely a Corolla). DispatchAction and its subclasses accepts input as form submission only (POST), because it detects input phase or render phase by request type. I think, this is a reasonable limitation. Not true. I pass stuff with a get all the time using a URL. This was a typo, I corrected it in another thread. I meant DialogAction. I need to distinguish between input phase and render phase. I see what you are doing - basically have a generic Action that tells the form to update, delete, etc. Again, I think this is pretty 'cool' but I don't think it is that much of a time saver Rick, I am sorry, but you don't see it (yet). It would be a generic action if it had not have two-phase request processing. I have a SelectAction for what you think it is, just an improved DispatchAction. But DialogAction is much more that an action with predefined handlers. I mean, DialogAction does not have predefined handlers at all (it has default getView() though). CRUDAction has predefined handlers, it is based on DialogAction, thus it has full power of two-phase request processing. and it is definitely a totally different paradigm from all the Struts stuff out there. Is this bad? Not saying it's not a good concept, I'm just stating that is more difficult to grasp at first since it's not how Struts was desgined. Right, so I suggest another way of doing things. I think, a better way. But it is not a replacement for other Struts stuff, this is merely an addition. You are free to mold it however you want and that's the beauty of open source, but I don't see your solution as that much more of a time saver or any easier to understand than the basic approaches. It is easy to understand and to use, once you get the idea, what two-phase processing (aka Redirect-after-Post) is good for. *AND* it allows to build almost fool-proof UI with better user experience. ALSO I will amost GUARANTEE you that in reality you will almost always end up having to do other things when an update/edit/delete takes place... This is just a base CRUDAction, subclass it if you need. But I believe that it is good as it is for 90% cases. Anyway, my version does not differ from other handlers. Data is loaded from the backend by crudForm.crudLoadForUpdate() method. This method has to load existing data either directly into action form or into
Re: embedding forms
The problem could be that getDnaForm() is returning null. See if it makes a difference if getDnaForm() instantiates dnaForm before returning it if it's currently null. Hubert On 7/7/05, Aleksandar Matijaca [EMAIL PROTECTED] wrote: Hi there, I am having a problem, trying to embed one ValidatorForm inside of another --- specifically this is the situation: - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Two Forms, Two Form Beans, One JSP
On 7/7/05, Abdullah Jibaly [EMAIL PROTECTED] wrote: No, I actually meant that Struts will only process and associate one form with the action processing that request, and therefore any validation, etc. So only one html form will get associated with the current ActionForm, even with session scope, although you may have several html forms in that page. It is easy to use several independent HTML forms, if they submit user input to their respective actions, and then redirect to the same page (master page). Master page will be simply reloaded, possibly, with updated form data. Michael. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Re: Fired???? was...Re: Struts Books Recommendations [OT]
Brandon- Keeping in mind that No inductive generalisations can qualify from these premises The last time I checked The price for the aforementioned is pegged at 1c/hour which by my calculations qualifies as 'outsourcing the outsourcers' This is the MSRP ..Your mileage may of course vary depending on your usage habits.. Viel Gluck, M- - Original Message - From: Brandon Goodin [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org; Martin Gainty [EMAIL PROTECTED] Sent: Wednesday, July 06, 2005 8:39 PM Subject: Re: [OT] Re: Fired was...Re: Struts Books Recommendations [OT] Where do you work!? I am going to notify your boss of you disgruntle behavior on this list!!! No wonder why we have H1Bs. They never complain and just take their 2 cents an hour. And I mean that in the best possible way :p ;-) :D Brandon On 7/6/05, Martin Gainty [EMAIL PROTECTED] wrote: Unfortunately in the US you can be canned for being too old or having the wrong religious views we have a ton of laws on the books but they are unenforced My question is how do I (an older engineer with politically incorrect views) get work in Germany Vielen Danke, Martin- - Original Message - From: Christian Bollmeyer [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Wednesday, July 06, 2005 7:31 PM Subject: Re: [OT] Re: Fired was...Re: Struts Books Recommendations [OT] On Wednesday 06 July 2005 19:48, Rick Reumann wrote: Hi, Daniel Perry wrote the following on 7/6/2005 12:49 PM: Hah, it's the business use of web/email they fire you for. Go read your terms of employment, and the reference to IT acceptible use policy that you inadvertantly agreed to. (the below has nothing to do with Mark).. For the record, I'm not against an employer firing an employee for 'whatever' reason they deem fit. If they don't like the way you wear your hair, I think they should have the right to fire you if they want. (The public also has a right to know about it based on the use of the press etc). Now though I'm clearly not in the position to get fired anytime soon, I still think as long as I'm doing my job right and don't blame the company I work for, what I do in my leisure time is not my employer's business. Including my haircut, age, religious beliefs or whatever. What I sell are my skills, work performance and last but not least a significant part of my lifetime, but neither my soul nor my private life. In Germany, it's not quite that easy to get rid of someone who, lets say, just got older because of working for you. And I think this is just. Stealing silver spoons, including deliberately breaking company rules in terms of e-mail usage and the like is another issue. Personally, if I owned a company and someone was using the company email domain name to post on sites such as swingers or transvestitepride, I think I should have right to terminate his or her's employment. What I have a problem with is ... 1) The inconsistency in what is protected. For example everyone today talks about tolerance. But what does this mean? What it ends up meaning is There are no moral absolutes so the only valid belief system protected is one that doesn't espouse moral judgments. But what about being tolerant to the idea that someone might feel otherwise? Why is state sanctioned secularism the only valid religion (and yes secularism is a belief system - a religion). It's sort of funny that those whom often claim to be the most 'tolerant' are often the most vicious when it comes to attacking someone that disagrees with their view of tolerance. There are many views I could state that would get me labeled as being 'intolerant,' yet, somehow it's supposedly not offensive to state All views on X,Y,orZ are equally acceptable. To me, and many others, that later position can be considered extremely offensive. Why is only one view (secular humanism) considered 'non offensive' but other religious views are some how bigoted and intolerant. It's pure hypocrisy. In Germany, in a major part thanks to the US (I mean it!), religious freedom, for instance, is granted to everyone in our Constitutional Law (Art. 4 GG). Getting fired just because of one's religious views is impossible by law. So I, who believes in Jesus Christ as my personal saviour and follows the Bible as his above-all-worldly-wisdom guide can happily work together with Hindus and common atheists, in- cluding my boss. I can even tell them if they're on the road to eternal doom, the same as they may tell me I'm ridiciously wrong, and still keep my job. And in fact, the Bible is quite intolerant when confronted with modern secularism, but what's my choice? As for general opinions and secular beliefs, we have Art. 5 GG which grants freedom of speech. So there's no need for hypocrisy here at all. On the other hand, I definitely never would use a company e-mail address for anything other
Re: Validating nested, indexed properties
What do you mean when you say it doesn't work? I compared your code with something I have that's working and they look pretty much the same. I have a form with a list of employees, and each employee has fields such as birth. The HTML form looks something like this: nested:iterate property=employees nested:text property=birth size=10 maxlength=10/ nested:text property=ssNumber size=9 maxlength=9/ nested:text property=salary size=12/ /TR /nested:iterate Validation rules look like this: field property=birth indexedListProperty=employees depends=required,date arg0 key=employeeform.birth.displayname/ var var-namedatePatternStrict/var-name var-valueMM/dd//var-value /var /field field property=ssNumber indexedListProperty=employees depends=required,integer arg0 key=employeeform.ssnumber.displayname/ /field field property=salary indexedListProperty=employees depends=required,mask arg0 key=employeeform.salary.displayname/ var var-namemask/var-name var-value^\$?\d+(,\d{3})*(\.\d{2})?$/var-value /var /field This app is using Struts 1.2, though. If you want to try it out, it's available at http://www.rabago.net/struts/formdef/dev/nested.war . It's using FormDef (which is a Struts plugin) but FormDef doesn't affect validation, so the same rules apply. Using nested tags also don't affect validation. In fact, you could use plain old HTML tags and still use Validator, as long as you name your fields correctly and/or populate your form beans properly. Hubert On 7/5/05, Kjersti Berg [EMAIL PROTECTED] wrote: Hi I would like to validate some nested, indexed properties on my form. I've googled and found someone having similar problems, but haven't found a solution yet. Any help would be great. The form contains a list of Job objects, each having a set of properties, let's say number and size. I tried to define the validation like this: field property=number indexedListProperty=jobs depends=integer arg0 key=absence.label.unitOfAbsence/ /field field property=size indexedListProperty=jobs depends=integer arg0 key=absence.label.scale/ /field This does not work, although as far as I can tell, this is how the documentation recommends using it. However, in the jsp, the values are collected using the nested tag, not the logic/bean tags. nested:iterate property=jobs nested:text property=number/ nested:text property=size/ /nested:iterate Would this interfere with the validation, or are the two tags identical when it comes to validation? I'm using Struts 1.1. Kjersti - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: execute instead of get and post
On 7/7/05, Rick Reumann [EMAIL PROTECTED] wrote: klute wrote the following on 7/7/2005 3:07 PM: It seems like it would make sense to have both so that you can use GET to set up a particular form and POST to process that form. Instead, I'd have to look at the request to see what was invoked and then conditionally do some processing. No need for conditional process based on GET or POST, you should be either directing control based on either... A) Separate mappings that point to different Action classes /setUpEdit.do /edit.do or B) pass in a dispatch parameter if using a DispatchAction (You can still use separate mappings also if you want also). -- Rick Not quite. POST is generally for data input (form processing). GET is generally for pulling static pages or semi-static result pages or at least for performing idemponent actions. These methods have different semantics. This difference is the cornerstone of approach that I use now [plug skipped]. Michael. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Paging in DisplayTag
Hi, Shud my Action form be in session scope if I want to specify pagesize in display tag for paging.. Because I get the following error: Error 500: Cannot find bean storeForm in any scope Thanks, Phani. __ Do you Yahoo!? Yahoo! Mail - You care about security. So do we. http://promotions.yahoo.com/new_mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: embedding forms
Wouldn't that give me a null-pointer exception?? I will give it a try, and let you kow! Thanks for the response, Alex. On 7/7/05, Hubert Rabago [EMAIL PROTECTED] wrote: The problem could be that getDnaForm() is returning null. See if it makes a difference if getDnaForm() instantiates dnaForm before returning it if it's currently null. Hubert On 7/7/05, Aleksandar Matijaca [EMAIL PROTECTED] wrote: Hi there, I am having a problem, trying to embed one ValidatorForm inside of another --- specifically this is the situation: - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Using struts forms as Value Objects: your opinion?
Hi, I'm currently designing and developping an enterprise J2EE application based on Struts. In this application there's a layer of Data Access Object which abstract the underlying persistent storage. For populating my struts' *Form I've imagined first a transfert between forms and DAO based on Value Object, associated with helper classes for translating from one type to another. And I realized that struts Form can be in some situations quite good transfert objects, and by doing so we economize development of both helper classes and VO classes. What do you thing about using forms as VO? Do you think it's a dirty solution? Forms are often mirrors of the database's table. Thank you for your opinion. Vincent. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using struts forms as Value Objects: your opinion?
You said it would be an enterprise j2ee application, right? So there is a chance it would be distributed once? In this case using ActionForms as VO is an absolute NO GO ! Besides, if you want a clear architectural separation of layers its a NO GO also! The VO Objects are parts of your business logic interface (I hope you have one) and ActionForm have nothing to do with business logic or, even worse, DAOs. A typical enterprise architecture is 3 layered: Presentation with Actions / ActionForms / jsps Business with business interfaces and VOs or DTOs (name it as you like it) Persistence with DAOs And, from practical experience, your Forms may seem to be mirrors of the database at the beginning, but this will change as soon as your application start to live (Think about collections for drop-downs for example). Regards Leon -Ursprüngliche Nachricht- Von: news [mailto:[EMAIL PROTECTED] Im Auftrag von Vincent Gesendet: Freitag, 8. Juli 2005 01:15 An: user@struts.apache.org Betreff: Using struts forms as Value Objects: your opinion? Hi, I'm currently designing and developping an enterprise J2EE application based on Struts. In this application there's a layer of Data Access Object which abstract the underlying persistent storage. For populating my struts' *Form I've imagined first a transfert between forms and DAO based on Value Object, associated with helper classes for translating from one type to another. And I realized that struts Form can be in some situations quite good transfert objects, and by doing so we economize development of both helper classes and VO classes. What do you thing about using forms as VO? Do you think it's a dirty solution? Forms are often mirrors of the database's table. Thank you for your opinion. Vincent. - 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]
Re: Using struts forms as Value Objects: your opinion?
You said it would be an enterprise j2ee application, right? So there is a chance it would be distributed once? In this case using ActionForms as VO is an absolute NO GO ! Besides, if you want a clear architectural separation of layers its a NO GO also! The VO Objects are parts of your business logic interface (I hope you have one) and ActionForm have nothing to do with business logic or, even worse, DAOs. A typical enterprise architecture is 3 layered: Presentation with Actions / ActionForms / jsps Business with business interfaces and VOs or DTOs (name it as you like it) Persistence with DAOs And, from practical experience, your Forms may seem to be mirrors of the database at the beginning, but this will change as soon as your application start to live (Think about collections for drop-downs for example). Regards Leon -Ursprüngliche Nachricht- Von: news [mailto:[EMAIL PROTECTED] Im Auftrag von Vincent Gesendet: Freitag, 8. Juli 2005 01:15 An: user@struts.apache.org Betreff: Using struts forms as Value Objects: your opinion? Hi, I'm currently designing and developping an enterprise J2EE application based on Struts. In this application there's a layer of Data Access Object which abstract the underlying persistent storage. For populating my struts' *Form I've imagined first a transfert between forms and DAO based on Value Object, associated with helper classes for translating from one type to another. And I realized that struts Form can be in some situations quite good transfert objects, and by doing so we economize development of both helper classes and VO classes. What do you thing about using forms as VO? Do you think it's a dirty solution? Forms are often mirrors of the database's table. Thank you for your opinion. Vincent. - 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]
Re: Using struts forms as Value Objects: your opinion?
An alternative would be to have your form class extend your value object class. However, this approach doesn't work for me. My form class fields are always Strings (because of HTTP), while my value object fields are whatever types make sense (such as Date). I always have value object classes that look very similar to my forms, but the types vary. It doesn't bother me. Check out Jakarta BeanUtils for auto-conversion of field data between form class and value object class. Erik -Original Message- From: Vincent [EMAIL PROTECTED] Sent: Jul 7, 2005 7:15 PM To: user@struts.apache.org Subject: Using struts forms as Value Objects: your opinion? Hi, I'm currently designing and developping an enterprise J2EE application based on Struts. In this application there's a layer of Data Access Object which abstract the underlying persistent storage. For populating my struts' *Form I've imagined first a transfert between forms and DAO based on Value Object, associated with helper classes for translating from one type to another. And I realized that struts Form can be in some situations quite good transfert objects, and by doing so we economize development of both helper classes and VO classes. What do you thing about using forms as VO? Do you think it's a dirty solution? Forms are often mirrors of the database's table. Thank you for your opinion. Vincent. - 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]
Re: Using struts forms as Value Objects: your opinion?
Also you could economize your development by using Struts Dyna-flavored forms (generated from xml) instead of writing your own form classes. Instead, I use a class I wrote that scans a properties file which has a comma-separated list of fields and their types, and some other data such as desired class name, default access modifier, etc. The class produces source files with typed fields (or an all-String version if I'm making a form class) and all the getters and setters. Saves all that unnecessary typing. All I do is write a properties file for each form and/or value object class I want. You can go a step further and create value object classes based on database metadata . . . Erik -Original Message- From: [EMAIL PROTECTED] Sent: Jul 7, 2005 7:33 PM To: Struts Users Mailing List user@struts.apache.org Subject: Re: Using struts forms as Value Objects: your opinion? An alternative would be to have your form class extend your value object class. However, this approach doesn't work for me. My form class fields are always Strings (because of HTTP), while my value object fields are whatever types make sense (such as Date). I always have value object classes that look very similar to my forms, but the types vary. It doesn't bother me. Check out Jakarta BeanUtils for auto-conversion of field data between form class and value object class. Erik -Original Message- From: Vincent [EMAIL PROTECTED] Sent: Jul 7, 2005 7:15 PM To: user@struts.apache.org Subject: Using struts forms as Value Objects: your opinion? Hi, I'm currently designing and developping an enterprise J2EE application based on Struts. In this application there's a layer of Data Access Object which abstract the underlying persistent storage. For populating my struts' *Form I've imagined first a transfert between forms and DAO based on Value Object, associated with helper classes for translating from one type to another. And I realized that struts Form can be in some situations quite good transfert objects, and by doing so we economize development of both helper classes and VO classes. What do you thing about using forms as VO? Do you think it's a dirty solution? Forms are often mirrors of the database's table. Thank you for your opinion. Vincent. - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using struts forms as Value Objects: your opinion?
On 7/7/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: An alternative would be to have your form class extend your value object class. However, this approach doesn't work for me. My form class fields are always Strings (because of HTTP), while my value object fields are whatever types make sense (such as Date). I always have value object classes that look very similar to my forms, but the types vary. It doesn't bother me. What is the point of having strong typed VOs? They are neither BOs (no behavior), nor actionforms. Why not to use BOs directly? Someone is going to check for business rules, why not to do it while data is still on web layer? Can save on call to backend. It seem to be a religious argument, and different approaches are good for different situations, but *generally* I would think that using BOs directly is easier and faster. One can say that app can evolve. BOs can evolve one way, and UI another way. Well, then create another BO instead of creating another VO. What is the difference? I will have several BOs working with more or less same data. How bad is that? Oh, right, I have to update web layer. As if one does not have to update web layer, when one modifies VOs. Ultimately all goes to database anyway. Michael. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: embedding forms
Hubert, that is EXACTLY what was wrong -- you were 100% correct! I guess, sometimes, it just takes 'another eye' to see things properly.. Cheers, Alex. On 7/7/05, Aleksandar Matijaca [EMAIL PROTECTED] wrote: Wouldn't that give me a null-pointer exception?? I will give it a try, and let you kow! Thanks for the response, Alex. On 7/7/05, Hubert Rabago [EMAIL PROTECTED] wrote: The problem could be that getDnaForm() is returning null. See if it makes a difference if getDnaForm() instantiates dnaForm before returning it if it's currently null. Hubert On 7/7/05, Aleksandar Matijaca [EMAIL PROTECTED] wrote: Hi there, I am having a problem, trying to embed one ValidatorForm inside of another --- specifically this is the situation: - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using struts forms as Value Objects: your opinion?
I usually build my ActionForm classes with the VO on it as a property. The String properties can be just refered to as bean.property on the jsp. Any non-string properties I map to the bean in the action form, with the translation - so if there is a date, for instance, the property on the action form might be someDate, and in it's setter, i store the string, parse it using a dateformat object, and store it into the bean if it is a valid format. If the format is bad, i keep the string for display back to the user. That way, by the time the action gets the form the bean has all the properties and the types are correct. Larry On 7/7/05, Vincent [EMAIL PROTECTED] wrote: Hi, I'm currently designing and developping an enterprise J2EE application based on Struts. In this application there's a layer of Data Access Object which abstract the underlying persistent storage. For populating my struts' *Form I've imagined first a transfert between forms and DAO based on Value Object, associated with helper classes for translating from one type to another. And I realized that struts Form can be in some situations quite good transfert objects, and by doing so we economize development of both helper classes and VO classes. What do you thing about using forms as VO? Do you think it's a dirty solution? Forms are often mirrors of the database's table. Thank you for your opinion. Vincent. - 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]
Fw: Re: Using struts forms as Value Objects: your opinion?
Sorry, Michael, I accidentally sent this directly to you . . . I'm not sure why you say save a call to the backend unless by backend you mean anything outside of the web tier. In my applications, it would typically save a call to the manager layer, which I consider the middle, not the backend. It would not typically save a call to the persistence layer -- the backend -- as managers usually don't need to access a persistent store to perform manager-layer validation (I suppose there are exceptions). So, different layer, as you say, but same VM usually. For a much-distributed application, I could see the argument about saving the call to any other layer, but, I would need another solution for that problem, such as a local manager. I don't typically have any classes that resemble what you are describing as a business object. I typically have managers, value objects, helper objects (mini-managers if you will), and data access objects. Value objects are the only ones that cross tier boundaries, and they are completely dumb. This creates weak coupling, which I prefer. I don't recall having any business object classes that had the same fields as value objects plus business logic. I suppose back when I was writing entity beans there might have been some. Now, I have managers which operate on the other object types. Business logic is in the managers. Data is elsewhere (generally). Erik -Original Message- From: Michael Jouravlev [EMAIL PROTECTED] Sent: Jul 7, 2005 8:16 PM To: Struts Users Mailing List user@struts.apache.org, [EMAIL PROTECTED] Subject: Re: Using struts forms as Value Objects: your opinion? On 7/7/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: An alternative would be to have your form class extend your value object class. However, this approach doesn't work for me. My form class fields are always Strings (because of HTTP), while my value object fields are whatever types make sense (such as Date). I always have value object classes that look very similar to my forms, but the types vary. It doesn't bother me. What is the point of having strong typed VOs? They are neither BOs (no behavior), nor actionforms. Why not to use BOs directly? Someone is going to check for business rules, why not to do it while data is still on web layer? Can save on call to backend. It seem to be a religious argument, and different approaches are good for different situations, but *generally* I would think that using BOs directly is easier and faster. One can say that app can evolve. BOs can evolve one way, and UI another way. Well, then create another BO instead of creating another VO. What is the difference? I will have several BOs working with more or less same data. How bad is that? Oh, right, I have to update web layer. As if one does not have to update web layer, when one modifies VOs. Ultimately all goes to database anyway. Michael. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Refresher for newbies (part 2)
Thanks Rick for the example. It has really helped me as I am certainly a noob. I'd love it if you (or anyone) could clarify something for me. Firstly, some basic info on my system: I have system wide settings including an SMTP server and a list of users that can access the system. These are stored in a SystemSettings class. I took your advice and used a DispatchAction for system-related updates. I called it SystemAction. It contains 2 methods: setUpForEdit() and edit(). My related form bean contains a dispatch property which defaults to setUpForEdit. This seems to work fine. My system configuration JSP lists users in a select box. Your example lists users as static text with an edit link for each user. This allows you to use c:url to figure include the user ID. However, I have one edit link next to my select box. I understand I have to use javascript to set the user ID and then submit / forward to my user JSP. My questions are: 1. Is there some standard way of handling this with struts / other tag libraries? 2. Assuming not, I would like to develop my own (I will have a lot of select boxes with add / edit / delete links alongside them in my application). Would this be possible, given the reliance on embedding javascript and knowing what parameters to pass to the target page? I know these are kind of general questions but I'm finding it hard to be more specific since I am such a noob. Hopefully you'll be able to confirm that what I'm attempting to do is fairly common and maybe point me in the right direction. Thanks, Kent -Original Message- From: Rick Reumann [mailto:[EMAIL PROTECTED] Sent: Friday, 8 July 2005 1:45 AM To: Struts Users Mailing List Subject: Re: Refresher for newbies (part 2) After reading the initial newbie post, you then might come across a situation where you need to have some things like lists on the page that aren't related to your ActionForm. For example, in the User example just given, imagine you need the person using the form to select a Department that the user belongs in. You thus need a way to make sure that a List of department is available on the page for the user to select from. Now before we get a ton of responses about how here's why I came up with this for Struts, and here's my solution..., I understand that many of the ideas that many of you have come up with our very ingenious and very practical once you understand the framework. I believe, however, for someone new to Struts that it's better to Keep Things Simple and keep things fairly consistent with what they are used to. For this reason I suggest you do things this way In your DispatchAction simply provide a prep( HtttpServletRequest request) method. In there you simply do any preparation of things your form might need. *NOTE* *NOTE* NOTE*: This is NOT, NOT, NOT where you do things like populate the form with user information etc. This is only where you would do things like provide lists for drop down so they are in scope. The next more advanced question is well what happens if you are using validation and validation fails, how are these going to be in scope? I believe the answer is quite simple... just call validate from your Action class versus relying on Struts to call it based on your struts config setting! I have more on this here http://www.reumann.net/struts/articles/request_lists.jsp The benefit to the prep() and the calling validate manually is everything is quite simple... you are using a standard DispatchAction which is easy for people to understand PLUS everything is all in one place. When dealing with editing Users you can look in your UserDispatchAction and see what's going on. No need to look at a bunch of xml config settings, AspectJ inserts, or some other hidden stuff. Granted yes, the newer frameworks handle all of this more gracefully, but the problem is not that big of a deal with Struts. I've written some pretty complex applications and the above has been working fine and it becomes so simple to do. -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Two Forms, Two Form Beans, One JSP
Ah, I think I get ya. Why don't you just make one great big form block containing both areas and any other non-form content inside? There's no restrictions on what can go in a form, so you can put your entire page into form if you want. - M Michael Taylor TXE Systems, Inc. [EMAIL PROTECTED] Abdullah Jibaly wrote: No, I actually meant that Struts will only process and associate one form with the action processing that request, and therefore any validation, etc. So only one html form will get associated with the current ActionForm, even with session scope, although you may have several html forms in that page. Regards, Abdullah -Original Message- From: Michael Taylor [mailto:[EMAIL PROTECTED] Sent: Thursday, July 07, 2005 1:02 PM To: Struts Users Mailing List Cc: Andrew Tomaka Subject: Re: Two Forms, Two Form Beans, One JSP You can have multiple forms on the same page. I am using Tiles. I put some forms in the header/footer and they work just fine. I had to use different actions for the two forms, and I had to use session scope for one of them in order to retain state for it. Request scope is the reason for the one-form limit you are suggesting, right? Michael Taylor TXE Systems, Inc. [EMAIL PROTECTED] Abdullah Jibaly wrote: To simplify your code, I would have one ActionForm, and one processing action. Depending on which submit button or whatever is pressed I'd redirect to the correct page. By the way you can only have one struts action form per action and per jsp page. Regards, Abdullah -Original Message- From: Andrew Tomaka [mailto:[EMAIL PROTECTED] Sent: Thursday, July 07, 2005 9:26 AM To: user@struts.apache.org Subject: Two Forms, Two Form Beans, One JSP Hey all, I'm attempting to create a JSP that is made up of two forms. Each form needs a different form bean and is processed by a different action. The catch is that the first form returns back to the JSP and the action responsible for this needs the name attribute set to the Form Bean of the first form. When the JSP is loaded after the processing of the first form, both the form tags are assigned the name of the first Form Bean. Is it possible to assign Form Beans to a form instead of assigning them to an action? Thanks, ~ Andrew Tomaka - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Which request is used in automatic Validation when the requirements aren't met?
Thai Dang Vu wrote: Perhaps I stated it unclearly. I am using automatic validation, not manual validation (which uses validate method of the form bean). If the requirements aren't met, Struts will lead us to the input page (in my case the /WEB-INF/provider/addprovider.jsp) without going to the execute method of the AddProviderAction class. So my question is: is there any place I can interrupt the request before the addprovider.jsp appears and displays the errors (I use html:errors/ in that page)? You weren't unclear, but Jeff's response was correct. He pointed out that your input can be an action, which can then do whatever you need, instead of a JSP. You just need to change your action mapping so the 'input' attribute names the mapping for your AddProviderAction rather than pointing at a JSP directly. L. -- Laurie, Open Source advocate, Java geek and novice blogger: http://www.holoweb.net/~laurie/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: execute instead of get and post
Michael Jouravlev wrote the following on 7/7/2005 5:26 PM: On 7/7/05, Rick Reumann [EMAIL PROTECTED] wrote: klute wrote the following on 7/7/2005 3:07 PM: It seems like it would make sense to have both so that you can use GET to set up a particular form and POST to process that form. Instead, I'd have to look at the request to see what was invoked and then conditionally do some processing. No need for conditional process based on GET or POST, you should be either directing control based on either... A) Separate mappings that point to different Action classes /setUpEdit.do /edit.do or B) pass in a dispatch parameter if using a DispatchAction (You can still use separate mappings also if you want also). -- Rick Not quite. POST is generally for data input (form processing). GET is generally for pulling static pages or semi-static result pages or at least for performing idemponent actions. These methods have different semantics. This difference is the cornerstone of approach that I use now [plug skipped]. My only point is that klute doesn't really need to worry about whether it's a GET or POST in order to process what he needs if he does things in a conventionaly way. He shouldn't be using the same entry semantics for going to a 'setup' vs 'a true edit' - that's just silly and would make it extremely difficult for someone working on the code to even firgure out what's going on. Just create some meaninful action mapping names and/or dispatch method names and all is well and he won't have to worry about GET vs POST. -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]