Re: Problem with the forward attribute in action
I didn't even know it was possible to do it the first way you show (I've always done it using #2). That would sure simplify things if #1 is possible - I want to know the answer too! Matt On Feb 3, 2004, at 6:33 PM, Narayanan, Sunitha wrote: Hi, I downloaded today's build of Struts 1.2 (Feb 3). While defining an action mapping in the struts-config.xml action path=/login forward=site.login.page / Gives me an error No action instance for path /login. [java] ERROR (RequestProcessor.java:327) - No action instance for path /lo gin could be created But when I specify it like this - action path=/login type=org.apache.struts.actions.ForwardAction parameter=site.login.page / It works fine. The method of only specifying forward attribute has worked in the past with struts 1.1 and also is shown as an example in the struts documentation. Can u let me know if something has changed? Thanks, Sunitha - 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: What does do stand for in .do files
Yes, you can use any extension you like. I'm currently using .cfm to integrate a Struts app into a Cold Fusion website. Matt On Jan 31, 2004, at 6:15 PM, Otávio Augusto wrote: So, just to complement the discussion, is it possible to use any other extension rather than .do? Changing it in the web.xml file makes that possible? Thanks Otávio Augusto On Sat, 31 Jan 2004 00:38:03 -0800 Craig R. McClanahan [EMAIL PROTECTED] wrote: Quoting Gopalakrishnan, Jayesh [EMAIL PROTECTED]: The do is insignificant, its just what all the sample applications use and has somehow stayed on. In the technical sense (could I use foo instead of do) you are absolutely right ... there is no intrinsic meaning to do. However, for native speakers of English, do has a natural connotation of 'go DO something that I wanted to pick up on, so that was my choice for the example mappings for the Struts controller servlet. Craig McClanahan PS: Being constructively lazy, it's also very easy to type :-). - 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: generating tables in Struts
The export/tiles issue has been fixed - you just needd to specify a filter in your web.xml. http://displaytag.sourceforge.net/install.html If you need to export data from an included JSP page, such as from Struts, you should configure the ResponseOverrideFilter in your web.xml. (You do not need the filter if you do not use exports, or if you do not use the table tag from a jsp page that is included inside of another page.) Configure the Filter in your web.xml: filter filter-nameResponseOverrideFilter/filter-name filter-classorg.displaytag.filter.ResponseOverrideFilter/filter-class /filter And add mappings for the pages that you will intercept, for example: filter-mapping filter-nameResponseOverrideFilter/filter-name url-pattern*.do/url-pattern /filter-mapping filter-mapping filter-nameResponseOverrideFilter/filter-name url-pattern*.jsp/url-pattern /filter-mapping It's been broken in CVS for the past couple of weeks, but I just fixed it today. You'll have to download and built it to get the latest fixes. For #2, you could use JavaScript to grab the table and add links to the column titles that submit your form. I've done this and it works fairly well - although in the end I decided the table didn't need any sorting. HTH, Matt -Original Message- From: lixin chu [mailto:[EMAIL PROTECTED] Sent: Friday, January 23, 2004 6:43 PM To: [EMAIL PROTECTED] Subject: generating tables in Struts Hi, I found the Display Tag which is really nice. However, it has a couple of problems: 1. 'export' display data in the Tile not exporting to a file - w/o Tiles it is fine. 2. I need a column of Checkbox, but the status is not kept after sorting. Does anyone know if there is another package handling the table in struts+Tiles with similar functionalities but supporting checkbox ? thanks li xin __ Do you Yahoo!? Yahoo! SiteBuilder - Free web site building tool. Try it! http://webhosting.yahoo.com/ps/sb/ - 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: Unit Test in struts
I use a fair amount of JavaScript in my apps, and what I've found is that the best thing to do is this: Write your app so it can be tested (and used) with JavaScript turned off. Works for me! Matt -Original Message- From: Edgar P Dollin [mailto:[EMAIL PROTECTED] Sent: Thursday, January 22, 2004 5:49 AM To: Struts Users Mailing List Subject: RE: Unit Test in struts I have spent a fair amount of time with WebTest and HttpUnit. The major issues with both of these are JavaScript related. For example if you use JavaScript to populate select lists or html objects they are not available in WebTest or HttpUnit (HttpUnit is a little better since you have finer grained control). How does jWebUnit compare? Thanks. Edgar -Original Message- From: Richard Hightower [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 21, 2004 4:26 PM To: Struts Users Mailing List Subject: RE: Unit Test in struts you should try jWebUnit. i like it a lot. --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.558 / Virus Database: 350 - Release Date: 1/2/2004 - 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-Menu (Support URL Re-writing)
Sounds complicated. I don't use struts-layout so I don't know that I'm that interested in *fixing* struts-menu so it works with it. Maybe you should check with them and see why they don't support the latest struts-menu - and why they care what version of struts-menu you're using? Matt -Original Message- From: Parag Pattewar [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 21, 2004 9:24 PM To: Struts Users Mailing List Cc: [EMAIL PROTECTED] Subject: RE: Struts-Menu (Support URL Re-writing) Hi Matt I am using JDK1.4 and Struts-Menu1.1. I tried to do the same thing with struts-menu2.1 , but as I am using struts-layout1.1 its not supporting struts-menu2.1 Can you help me to get the compatible version of Struts-Layout2.1 and struts-menu2.1.Which will support the action and forward attribute for the menu and item. Thanks Parag -Original Message- From: Matt Raible [mailto:H Sent: Tuesday, January 20, 2004 7:32 PM To: 'Struts Users Mailing List' Subject: RE: Struts-Menu (Support URL Re-writing) I need to know a couple things to help you with this problem. 1. What version of Struts Menu are you using? 2. Which displayer are you using? Also, knowing what platform (OS) and JDK version you're using can't hurt. Matt -Original Message- From: Parag Pattewar [mailto:[EMAIL PROTECTED] Sent: Monday, January 19, 2004 10:34 PM To: Struts Users Mailing List Cc: [EMAIL PROTECTED] Subject: RE: Struts-Menu (Support URL Re-writing) Hi If I change below location attribute to action attribute for Menu as well as from Item then For menu link I am getting http://localhost:8080/cust/null/expandedMenu=CsrAccountInformation and For Item link I am getting http://localhost:8080/cust/null instead of http://localhost:8080/cust/personalDataLoad?expandedMenu=CsrAc countInformati on Menu name=CsrAcctInfo title= action=/accountinfoview Item name=AcctCon title=Contact action=/personalDataLoad?expandedMenu=CsrAccountInformation/ Item name=ClsAcct title=Close action=/closeAccountPageRouter?expandedMenu=CsrAccountInformation/ /Menu Why this null is coming, is it coming bacause of some path problem. I checked the entry of /accountinfoview and all actions mentioned above in my struts-config.xml, the entries are there. Thanks in advance for the Help. Regards Parag -Original Message- From: Matt Raible [mailto:[EMAIL PROTECTED] Sent: Saturday, January 17, 2004 9:20 PM To: 'Struts Users Mailing List' Subject: RE: Struts-Menu (Support URL Re-writing) Change the location attribute to a action attribute, where the value of action matches the path of your action mapping. For example: Menu name=CsrAccountInformation title= action=/accountinfoview If you are using 2.0, this should work. If it doesn't, let me know what displayer you're using and I'll fix it. Matt -Original Message- From: Parag Pattewar [mailto:[EMAIL PROTECTED] Sent: Saturday, January 17, 2004 12:05 AM To: Matt Raible; 'Struts Users Mailing List' Subject: RE: Struts-Menu (Support URL Re-writing) Hi I am having previous implementation of struts-menu as below Menu name=CsrAccountInformation title= location=accountinfoview.do Item name=act title=Con location=personaldtd.do?expMenu=AcctInfo/ Item name=cas title=Clo Acct location=clsRouter.do?expMenu=AcctInfo/ /Menu I have changed it as below, is it the correct way of using action and forward attributes in struts-menu. Menu name=CsrAccountInformation title= location=accountinfoview.do Item name=act title=Con action=personaldtd.do?expMenu=AcctInfo/ Item name=cas title=Clo Acct forward=clsRouter.do?expMenu=AcctInfo/ /Menu -Original Message- From: Matt Raible [mailto:[EMAIL PROTECTED] Sent: Friday, January 16, 2004 8:44 PM To: 'Struts Users Mailing List'; 'Parag Pattewar' Subject: RE: Struts-Menu (Support URL Re-writing) Struts Menu makes use of Struts classes to support forward and action attributes. If you use those, you'll likely get the re-writing you're looking for. I did this on a previous project and did find that the forward attribute worked, but not the action attribute. I believe this is a bug in Struts since it should do rewriting when looking up an Action's path. The one issue with re-writing is that if you're using a menu that matches URLs (i.e. tabbed-menu) - they probably won't get matched up. At a previous project, we were using URLs to highlight the current page we were on and we found that we had to use the action attribute or the page attribute so that the jsessionid wasn't
RE: Struts-Menu (Support URL Re-writing)
I need to know a couple things to help you with this problem. 1. What version of Struts Menu are you using? 2. Which displayer are you using? Also, knowing what platform (OS) and JDK version you're using can't hurt. Matt -Original Message- From: Parag Pattewar [mailto:[EMAIL PROTECTED] Sent: Monday, January 19, 2004 10:34 PM To: Struts Users Mailing List Cc: [EMAIL PROTECTED] Subject: RE: Struts-Menu (Support URL Re-writing) Hi If I change below location attribute to action attribute for Menu as well as from Item then For menu link I am getting http://localhost:8080/cust/null/expandedMenu=CsrAccountInformation and For Item link I am getting http://localhost:8080/cust/null instead of http://localhost:8080/cust/personalDataLoad?expandedMenu=CsrAc countInformati on Menu name=CsrAcctInfo title= action=/accountinfoview Item name=AcctCon title=Contact action=/personalDataLoad?expandedMenu=CsrAccountInformation/ Item name=ClsAcct title=Close action=/closeAccountPageRouter?expandedMenu=CsrAccountInformation/ /Menu Why this null is coming, is it coming bacause of some path problem. I checked the entry of /accountinfoview and all actions mentioned above in my struts-config.xml, the entries are there. Thanks in advance for the Help. Regards Parag -Original Message- From: Matt Raible [mailto:[EMAIL PROTECTED] Sent: Saturday, January 17, 2004 9:20 PM To: 'Struts Users Mailing List' Subject: RE: Struts-Menu (Support URL Re-writing) Change the location attribute to a action attribute, where the value of action matches the path of your action mapping. For example: Menu name=CsrAccountInformation title= action=/accountinfoview If you are using 2.0, this should work. If it doesn't, let me know what displayer you're using and I'll fix it. Matt -Original Message- From: Parag Pattewar [mailto:[EMAIL PROTECTED] Sent: Saturday, January 17, 2004 12:05 AM To: Matt Raible; 'Struts Users Mailing List' Subject: RE: Struts-Menu (Support URL Re-writing) Hi I am having previous implementation of struts-menu as below Menu name=CsrAccountInformation title= location=accountinfoview.do Item name=act title=Con location=personaldtd.do?expMenu=AcctInfo/ Item name=cas title=Clo Acct location=clsRouter.do?expMenu=AcctInfo/ /Menu I have changed it as below, is it the correct way of using action and forward attributes in struts-menu. Menu name=CsrAccountInformation title= location=accountinfoview.do Item name=act title=Con action=personaldtd.do?expMenu=AcctInfo/ Item name=cas title=Clo Acct forward=clsRouter.do?expMenu=AcctInfo/ /Menu -Original Message- From: Matt Raible [mailto:[EMAIL PROTECTED] Sent: Friday, January 16, 2004 8:44 PM To: 'Struts Users Mailing List'; 'Parag Pattewar' Subject: RE: Struts-Menu (Support URL Re-writing) Struts Menu makes use of Struts classes to support forward and action attributes. If you use those, you'll likely get the re-writing you're looking for. I did this on a previous project and did find that the forward attribute worked, but not the action attribute. I believe this is a bug in Struts since it should do rewriting when looking up an Action's path. The one issue with re-writing is that if you're using a menu that matches URLs (i.e. tabbed-menu) - they probably won't get matched up. At a previous project, we were using URLs to highlight the current page we were on and we found that we had to use the action attribute or the page attribute so that the jsessionid wasn't appended. Of course, we could've stripped this off in our Velocity template, but we wen't with the quick, less-logic, way. To see this project, go to http://telluride.resortquest.com and drill down a bit. The menu with highlight is on the right. BTW, this site uses the Velocity displayer for both the top menu and the side menu. If you're not familiar with struts-menu, checkout the demo at http://raibledesigns.com/struts-menu. Matt -Original Message- From: Edgar P Dollin [mailto:[EMAIL PROTECTED] Sent: Friday, January 16, 2004 7:54 AM To: 'Parag Pattewar'; [EMAIL PROTECTED] Subject: RE: Struts-Menu (Support URL Re-writing) You have the source to struts and the source to struts-menu, grab the code from struts and plug it into struts-menu and submit a patch. You might need a menu-config.xml option to indicate that you will be url rewriting. Edgar -Original Message- From: Parag Pattewar [mailto:[EMAIL PROTECTED] Sent: Friday, January 16, 2004 7:21 AM To: [EMAIL PROTECTED] Subject: Struts-Menu (Support URL Re-writing) Hi all How do I
RE: Problem - Trying to hide javascript files in WEB-INF
Anything that the client will access, i.e. .js or .css files via href attributes needs to be exposed to them. I usually put my scripts in a scripts folder and my stylesheets in a styles folder. -Original Message- From: Colin Foulkes [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 20, 2004 2:12 PM To: [EMAIL PROTECTED] Subject: Problem - Trying to hide javascript files in WEB-INF Hi, I'm quite new to Open source and Struts I'm trying to convert some Microsoft asp.net pages to a struts/apache environment; and following advice on the newgroup, have hidden my .jsp pages in directories beneath /WEB-INF. However, I have some pages that include script tags for loading javascript files. When I place the .js files under the WEB-INF directory they are not accessible to my page. The jsp page contains... script src=/WEB-INF/scripts/XXX.js The output window for local host access (under netbeans ide) shows the following... GET /WEB-INF/scripts/XXX.js HTTP/1.1 404 720 If I move the scripts directory out from under WEB-INF, the page loads fine, the log shows the following GET /scripts/XXX.js HTTP/1.1 304 - Is there a way to do this? To hide javascript files under WEB-INF and access them from the jsp pages? Thanks in advance, Colin - 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: Problem - Trying to hide javascript files in WEB-INF
You could include it (jsp:include), but then you'd lose the browser's ability to cache the script and you'd end up with a bunch of JavaScript in your page. The best practice is to put your scripts in a place where browsers can get at them. If, for some reason, you don't want folks looking at your script - there's probably something you need to remove. Matt -Original Message- From: Colin Foulkes [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 20, 2004 2:21 PM To: Struts Users Mailing List Subject: RE: Problem - Trying to hide javascript files in WEB-INF Yes, I understand what's happening, but I'm not sure whether there is an alternative approach to placing the .js content into the jsp at the server side. Thanks Colin -Original Message- From: Matt Raible [mailto:[EMAIL PROTECTED] Sent: January 20, 2004 3:15 PM To: 'Struts Users Mailing List' Subject: RE: Problem - Trying to hide javascript files in WEB-INF Anything that the client will access, i.e. .js or .css files via href attributes needs to be exposed to them. I usually put my scripts in a scripts folder and my stylesheets in a styles folder. -Original Message- From: Colin Foulkes [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 20, 2004 2:12 PM To: [EMAIL PROTECTED] Subject: Problem - Trying to hide javascript files in WEB-INF Hi, I'm quite new to Open source and Struts I'm trying to convert some Microsoft asp.net pages to a struts/apache environment; and following advice on the newgroup, have hidden my .jsp pages in directories beneath /WEB-INF. However, I have some pages that include script tags for loading javascript files. When I place the .js files under the WEB-INF directory they are not accessible to my page. The jsp page contains... script src=/WEB-INF/scripts/XXX.js The output window for local host access (under netbeans ide) shows the following... GET /WEB-INF/scripts/XXX.js HTTP/1.1 404 720 If I move the scripts directory out from under WEB-INF, the page loads fine, the log shows the following GET /scripts/XXX.js HTTP/1.1 304 - Is there a way to do this? To hide javascript files under WEB-INF and access them from the jsp pages? Thanks in advance, Colin - 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: Struts-Menu (Support URL Re-writing)
Struts Menu 2.0 and above. What version of Struts Menu are you using? Feel free to subscribe to the struts-menu mailing list and move this discussion over there. http://lists.sourceforge.net/lists/listinfo/struts-menu-user Or use the forums: http://sourceforge.net/forum/?group_id=48726 Matt -Original Message- From: Parag Pattewar [mailto:[EMAIL PROTECTED] Sent: Sunday, January 18, 2004 9:37 PM To: Struts Users Mailing List Cc: [EMAIL PROTECTED] Subject: RE: Struts-Menu (Support URL Re-writing) Hi I tried to change the location attribute to forward or Action, its not supporting because the struts version we are using is 1.1 and as you have mentioned to use struts 2.0 and above. How do I make change, so struts 1.1 should support URL Rewriting. Regards Parag -Original Message- From: Matt Raible [mailto:[EMAIL PROTECTED] Sent: Saturday, January 17, 2004 9:20 PM To: 'Struts Users Mailing List' Subject: RE: Struts-Menu (Support URL Re-writing) Change the location attribute to a action attribute, where the value of action matches the path of your action mapping. For example: Menu name=CsrAccountInformation title= action=/accountinfoview If you are using 2.0, this should work. If it doesn't, let me know what displayer you're using and I'll fix it. Matt -Original Message- From: Parag Pattewar [mailto:[EMAIL PROTECTED] Sent: Saturday, January 17, 2004 12:05 AM To: Matt Raible; 'Struts Users Mailing List' Subject: RE: Struts-Menu (Support URL Re-writing) Hi I am having previous implementation of struts-menu as below Menu name=CsrAccountInformation title= location=accountinfoview.do Item name=act title=Con location=personaldtd.do?expMenu=AcctInfo/ Item name=cas title=Clo Acct location=clsRouter.do?expMenu=AcctInfo/ /Menu I have changed it as below, is it the correct way of using action and forward attributes in struts-menu. Menu name=CsrAccountInformation title= location=accountinfoview.do Item name=act title=Con action=personaldtd.do?expMenu=AcctInfo/ Item name=cas title=Clo Acct forward=clsRouter.do?expMenu=AcctInfo/ /Menu -Original Message- From: Matt Raible [mailto:[EMAIL PROTECTED] Sent: Friday, January 16, 2004 8:44 PM To: 'Struts Users Mailing List'; 'Parag Pattewar' Subject: RE: Struts-Menu (Support URL Re-writing) Struts Menu makes use of Struts classes to support forward and action attributes. If you use those, you'll likely get the re-writing you're looking for. I did this on a previous project and did find that the forward attribute worked, but not the action attribute. I believe this is a bug in Struts since it should do rewriting when looking up an Action's path. The one issue with re-writing is that if you're using a menu that matches URLs (i.e. tabbed-menu) - they probably won't get matched up. At a previous project, we were using URLs to highlight the current page we were on and we found that we had to use the action attribute or the page attribute so that the jsessionid wasn't appended. Of course, we could've stripped this off in our Velocity template, but we wen't with the quick, less-logic, way. To see this project, go to http://telluride.resortquest.com and drill down a bit. The menu with highlight is on the right. BTW, this site uses the Velocity displayer for both the top menu and the side menu. If you're not familiar with struts-menu, checkout the demo at http://raibledesigns.com/struts-menu. Matt -Original Message- From: Edgar P Dollin [mailto:[EMAIL PROTECTED] Sent: Friday, January 16, 2004 7:54 AM To: 'Parag Pattewar'; [EMAIL PROTECTED] Subject: RE: Struts-Menu (Support URL Re-writing) You have the source to struts and the source to struts-menu, grab the code from struts and plug it into struts-menu and submit a patch. You might need a menu-config.xml option to indicate that you will be url rewriting. Edgar -Original Message- From: Parag Pattewar [mailto:[EMAIL PROTECTED] Sent: Friday, January 16, 2004 7:21 AM To: [EMAIL PROTECTED] Subject: Struts-Menu (Support URL Re-writing) Hi all How do I change Struts-Menu implemention, so it can support URL ReWriting for session tracking? Thanks and Regards Parag Pattewar Persistent Systems Private Limited Bhageerath 402, Senapati Bapat Road Pune 411016 India Tel: +91 (20) 2567 8900 extn. 2640 Fax: +91 (20) 2567 8901 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED
RE: Struts-Menu (Support URL Re-writing)
Change the location attribute to a action attribute, where the value of action matches the path of your action mapping. For example: Menu name=CsrAccountInformation title= action=/accountinfoview If you are using 2.0, this should work. If it doesn't, let me know what displayer you're using and I'll fix it. Matt -Original Message- From: Parag Pattewar [mailto:[EMAIL PROTECTED] Sent: Saturday, January 17, 2004 12:05 AM To: Matt Raible; 'Struts Users Mailing List' Subject: RE: Struts-Menu (Support URL Re-writing) Hi I am having previous implementation of struts-menu as below Menu name=CsrAccountInformation title= location=accountinfoview.do Item name=act title=Con location=personaldtd.do?expMenu=AcctInfo/ Item name=cas title=Clo Acct location=clsRouter.do?expMenu=AcctInfo/ /Menu I have changed it as below, is it the correct way of using action and forward attributes in struts-menu. Menu name=CsrAccountInformation title= location=accountinfoview.do Item name=act title=Con action=personaldtd.do?expMenu=AcctInfo/ Item name=cas title=Clo Acct forward=clsRouter.do?expMenu=AcctInfo/ /Menu -Original Message- From: Matt Raible [mailto:[EMAIL PROTECTED] Sent: Friday, January 16, 2004 8:44 PM To: 'Struts Users Mailing List'; 'Parag Pattewar' Subject: RE: Struts-Menu (Support URL Re-writing) Struts Menu makes use of Struts classes to support forward and action attributes. If you use those, you'll likely get the re-writing you're looking for. I did this on a previous project and did find that the forward attribute worked, but not the action attribute. I believe this is a bug in Struts since it should do rewriting when looking up an Action's path. The one issue with re-writing is that if you're using a menu that matches URLs (i.e. tabbed-menu) - they probably won't get matched up. At a previous project, we were using URLs to highlight the current page we were on and we found that we had to use the action attribute or the page attribute so that the jsessionid wasn't appended. Of course, we could've stripped this off in our Velocity template, but we wen't with the quick, less-logic, way. To see this project, go to http://telluride.resortquest.com and drill down a bit. The menu with highlight is on the right. BTW, this site uses the Velocity displayer for both the top menu and the side menu. If you're not familiar with struts-menu, checkout the demo at http://raibledesigns.com/struts-menu. Matt -Original Message- From: Edgar P Dollin [mailto:[EMAIL PROTECTED] Sent: Friday, January 16, 2004 7:54 AM To: 'Parag Pattewar'; [EMAIL PROTECTED] Subject: RE: Struts-Menu (Support URL Re-writing) You have the source to struts and the source to struts-menu, grab the code from struts and plug it into struts-menu and submit a patch. You might need a menu-config.xml option to indicate that you will be url rewriting. Edgar -Original Message- From: Parag Pattewar [mailto:[EMAIL PROTECTED] Sent: Friday, January 16, 2004 7:21 AM To: [EMAIL PROTECTED] Subject: Struts-Menu (Support URL Re-writing) Hi all How do I change Struts-Menu implemention, so it can support URL ReWriting for session tracking? Thanks and Regards Parag Pattewar Persistent Systems Private Limited Bhageerath 402, Senapati Bapat Road Pune 411016 India Tel: +91 (20) 2567 8900 extn. 2640 Fax: +91 (20) 2567 8901 - 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: Cactus vs StrutsTestCase
You might take a look at my AppFuse project - it uses all the technologies you mention (except for Oracle). It already has Cactus and StrutsTestCase configured. IMO, if you're testing Servlets or Filters, use Cactus. If you're testing Struts Actions, use StrutsTestCase. If you're testing JSPs, use Canoo's WebTest (http://webtest.canoo.com). AppFuse Home: http://raibledesigns.com/appfuse Live Demo: http://demo.raibledesigns.com/appfuse HTH, Matt -Original Message- From: Ashikuzzaman [mailto:[EMAIL PROTECTED] Sent: Saturday, January 17, 2004 8:51 AM To: [EMAIL PROTECTED] Subject: Cactus vs StrutsTestCase My new project is going to use Struts, Hibernate, XDoclets, Ant etc. together in a Debian O/S plus Oracle backend. For that project we found that there are two primary testing strategies used in server-side testing: mock object (MO) and in-container (IC). I got a look of what is what but would like to know which approach is generally used more? We also found two open source projects are popular for this testing - Apache Cactus and StrutsTestCase. Now which one should fit better for testing Struts applications? I mean pros and cons. Any comment or lights please? Regards, Muhammad Ashikuzzaman (Fahim) SCJP, SCWCD, IBM WebSphere and XML Developer Senior Software Engineer, SurroundApps Inc. - 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-Menu (Support URL Re-writing)
If you use forwards or actions for attributes, it should do this for you. On Jan 16, 2004, at 5:20 AM, Parag Pattewar wrote: Hi all How do I change Struts-Menu implemention, so it can support URL ReWriting for session tracking? Thanks and Regards Parag Pattewar Persistent Systems Private Limited Bhageerath 402, Senapati Bapat Road Pune 411016 India Tel: +91 (20) 2567 8900 extn. 2640 Fax: +91 (20) 2567 8901 - 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-Menu (Support URL Re-writing)
Struts Menu makes use of Struts classes to support forward and action attributes. If you use those, you'll likely get the re-writing you're looking for. I did this on a previous project and did find that the forward attribute worked, but not the action attribute. I believe this is a bug in Struts since it should do rewriting when looking up an Action's path. The one issue with re-writing is that if you're using a menu that matches URLs (i.e. tabbed-menu) - they probably won't get matched up. At a previous project, we were using URLs to highlight the current page we were on and we found that we had to use the action attribute or the page attribute so that the jsessionid wasn't appended. Of course, we could've stripped this off in our Velocity template, but we wen't with the quick, less-logic, way. To see this project, go to http://telluride.resortquest.com and drill down a bit. The menu with highlight is on the right. BTW, this site uses the Velocity displayer for both the top menu and the side menu. If you're not familiar with struts-menu, checkout the demo at http://raibledesigns.com/struts-menu. Matt -Original Message- From: Edgar P Dollin [mailto:[EMAIL PROTECTED] Sent: Friday, January 16, 2004 7:54 AM To: 'Parag Pattewar'; [EMAIL PROTECTED] Subject: RE: Struts-Menu (Support URL Re-writing) You have the source to struts and the source to struts-menu, grab the code from struts and plug it into struts-menu and submit a patch. You might need a menu-config.xml option to indicate that you will be url rewriting. Edgar -Original Message- From: Parag Pattewar [mailto:[EMAIL PROTECTED] Sent: Friday, January 16, 2004 7:21 AM To: [EMAIL PROTECTED] Subject: Struts-Menu (Support URL Re-writing) Hi all How do I change Struts-Menu implemention, so it can support URL ReWriting for session tracking? Thanks and Regards Parag Pattewar Persistent Systems Private Limited Bhageerath 402, Senapati Bapat Road Pune 411016 India Tel: +91 (20) 2567 8900 extn. 2640 Fax: +91 (20) 2567 8901 - 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-Menu (Support URL Re-writing)
In 2.0, you can use a forward or action attribute - and struts-menu will look this up in struts-config.xml. That's all I'm trying to say - both of these should have URL re-writing built in. Matt On Jan 16, 2004, at 6:11 PM, Edgar P Dollin wrote: Unless I am mistaken the relative url in struts-menu is just the text passed in from menu-config.xml. In the CoolMenuDisplayer it calls, buildMenuString -- getArgs -- getUrl which unless there is prior transformation the string from the config. Let me know if I am seeing it wrong or if this is different from displayer to displayer. Thanks. Edgar -Original Message- From: Matt Raible [mailto:[EMAIL PROTECTED] Sent: Friday, January 16, 2004 10:14 AM To: 'Struts Users Mailing List'; 'Parag Pattewar' Subject: RE: Struts-Menu (Support URL Re-writing) Struts Menu makes use of Struts classes to support forward and action attributes. If you use those, you'll likely get the re-writing you're looking for. I did this on a previous project and did find that the forward attribute worked, but not the action attribute. I believe this is a bug in Struts since it should do rewriting when looking up an Action's path. The one issue with re-writing is that if you're using a menu that matches URLs (i.e. tabbed-menu) - they probably won't get matched up. At a previous project, we were using URLs to highlight the current page we were on and we found that we had to use the action attribute or the page attribute so that the jsessionid wasn't appended. Of course, we could've stripped this off in our Velocity template, but we wen't with the quick, less-logic, way. To see this project, go to http://telluride.resortquest.com and drill down a bit. The menu with highlight is on the right. BTW, this site uses the Velocity displayer for both the top menu and the side menu. If you're not familiar with struts-menu, checkout the demo at http://raibledesigns.com/struts-menu. Matt -Original Message- From: Edgar P Dollin [mailto:[EMAIL PROTECTED] Sent: Friday, January 16, 2004 7:54 AM To: 'Parag Pattewar'; [EMAIL PROTECTED] Subject: RE: Struts-Menu (Support URL Re-writing) You have the source to struts and the source to struts-menu, grab the code from struts and plug it into struts-menu and submit a patch. You might need a menu-config.xml option to indicate that you will be url rewriting. Edgar -Original Message- From: Parag Pattewar [mailto:[EMAIL PROTECTED] Sent: Friday, January 16, 2004 7:21 AM To: [EMAIL PROTECTED] Subject: Struts-Menu (Support URL Re-writing) Hi all How do I change Struts-Menu implemention, so it can support URL ReWriting for session tracking? Thanks and Regards Parag Pattewar Persistent Systems Private Limited Bhageerath 402, Senapati Bapat Road Pune 411016 India Tel: +91 (20) 2567 8900 extn. 2640 Fax: +91 (20) 2567 8901 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.558 / Virus Database: 350 - Release Date: 1/2/2004 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.558 / Virus Database: 350 - Release Date: 1/2/2004 - 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 + xdoclet
XDoclet and Struts works very nicely together - throwing Maven into it has only brought me headaches and I found it easier to just do it in Ant. Why try to do it in Maven just because Maven is cool? ;-) You might checkout my AppFuse project with uses Ant/XDoclet/Struts/Hibernate. http://raibledesigns.com/appfuse HTH, Matt On Jan 15, 2004, at 9:24 AM, Raj Atchutuni wrote: Can some tell where you want me to research on xdoclet + struts + maven. I would like to generate xdoclet for STRUTS Dynaforms , Action Mappings. FYI : I completed my project in Struts (w/ Dynaforms, Actions etc). Now i want to implement xdoclet and also xdoclet for maven to it. Thanks Raj - Do you Yahoo!? Yahoo! Hotjobs: Enter the Signing Bonus Sweepstakes - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Blank page after form validation
Most likely your input attribute is invalid - this usually results in a blank page in my experience. HTH, Matt On Jan 13, 2004, at 10:56 PM, VENKATESH GANGAL wrote: Hi All, We have been facing a very strange problem with form validation We have a JSP which is an input to an action and there is an associated form bean to validate the form. Here is the configuaration file struts-config.xml: form-beans form-bean name=summaryForm type=com.xxx.yyy.zzz.core.view.SummaryForm /form-bean /form-beans actionpath=/summaryEdit type=com.xxx.yyy.zzz.core.controller.SummaryAction name=summaryForm scope=session validate=true input=/casefolder-jsp/summaryEdit.jsp forward name=workflowEdit path=/casefolder- jsp/workflowEdit.jsp/ /action message-resources parameter=MessageResources/ plug-in className=org.apache.struts.validator.ValidatorPlugIn set-property property=pathnames value=/WEB-INF/validator-rules.xml, /WEB-INF/validation.xml/ /plug-in validation.xml : form-validation formset form name=summaryEditForm field property=productRef depends=required arg0 key=form.error.productRef/ /field /form /formset /form-validation MessageResources.properties form.error.productRef = Please enter Product Reference FormBean Validation method : public ActionErrors validate(ActionMapping mapping,HttpServletRequest request) { //ActionErrors errors = super.validate(mapping, request); ActionErrors errors = new ActionErrors(); if ((productRef == null) || (productRef.trim().length() 1)){ errors.add (productRef,new ActionError(form.error.productRef)); } return errors ; } Here is the JSP html:html locale=true headhtml:base / /head body html:form action=summaryEdit table /tr tr tdhtml:errors //td /tr tr td class=searchCtrlLhtml:text property=productRef /td /tr When I submit this form without entering anything in the textfield, it is taking me to a blank page. Can anyone let me know why this is happening? It is not going to the action at all and is returning with errors to the JSP.I am not able to reach the page from where I submitted the data along with errors.The error was added to ActionErrors object. We are using oc4j(Oracle Apps) standalone application.We are using struts 1.1 Thanks in advance for your help. Cheers... Venkatesh - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: AW: .NET: We are just like Struts... only better.
The two Java libraries that I know of are JSP Tag Libraries - here are links to their demo sites: http://displaytag.org http://raibledesigns.com/struts-menu Matt On Jan 14, 2004, at 2:08 AM, Salgar, Mehmet wrote: Hello everybody, I am following this discussion for very long time, it is really interesting. I am developing both Java and MS stuff. Mainly I am a Java developer but I have few .NET projects also in the mean time. I have to say that with Struts, JSP is a much attractive tool (with Velocity it is very very interesting tool :)) ) but I have to say that with ASP.NET and web control MS has a nodge over Java at the moment. But I am sure when Java Server Faces will be ready, everything will be same again. PS. If you need real numbers I can say that at this moment Web Controls give % 30 less development times over the controls like TreeView, Menu Controls, fully functional Rich Text Editor as Web Control. And a question, do you know is there any library in Java producing the functionality of the View States. Regards, Mehmet Salgar -Ursprüngliche Nachricht- Von: Craig R. McClanahan [mailto:[EMAIL PROTECTED] Gesendet am: Dienstag, 30. Dezember 2003 23:57 An: Struts Users Mailing List Betreff: RE: .NET: We are just like Struts... only better. Quoting Hookom, Jacob [EMAIL PROTECTED]: As a follow up to your by hand comment, isn't Sun developing a new GUI development tool to wizard-ize JSF? Yes: http://wwws.sun.com/software/products/jscreator/index.html Even if it weren't a product coming from the company I work for :-), this one would have me tempted ... Many other companies are promising support for JavaServer Faces in the near term as well. Speaking of wizards, can JSF enforce flow in a wizard manner without additional modifications like Struts? Depends on what you mean by enforce -- Struts doesn't really do anything to enforce flows. However, both Struts and JavaServer Faces share the concept of decoupling the actual name of the page to be displayed next from the business logic that returns an outcome which the navigation decision is based on. In Struts you do this by using forward declarations at the global or per-Action level. In JavaServer Faces, you do this by defining navigation rules based on the page you're currently on, the action method that was called (i.e. which submit button was pushed), and what the logical outcome value was returned by the action method. Thanks much! Craig - 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: handling form based authentication w/ remember-me cookie
On Jan 14, 2004, at 3:52 AM, Nadeem Bitar wrote: A note about storing passwords in cookies. Encode the password. Do not store the userid with the password in the cookie, store some id associated with the user id. You can generate a one-way hash (MD5) of the contents of the cookie with a secret key only known to the server. This way when you get the cookie back you can compare it to make sure it wasn't altered. Many open source java projects store passwords in cookies insecurely so beware of that if you are going to use that as reference. I'm guilty of this - do you have code samples (or articles) of how to MD5-ify a String and get it's secret code? I've been struggling with this for quite some time - a full example (storing some id vs. userid) is even more desirable. Thanks, Matt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: handling form based authentication w/ remember-me cookie
On Jan 13, 2004, at 12:42 AM, Craig R. McClanahan wrote: Filters are *not* required to be invoked on j_security_check invocations. In fact, Tomcat won't even enable the j_security_check url unless an unauthenticated user accesses a protected resource. Basically, I believe there is no guaranteed-to-be-portable way to implement remember me functionality on the server using container managed security. Craig The Filter I use is mapped to the location of the form-login-page. The solution I use does work on both Tomcat 4/5 and Resin, which is portable enough for me! I did have to add dispatcherFORWARD/dispatcher for Tomcat 5 and Resin, where the login page is displayed using a forward instead of a redirect. Matt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: handling form based authentication w/ remember-me cookie
They should be getting called for both - since they both are a request. You might try adding the dispatcher element to trap forwards as well. This is a Servlet 2.4 feature. filter-mapping filter-nameloginFilter/filter-name url-pattern/security/*/url-pattern !-- These are needed by Tomcat 5 since it does a forward to login.jsp -- dispatcherREQUEST/dispatcher dispatcherFORWARD/dispatcher /filter-mapping On Jan 13, 2004, at 12:19 PM, [EMAIL PROTECTED] wrote: Are Servlet filters supposed to be called for both GET and POST methods? They seem to be getting called for GETs only on Tomcat 5. -Chris -Original Message- From: Parmar, Dipakkumar [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 13, 2004 03:57 PM To: 'Struts Users Mailing List' Subject: RE: handling form based authentication w/ remember-me cookie Hi Max, I haven't tested it either. I read it about this in IBM WebSphere V5.0 Security handbook (page 64). Regards, Dipak Parmar -Original Message- From: Max Cooper [mailto:[EMAIL PROTECTED] Sent: Monday, January 12, 2004 10:42 PM To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: Re: handling form based authentication w/ remember-me cookie Dipak, Are you certain that the filter will be invoked on the /j_security_check request when container-based security is used? I have not tested this, but it would not surprise me to find that some containers do not execute filters on /j_security_check requests. I don't know if the Servlet Spec says anything about this case. Chris, Another alternative to the original problem of security with remember me functionality will be available soon. A patch has been submitted to my SecurityFilter project (http://www.securityfilter.org/) to support remember me functionality. The integration should be complete soon, and a beta release will be made available once the integration is complete. SecurityFilter works very much like container-managed security otherwise, including the configuration format (except that you declare the constraints in a separate config file rather than web.xml). -Max - Original Message - From: Parmar, Dipakkumar [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, January 12, 2004 7:43 AM Subject: RE: handling form based authentication w/ remember-me cookie Hi Chris, You can do this using Servlet Filter. What you need to do is write postLoginFilter that maps to the j_security_check url. In doFilter method, you can write your post login code after j_security_check done is work. Something like: public void doFilter(.) // let the j_security_check to do it's work chain.doFilter(request, response) // do you post login stuff here Regards, Dipak Parmar -Original Message- From: Chris Ruegger [mailto:[EMAIL PROTECTED] Sent: Monday, January 12, 2004 9:53 AM To: Struts Users Mailing List Subject: handling form based authentication w/ remember-me cookie I am using Struts and building a logon page to do Form-based authentication under Tomcat. I want to also have a checkbox for the user to check that says remember me so that I can send them a cookie. I'm not sure how to intercept the form values because I have to post to j_security_check. How can I get the check-box value, set up the cookie, and send them to j_security_check with struts? 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: handling form based authentication w/ remember-me cookie
Remember Me functionality with j_security_check has worked fine for me. I just go to a LoginServlet from my loginForm, which sets cookies and redirects to j_security_check. Then I map a Filter to check for those cookies and logs the user in appropriately. More with code at: http://www.mail-archive.com/[EMAIL PROTECTED]/msg86636.html Complete code is available in my AppFuse application at: http://raibledesigns.com/wiki/Wiki.jsp?page=AppFuse HTH, Matt On Jan 12, 2004, at 8:41 PM, Max Cooper wrote: Dipak, Are you certain that the filter will be invoked on the /j_security_check request when container-based security is used? I have not tested this, but it would not surprise me to find that some containers do not execute filters on /j_security_check requests. I don't know if the Servlet Spec says anything about this case. Chris, Another alternative to the original problem of security with remember me functionality will be available soon. A patch has been submitted to my SecurityFilter project (http://www.securityfilter.org/) to support remember me functionality. The integration should be complete soon, and a beta release will be made available once the integration is complete. SecurityFilter works very much like container-managed security otherwise, including the configuration format (except that you declare the constraints in a separate config file rather than web.xml). -Max - Original Message - From: Parmar, Dipakkumar [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, January 12, 2004 7:43 AM Subject: RE: handling form based authentication w/ remember-me cookie Hi Chris, You can do this using Servlet Filter. What you need to do is write postLoginFilter that maps to the j_security_check url. In doFilter method, you can write your post login code after j_security_check done is work. Something like: public void doFilter(.) // let the j_security_check to do it's work chain.doFilter(request, response) // do you post login stuff here Regards, Dipak Parmar -Original Message- From: Chris Ruegger [mailto:[EMAIL PROTECTED] Sent: Monday, January 12, 2004 9:53 AM To: Struts Users Mailing List Subject: handling form based authentication w/ remember-me cookie I am using Struts and building a logon page to do Form-based authentication under Tomcat. I want to also have a checkbox for the user to check that says remember me so that I can send them a cookie. I'm not sure how to intercept the form values because I have to post to j_security_check. How can I get the check-box value, set up the cookie, and send them to j_security_check with struts? 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: Linking CSS
I prefer using c:url or html:rewrite to give my CSS files an absolute path - but that's just me: link href=c:url value=/jsp/base.css/ ... Matt On Jan 12, 2004, at 10:01 PM, Mike Deegan wrote: link href=../jsp/base.css rel=stylesheet type=text/css works for me ... what is the error you are getting? may require use of the html:base/ tag ? - Original Message - From: vasudevrao gupta [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Monday, January 12, 2004 9:48 PM Subject: Linking CSS Dear All, I am usign WebSphere Application Development Studio for development of our application in struts. When I am linking .css files to a JSP using normal HTML tag, its not getting identified,..Do we need to use a different syntax for linking .css files for JSP in struts??? Eg: LINK href=../../../../theme/Master.css rel=stylesheet type=text/css Regards vasudevRaoGupta Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments. - 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: Pagination Support
Is this what you're looking for? http://displaytag.sf.net, demo at http://www.displaytag.org HTH, Matt On Jan 12, 2004, at 10:03 PM, Viral_Thakkar wrote: Hi all, Do struts have any support forpaginationpurpose? By pagination, I mean, displaying the data retrieved from database in JSP page in fixed slots... Thanks Regards, Viral - 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]
403 error page not being displayed
I have roles configured on my /editUser action mapping so that only administrator can access it. When I try to request the page as a user, I get the default 403 page from Tomcat, rather than my app's configured one. In web.xml, I have a number of error pages defined, and 404 works OK: error-page error-code500/error-code location/error.jsp/location /error-page error-page error-code400/error-code location/index.jsp/location /error-page error-page error-code403/error-code location/403.jsp/location /error-page error-page error-code404/error-code location/404.jsp/location /error-page In another application, that uses a very similar structure, when a 403 is returned the user sees nothing - they're just routed back to the welcome file of the app. The first app uses a Struts Nightly build from early December, the 2nd uses Struts 1.1. Any ideas why my 403.jsp error page isn't displaying? I can pull it up fine if I type in the URL. Thanks, Matt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: 403 error page not being displayed
I'm currently experiencing the issue with Tomcat 4.1.29, JDK 1.4.2 on Windows XP and Fedora Core 1. The header (from Mozilla) looks fine: HTTP/1.x 403 User is not authorized to access action /editUser Content-Type: text/html;charset=ISO-8859-1 Content-Language: en-US Transfer-Encoding: chunked Date: Thu, 08 Jan 2004 19:51:50 GMT Server: Apache-Coyote/1.1 After further review it looks like my Gzip CompressionFilter (http://tinyurl.com/25xva) is hosing things up - bout time I get a new one (http://tinyurl.com/3aaoy). Thanks, Matt -Original Message- From: Kris Schneider [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 12:05 PM To: Struts Users Mailing List Subject: Re: 403 error page not being displayed Huh. Both 4.1.29 and 5.0.16 seem to work for 400 and 403 with a simple error-page test (no Struts involved). AFAIK, the roles check is performed within RequestProcessor.processRoles which just does an HttpServletResponse.sendError if the user in not in the required role. At that point, the container should take over, so I'm not sure why it's not working for you. Big help, eh? ;-) Quoting Kris Schneider [EMAIL PROTECTED]: Looks like Struts 1.1 sends a 400 and the current nightly sends a 403. Maybe it's a TC bug. Which version are you using? Quoting Matt Raible [EMAIL PROTECTED]: I have roles configured on my /editUser action mapping so that only administrator can access it. When I try to request the page as a user, I get the default 403 page from Tomcat, rather than my app's configured one. In web.xml, I have a number of error pages defined, and 404 works OK: error-page error-code500/error-code location/error.jsp/location /error-page error-page error-code400/error-code location/index.jsp/location /error-page error-page error-code403/error-code location/403.jsp/location /error-page error-page error-code404/error-code location/404.jsp/location /error-page In another application, that uses a very similar structure, when a 403 is returned the user sees nothing - they're just routed back to the welcome file of the app. The first app uses a Struts Nightly build from early December, the 2nd uses Struts 1.1. Any ideas why my 403.jsp error page isn't displaying? I can pull it up fine if I type in the URL. Thanks, Matt -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.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: 403 error page not being displayed
OK, well that Filter isn't any better - anyone know how to get the HTTP_STATUS code so I can disable the filter when the error-code is 403? Thanks, Matt -Original Message- From: Matt Raible [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 1:14 PM To: 'Struts Users Mailing List' Subject: RE: 403 error page not being displayed I'm currently experiencing the issue with Tomcat 4.1.29, JDK 1.4.2 on Windows XP and Fedora Core 1. The header (from Mozilla) looks fine: HTTP/1.x 403 User is not authorized to access action /editUser Content-Type: text/html;charset=ISO-8859-1 Content-Language: en-US Transfer-Encoding: chunked Date: Thu, 08 Jan 2004 19:51:50 GMT Server: Apache-Coyote/1.1 After further review it looks like my Gzip CompressionFilter (http://tinyurl.com/25xva) is hosing things up - bout time I get a new one (http://tinyurl.com/3aaoy). Thanks, Matt -Original Message- From: Kris Schneider [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 12:05 PM To: Struts Users Mailing List Subject: Re: 403 error page not being displayed Huh. Both 4.1.29 and 5.0.16 seem to work for 400 and 403 with a simple error-page test (no Struts involved). AFAIK, the roles check is performed within RequestProcessor.processRoles which just does an HttpServletResponse.sendError if the user in not in the required role. At that point, the container should take over, so I'm not sure why it's not working for you. Big help, eh? ;-) Quoting Kris Schneider [EMAIL PROTECTED]: Looks like Struts 1.1 sends a 400 and the current nightly sends a 403. Maybe it's a TC bug. Which version are you using? Quoting Matt Raible [EMAIL PROTECTED]: I have roles configured on my /editUser action mapping so that only administrator can access it. When I try to request the page as a user, I get the default 403 page from Tomcat, rather than my app's configured one. In web.xml, I have a number of error pages defined, and 404 works OK: error-page error-code500/error-code location/error.jsp/location /error-page error-page error-code400/error-code location/index.jsp/location /error-page error-page error-code403/error-code location/403.jsp/location /error-page error-page error-code404/error-code location/404.jsp/location /error-page In another application, that uses a very similar structure, when a 403 is returned the user sees nothing - they're just routed back to the welcome file of the app. The first app uses a Struts Nightly build from early December, the 2nd uses Struts 1.1. Any ideas why my 403.jsp error page isn't displaying? I can pull it up fine if I type in the URL. Thanks, Matt -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Serving up Tiles based on Role
I'd love to serve up a specific tile based on a role, but it doesn't seem like it's currently possible in the Tiles Framework. Basically, I want to do the following: !-- User Profile definition -- definition name=.userProfile extends=.mainMenu put name=title.key value=userProfile.title/ put name=heading.key value=userProfile.heading/ put name=content value=/WEB-INF/pages/userProfile.jsp role=admin/ put name=content value=/WEB-INF/pages/userDetail.jsp role=tomcat/ /definition In this example, users with role admin get the userProfile.jsp, while users with a tomcat role get the userDetail.jsp. Unfortunately, role is not an allowed attribute on put. It seems it's only possible to do this on a definition level - but then they cannot be the same name, and it seems rather clunky. For the definition stuff, it'd be nice to do: definition name=.userProfile extends=.mainMenu put name=title.key value=userProfile.title/ put name=heading.key value=userProfile.heading/ put name=content value=.meatOfPage/ /definition definition name=.meatOfPage path=/WEB-INF/pages/userProfile.jsp role=admin/ definition name=.meatOfPage path=/WEB-INF/pages/userDetail.jsp role=tomcat/ Any tips are appreciated. Matt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[ANNOUNCE] Struts Menu 2.0 Released!
This release is a significant refactoring of the 1.x codebase. The source and site is now built using Maven. Menus can now be defined using Velocity templates and support has been added for looking up dynamic values. This means that if you have ${variableName} in your menu-config.xml (in a link), the tag library will look in all scopes for a variable with the name variableName. The example app has been updated to improve documentation. IMO, the Velocity templates is huge because it means if it's possible with HTML - it's possible with Struts Menu. Changes (http://struts-menu.sourceforge.net/changes-report.html): - Renamed package structure to net.sf.navigator. - Added support for using Struts' actions and forwards for links in menu-config.xml. - Added support for using dynamic variables in menu-config.xml. - Updated build process to use Maven for building/deploying. - Refactored to use Velocity and allow dynamic variable substitution. Read the nitty-gritty details about the Velocity enhancements at http://raibledesigns.com/wiki/Wiki.jsp?page=StrutsMenu. Demo: http://raibledesigns.com/struts-menu Download: http://tinyurl.com/x6p9 Enjoy! Matt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: code generate by validwhen doesn't exists
I don't believe that requiredif or validwhen generate client-side (JavaScript) validation. Matt -Original Message- From: Ruben Orta Magan [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 28, 2003 10:56 AM To: Struts Users Mailing List Subject: code generate by validwhen doesn't exists Hello again. I'm fighting with validwhen againi've got the lastest nightly build(jakarta-struts-20031027.zip) and it looks like when you use validwhen validation no javascript code is generated and inserted in the jsp file. If i use this validation definition: field property=tituloRevista depends=required arg0 key=icytReviForm.tituloRevista.displayname/ /field field property=tipoAdquisicion depends=required arg0 key=icytReviForm.tipoAdquisicion.displayname/ /field The javascript code inserted in my jsp page is: function validateIcytReviForm(form) { if (bCancel) return true; else var formValidationResult; formValidationResult = validateRequired(form); return (formValidationResult == 1); } function required () { this.aa = new Array(tituloRevista, El título es un campo obligatorio, new Function (varName, return this[varName];)); this.ab = new Array(tipoAdquisicion, El tipo de adquisición es un campo obligatorio, new Function (varName, return this[varName];)); } But if I add a new field validation in my validation.xml : field property=tituloRevista depends=required arg0 key=icytReviForm.tituloRevista.displayname/ /field field property=tipoAdquisicion depends=required arg0 key=icytReviForm.tipoAdquisicion.displayname/ /field !-- new field -- field property=tituloAbreviado depends=validwhen arg0 key=icytReviForm.tituloAbreviado.displayname/ var var-nametest/var-name var-value(tituloRevista != null)/var-value /var /field The javascript code generated is the same! function validateIcytReviForm(form) { if (bCancel) return true; else var formValidationResult; formValidationResult = validateRequired(form); return (formValidationResult == 1); } function required () { this.aa = new Array(tituloRevista, El título es un campo obligatorio, new Function (varName, return this[varName];)); this.ab = new Array(tipoAdquisicion, El tipo de adquisición es un campo obligatorio, new Function (varName, return this[varName];)); } Please someone can help me??? is the validwhen running correctly? is the problem in the definition??? Thanks... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts-config
Download XML Spy (or another good XML tool) and validate it against the DTD. -Original Message- From: Edgar P Dollin [mailto:[EMAIL PROTECTED] Sent: Monday, October 27, 2003 4:37 PM To: Struts Users Mailing List Subject: Struts-config Has anyone experienced situtation where struts 1.1 will not allow any configuration items (controller / message-resources / plug-in) after the end of the action-mappings section. The error message is xml.sax.SAXParseException: Element struts-config allows no further input; controller is not allowed. I have checked the DTD and the position for these elements should follow action-mappings yet something is upsetting the digester. I have double checked the syntax and made sure it is correct. If anyone has an insight, thanks in advance Edgar - 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]
Can I use tiles with JSF?
There seems to be a fair amount of JSF experts on this list, so I'll pose my question here. After read this article (http://tinyurl.com/s23s), I'm got a bit of motivation to try porting one of my apps to use JSF. However, my app uses Tiles heavily and I want to make sure that's still possible. It also uses Struts-Menu and the DisplayTag, and I believe these both should work fine with JSF, but I don't know about Tiles. Any insights? Does JSF have a replacements for Tiles (maybe from JSP 2.0)? Thanks, Matt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Can I use tiles with JSF?
This looks like something similar to what I might be looking for - however, what I really want is to provide an alternative implementation of my app with JSF, JSTL and Tiles - no struts-config.xml or any struts-specific tags. It's just an experiment and I'd like to know if it's possible - no reason to bang my head agains the wall if its not possible. Thanks, Matt -Original Message- From: John Greenhill [mailto:[EMAIL PROTECTED] Sent: Thursday, October 23, 2003 9:51 AM To: Struts Users Mailing List Subject: RE: Can I use tiles with JSF? These guys give the modifications required to get tiles to work with it, but I haven't tried it... http://www-106.ibm.com/developerworks/library/j-integrate/ -Original Message- From: Matt Raible [mailto:[EMAIL PROTECTED] Sent: Thursday, October 23, 2003 8:23 AM To: '[EMAIL PROTECTED]' Subject: Can I use tiles with JSF? There seems to be a fair amount of JSF experts on this list, so I'll pose my question here. After read this article (http://tinyurl.com/s23s), I'm got a bit of motivation to try porting one of my apps to use JSF. However, my app uses Tiles heavily and I want to make sure that's still possible. It also uses Struts-Menu and the DisplayTag, and I believe these both should work fine with JSF, but I don't know about Tiles. Any insights? Does JSF have a replacements for Tiles (maybe from JSP 2.0)? Thanks, Matt - 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: Displaytag and export: more info
This is a known issue - checkout the displaytag's mailing lists - there's a couple of workarounds in there. http://displaytag.sf.net. HTH, Matt -Original Message- From: Grassi Fabio [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 22, 2003 11:23 AM To: [EMAIL PROTECTED] Subject: Displaytag and export: more info Doing some testing it appears that the export function doesn't work when the jsp is inserted in the document via the tiles:insert tag. Is anyone experiencing similar problems? Is anybody using displaytag with tiles? Thanks in advance, Fabio. -Messaggio originale- Da: Grassi Fabio Inviato: mercoledì 22 ottobre 2003 18:00 A: '[EMAIL PROTECTED]' Oggetto: Displaytag and export I'm trying to use the export function of displaytag in a Struts application without success. What I get is the contente of the file to be exported visualized in place of the table. Does anyone have any suggestion? TIA, Fabio. Ai sensi della Legge 675/96, si precisa che le informazioni contenute in questo messaggio sono riservate ed a uso esclusivo del destinatario. Qualora il messaggio in parola Le fosse pervenuto per errore, la preghiamo di eliminarlo senza copiarlo e di non inoltrarlo a terzi, dandocene gentilmente comunicazione. Grazie.BRBRThis message, for the law 675/96 may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Multiple select and string arrays
I have an html:select multiple=true and String[] getters/setters/variables in my Form. For some reason, the selected value is passed through twice, meaning that if we select 1 in the select, 1, 1 gets passed in. Has anyone seen this behavior. It's highly likely that this is a result of a filter we're using, but just wanted to put a probe out in case it's not. Back to investigating Matt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Multiple select and string arrays [solved]
Nevermind, I was appending the request parameters in a filter even when posting - causing a duplication in request parameters. I changed my filter to only do this on a get and everything seems to be fixed. Matt On 10/14/03 2:05 PM, Matt Raible [EMAIL PROTECTED] wrote: I have an html:select multiple=true and String[] getters/setters/variables in my Form. For some reason, the selected value is passed through twice, meaning that if we select 1 in the select, 1, 1 gets passed in. Has anyone seen this behavior. It's highly likely that this is a result of a filter we're using, but just wanted to put a probe out in case it's not. Back to investigating Matt - 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: tiles-defs.xml and dynamic page titles: how to do?
You could use a Tiles controller to the title attribute from the TilesContext and append the customer name. HTH, Matt -Original Message- From: PhilNoon [mailto:[EMAIL PROTECTED] Sent: Thursday, October 09, 2003 10:30 AM To: [EMAIL PROTECTED] Subject: tiles-defs.xml and dynamic page titles: how to do? I am using tiles. I define the title of a web page in tiles-defs.xml as in this snippet: definition name=tiles.customer.title.parcels extends=tiles.default.layout put name=title value=Customer Consignment Note/ put name=content value=/pages/customerTitleParcels.jsp/ /definition Then in my jsp, I have: tiles:getAsString name=title/ Which outputs Customer Consignment Note as expected. Now my client wants the title to read Consignment Note for where is the customer's name. Does anyone have an idea how to do this? - 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: Container-Managed Authentication login-config in web.xml vs . Specifying Paths in the struts-config.xml
Don't put anything in struts-config, in web.xml, put: login-config auth-methodFORM/auth-method form-login-config form-login-page/login.jsp/form-login-page form-error-page/login.jsp?error=true/form-error-page /form-login-config /login-config You can use whatever code you like in login.jsp, here's mine as an example: %@ include file=/common/taglibs.jsp% tiles:insert definition=.login flush=true/ So you can see it uses Tiles - here's my .login definition: !-- Login Page definition -- definition name=.login extends=baseLayout put name=titleKey value=login.title/ put name=headingKey value=login.heading/ put name=menu value=/menu.html/ put name=content value=/WEB-INF/pages/login.jsp/ /definition Where /pages/login.jsp is: %@ include file=/common/taglibs.jsp% div id=loginTable form method=post id=loginForm action=j_security_check table width=100% tr td colspan=2 c:if test=${param.error != null} div class=error style=margin-right: 0; margin-bottom: 3px; margin-top: 3px html:img pageKey=icon.warning.img altKey=icon.warning styleClass=icon/ fmt:message key=errors.password.mismatch/ /div /c:if /td /tr tr th label for=j_username class=required fmt:message key=label.username/*: /label /th td input type=text name=j_username id=j_username size=25 / /td /tr tr th label for=j_password class=required fmt:message key=label.password/*: /label /th td input type=password name=j_password id=j_password size=20 / /td /tr tr td/td td input type=checkbox name=rememberMe id=rememberMe / label for=rememberMefmt:message key=login.rememberMe//a !-- for Resin -- input type=hidden name=j_uri id=j_uri value= / /td /tr tr td/td td input type=submit name=login id=login value=Login / input type=reset name=reset id=reset value=Reset onclick=document.getElementById('j_username').focus() / /td /tr tr td/td tdbr /fmt:message key=login.signup//td /tr /table /form /div HTH, Matt -Original Message- From: Caroline Jen [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 07, 2003 2:11 PM To: Struts Users Mailing List Subject: Re: Container-Managed Authentication login-config in web.xml vs . Specifying Paths in the struts-config.xml People answer questions without reading my original post. Therefore, I must re-type my original question again. Before I posted my question, I had configured the Tomcat JDBCRealm following the instructions at http://jakarta.apache.org/tomcat/tomcat-4.1-doc/realm-howto.html so that I can do security testing programmically, such as isUserInRole(), in my program. If I use form based authentication, I insert the login-config and its sub-elements in my web.xml file (see below). As we know, the form-login-page and form-error-page are required. My question is that the container-managed authentication (we provide login page and error page in the web.xml) does not seem to be consistent with what we usually do in struts; e.g. we state the logical name and path for each .jsp page in the struts-config.xml file. What is the Struts convention in dealing with user authentication? Should we specify the paths for the logon page and error page in the struts.config.xml or we should use the form-login-page and form-error-page in the web.xml file? Thanks. --- Craig R. McClanahan [EMAIL PROTECTED] wrote: Caroline Jen wrote: But, I do not want to use BASIC authentication. I have many different roles and hundreds of people per role. Users' name, role, etc. are stored in a database. How authentication is performed (BASIC, form-based, DIGEST, or SSL client certificates) and how users are stored (database, directory server, local XML file, ...) are two separate questions. For most servers , any combination is possible. With Tomcat, for example, you can configure JDBCRealm to point at your user and role definitions in a database, and then use those users with any of the authentication methods. For more information, see: http://jakarta.apache.org/tomcat/tomcat-4.1-doc/realm-howto.html The choice between BASIC and form-based authentication, then, can be based on user interface related concerns, rather than worrying about a database. Craig --- Matt Raible [EMAIL PROTECTED] wrote: A JDBCRealm can use BASIC authentication - it doesn't require form-based. Here's an example app that might help you out: http
RE: Setting focus in struts html form
All that the focus attribute does is to write some JavaScript for you. There's nothing wrong with writing your own JavaScript after your form. Here's a sample of what it writes: script type=text/javascript var focusControl = document.forms[searchForm].elements[arrivalDate]; if (focusControl.type != hidden) { focusControl.focus(); } /script Feel free to modify for your needs... Matt -Original Message- From: muzammil shahbaz [mailto:[EMAIL PROTECTED] Sent: Monday, October 06, 2003 5:23 AM To: [EMAIL PROTECTED] Subject: Setting focus in struts html form I am getting trouble in setting focus in Struts html:form. There are two possibilities in my case; in one scenario text field 'A' in form exists while in other scenario it does not. I want to set focus on 'A' if it exists. For that simply, I write focus=A. But it gives javascript error when this field does not exist. The statement below doesnot accept any scriptlet, so that I may choose when to put focus and when not. I am using Struts 1.0 and find no way of dynamic setting focus in form. html:form action=submitProfile.do method=post focus=A I will appreciate your kind response in this regard. Thanks in advance. MMS - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Help with StrutsTestCase examples and usage.
Here's an in-container StrutsTestCase: http://tinyurl.com/pwkp HTH, Matt -Original Message- From: Mick Knutson [mailto:[EMAIL PROTECTED] Sent: Monday, October 06, 2003 11:29 AM To: struts Subject: Help with StrutsTestCase examples and usage. I am having issues with getting StrutsTestCase to work. I have several actions that I am checking for a given ActionForward, but the Forward is not what was expected. However, it does not tell me what Forward was received. Also, when there is an error returned, I keep getting Error was returned, but no message was found. I am using message keys, and checking for them, but none exist. And I am not told what error type was thrown, and why there are no messages, or if there were any other messages. So, if anyone has any Mock examples other than login examples, I would love to see how others are testing there Actions. --- Thanks Mick Knutson The world is a playground...Play Hard, Play Smart. Visit http://www.YourSoS.com to learn how our Personal Emergency Alert Contact System can help you Play Smart. +00 1 (877) SoS-9119 +00 1 (708) 570-2772 Fax --- - 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: Help with StrutsTestCase examples and usage.
I use DBUnit to ensure that the database is in a repeatable state. Cactus does support container managed authentication, but I don't think it's in a released version yet. Here's my tests that prove it works: public void beginFormAuthentication(WebRequest theRequest) { theRequest.setRedirectorName(ServletRedirectorSecure); theRequest.setAuthentication(new FormAuthentication(rb.getString( username), rb.getString(password))); } /** * Test logging in as user a user */ public void testFormAuthentication() { assertEquals(rb.getString(username), request.getUserPrincipal().getName()); assertEquals(rb.getString(username), request.getRemoteUser()); assertTrue(User not in ' + rb.getString(role) + ' role, request.isUserInRole(rb.getString(role))); } Where rb is a properties file for my test. HTH, Matt -Original Message- From: Mick Knutson [mailto:[EMAIL PROTECTED] Sent: Monday, October 06, 2003 11:45 AM To: Struts Users Mailing List Subject: Re: Help with StrutsTestCase examples and usage. How do you handle Database updates with these type of tests? I have MySql and do not have inoDB support yet. So I need to ensure the DATA is in a repeatable state. This is why I was starting with Mock tests instead. Not to mention, I use JAAS Container authentication, so wouldn't that interfere with the tests? I thought that Cactus did not yet support testing through container managed security, and my actions are all in a secured area requiring authentication. --- Thanks Mick Knutson The world is a playground...Play Hard, Play Smart. Visit http://www.YourSoS.com to learn how our Personal Emergency Alert Contact System can help you Play Smart. +00 1 (877) SoS-9119 +00 1 (708) 570-2772 Fax --- - Original Message - From: Matt Raible [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Monday, October 06, 2003 10:29 AM Subject: RE: Help with StrutsTestCase examples and usage. Here's an in-container StrutsTestCase: http://tinyurl.com/pwkp HTH, Matt -Original Message- From: Mick Knutson [mailto:[EMAIL PROTECTED] Sent: Monday, October 06, 2003 11:29 AM To: struts Subject: Help with StrutsTestCase examples and usage. I am having issues with getting StrutsTestCase to work. I have several actions that I am checking for a given ActionForward, but the Forward is not what was expected. However, it does not tell me what Forward was received. Also, when there is an error returned, I keep getting Error was returned, but no message was found. I am using message keys, and checking for them, but none exist. And I am not told what error type was thrown, and why there are no messages, or if there were any other messages. So, if anyone has any Mock examples other than login examples, I would love to see how others are testing there Actions. --- Thanks Mick Knutson The world is a playground...Play Hard, Play Smart. Visit http://www.YourSoS.com to learn how our Personal Emergency Alert Contact System can help you Play Smart. +00 1 (877) SoS-9119 +00 1 (708) 570-2772 Fax --- - 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: Help with StrutsTestCase examples and usage.
Yes, all my junit tests (including cactus) depend on a db-load task that uses DBUnit. As far as logging in before running your test (the j_security_check) that should work - at least it sounds like it should. You can check out my build.xml file (http://tinyurl.com/pwqt) for AppFuse or download the whole project (http://raibledesigns.com/wiki/Wiki.jsp?page=AppFuse) to see how I'm doing it. Matt -Original Message- From: Mick Knutson [mailto:[EMAIL PROTECTED] Sent: Monday, October 06, 2003 11:56 AM To: Struts Users Mailing List Subject: Re: Help with StrutsTestCase examples and usage. So, do you kick off DBUnit at the beginning and end of your testing? I am running ant for my junit, and am trying to set my tests up correctly. I also saw the j_security_check example on your site. Can I just run that check as the init() of my tests with CactusTestCases? --- Thanks Mick Knutson The world is a playground...Play Hard, Play Smart. Visit http://www.YourSoS.com to learn how our Personal Emergency Alert Contact System can help you Play Smart. +00 1 (877) SoS-9119 +00 1 (708) 570-2772 Fax --- - Original Message - From: Matt Raible [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Monday, October 06, 2003 10:45 AM Subject: RE: Help with StrutsTestCase examples and usage. I use DBUnit to ensure that the database is in a repeatable state. Cactus does support container managed authentication, but I don't think it's in a released version yet. Here's my tests that prove it works: public void beginFormAuthentication(WebRequest theRequest) { theRequest.setRedirectorName(ServletRedirectorSecure); theRequest.setAuthentication(new FormAuthentication(rb.getString( username), rb.getString(password))); } /** * Test logging in as user a user */ public void testFormAuthentication() { assertEquals(rb.getString(username), request.getUserPrincipal().getName()); assertEquals(rb.getString(username), request.getRemoteUser()); assertTrue(User not in ' + rb.getString(role) + ' role, request.isUserInRole(rb.getString(role))); } Where rb is a properties file for my test. HTH, Matt -Original Message- From: Mick Knutson [mailto:[EMAIL PROTECTED] Sent: Monday, October 06, 2003 11:45 AM To: Struts Users Mailing List Subject: Re: Help with StrutsTestCase examples and usage. How do you handle Database updates with these type of tests? I have MySql and do not have inoDB support yet. So I need to ensure the DATA is in a repeatable state. This is why I was starting with Mock tests instead. Not to mention, I use JAAS Container authentication, so wouldn't that interfere with the tests? I thought that Cactus did not yet support testing through container managed security, and my actions are all in a secured area requiring authentication. --- Thanks Mick Knutson The world is a playground...Play Hard, Play Smart. Visit http://www.YourSoS.com to learn how our Personal Emergency Alert Contact System can help you Play Smart. +00 1 (877) SoS-9119 +00 1 (708) 570-2772 Fax --- - Original Message - From: Matt Raible [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Monday, October 06, 2003 10:29 AM Subject: RE: Help with StrutsTestCase examples and usage. Here's an in-container StrutsTestCase: http://tinyurl.com/pwkp HTH, Matt -Original Message- From: Mick Knutson [mailto:[EMAIL PROTECTED] Sent: Monday, October 06, 2003 11:29 AM To: struts Subject: Help with StrutsTestCase examples and usage. I am having issues with getting StrutsTestCase to work. I have several actions that I am checking for a given ActionForward, but the Forward is not what was expected. However, it does not tell me what Forward was received. Also, when there is an error returned, I keep getting Error was returned, but no message was found. I am using message keys, and checking for them, but none exist. And I am not told what error type was thrown, and why there are no messages, or if there were any other messages. So, if anyone has any Mock examples other than login examples, I would love to see how others are testing there Actions. --- Thanks Mick Knutson The world is a playground...Play Hard, Play Smart. Visit http://www.YourSoS.com to learn how our Personal Emergency Alert Contact System can help you Play Smart. +00 1 (877) SoS-9119 +00 1 (708) 570-2772 Fax --- - 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: Container-Managed Authentication login-config in web.xml vs . Specifying Paths in the struts-config.xml
A JDBCRealm can use BASIC authentication - it doesn't require form-based. Here's an example app that might help you out: http://raibledesigns.com/wiki/Wiki.jsp?page=SecurityExample HTH, Matt -Original Message- From: Caroline Jen [mailto:[EMAIL PROTECTED] Sent: Monday, October 06, 2003 4:45 PM To: [EMAIL PROTECTED] Subject: Container-Managed Authentication login-config in web.xml vs. Specifying Paths in the struts-config.xml I use the Tomcat. I configured the Tomcat JDBCRealm so that I can use programmic security testing, such as isUserInRole(), in my program. Because Tomcat JDBCRealm is form based, I inserted the login-config and its sub-elements in my web.xml file (see below). As we know, the form-login-page and form-error-page are required. My question is that the container-managed authentication does not seem to be consistent with what we usually do in struts; e.g. we state the logical name and path for each .jsp page in the struts-config.xml file. What is the Struts convention in dealing with user authentication? Should we specify the paths for the logon page and error page in the struts.config.xml or we should use the form-login-page and form-error-page in the web.xml file? == security-constraint web-resource-collection web-resource-nameSalesInfo/web-resource-name url-pattern/SalesInfo/*/url-pattern http-methodGET/http-method http-methodPOST/http-method /web-resource-collection auth-constraint role-namemanager/role-name /auth-constraint user-data-constraint transport-guaranteeNONE/transport-guarantee /user-data-constraint /security-constraint login-config auth-methodFORM/auth-method form-login-config form-login-page/authentication/login.html/form-login-page form-error-page/authentication/error.html/form-error-page /form-login-config /login-config security-role role-namemanager/role-name /security-role __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.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: Displaytag does not work with Tiles
You're better off asking this question on the displaytag-user list. http://displaytag.sourceforge.net/mail-lists.html Matt -Original Message- From: Navneet Karnani [mailto:[EMAIL PROTECTED] Sent: Thursday, October 02, 2003 5:56 PM To: [EMAIL PROTECTED] Subject: Displaytag does not work with Tiles Hello, I was trying to get the display:* tags to help me build a sortable table but I noticed that since I was using a tiles based setup, the generated link from the sort link on the table header did not match the action that needed to be invoked. Is this a known problem ? Is there a known/published workaround ? - Navneet Karnani Umber Business Solutions Pvt. Ltd. http://www.umber.biz - 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: tiles and parameters
Even easier - stuff it in the request: tiles:useAttribute name=nav_key scope=request / Better yet, make all attributes available to all tiles in your baseLayout.jsp: tiles:importAttribute scope=request/ HTH, Matt -Original Message- From: Yann Lebreton [mailto:[EMAIL PROTECTED] Sent: Friday, October 03, 2003 10:58 AM To: Struts Users Mailing List Subject: RE: tiles and parameters Solution number 2, propagate the value down: headerContentFooter.jsp: tiles:useAttribute name=nav_key / pnav_key = %=nav_key%p tiles:insert attribute=content tiles:put name=nav_keytiles:getAsString name=menuMain//tiles:put /tiles:insert -Original Message- From: Manish Singla [mailto:[EMAIL PROTECTED] Sent: Thursday, October 02, 2003 4:15 PM To: Struts Users Mailing List Subject: Re: tiles and parameters You are getting error because nav_key is in page context. thus you cannot retrieve value in included page... YOu may use tiles:useAttribute name=nav_key scope=request / in headercontentfooter.jsp Frank Maritato wrote: Hi all, I'm having a problem passing a parameter down from a tiles definition to a jsp. I can access the value easily in the layout definition, but I can't get access to it in a file (or action) I'm inserting into the layout. Here is an example of what I'm doing (cut down a bit) tiles.xml: definition name=mp.main path=/tiles/layout/headerContentFooter.jsp put name=nav_keyvalue=mp type=string/ put name=contentvalue=/showcontent.do / /definition headerContentFooter.jsp: tiles:useAttribute name=nav_key / pnav_key = %=nav_key%p tiles:insert attribute=content / samplecontent.jsp: bean:define id=nav_key name=nav_key / bnav_key::: %=nav_key%/b So I'm getting an error in samplecontent.jsp that there is no such variable in any scope. How can I get it? I can print out the value fine in the headerContentFooter layout. I also tried adding a tiles:useAttribute in samplecontent.jsp to try and get access to the variable but that didn't work either. Any help would be appreciated. Thanks! -- Thanks Manish Singla x73166 - 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: EJB's vs. Hibernate vs. Torque vs. custom DTO's
I might as well chime in here. I've used Hibernate and iBatis on my last two projects. Using them made it super simple to implement the data tier. In fact, in both projects, it took under a week to do all the CRUD stuff needed for our applications. I also developed a 23 table / 21 page JSP application in 70 hours using my AppFuse project (which uses Hibernate, XDoclet and Struts). I think they're both great, but I prefer Hibernate b/c of it's integration with XDoclet. But that's just me, and I'm probably biased because I took the time to learn Hibernate and how it works with XDoclet and Struts. iBatis was much easier to learn in my experience. Matt -Original Message- From: Ted Husted [mailto:[EMAIL PROTECTED] Sent: Friday, October 03, 2003 1:53 PM To: Struts Users Mailing List Subject: Re: EJB's vs. Hibernate vs. Torque vs. custom DTO's In the end, this is a team decision and which decision is right is going to depend on who else is on the team. Each of the technologies has their own merits and demerits (which is why we keep creating them). But, if you are used to writing your own DTOs, and all other things remaining equal, you should take a good look at iBATIS Database Layer. http://www.ibatis.com/ It is not an Object Relational Mapping framework, but does a truly excellent job of separating data persistence from the rest of your application. Clinton posted a very fine comparison of SQL Mapping and ORM here: http://sourceforge.net/forum/forum.php?thread_id=914883forum_id=206693 A real plus for a Struts developer is that there is a realistic, best-practices, soup-to-nuts example Struts/iBATIS application available: http://www.ibatis.com/jpetstore/jpetstore.html Regardless of whatever choice you make, I would strongly recommend taking a close look at the DAO framework that ships with iBATIS. It is not dependant on the iBATIS SqlMaps and can be used with Hibernate, OJB, or whatever else. Or nothing else. I also use the iBATIS DAO framework to switch to a mock database for testing. (This is the sort of thing Joe meant by persistence interface.) -Ted. Sasha Borodin wrote: I hope I'm not comparing apples and oranges; if I am, please excuse the ignorance, and slap me upside the head... The subject line says it all - I'm investigating the appropriate uses of the above technologies to move data between databases and objects. Thus far in my development career, I've relied on my own DTO's - homegrown primitive lazy loading, caching, etc. As I'm starting projects for other companies, I'm realizing that no one wants home-grown solutions where standards and proven products have already filled the niche. Thus, I'd like to get some opinions as to the level of complexity and appropriate use of EJBs and other object-relational bridging technologies. Who uses what, why, and where? :-) -Sasha Borodin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Ted Husted, Junit in Action - http://www.manning.com/massol/, Struts in Action - http://husted.com/struts/book.html, JSP Site Design - http://www.amazon.com/exec/obidos/ISBN=1861005512. Get Ready, We're Moving Out!! - http://www.clark04.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: externalizing the button hashmap for the LookupDispatchAction ?
I've done it with a LookupMethods.properties file that contains the following: button.add=add button.cancel=cancel button.copy=copy button.edit=edit button.delete=delete button.save=save button.search=search Then I have the following method in my BaseAction class: /** * Provides the mapping from resource key to method name * * @return Resource key / method name map */ public Map getKeyMethodMap() { Map map = new HashMap(); ResourceBundle methods = ResourceBundle.getBundle(org.appfuse.webapp.action.LookupMethods); Enumeration keys = methods.getKeys(); while (keys.hasMoreElements()) { String key = (String) keys.nextElement(); map.put(key, methods.getString(key)); } return map; } It's not much better, but it does make it a *bit* easier to manage. HTH, Matt -Original Message- From: Mick Knutson [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 30, 2003 1:37 PM To: struts Subject: externalizing the button hashmap for the LookupDispatchAction? I am just wondering if anyone has already made a nicer way to manage the hashmap for the button labels on the LookupDispatchAction? I hate having to continually add elements in the code when I add a new button. --- Thanks Mick Knutson coming soon: Your SOS: Your personal emergency contact system. http://YourSoS.com +001(805) 563-0666 Office +001 (708) 570-2772 Fax --- - 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: Change the .do extension
Yes this is possible. I use a filter mapped to /* and perform logic to lookup all the actions and attempt a match, then forward to the action if it's found. http://www.raibledesigns.com/page/rd?anchor=vanity_urls_in_struts HTH, Matt -Original Message- From: Dirk Behrendt [mailto:[EMAIL PROTECTED] Sent: Monday, September 29, 2003 8:09 AM To: [EMAIL PROTECTED] Subject: Change the .do extension Hello! Is there a possibility to get rid of the .do extension in the actions? For example: http://localhost/login.do should be -- http://localhost/login Ist this possible? Thanks! Dirk - 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: OT - how much to java web developers charge?
It really depends on what clients are willing to pay. In Denver, the going rate for Java Developers is 45-55 hour. A few years ago, it was easy to get 75-100/hour. Times a changin'. HTH, Matt -Original Message- From: Sasha Borodin [mailto:[EMAIL PROTECTED] Sent: Monday, September 29, 2003 8:24 AM To: Struts Users Mailing List Subject: OT - how much to java web developers charge? I though this would be an appropriate group of people to ask: What is the industry-standard compensation structure/level for java web application development? Like if a company said they need a shopping cart e-store, and the developer has to design the database, beans, actions, jsp's, etc.? Do the professionals charge per hour? If so what's the range? Or by the size of the project? Thanks for any insight. -Sasha - 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: DisplayTag
You're best off posting this to a more appropriate list: http://displaytag.sourceforge.net/mail-lists.html -Original Message- From: Slattery, Tim - BLS [mailto:[EMAIL PROTECTED] Sent: Monday, September 29, 2003 9:22 AM To: Struts User List ([EMAIL PROTECTED]) Subject: DisplayTag I STILL can't make this thing work! Here's the code from my JSP page: display:table name=TabBean.counts defaultsort=1 display:column property=value title=Value sortable=true/ display:column property=count title=Count sortable=true decorator=gov.bls.idcf.freqs.struts.CountDec / /display:table Debug print in my Java code shows that the counts property (an array list) is being retrieved, and iterated through. For each member of counts, the value and count properties are being retrieved, and the decorator is being properly called for count. But I have no table. Instead I have this message: Root cause of ServletException java.lang.NoSuchMethodError at org.displaytag.tags.TableTag.doEndTag(TableTag.java:752) at jsp_servlet._content.__tabpage._jspService(__tabpage.java:322) at weblogic.servlet.jsp.JspBase.service(JspBase.java:27) Etc, etc. It doesn't say WHAT method it can't find. What might be the problem here? -- Tim Slattery [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: [Q]Tags: Lookforward to create the correct session name for b ean?
The name given to your bean (and stored in its respective scope) is the same name you give it in your action-mapping in struts-config.xml. HTH, Matt -Original Message- From: Johan Wasserman - CPX Mngd Services [mailto:[EMAIL PROTECTED] Sent: Monday, September 29, 2003 10:03 AM To: Struts Users Mailing List Subject: RE: [Q]Tags: Lookforward to create the correct session name for bean? Are my questions real difficult, or s stupid? No-one's ever answered any of 'em, if only I knew why. {:( -Original Message- From: Johan Wasserman - CPX Mngd Services Sent: Monday, September 29, 2003 8:17 AM To: Struts Users Mailing List Subject: [Q]Tags: Lookforward to create the correct session name for bean? Hi, Is there a way for a formAction to look at the tag defined in the form (especialy the name attribute) so that I can create a bean and save it in the session as the same name as the name attribute even before the tag needs it. Thanks, Johan. - 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: [OT] Apache/SSL help
http://raibledesigns.com/wiki/Wiki.jsp?page=Articles -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, September 29, 2003 10:09 AM To: Struts Users Mailing List Subject: [OT] Apache/SSL help Hello, Can anyone send link explaining how to set up an SSL page on a website (Apache 1.3, Tomcat 4.1)? I am really confused and cannot find the info anywhere. Thanks, Denis - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: BUTTON element
You are correct - there is no button element, but there's nothing preventing you from using your own: button type=submitbean:message key=button.submit//button Struts does not mandate that you use it's tags for form buttons. -Original Message- From: Graham Leggett [mailto:[EMAIL PROTECTED] Sent: Monday, September 29, 2003 10:48 AM To: Struts Users Mailing List Subject: BUTTON element Hi all, I don't seem to see a corresponding struts html tag to render a button element - is there a reason for this, or am I reading the docs wrong? Regards, Graham -- - 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: Change the .do extension
Here's the code - enjoy. I wrote a different one for PathRequestFilter (i.e. /do/*), but this one should work for both - my local versions have a lot of extra logic in it - so I trimmed that. This is untested and I don't even know if it'll compile. I'll be adding to my appfuse project shortly, so I'll know in the next week or two. Here's the settings in web.xml: filter filter-namerequestFilter/filter-name display-nameRequest Filter/display-name filter-classorg.appfuse.webapp.filter.ExtensionRequestFilter/filter-class init-param param-nameallowedExtensions/param-name param-value.html,.asp,.cfm/param-value /init-param init-param param-nameignorePaths/param-name param-value/images,/includes/param-value /init-param /filter filter-mapping filter-namerequestFilter/filter-name url-pattern/*/url-pattern /filter-mapping ExtensionRequestFilter.java /** * This class is used to filter all requests and to determine * if a request should forward to an Action. * * @author Matt Raible * @version $Revision: 1.2 $ $Date: 2003/09/29 15:28:41 $ */ public class ExtensionRequestFilter implements Filter { //~ Static fields/initializers = private static String[] allowedExtensions = null; private static String[] ignorePaths = null; //~ Instance fields /** * The codeLog/code instance for this class */ private Log log = LogFactory.getLog(ExtensionRequestFilter.class); private FilterConfig config = null; //~ Methods public void init(FilterConfig config) throws ServletException { this.config = config; allowedExtensions = StringUtils.split(config.getInitParameter(allowedExtensions), ,); ignorePaths = StringUtils.split(config.getInitParameter(ignorePaths), ,); } /** * Destroys the filter. */ public void destroy() { config = null; } public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws IOException, ServletException { // cast to the types I want to use HttpServletRequest request = (HttpServletRequest) req; HttpServletResponse response = (HttpServletResponse) resp; // flag to attempt to process this URL boolean process = true; // get the requested path String path = request.getServletPath(); // we don't care to check the ignoredPaths for (int j = 0; j ignorePaths.length; j++) { if (path.startsWith(ignorePaths[j])) { process = false; break; } } if (process !StringUtils.equals(path, /) !StringUtils.equals(path, )) { // get Struts' configuration ModuleConfig m = getModuleConfig(request); // get a list of actions ActionConfig[] actions = m.findActionConfigs(); // check to see if path ends with a vanity extension for (int j = 0; j allowedExtensions.length; j++) { if (path.endsWith(allowedExtensions[j])) { path = path.substring(0, path.indexOf(allowedExtensions[j])); break; } } String params = RequestUtil.getRequestParameters(request); StringBuffer url = new StringBuffer(); // check all the actions to see if we have a match for (int i = 0; i actions.length; i++) { ActionConfig action = actions[i]; String actionPath = action.getPath(); if (StringUtils.equalsIgnoreCase(actionPath, path)) { url.append(actionPath + .html); url.append((!StringUtils.isEmpty(params)) ? (? + params) : ); log.debug(requesting action: + actionPath); RequestDispatcher dispatcher = request.getRequestDispatcher(url.toString()); dispatcher.forward(request, response); return; } } } chain.doFilter(request, response); } /** * Return the module configuration object for the currently selected * module. MR - Copied from Struts' ActionServlet * * @param request The servlet request we are processing * @since Struts 1.1 */ protected ModuleConfig getModuleConfig(HttpServletRequest request) { ModuleConfig mConfig = (ModuleConfig) request.getAttribute(Globals.MODULE_KEY); if (mConfig == null) { mConfig = (ModuleConfig
RE: DisplayTag library
Here's a temporary demo site - this URL will self-destruct as soon as the live examples is working: http://raibledesigns.com/displaytag ;-) -Original Message- From: Slattery, Tim - BLS [mailto:[EMAIL PROTECTED] Sent: Friday, September 26, 2003 9:27 AM To: Struts User List ([EMAIL PROTECTED]) Subject: DisplayTag library I saw the announcement of the SidplayTag library here a couple of days ago, and it looks useful. But Clicking the Live Examples link on its web page yields a 404 (page not found). And I would like to use a ColumnDecorator, but where's the documentation on that? In the ZIP download file, there are *two* ColumnDecorator classes, one in /org/displaytag/decorator package, the other in org/apache/taglibs/display package. But there's no mention of this package at the Apache site. So where's the documentation? -- Tim Slattery [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 menu
It's probably best that you post this to the [EMAIL PROTECTED] project. -Original Message- From: Jan Van Stalle [mailto:[EMAIL PROTECTED] Sent: Friday, September 26, 2003 7:19 PM To: [EMAIL PROTECTED] Subject: struts menu Hello, Lately I saw a reference to struts menu on this newsgroup; tried to use it but it seems complicated to put the bits and pieces together (classes, js files, ...) Does anyone have a link to documentation, besides the one which comes with the war file ?? Thanks, Jan - 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: display tags and large result sets
You're better off asking this question on the [EMAIL PROTECTED] mailing list. Here's a quick answer: The display tag library is just that - a tag library, meant for viewing and iterating lists. As far as dealing with your backend data, that's up to (as far as it's concerned). If you want to limit and such, you can probably trap the request parameters in your Action and adjust your query accordingly to retrieve the proper dataset. HTH, Matt -Original Message- From: Michael Muller [mailto:[EMAIL PROTECTED] Sent: Friday, September 26, 2003 3:53 PM To: Struts Users Mailing List Subject: display tags and large result sets I'd love to use this package, but I often deal with large result sets returned from a database. I'm afraid that I wouldn't be able to support many users if I kept sucking the whole table into memory. I deal with this manually by using MySQL's LIMIT and OFFEST syntax. Clicking on column headers changes the ORDER BY of the query. I gave the docs a quick look and didn't see anything that looked like it would support something like this. Did I miss anything? How hard would it be to enhance the tag to support this? -- Mike - 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]
Setting the page title from a tile
I have an interesting problem that I can't figure out how to solve. We are using Tiles, as well as a custom tag library that renders content from Velocity Templates. These templates have HTML content in them, but they're mostly text - and this is our CMS (for now). The problem is is that we've developed our app in a way only our menu needs to know about the templates. So /appName/static/template will show the template page (wrapped in Tiles). The problem is, by the time I load the Tile, with the template, the page's title has already been set. Sure I could use JavaScript and set document.title in the Velocity template, but that does no good for search engine optimization. Another solution I thought of is to put the title into the URL in my menus, i.e. /appName/static/homeownerServices?title=Homeowner%20Services - but that's just plain ol' ugly to send as a URL (via e-mail and such). Two other solutions I can think of: 1. Create a action-mapping and tile for each template (i.e. /appName/homeownerServices), and define the title in there. 2. Parse the template name and convert it to readable titles. This would require that I name all my templates so they have an appropriate title, but it just might work. In this example, /homeownerServices gets translated to Homeowner Services as a title. I guess I'll go with #2 (see how simply posting these messages actually helps to solve things!), but I wanted to see if anyone else had any good suggestions/practices. Thanks, Matt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Know of any good Calendar Tag Libraries? (Sorry, that was Aug 21)
Try this: http://www.aoc.nrao.edu/~bwaters/pub/taglib/calendar-taglib.html -Original Message- From: Navneet Karnani [mailto:[EMAIL PROTECTED] Sent: Thursday, September 25, 2003 1:58 AM To: [EMAIL PROTECTED] Subject: Re: Know of any good Calendar Tag Libraries? (Sorry, that was Aug 21) So, did you find it ? If yes, let me know too. I was looking out for something similar. - Navneet Matt Raible said the following on 25/09/2003 4:15 AM: I'm aware of Matt's Library (and I love it), but I don't want a pop-up, I want an in-page calendar. Matt -Original Message- From: David G Friedman [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 24, 2003 4:37 PM To: Struts Users Mailing List Subject: RE: Know of any good Calendar Tag Libraries? (Sorry, that was Aug 21) What about Matt Kruse's (very) beta taglib mentioned August 21st? http://www.mattkruse.com/javascript/javascripttoolbox.zip I wonder if it's any further along. -David -Original Message- From: Matt Raible [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 24, 2003 6:23 PM To: '[EMAIL PROTECTED]' Subject: Know of any good Calendar Tag Libraries? Anyone know of a good Calendar Tag Library - that renders calendars like the ones you see on blogs (not a pop-up)? I found this one (http://tinyurl.com/ok95) from Coldbeans, but it's $50 - whereas free is always better. We just need it to render a calendar on a page and gray out certain days (with CSS) to say that day is not available. Thanks, Matt - 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: Setting the page title from a tile
I'm already doing this in most of my definitions: put name=titleKey value=activities.title/ %-- Push tiles attributes in page context --% tiles:importAttribute scope=request/ titlebean:message name=titleKey//title But if you read my message closely - you'd see that I don't have a definition, and I don't have an action defined for these velocity template pages. In fact, my app really knows nothing about them - the URL indicates that a template should be rendered. The *only* thing in my app that knows these templates exists is the URL - which will eventually be configured in the menu for the app. To include a static template in a tile, I'm doing: putList name=sections add value=/WEB-INF/pages/weather.jsp/ add value=/do/static?template=indexAds/ /putList Where the second one is a static template (there's a ForwardAction for /static) and it takes a parameter of /WEB-INF/pages/static.jsp where static.jsp only has: %@ include file=/common/taglibs.jsp% rq:content page=%=request.getParameter(template)%/ Thanks, Matt -Original Message- From: Holman, Cal [mailto:[EMAIL PROTECTED] Sent: Thursday, September 25, 2003 8:40 AM To: Struts Users Mailing List Subject: RE: Setting the page title from a tile I do something a little different to pull the title out of application.properties definition name=whatsnew.pagedef extends=home.pagedef put name=title value=whatsnew.title / put name=content value=/web/pages/home/WhatsNew.jsp / put name=keywords value=whatsnew.keywords/ put name=crumbtitle2 value=What's New/ put name=crumblink2 value=/home/WhatsNew/ put name=pagename value=WhatsNew/ put name=defname value=whatsnew.pagedef/ /definition in template tiles:importAttribute name=title/ titlebean:message name=title scope=page//title Additionally to pass the tile name for menus to use I define a bean in the definition name to the request tiles:useAttribute id=defname name=defname scope=request/ Cal http://www.calandva.com/Last update 08/01/03 -Original Message- From: Srinivas Gunturu [mailto:[EMAIL PROTECTED] Sent: Thursday, September 25, 2003 09:56 To: [EMAIL PROTECTED] Subject: Re: Setting the page title from a tile Matt, We have solved this in our application by defining our tile as follows definition name=baseDef path=/Template.jsp put name=title value=My Title1 / put name=header value=/header.jsp/ put name=topnav value=/topnav.jsp/ put name=leftnav value=/navigation.jsp/ put name=footer value=/footer.jsp/ put name=body value=/body.jsp /definition In Template.jsp, you can access title using tiles.getAsString TITLEtiles:getAsString name=title//TITLE Hope this helps. [EMAIL PROTECTED] 09/25/03 08:51AM I have an interesting problem that I can't figure out how to solve. We are using Tiles, as well as a custom tag library that renders content from Velocity Templates. These templates have HTML content in them, but they're mostly text - and this is our CMS (for now). The problem is is that we've developed our app in a way only our menu needs to know about the templates. So /appName/static/template will show the template page (wrapped in Tiles). The problem is, by the time I load the Tile, with the template, the page's title has already been set. Sure I could use JavaScript and set document.title in the Velocity template, but that does no good for search engine optimization. Another solution I thought of is to put the title into the URL in my menus, i.e. /appName/static/homeownerServices?title=Homeowner%20Services - but that's just plain ol' ugly to send as a URL (via e-mail and such). Two other solutions I can think of: 1. Create a action-mapping and tile for each template (i.e. /appName/homeownerServices), and define the title in there. 2. Parse the template name and convert it to readable titles. This would require that I name all my templates so they have an appropriate title, but it just might work. In this example, /homeownerServices gets translated to Homeowner Services as a title. I guess I'll go with #2 (see how simply posting these messages actually helps to solve things!), but I wanted to see if anyone else had any good suggestions/practices. Thanks, Matt - 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] Learn more about Paymentech's payment processing services at www.paymentech.com THIS MESSAGE IS CONFIDENTIAL. This e-mail message and any attachments are proprietary and confidential information intended only for the use of the recipient(s) named
RE: Urgent: Changing URLs for existing struts project
Your best bet is to ask this question on the tomcat user list since it's really a tomcat issue. My suggestion would be to put apache in front of Tomcat and create a mapping for the jk to map javapps/* to tomcat. OT: javapps makes no sense, I'd use /javaapps or /java or /apps. And when are longer URLs better? ;-) Matt -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, September 25, 2003 9:31 AM To: [EMAIL PROTECTED] Subject: Urgent: Changing URLs for existing struts project Hi All I am currently running tomcat4.1.27 and apache1.3.x. I am using struts. I used call my webapplication xyz using www.abc.org/xyz. Now company has decided that pople should be able to access this webapplication through the URL www.abc/javapps/xyz. Do i need to change the whole architecture now or should i be able to do it easily. I have tried to create a directory under /var/tomcat4/webapps/ as japps/xyz and pointed my .war file to this directory. But tomcat is not able to map this URL at all. Please help me find a solution to this problem. Thanx in advance --Mohan - 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]
Inserting tiles dynamically based on a list from tiles-config.xml
I have the following in tiles-config.xml: putList name=sections add value=/WEB-INF/pages/sideNav.jsp/ add value=/WEB-INF/pages/weather.jsp/ add value=/WEB-INF/pages/package.jsp/ add value=/WEB-INF/pages/deals.jsp/ /putList And I want to loop through these in my layout and render them accordingly: c:forEach var=section items=${sectionList} varStatus=status tiles:insert attribute=${section}/ /c:forEach Alas, there's no tile-el tag library and this is not possible (yet). Do I have to use logic:iterate to accomplish this? Thanks, Matt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Inserting tiles dynamically based on a list from tiles-config .xml [SOLVED]
c:forEach var=section items=${sections} varStatus=status c:import url=${section}/ /c:forEach -Original Message- From: Matt Raible [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 24, 2003 1:33 PM To: '[EMAIL PROTECTED]' Subject: Inserting tiles dynamically based on a list from tiles-config.xml I have the following in tiles-config.xml: putList name=sections add value=/WEB-INF/pages/sideNav.jsp/ add value=/WEB-INF/pages/weather.jsp/ add value=/WEB-INF/pages/package.jsp/ add value=/WEB-INF/pages/deals.jsp/ /putList And I want to loop through these in my layout and render them accordingly: c:forEach var=section items=${sectionList} varStatus=status tiles:insert attribute=${section}/ /c:forEach Alas, there's no tile-el tag library and this is not possible (yet). Do I have to use logic:iterate to accomplish this? Thanks, Matt - 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]
Tiles Tips o' the Day
Some things I learned today: http://raibledesigns.com/page/rd?anchor=tiles_tips_o_the_day Enjoy! Matt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Know of any good Calendar Tag Libraries?
Anyone know of a good Calendar Tag Library - that renders calendars like the ones you see on blogs (not a pop-up)? I found this one (http://tinyurl.com/ok95) from Coldbeans, but it's $50 - whereas free is always better. We just need it to render a calendar on a page and gray out certain days (with CSS) to say that day is not available. Thanks, Matt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Know of any good Calendar Tag Libraries? (Sorry, that was Aug 21)
I'm aware of Matt's Library (and I love it), but I don't want a pop-up, I want an in-page calendar. Matt -Original Message- From: David G Friedman [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 24, 2003 4:37 PM To: Struts Users Mailing List Subject: RE: Know of any good Calendar Tag Libraries? (Sorry, that was Aug 21) What about Matt Kruse's (very) beta taglib mentioned August 21st? http://www.mattkruse.com/javascript/javascripttoolbox.zip I wonder if it's any further along. -David -Original Message- From: Matt Raible [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 24, 2003 6:23 PM To: '[EMAIL PROTECTED]' Subject: Know of any good Calendar Tag Libraries? Anyone know of a good Calendar Tag Library - that renders calendars like the ones you see on blogs (not a pop-up)? I found this one (http://tinyurl.com/ok95) from Coldbeans, but it's $50 - whereas free is always better. We just need it to render a calendar on a page and gray out certain days (with CSS) to say that day is not available. Thanks, Matt - 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]
[ANNOUNCE] Display Tag 1.0 beta 1 Released!
The Display Tag Library has a new release! This release is pretty stellar - checkout the full list of changes at http://displaytag.sourceforge.net/changes-report.html#1.0-b1. Matt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Is it possible to remove *.do or /do/* from the URL [solved]
Back to the original question... I found a solution and want to validate it: 1. I created a RequestFilter that maps to /* 2. This filter checks to see if request.getServletPath() matches any of the action paths in struts-config.xml. If so, it forwards to the action. 3. As an added feature, I added a set of allowed extensions to this filter's init parameters. So far I have .jsp,.html,.asp,.cfm (using .jsp ensures no one links to them directly, MVC enforced!) - so marketing can choose what technology they want to convey ;-) This seems to work great. For example, I have an advancedSearch action defined as follows: action path=/advancedSearch type=org.apache.struts.actions.ForwardAction parameter=.advancedSearch/ (ForwardAction will eventually be replaces, if necessary, with a real action). This allows all of the following URLs to work: http://site.com/do/advancedSearch (works with Struts by default) http://site.com/advancedSearch http://site.com/advancedSearch.html + all other extensions listed. Pretty slick IMO. Please let me know if I'm missing anything. Thanks, Matt Here's the code from RequestFilter.doFilter(): // get Struts' configuration ModuleConfig m = getModuleConfig(request); // get a list of actions ActionConfig[] actions = m.findActionConfigs(); // get the requested path String path = request.getServletPath(); for (int i = 0; i actions.length; i++) { ActionConfig action = actions[i]; String actionPath = action.getPath(); String params = RequestUtil.getRequestParameters(request); // check to see if path ends with a vanity extension for (int j = 0; j allowedExtensions.length; j++) { if (path.endsWith(allowedExtensions[j])) { path = path.substring(0, path.indexOf(allowedExtensions[j])); break; } } if (StringUtils.equalsIgnoreCase(actionPath, path)) { StringBuffer url = new StringBuffer(); boolean redirect = false; // change to true if using redirect if (redirect) { url.append(request.getContextPath()); } url.append(/do + actionPath); url.append((!StringUtils.isEmpty(params)) ? (? + params) : ); if (log.isDebugEnabled()) { log.debug(forwarding from path ' + path + ' to action ' + actionPath + '); } // This this until we have issues (this way the URL doesn't change) RequestDispatcher dispatcher = request.getRequestDispatcher(url.toString()); dispatcher.forward(request, response); // If a forward doesn't work - use the one below // Redirect the page to the desired URL // response.sendRedirect(response.encodeRedirectURL(url.toString())); // ensure we don't chain to requested resource return; } } protected ModuleConfig getModuleConfig(HttpServletRequest request) { ModuleConfig mConfig = (ModuleConfig) request.getAttribute(Globals.MODULE_KEY); if (mConfig == null) { mConfig = (ModuleConfig) config.getServletContext().getAttribute(Globals.MODULE_KEY); } return mConfig; } -Original Message- From: Jason Lea [mailto:[EMAIL PROTECTED] Sent: Thursday, September 18, 2003 3:10 PM To: Struts Users Mailing List Subject: Re: Is it possible to remove *.do or /do/* from the URL If there are only a small number of 'marketing' style URLs that are going to be used, you could do those mappings specifically in the web.xml and leave everything else to your /do/* mapping Eg Marketing URLs 'activities', 'contact', 'foo' /activities/* /contact/* /foo/* everything else /do/* Or you could wrap a filter around the /activities/*, /contact/*, /foo/* mappings and forward to the correct action. -- Jason Lea Matt Raible wrote: The reason I don't like extension mapping is because I think path-mapping (/do/*) is cleaner. Also, I like using path-mapping b/c then we can add parameters and they look like regular URLs. For example - extension mapping: http://site.com/activities.do?activity=fishing or http://site.com/activities.do?fishing path-mapping: http://site.com/do/activities/fishing And then in our activities action, we can do a check (request.getPathInfo()) to see if we should serve up the fishing page vs. the general activities one. Thanks to all for your opinions and practices. Matt -Original Message- From: Micael [mailto:[EMAIL PROTECTED] Sent: Thursday, September 18, 2003 11:33 AM To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: Re: Is it possible to remove *.do or /do/* from the URL I use .Whatever, where that is some marketing term that is acceptable. At 10:39 AM 9/18/2003 -0400, Vic Cekvenich wrote: How about a hack: *.jsp It looks as jsp on top but it's a do. Or you can even say *.asp, or anything. Just pick a word marketing likes. .V Matt Raible wrote: I agree with you
RE: Is it possible to remove *.do or /do/* from the URL
I agree with you - however, it's a marketing thing. The project I'm on has implemented a lot of folder/index.html (with meta-refresh) so that marketing materials have pretty URLs. I was simply hoping to accomplish this without doing anything extra - so http://site.com/do/activities can be put into marketing materials as http://site.com/activities. Maybe we could have marketing use http://site.com/activities/index.html and then use a filter (mapped to *.html) to do a redirect to http://site.com/do/activities. Matt -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED] Sent: Thursday, September 18, 2003 1:26 AM To: Struts Users Mailing List Subject: Re: Is it possible to remove *.do or /do/* from the URL The important principle here is Web Application != Web Site. If your users feel compelled to use bookmarks and the back button in your webapps, despite efforts to train them correctly, this is a pretty good sign that you have not provided enough suitable navigation controls in your basic UI. Craig - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Is it possible to remove *.do or /do/* from the URL
The reason I don't like extension mapping is because I think path-mapping (/do/*) is cleaner. Also, I like using path-mapping b/c then we can add parameters and they look like regular URLs. For example - extension mapping: http://site.com/activities.do?activity=fishing or http://site.com/activities.do?fishing path-mapping: http://site.com/do/activities/fishing And then in our activities action, we can do a check (request.getPathInfo()) to see if we should serve up the fishing page vs. the general activities one. Thanks to all for your opinions and practices. Matt -Original Message- From: Micael [mailto:[EMAIL PROTECTED] Sent: Thursday, September 18, 2003 11:33 AM To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: Re: Is it possible to remove *.do or /do/* from the URL I use .Whatever, where that is some marketing term that is acceptable. At 10:39 AM 9/18/2003 -0400, Vic Cekvenich wrote: How about a hack: *.jsp It looks as jsp on top but it's a do. Or you can even say *.asp, or anything. Just pick a word marketing likes. .V Matt Raible wrote: I agree with you - however, it's a marketing thing. The project I'm on has implemented a lot of folder/index.html (with meta-refresh) so that marketing materials have pretty URLs. I was simply hoping to accomplish this without doing anything extra - so http://site.com/do/activities can be put into marketing materials as http://site.com/activities. Maybe we could have marketing use http://site.com/activities/index.html and then use a filter (mapped to *.html) to do a redirect to http://site.com/do/activities. Matt -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED] Sent: Thursday, September 18, 2003 1:26 AM To: Struts Users Mailing List Subject: Re: Is it possible to remove *.do or /do/* from the URL The important principle here is Web Application != Web Site. If your users feel compelled to use bookmarks and the back button in your webapps, despite efforts to train them correctly, this is a pretty good sign that you have not provided enough suitable navigation controls in your basic UI. Craig - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] LEGAL NOTICE This electronic mail transmission and any accompanying documents contain information belonging to the sender which may be confidential and legally privileged. This information is intended only for the use of the individual or entity to whom this electronic mail transmission was sent as indicated above. If you are not the intended recipient, any disclosure, copying, distribution, or action taken in reliance on the contents of the information contained in this transmission is strictly prohibited. If you have received this transmission in error, please delete the message. Thank you - 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]
Requesting the same action with more than one path
I want to hit a page action (path=/page) with the following URLs - and then do logic to determine which tiles definition I should load: http://site.com/do/page/tile1 http://site.com/do/page/tile2 But I keep getting: RequestProcessor.processMapping(683) | Invalid path /page/tile1 was requested. Is this possible w/o subclassing RequestProcessor. Can I do path=/page/* (I tried this, no dice) in my struts-config.xml? I know I can use the DefinitionDispatcherAction to do /do/page?def=defName, but I'd like a cleaner URL (no params). Thanks, Matt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [ANNOUNCE] StrutsDoc 0.4 Released
I'd prefer them just be shown in a pre - so I could see the whole function. Here's what I use for pre in CSS. pre { background: #dd; border: 1px solid #99; color: #00; padding: 5px 5px 5px 7px; } Matt -Original Message- From: Nick [mailto:[EMAIL PROTECTED] Sent: Monday, September 15, 2003 10:54 PM To: [EMAIL PROTECTED] Subject: [ANNOUNCE] StrutsDoc 0.4 Released Note: I'm not sure if the way the javascript functions are presented in the Validator docs is the best way to do it. If you have feedback or suggestions about how I could better present it, please let me know. -- Nick Heudecker SystemMobile, Inc. Email: [EMAIL PROTECTED] Phone: 734.604.9192 Web: http://www.systemmobile.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: [OT] Java Class to match US state abbreviations with their fu ll name?
http://tinyurl.com/ngnc HTH, Matt -Original Message- From: David Erickson [mailto:[EMAIL PROTECTED] Sent: Monday, September 15, 2003 3:07 PM To: Struts Mailing List Subject: [OT] Java Class to match US state abbreviations with their full name? Just wondering if anyone offhand knew of a open source java class for matching state abbreviations with their full name.. I could write something to do it myself easily enough but I'm not encredibly interested in doing it =) Thanks David - 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 Menu framework documentation
The example application is the best documentation available. You can also checkout the demo on my site at http://raibledesigns.com/struts-menu. HTH, Matt -Original Message- From: Madhu Nair [mailto:[EMAIL PROTECTED] Sent: Friday, September 12, 2003 2:40 AM To: Struts Users Mailing List Subject: Struts Menu framework documentation Hi, Can someone point me to some documentation on using the Struts menu framework? Regards, Madhu - 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: java.util.Date in a Bean/ActionForm
I've accomplished this by registering a DateConverter in a static block. From my BaseManager.java class: static { ... ConvertUtils.register(new DateConverter(), Date.class); ... } DateConverter.java public class DateConverter implements Converter { //~ Instance fields /** Log instance for this class */ private Log log = LogFactory.getLog(DateConverter.class); //~ Methods /** * Convert a String to a Date and a Date to a String * * @param type the class type to output * @param value the object to convert * @return object the converted object (Date or String) */ public final Object convert(final Class type, final Object value) { log.debug(entered method); // for a null value, return null if (value == null) { return null; } else { if (value instanceof String) { log.debug(value ( + value + ) instance of String); try { if (StringUtils.isEmpty(value.toString())) { return null; } return DateUtil.convertStringToDate(value.toString()); } catch (ParseException pe) { pe.printStackTrace(); } } else if (value instanceof Date) { log.debug(value ( + value + ) instance of Date); return DateUtil.convertDateToString((Date) value); } } throw new ConversionException(Could not convert + value.getClass().getName() + to + type.getName() + !); } } -Original Message- From: Cees van de Griend [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 10, 2003 2:00 PM To: Struts Users Subject: java.util.Date in a Bean/ActionForm L.S. I'm new at Struts, but I got it working. I've an simple Bean with a java.util.Date property and the set and get methods with to set/get the java.util.Date values. I've an (almost) working ActionForm with the same properties. In a Action I use somthing like: org.apache.commons.beanutils.PropertyUtils.copyProperties(form, bean) to copy all the properties from the bean to the form and forward to a JSP page to edit the properties in an HTML-form. So far, all is well; the date is displayed like '2003-09-10' in an text-field. If I submit this page, a 'IllegalArgumentException: argument type mismatch' is thrown. If I remove all the java.util.Date code, all is working as expected. Clearly I'm doing something wrong with the java.util.Date. What is the best way to get a date from a HTML-form to a Bean? Regards, Cees. - 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: DateUtil
I created it myself - here's the method you're looking for: /** * This method converts a String to a date using the pattern MM/dd/ * * @param strDate the date to convert * @return a date object * * @throws ParseException exception thrown when formatting fails */ public static Date convertStringToDate(String strDate) throws ParseException { SimpleDateFormat df = new SimpleDateFormat(MM/dd/); Date date = null; if (log.isDebugEnabled()) { log.debug(converting ' + strDate + ' to date); } try { date = df.parse(strDate); } catch (ParseException pe) { log.error(ParseException: + pe); throw new ParseException(pe.getMessage(), pe.getErrorOffset()); } return date; } -Original Message- From: Cees van de Griend [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 10, 2003 3:11 PM To: Matt Raible Subject: DateUtil Hello Matt, I can't find the class DateUtil. Could you tell me where you found it or send the code to me? TIA, Cees. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tiles html-taglib producing XHTML
You have to set each tile to be XHTML - here's how I do it: Since every page probably needs taglibs, I have a common/taglibs.jsp file. In this page, I have my taglib declarations and the following line at the end: html:xhtml / Then every page includes that with: %@ include file=/common/taglibs.jsp% This has worked great for me. Matt -Original Message- From: Adam Hardy [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 09, 2003 10:09 AM To: Struts Users Mailing List Subject: Tiles html-taglib producing XHTML I'm using the struts html taglib, well actually the html-el taglib but the problem is with both, and I am outputting XHTML, but the input taglib doesn't output XHTML when it's in a different Tile. I have my Tiles layout page with the doctype declaration and the html:html xhtml=true and the tiles:insert attribute=bodyContent / to include my content. Anything nested nicely inside the html:html xhtml=true tags in the layout tile is given proper XHTML syntax, but in the other tiles, it's not. i.e. instead of: input type=image name= src=edit.png title=Edit alt=Edit / it gives: input type=image name= src=edit.png title=Edit alt=Edit Before I go off to bugzilla, assuming I haven't overlooked something important, what is it a bug of? html-taglib or tiles? Thanks, Adam -- struts 1.1 + tomcat 4.1.27 + java 1.4.2 Linux 2.4.20 RH9 - 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: What's a well defined Struts Project Structure?
Here's what I do - based on Erik Hatcher's recommendations in his Java Development with Ant book: MyProject | - lib (third party jars, etc.) | src (.java files) | test (junit, cactus, webtest tests) | web | images | styles | scripts | WEB-INF | classes | .properties and .xml files web.xml struts-config.xml build.xml For a working example, checkout my appfuse project at: http://raibledesigns.com/wiki/Wiki.jsp?page=AppFuse HTH, Matt -Original Message- From: Yansheng Lin [mailto:[EMAIL PROTECTED] Sent: Monday, September 08, 2003 10:37 AM To: 'Struts Users Mailing List' Subject: What's a well defined Struts Project Structure? What a well defined struts project structure would look like? I am always a bit hesitant with where to put things Right now, I have: MyProject |- documentation |- images |- jsps |- styles |- javascript |- WEB-INF |- classes |- bin struts-config.xml *.tld project.xml ... But I always run into problems with too many files in one folder or too few files in one folder. I searched the apache CVS tree, and found that it's a mess there too. Just compare Tomcat and Struts, you will know what I am talking about. 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: What's a well defined Struts Project Structure?
For documentation - I'd create a docs folder at the basedir level. Maven is a very slick tool, and I like their directory structure, I just haven't migrated my AppFuse project to use it yet. Matt -Original Message- From: Yansheng Lin [mailto:[EMAIL PROTECTED] Sent: Monday, September 08, 2003 12:06 PM To: 'Struts Users Mailing List' Subject: RE: What's a well defined Struts Project Structure? How about documentation folder and jsp files, where would you put them? BTW, I was studying a tool called Maven on Apache. I think it's more relevant to project structure than Ant. Ant is more related to building a project, isn't it? Is there a standard project model/pattern out there we can just follow? -Original Message- From: Matt Raible [mailto:[EMAIL PROTECTED] Sent: September 8, 2003 11:06 AM To: 'Struts Users Mailing List' Subject: RE: What's a well defined Struts Project Structure? Here's what I do - based on Erik Hatcher's recommendations in his Java Development with Ant book: MyProject | - lib (third party jars, etc.) | src (.java files) | test (junit, cactus, webtest tests) | web | images | styles | scripts | WEB-INF | classes | .properties and .xml files web.xml struts-config.xml build.xml For a working example, checkout my appfuse project at: http://raibledesigns.com/wiki/Wiki.jsp?page=AppFuse HTH, Matt -Original Message- From: Yansheng Lin [mailto:[EMAIL PROTECTED] Sent: Monday, September 08, 2003 10:37 AM To: 'Struts Users Mailing List' Subject: What's a well defined Struts Project Structure? What a well defined struts project structure would look like? I am always a bit hesitant with where to put things Right now, I have: MyProject |- documentation |- images |- jsps |- styles |- javascript |- WEB-INF |- classes |- bin struts-config.xml *.tld project.xml ... But I always run into problems with too many files in one folder or too few files in one folder. I searched the apache CVS tree, and found that it's a mess there too. Just compare Tomcat and Struts, you will know what I am talking about. 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Converting a ResultSet to a List of POJOs
Thanks to all for your suggestions. I did some number comparisons b/w the standard way (rs.next() ... set, set, set), ibatis, and ResultSetUtils.getCollection() from scaffold. Here's what I found: 1. Standard way - 0.24 seconds 2. ibatis - 5+ seconds (ugh! - maybe I'm doing something wrong, more info here: http://tinyurl.com/mod4) 3. ResultSetUtils.getCollection - 0.27 seconds So I'm going with #3 as it'll speed up dev time and doesn't have much of a performance hit. Thanks, Matt -Original Message- From: Jerry Jalenak [mailto:[EMAIL PROTECTED] Sent: Monday, September 08, 2003 7:09 AM To: 'Struts Users Mailing List' Subject: RE: Converting a ResultSet to a List of POJOs +1. Simplest method I've seen to go from a ResultSet to a Collection of JavaBeans Jerry Jalenak Team Lead, Web Publishing LabOne, Inc. 10101 Renner Blvd. Lenexa, KS 66219 (913) 577-1496 [EMAIL PROTECTED] -Original Message- From: Ted Husted [mailto:[EMAIL PROTECTED] Sent: Saturday, September 06, 2003 10:34 AM To: Struts Users Mailing List Subject: Re: Converting a ResultSet to a List of POJOs I'm about to try iBATIS www.ibatis.com for a new phase of a project we started in Hibernate. Hibernate is cool, but I think something simpler might be a better fit. (Not sure if we really need that finely grained object layer after all :) It will let you remove the SQL to a simple XML file and give that statement a name. You can then call the named statement from your Java code and get a POJO result. Like what I was doing in Scaffold, only better =:0) -Ted. Matt Raible wrote: Dear Struts Experts, I recently started a new project where most of the backend code is already written with JDBC and ResultSets. The ResultSets are iterated through and a POJOs values are set using pojo.setName(rs.getString(...)), etc. - you get the point. I'm wondering if there's an easier way - so I could do something like this: ResultSet rs = stmt.executeQuery(SELECT ...); List objects = FancyUtilitity.convertResultSetToListOfObjects(rs, object.class); Hibernate let me do this very simply - and I miss the fact that I could type a line or two to get a List of POJOs. List users = ses.createQuery(from u in class + User.class + order by u.name).list(); I've looked at the RowSetDynaClass (http://tinyurl.com/mekh), which has an interesting way of doing this - is this the recommended approach in the JDBC world? Here's an example using it: ResultSet rs = stmt.executeQuery(SELECT ...); RowSetDynaClass rsdc = new RowSetDynaClass(rs); rs.close(); stmt.close(); ...;// Return connection to pool List rows = rsdc.getRows(); ...; // Process the rows as desired Thanks, Matt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Ted Husted, Junit in Action - http://www.manning.com/massol/, Struts in Action - http://husted.com/struts/book.html, JSP Site Design - http://www.amazon.com/exec/obidos/ISBN=1861005512. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This transmission (and any information attached to it) may be confidential and is intended solely for the use of the individual or entity to which it is addressed. If you are not the intended recipient or the person responsible for delivering the transmission to the intended recipient, be advised that you have received this transmission in error and that any use, dissemination, forwarding, printing, or copying of this information is strictly prohibited. If you have received this transmission in error, please immediately notify LabOne at the following email address: [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]
Converting a ResultSet to a List of POJOs
Dear Struts Experts, I recently started a new project where most of the backend code is already written with JDBC and ResultSets. The ResultSets are iterated through and a POJOs values are set using pojo.setName(rs.getString(...)), etc. - you get the point. I'm wondering if there's an easier way - so I could do something like this: ResultSet rs = stmt.executeQuery(SELECT ...); List objects = FancyUtilitity.convertResultSetToListOfObjects(rs, object.class); Hibernate let me do this very simply - and I miss the fact that I could type a line or two to get a List of POJOs. List users = ses.createQuery(from u in class + User.class + order by u.name).list(); I've looked at the RowSetDynaClass (http://tinyurl.com/mekh), which has an interesting way of doing this - is this the recommended approach in the JDBC world? Here's an example using it: ResultSet rs = stmt.executeQuery(SELECT ...); RowSetDynaClass rsdc = new RowSetDynaClass(rs); rs.close(); stmt.close(); ...;// Return connection to pool List rows = rsdc.getRows(); ...; // Process the rows as desired Thanks, Matt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Converting a ResultSet to a List of POJOs
This is what I'm trying to get away from. -Original Message- From: Micael [mailto:[EMAIL PROTECTED] Sent: Friday, September 05, 2003 5:19 PM To: Struts Users Mailing List Subject: Re: Converting a ResultSet to a List of POJOs I assume you don't mean something like: brbr List list = null;br try {br list = Collections.synchronizedList(new LinkedList());br User user = null;br CompositeEntity composite = new CompositeEntity();br while(rs.next()) {br user = composite.getUserVO();br user.setId(rs.getInt(id));br user.setUsername(rs.getString(username));br user.setPassword(rs.getString(password));br user.setName(rs.getString(name));br user.setEmail(rs.getString(email));br user.setType(rs.getString(type));br user.setStatus(rs.getInt(status));br user.setTime(rs.getLong(time));br list.add(user);br } pstmnt.close();br pstmnt = null;br } catch(SQLException sqle) {br throw new ChainedException(sqle, HsqlUserDAO: rs.next(): + sqle.getMessage());br }br return list;brbrbr But, if you do, there it is: Micael At 05:49 PM 9/5/2003 -0500, you wrote: Dear Struts Experts, I recently started a new project where most of the backend code is already written with JDBC and ResultSets. The ResultSets are iterated through and a POJOs values are set using pojo.setName(rs.getString(...)), etc. - you get the point. I'm wondering if there's an easier way - so I could do something like this: ResultSet rs = stmt.executeQuery(SELECT ...); List objects = FancyUtilitity.convertResultSetToListOfObjects(rs, object.class); Hibernate let me do this very simply - and I miss the fact that I could type a line or two to get a List of POJOs. List users = ses.createQuery(from u in class + User.class + order by u.name).list(); I've looked at the RowSetDynaClass (http://tinyurl.com/mekh), which has an interesting way of doing this - is this the recommended approach in the JDBC world? Here's an example using it: ResultSet rs = stmt.executeQuery(SELECT ...); RowSetDynaClass rsdc = new RowSetDynaClass(rs); rs.close(); stmt.close(); ...;// Return connection to pool List rows = rsdc.getRows(); ...; // Process the rows as desired Thanks, Matt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] LEGAL NOTICE This electronic mail transmission and any accompanying documents contain information belonging to the sender which may be confidential and legally privileged. This information is intended only for the use of the individual or entity to whom this electronic mail transmission was sent as indicated above. If you are not the intended recipient, any disclosure, copying, distribution, or action taken in reliance on the contents of the information contained in this transmission is strictly prohibited. If you have received this transmission in error, please delete the message. Thank you - 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: Does Struts Menu work with subapps?
There's nothing specifically coded for subapps (to my knowledge). How is it *not* working in your subapp? -Original Message- From: Menke, John [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 20, 2003 3:31 PM To: Struts (E-mail) Subject: Does Struts Menu work with subapps? Will the menu be able to handle links to subapps correctly? -jm - 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]
Globals forwards with LookupDispatchAction
I'm using lookup LookupDispatchAction and to ease development, I've defined each of my CRUD methods as a global-forward. For example: forward name=editProfile path=/editUser.do?action=Edit/ However, the problem is that this doesn't work with i18n. What I'd like to do is to have it dynamically substituted in the struts-config.xml file. So my forward would look like this: forward name=editProfile path=/editUser.do?action=${msg:button.edit}/ Is this possible - or am I best off using html:link with parameters as part of the link? Thanks, Matt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Suggestions for Calendar Popup taglib?
Cool Matt - I've always loved you pop-up calendar. Does this mean it'll write JS for the popup calendar too? I like the div version - which requires a hidden div and such - so I hope you'll incorporate this. Maybe something like: html:calendar property=startDate format=MM/dd/ image=path/to/image / Of course, this will still be a String property b/c that's all the web can handle, but I always use a image icon for my calendar links - so I'd like to see that as an option. Matt --- Yansheng Lin [EMAIL PROTECTED] wrote: Cool! Here is what I always wanted: In jsp: html:calendar form=myForm property=theDate In Action: Calendar inputDate = myForm.getTheDate(); In FormBean: Calendar theDate = new Calendar(); + setter and getter; Kruse, Matt wrote: I'm going to have some free time soon and I plan to convert my calendar popup javascript (http://www.mattkruse.com/javascript/calendarpopup) into a tag lib to be easily used in struts apps. If anyone has suggestions on how it should work or features it should support, please let me know! Also, should it be extending the struts html:input tag, or since those will one day go away, should I be extending a different taglib? I'm more familiar with the struts tags (extended them before) but I want the tag to be useable by the majority of struts developers :) Matt -- Vic Cekvenich, Struts Instructor, 1-800-917-JAVA Advanced a href =baseBeans.comStruts Training/a, mentoring and project recovery in North East. Struts conversion and a href =baseBeans.com fixed bid development/a. - 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] __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[validator] currency values and datatypes
I'm developing an application that has a bunch of dollar amount fields. I want to validate my design, as well as ask a couple of questions. It's not an internationalized application, so I'm using Double for my data types in my POJOs - which translates to a double in MySQL (when using Hibernate). First question - Should I be using Floats or Doubles? I'm formatting these for the UI using a DecimalFormat(#.00). Second question - what about percentages? Lastly, if I remain using either of these numbers (vs. Strings) - what is the best validator to use for these? I noticed that double doesn't have a client-side JS method, whereas float does. I'd also like to here how any of you have coded/validated currency amounts and percentages in your applications. Thanks, Matt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts-menu with Tiles
These types of questions should probably be asked on the struts-menu-user list. You can subscribe here: http://lists.sourceforge.net/lists/listinfo/struts-menu-user Yes, struts-menu integrates with Struts's RecourceBundle for i18n. It uses the title attribute as a key, and if the key is not found in ApplicationResources.properties, then it just uses the title's value. HTH, Matt -Original Message- From: Heligon Sandra [mailto:[EMAIL PROTECTED] Sent: Thursday, March 13, 2003 3:13 AM To: '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]' Subject: RE: Struts-menu with Tiles Is it possible to do internationalization with struts-menu ? --- As of February 12, 2003 Thomson unifies its email addresses on a worldwide basis.Please note my new email address: [EMAIL PROTECTED] Thomson is the leader in solutions and technologies for the entertainment and media industries and serves its customers under its four strategic brands: Technicolor, Grass Valley, RCA and THOMSON. More about Thomson: http://www.thomson.net/videochain Original Message- From: Heligon Sandra Sent: 13 March 2003 09:47 To: '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]' Subject:Struts-menu with Tiles My question is perhaps stupid, sorry. I would wish to know if it is possible to use struts-menu with Tiles. I for a long time seek an example of horizontal dropdown menu and the menu used in struts-menu example coolmenus3 seems to me satisfactory. But I use the Tiles components to build my pages. Is it possible to use the two technologies? Thanks a lot in advance. Sandra
RE: Struts-menu with Tiles
I (at one time) used Tiles to build my menu, but found struts-menu to be much easier to configure. Out of the box, no, it does not support this. However, you could contribute a new TilesDisplayer - it is open source after all ;-) -Original Message- From: Heligon Sandra [mailto:[EMAIL PROTECTED] Sent: Thursday, March 13, 2003 1:47 AM To: '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]' Subject: Struts-menu with Tiles My question is perhaps stupid, sorry. I would wish to know if it is possible to use struts-menu with Tiles. I for a long time seek an example of horizontal dropdown menu and the menu used in struts-menu example coolmenus3 seems to me satisfactory. But I use the Tiles components to build my pages. Is it possible to use the two technologies? Thanks a lot in advance. Sandra --- As of February 12, 2003 Thomson unifies its email addresses on a worldwide basis.Please note my new email address: [EMAIL PROTECTED] Thomson is the leader in solutions and technologies for the entertainment and media industries and serves its customers under its four strategic brands: Technicolor, Grass Valley, RCA and THOMSON. More about Thomson: http://www.thomson.net/videochain
Re: [displaytag-user] Using the display:* taglib with tiles
Hi, I'm pretty sure I read the solution to this just last night but now I can't find it... The display:* taglib will let me do something like this: display:table width=75% name=reportList display:column property=reportCategoryName title=Category group=1 sort=true/ The resulting HTML will be a table and the 'Category' header will be a link of the form: http://.../MyApplication/WEB-INF/jsp/layout.jsp?order=decsort=1 What I want is more along the lines of: http://.../MyApplication/some/action.do?order=decsort=1 Isn't there some tiles trick that sets things up so that this works? Thanks, J You can specify a requestURI attribute as part of the display:table tag. HTH, Matt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: StrutsMenu
It should already be built into the following Displayers using the roles attribute on a menu or item. http://raibledesigns.com/struts-menu/dhtmlDropdown.jsp http://raibledesigns.com/struts-menu/dhtmlExpandable.jsp http://raibledesigns.com/struts-menu/coolmenu4.jsp For saving a menu's expanded location - you might want to look at the following Tree menu. I hope to add support for this type of menu in the coming weeks. http://webfx.eae.net/dhtml/xtree/demo.html HTH, Matt -Original Message- From: Edgar Dollin [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 11, 2003 6:04 PM To: '[EMAIL PROTECTED]' Cc: 'Struts Users Mailing List' Subject: StrutsMenu Would it be simple to implement roles and permissions on the DropDownDisplayer? I have started to look at it and am not sure of all the touch points. BTW: my solution for restoring a menu position on a target page with the same menu as the prior page is sub-optimal. The only solution I could come up with saved menu down and up movements and created expiring cookies on menu selection. Of course if you do any other action the menu doesn't redrop. If you are using contexts, the cookies are discarded across the change of context. It looks like the only way to really make menu position controllable is to do some server side stuff. An interesting project. Thanks for your help. Edgar
Re: Validator- List/Map-backed property validation
Is there a way to validate a list/map-backed property using validator in a generic fashion? For ex. i would like to something like the following to validate all the lastName fileds in the list/map: form name=view1SubmitForm field property=lastName[*] depends=required arg0 key=view1SubmitForm.lastName/ /field /form -Harish Not currently, but IMO - there should be! ;0) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Strange Validator Issue
I'm using Struts 1.1 RC1 and I can't seem to figure this one out... Basically, when I click on a cancel button, the client-side validation is stopped, but not the server-side. Here's my cancel button: html:cancel styleClass=button property=action bean:message key=button.cancel/ /html:cancel -- onclick=bCancel=true; is added automagically by Struts when rendering. My form's action is saveUser which does specify validation=true action path=/saveUser type=org.appfuse.webapp.action.UserAction name=userForm scope=session input=editProfile parameter=action unknown=false validate=true Since UserAction.java is a subclass of LookupDispatchAction, I should be able to map button.cancel to a cancel method, which I have done, but I never get to it. The Validator tries to validate the form anyway: DEBUG [Thread-5] RequestProcessor.processActionForm(367) | Storing ActionForm bean instance in scope 'session' under at tribute key 'userForm' DEBUG [Thread-5] RequestProcessor.processPopulate(808) | Populating bean properties from this request DEBUG [Thread-5] RequestProcessor.processValidate(935) | Validating input form properties DEBUG [Thread-5] PropertyMessageResources.getMessage(177) | getMessage(en_US,userForm.password) DEBUG [Thread-5] PropertyMessageResources.loadLocale(266) | loadLocale(en_US) DEBUG [Thread-5] PropertyMessageResources.getMessage(177) | getMessage(en_US,userForm.email) DEBUG [Thread-5] PropertyMessageResources.loadLocale(266) | loadLocale(en_US) DEBUG [Thread-5] RequestProcessor.processValidate(967) | Validation failed, returning to 'editProfile' DEBUG [Thread-5] TilesRequestProcessor.processForwardConfig(298) | processForwardConfig(/userProfile.do, false) Thanks, Matt P.S. I've written about my upgrade from Struts 1.1b3 to Struts 1.1rc1 at http://tinyurl.com/6cp9 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] Struts and Design Patterns
I'm writing a chapter on Struts for a book, Professional JSP 2.0, from Wrox (http://www.wrox.com/books/1861008325.htm). The reason I'm sending this post is to verify my belief of the different design patterns that Struts implements. From the Core J2EE Design Patterns book (by Alur, Crupi, and Malks), there are 6 patterns discussed: Intercepting Filter Front Controller View Helper Composite View Service to Worker Dispatcher View In Struts, I'm assuming the following: Front Controller (ActionServlet) View Helper (ActionForm) Composite View (Tiles) Service to Worker (ActionServlet to your Actions) Dispatcher View (RequestProcessor) Thanks, Matt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Struts and Design Patterns
Figures... I own the book and left it at work. Anyone care to save me a trip into the office to verify this? Thanks, Matt --- In [EMAIL PROTECTED], Jerome Jacobsen [EMAIL PROTECTED] wrote: This has already been done by Ted in his book, I think. At least in the downloadable draft version there is a Patterns chapter. Actually it is Appendix D. -Original Message- From: Matt Raible [mailto:matt@r...] Sent: Monday, February 17, 2003 11:57 AM To: [EMAIL PROTECTED] Subject: [OT] Struts and Design Patterns I'm writing a chapter on Struts for a book, Professional JSP 2.0, from Wrox (http://www.wrox.com/books/1861008325.htm). The reason I'm sending this post is to verify my belief of the different design patterns that Struts implements. From the Core J2EE Design Patterns book (by Alur, Crupi, and Malks), there are 6 patterns discussed: Intercepting Filter Front Controller View Helper Composite View Service to Worker Dispatcher View In Struts, I'm assuming the following: Front Controller (ActionServlet) View Helper (ActionForm) Composite View (Tiles) Service to Worker (ActionServlet to your Actions) Dispatcher View (RequestProcessor) Thanks, Matt - 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]
Tiles 101
Here's a great tutorial on Tiles written today: http://tinyurl.com/5neg Matt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] Display Tag Library Project setup at SF
All, I've setup a project at SourceForge for the Display Tag Library. Please e-mail me if you'd like to have committer rights to the project. Also, if anyone has Admin experience at SF, please let me know (I've only been a committer). The first thing is probably to get someone's enhancements in there and get a release out (v 0.9?). Thanks, Matt -Original Message- From: SourceForge.net [mailto:[EMAIL PROTECTED]] Sent: Monday, February 03, 2003 12:34 AM To: [EMAIL PROTECTED] Subject: SourceForge.net Project Approved Your project registration for SourceForge.net has been approved. Project Descriptive Name: Display Tag Library Project Unix Name: displaytag CVS Server: cvs.displaytag.sourceforge.net Shell/Web Server: displaytag.sourceforge.net Your DNS will take up to a day to become active on our site. While waiting for your DNS to resolve, you may try shelling into shell.sourceforge.net and pointing CVS to cvs.sourceforge.net. If after 6 hours your shell/CVS accounts still do not work, please open a support ticket so that we may take a look at the problem. Please note that all shell/CVS accounts are closed to telnet and only work with SSH1. Your web site is accessible through your shell account. Please read site documentation (see link below) about intended usage, available services, and directory layout of the account. Please take some time to read the site documentation about project administration (http://sourceforge.net/docs/site/). If you visit your own project page in SourceForge.net while logged in, you will find additional menu functions to your left labeled 'Project Admin'. We highly suggest that you now visit SourceForge.net and create a public description for your project. This can be done by visiting your project page while logged in, and selecting 'Project Admin' from the menus on the left (or by visiting https://sourceforge.net/project/admin/?group_id=73068 after login). Your project will also not appear in the Trove Software Map (primary list of projects hosted on SourceForge.net which offers great flexibility in browsing and search) until you categorize it in the project administration screens. So that people can find your project, you should do this now. Visit your project while logged in, and select 'Project Admin' from the menus on the left. Enjoy the system, and please tell others about SourceForge.net. Let us know if there is anything we can do to help you. -- the SourceForge.net crew - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] Display Tag Library Project setup at SF
I've setup mailing lists for this project, please subscribe to displaytag-devel to continue discussions on this matter. http://sourceforge.net/mail/?group_id=73068 Matt -Original Message- From: Matt Raible [mailto:[EMAIL PROTECTED]] Sent: Monday, February 03, 2003 11:16 AM To: '[EMAIL PROTECTED]' Cc: Ed Hill ([EMAIL PROTECTED]) Subject: [OT] Display Tag Library Project setup at SF All, I've setup a project at SourceForge for the Display Tag Library. Please e-mail me if you'd like to have committer rights to the project. Also, if anyone has Admin experience at SF, please let me know (I've only been a committer). The first thing is probably to get someone's enhancements in there and get a release out (v 0.9?). Thanks, Matt -Original Message- From: SourceForge.net [mailto:[EMAIL PROTECTED]] Sent: Monday, February 03, 2003 12:34 AM To: [EMAIL PROTECTED] Subject: SourceForge.net Project Approved Your project registration for SourceForge.net has been approved. Project Descriptive Name: Display Tag Library Project Unix Name: displaytag CVS Server: cvs.displaytag.sourceforge.net Shell/Web Server: displaytag.sourceforge.net Your DNS will take up to a day to become active on our site. While waiting for your DNS to resolve, you may try shelling into shell.sourceforge.net and pointing CVS to cvs.sourceforge.net. If after 6 hours your shell/CVS accounts still do not work, please open a support ticket so that we may take a look at the problem. Please note that all shell/CVS accounts are closed to telnet and only work with SSH1. Your web site is accessible through your shell account. Please read site documentation (see link below) about intended usage, available services, and directory layout of the account. Please take some time to read the site documentation about project administration (http://sourceforge.net/docs/site/). If you visit your own project page in SourceForge.net while logged in, you will find additional menu functions to your left labeled 'Project Admin'. We highly suggest that you now visit SourceForge.net and create a public description for your project. This can be done by visiting your project page while logged in, and selecting 'Project Admin' from the menus on the left (or by visiting https://sourceforge.net/project/admin/?group_id=73068 after login). Your project will also not appear in the Trove Software Map (primary list of projects hosted on SourceForge.net which offers great flexibility in browsing and search) until you categorize it in the project administration screens. So that people can find your project, you should do this now. Visit your project while logged in, and select 'Project Admin' from the menus on the left. Enjoy the system, and please tell others about SourceForge.net. Let us know if there is anything we can do to help you. -- the SourceForge.net crew - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: The display:* tag library
Ed, I received lots of interested parties from my mailing to the struts-user list. You can view the responses by following the thread at: http://www.mail-archive.com/struts-user%40jakarta.apache.org/msg55520.ht ml Please let me know what we should do next to start a project at SourceForge. Thanks, Matt -Original Message- From: Ed Hill [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 22, 2003 10:17 PM To: Matt Raible Subject: Re: The display:* tag library I would gladly support any efforts to continue (restart) development on my taglib. I've reserved some sourceforge space myself, but have not moved things over yet. Alas, it currently does what I need it to do and other priorities have well taken priority. If someone steps up to volunteer to be the pumpkin keeper (sorry, Perl cultural reference), I will do what I can to help (redirect my web site on my personal machine to the new home, etc...) I don't subscribe to the struts-user list, so if you would please forward this on to encourage any discussion, I would appreciate it. Thank you! -Ed Hill ([EMAIL PROTECTED]) Software Developer - Information Technology Services - University of Iowa On Wed, 22 Jan 2003, Matt Raible wrote: Below is a proposal I posted on my website tonight (http://tinyurl.com/4s3j): If you need a slick JSP Tag Library for sorting and paging data, the display tag library is a great library to use. However, it's got issues - just like any piece of software. I've fixed a couple on my own, but it definitely needs some work - and integration with Struts (i.e. for getting messages, or referencing forwards) would be awesome. The problem is that Ed Hill doesn't seem to be working on it anymore - and there hasn't been a release since May 2002! Since I do have the source it wouldn't be hard to create a project at SourceForge for it. It would be great to get some input from Ed though. Last year, I think he even did a presentation on JSP Taglibs at Java One! I know there's lots of Struts developers that use the display tag - are any of you interested in continuing development on this project? Thanks, Matt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: The display:* tag library
Ed, Thanks for getting back to me. I actually sent the same message you see below (mine not yours) to the struts-user list last night. I'll let you know what they say and if I can find a pumpkin keeper. In the meantime, if you want to get the ball rolling for setting up a project at SF, that'd be awesome. Thanks, Matt -Original Message- From: Ed Hill [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 22, 2003 10:17 PM To: Matt Raible Subject: Re: The display:* tag library I would gladly support any efforts to continue (restart) development on my taglib. I've reserved some sourceforge space myself, but have not moved things over yet. Alas, it currently does what I need it to do and other priorities have well taken priority. If someone steps up to volunteer to be the pumpkin keeper (sorry, Perl cultural reference), I will do what I can to help (redirect my web site on my personal machine to the new home, etc...) I don't subscribe to the struts-user list, so if you would please forward this on to encourage any discussion, I would appreciate it. Thank you! -Ed Hill ([EMAIL PROTECTED]) Software Developer - Information Technology Services - University of Iowa On Wed, 22 Jan 2003, Matt Raible wrote: Below is a proposal I posted on my website tonight (http://tinyurl.com/4s3j): If you need a slick JSP Tag Library for sorting and paging data, the display tag library is a great library to use. However, it's got issues - just like any piece of software. I've fixed a couple on my own, but it definitely needs some work - and integration with Struts (i.e. for getting messages, or referencing forwards) would be awesome. The problem is that Ed Hill doesn't seem to be working on it anymore - and there hasn't been a release since May 2002! Since I do have the source it wouldn't be hard to create a project at SourceForge for it. It would be great to get some input from Ed though. Last year, I think he even did a presentation on JSP Taglibs at Java One! I know there's lots of Struts developers that use the display tag - are any of you interested in continuing development on this project? Thanks, Matt -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Any Struts-based calendar examples out there?
One open source project (Roller) I work on has a JSP Tag Library calendar - you might be able to tweak it. Project Page: http://rollerweblogger.org/ And there's also a big calendar as part of it - example at: http://www.rollerweblogger.org/page/roller/Archives For my favorite javascript-based popup-calendar, check out: http://www.mattkruse.com/javascript/calendarpopup/ #2 is my fav. Matt --- In [EMAIL PROTECTED], James Mitchell [EMAIL PROTECTED] wrote: This should give you a few ideas.although it requires javascript: http://javascript.internet.com/calendars/ -- James Mitchell Software Engineer/Struts Evangelist http://www.open-tools.org/ The man who does not read good books has no advantage over the man who cannot read them. - Mark Twain (1835-1910) -Original Message- From: Trevor Morris [mailto:morr0209@t...] Sent: Wednesday, January 22, 2003 9:34 PM To: [EMAIL PROTECTED] Subject: Any Struts-based calendar examples out there? I have to create a calendar page to display meetings, etc. As you know, anything date-related is not the easiest task in the world. I have found a JSP-based calendar, but it would require some extensive rework to get rid of all the scriplet code. Short deadline + overworked programmer = trying to steal code instead of reinventing the wheel ;) Anyone seen anything in any struts example code out there? Trevor -- To unsubscribe, e-mail: mailto:struts-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:struts-user-help@j... -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe@j... For additional commands, e-mail: mailto:struts-user-help@j... -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
The display:* tag library
Below is a proposal I posted on my website tonight (http://tinyurl.com/4s3j): If you need a slick JSP Tag Library for sorting and paging data, the display tag library is a great library to use. However, it's got issues - just like any piece of software. I've fixed a couple on my own, but it definitely needs some work - and integration with Struts (i.e. for getting messages, or referencing forwards) would be awesome. The problem is that Ed Hill doesn't seem to be working on it anymore - and there hasn't been a release since May 2002! Since I do have the source it wouldn't be hard to create a project at SourceForge for it. It would be great to get some input from Ed though. Last year, I think he even did a presentation on JSP Taglibs at Java One! I know there's lots of Struts developers that use the display tag - are any of you interested in continuing development on this project? Thanks, Matt -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]