RE: Debugging JSP
In my experience, if your jsp is so complicated you need a debugger, you should write java classes and/or tags and debug them using junit/httpunit and logging. Edgar -Original Message- From: Ramadoss Chinnakuzhandai [mailto:[EMAIL PROTECTED] Sent: Monday, February 09, 2004 10:10 AM To: [EMAIL PROTECTED] Subject: Debugging JSP Hi, I'm debugging Java code using JBoss IDE installed with Eclipse 2.1 and I found I could not debug JSP using the same IDEthen I installed MyEclipse to debug JSP and tested working fine with JSP when I come to debug Java code the break point which I put seems to be does not working then I found MyEclipse has got its own JBoss IDE and it clashes with JBoss IDE which I installed already. Can anybody suggest me how can get rid of this problem or suggest is there anyother way I can debug JSP without getting into this problem? or any better alternatives debug JSP without affecting debugging of java code?? Thankx in advance, -Ramadoss --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.580 / Virus Database: 367 - Release Date: 2/6/2004 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.580 / Virus Database: 367 - Release Date: 2/6/2004 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Unit Test in struts
Could you share with us how you worked around some of my issues, i.e. The user is entering items. User needs dynamic feedback as to to how much is entered so correctness of data entry can be determined. Thanks Edgar -Original Message- From: Jesse Alexander (KAID 11) [mailto:[EMAIL PROTECTED] Sent: Friday, January 23, 2004 3:37 AM To: 'Struts Users Mailing List' Subject: RE: Unit Test in struts not true. I've seen web-apps that use strictly html (not a line of JavaScript) and look very dynamic and responsive (one app reports its users are more happy with the html-version than with the smalltalk fat client solution (with the same functionality)). Unfortunately these apps are company internal intranet-webapps, that cannot be shown to the outside. It is basically a way of thinking. Remember what we usually hate about stuff like M$ Office? - The UI is overkill. Way too much unnecessary stuff. Give the users a FAST but very simple and clean (forget about animated gif's,...) UI, make it intuitively (NO learning curve) and they will love it. hth Alexander PS: These apps are easier to be tested... (to bring us back on the original trail) --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.564 / Virus Database: 356 - Release Date: 1/19/2004 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: JSP to static html...
You could use webtest with one of the logging options. Then if they change you could run your test to regenerate the pages. Edgar - Original Message - From: Jacob Wilson [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Friday, January 23, 2004 12:30 PM Subject: JSP to static html... Hi All... I have a specific requirement in my project... I want to convert the JSP pages to static html pages and save them in a local directory... How do I achieve this functionality??? Any suggestions appreciated. Thanks much. -Jacob - Do you Yahoo!? Yahoo! SiteBuilder - Free web site building tool. Try it! --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.564 / Virus Database: 356 - Release Date: 1/19/2004 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.564 / Virus Database: 356 - Release Date: 1/19/2004 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
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]
RE: Unit Test in struts
I wish I had the luxury. Edgar -Original Message- From: Matt Raible [mailto:[EMAIL PROTECTED] Sent: Thursday, January 22, 2004 9:42 AM To: 'Struts Users Mailing List' Subject: 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 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.564 / Virus Database: 356 - Release Date: 1/19/2004 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Unit Test in struts
Maybe I am not smart enough for my applications (order entry, inventory, etc.) I just don't see how to give any real functionality in the application space without JavaScript. Some issues where I don't see a work around for which are intrisic to all the applications I am working on. 1) The user is entering items. User needs dynamic feedback as to to how much is entered so correctness of data entry can be determined. 2) User can't remember a code from a 'large' list and needs to look it up and return to where he was with the correct value filled in. Perhaps it can be done with some fancy footwork with actions but... 3) Menus, yes there are plenty of static menus but all the real ones are javascript, i.e. coolmenus cannot be tested with the existing test tools. Menu's are not required to be tested but it would be nice. Edgar -Original Message- From: Ashikuzzaman [mailto:[EMAIL PROTECTED] Sent: Thursday, January 22, 2004 1:25 PM To: 'Struts Users Mailing List' Subject: RE: Unit Test in struts I somehow dislike JavaScript from the very beginning. I try my best to avoid it in big projects and so far successful. :-{ Regards, Muhammad Ashikuzzaman (Fahim) Senior Software Engineer, SurroundApps Inc. --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.564 / Virus Database: 356 - Release Date: 1/19/2004 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
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: Session Problem
If IE opens a new window (either through javascript or from the file/new/window menu) and IE is in a session, the session is shared between the two browser sessions. If you open two copies of IE from the operating system, they will not share the session. The only way to solve this that I know of, is to keep a session token, if you find it out of sequence, forward to a page which closes the window (if javascript is enabled). If you use tokens on your update sequences you should be able to live with the two browsers in the same session. Edgar -Original Message- From: Guillermo Meyer [mailto:[EMAIL PROTECTED] Sent: Friday, January 16, 2004 7:19 AM To: 'Struts Users Mailing List'; [EMAIL PROTECTED] Subject: RE: Session Problem I had a similar problem. I have two browsers opened with diferent sessions (and logged on with different users to my app) in the same machine. In one browser, I click a button that opens a new window (window.open in javascript) and in this new window a submit is performed to an action of struts. This action has an execute that checks isTokenValid and gives false, not because I haven't saved token first, but because session are different. */ protected boolean isTokenValid(HttpServletRequest request) { // Retrieve the saved transaction token from our session HttpSession session = request.getSession(false); //-- here, session id is different of the main window session, but equals to the other window session. if (session == null) . . . //as session id is wrong, token is invalid. } If I have one only main browser opened this problem doesn't happen. I think that it can be a window.open IE problem, but I still couldn't find out a solution. If anyone has one... Thanks.. Guillermo. -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED] Sent: Viernes, 16 de Enero de 2004 08:38 a.m. To: Struts Subject: RE: Session Problem snip How do I make sure the session on both the browsers will be different other than URL Rewriting. /snip This I do not know. :-( You can take a look through all the browser options and see if there is anything to make it associate cookies only with a specific window, but I would be quite surprised if there is such an option. I suspect in the absense of url rewriting you will need to use either different machines for each browser, or a different browser (ie open second window in mozilla or something). Hopefully Im wrong on that and someone else on this list has a better idea! -Original Message- From: Parag Pattewar [mailto:[EMAIL PROTECTED] Sent: Friday, 16 January 2004 19:31 To: [EMAIL PROTECTED] Subject: RE: Session Problem Hi I tried to use URL rewriting explicetly for session tracking, unfortunately I wont be able to use this because Its not been guaranteed in the code is been written using html:link always for the links. As both the browsers sessions are using only the same cookies, so I think the problem is because of that. How do I make sure the session on both the browsers will be different other than URL Rewriting. Thanks Parag -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED] Sent: Friday, January 16, 2004 4:51 PM To: Struts Users Mailing List Subject: RE: Session Problem On the same machine? Rather sounds like its the same session. Im not sure about IE6, but as I recall, IE5 will share its cookies between the various windows if cookies are enabled. If cookies are disabled then url writing takes over (asuming youve made sure your links are re-written by using the appropriate tags) which means they shouldlnt share sessions if opened seperately. You could test this theory by disabling cookies in your browser and see if it makes a difference. Put it a log statement somewhere to log the sessionId and compare the results for both the windows to see if it is indeed a different session, or if the second window causes the first window to end up in the second's session. -Original Message- From: Parag Pattewar [mailto:[EMAIL PROTECTED] Sent: Friday, 16 January 2004 19:17 To: [EMAIL PROTECTED] Subject: Session Problem Hi I am getting session collusion problem , if I open my application on two IE5.5 browsers , after some time , I am getting same values and junk values which are not applicable for that session , but will be applicable for the session present on other browser. Please help, What could be the problem? 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,
RE: JSP Protection
There is one other way and that is to foward *.jsp in web.xml to a filter which always fails. Edgar -Original Message- From: lixin chu [mailto:[EMAIL PROTECTED] Sent: Thursday, January 15, 2004 8:24 PM To: Struts Users Mailing List Subject: Re: JSP Protection thanks ! --- Max Cooper [EMAIL PROTECTED] wrote: The images are requested directly by the browser, so they must be accessible from the outside. Here's a little browser-server dialog to illustrate how it works: Browser: please give me /DoSomething.do Server: Here you go... (server invokes Struts action servlet, action servlet invokes the requested action, action says it wants to forward to a JSP, action servlet does the forward...) htmlimg src=/images/bitchin_camaro.jpg/html Browser: please give me /images/bitchin_camaro.jpg Server: Here you go... 24927image247data7902578259image293data85984396574389... The request for the action returns HTML. The browser reads the HTML and sees that it references an image. The browser then makes a separate request for the image file so that it can render the page. The image file must be request-able by the browser or it won't show up when someone wants to view the page. -Max - Original Message - From: lixin chu [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, January 15, 2004 5:07 PM Subject: RE: JSP Protection I can successfully move all the files into /WEB-INF/subfolder (WEB-INF is protected by default) except the images/ folder. It seems that I have to leave it outside - in the webapp root. I am using Tomcat 5.0.16. Is it a defect or it is like this ? --- Karr, David [EMAIL PROTECTED] wrote: Put all JSP pages that can't be accessed directly into a security constraint, only accessible by the role nobody, which you will never add a user to. All accesses of JSPs will be through forwards from actions, which will not be blocked by that security constraint (unless you either have a broken web container or a Servlet 2.4 container where you've enabled auth on forward). -Original Message- From: J#40693;gen Scheffler [mailto:[EMAIL PROTECTED] Sent: Thursday, January 15, 2004 8:15 AM To: [EMAIL PROTECTED] Subject: JSP Protection Hi, how do i block URL guessing? if someone requests abc.com/secret_page.jsp he gets it. In my Action i check if the user object has the right rights for this action and then i forward him. But if guesses the jsp, he opens it. Help me! J#40693;gen - 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! Hotjobs: Enter the Signing Bonus Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus - 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! Hotjobs: Enter the Signing Bonus Sweepstakes http://hotjobs.sweepstakes.yahoo.com/signingbonus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts-Menu (Support URL Re-writing)
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]
RE: report in struts
JasperReports on sourceforge is pretty good with a decent base of support. Edgar -Original Message- From: Hari_s [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 14, 2004 8:25 PM To: Struts Users Mailing List Subject: report in struts Hi all is there any reporting tools (for creating report) that can embedded in struts project that free of charge.? --- 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]
RE: Data Sources problem
I don't mean to discourage you however you are developing an application using struts. The current struts datasource is deprecated and it is recomended that you use either a jndi datasource or a product like poolman on sourceforge or a DAO product which maintains the datasource itself. I suspect your problem is due to not including struts-legacy.jar since the datasource is only marginally supported and was not included in the base jar. Edgar -Original Message- From: Sandy Bingham-Porter [mailto:[EMAIL PROTECTED] Sent: Monday, January 12, 2004 10:55 AM To: Struts Users Mailing List Subject: Data Sources problem Hi, I am new to struts and am trying to use the data-source element within my struts-config.xml. When I execute the web app I get the following error: 503 Initializing application data source org.apache.struts.action.DATA_SOURCE I have placed the commons-dbcp-1.1.jar file in my lib path. My platform is Jrun4 and a SQL2000 database. Does anyone have any ideas or suggestions as to why I am getting this error? My struts-config.xml is as follows: ?xml version=1.0 encoding=ISO-8859-1 ? !DOCTYPE struts-config PUBLIC -//Apache Software Foundation//DTD Struts Configuration 1.0//EN http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd; struts-config data-sources data-source type=org.apache.commons.dbcp.BasicDataSource set-property property=driverClassName value=sun.jdbc.odbc.JdbcOdbcDriver/ set-property property=url value=jdbc:odbc:x/ set-property property=username value=x/ set-property property=password value=x/ /data-source /data-sources form-beans form-bean name=loginForm type=LoginForm/ /form-beans ..etc. Thanks for any help. Frank Kingery Applications Programmer III Information Technology Services Eastern Illinois University --- 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]
filters / tomcat / httpunit / webtest
I have a an interesting issue which at first blush doesn't seem solvable but could be a bug in struts 1.1 or my use of struts. I have a partially implemented struts application which is using filters for security (not the sourceforge security filter). I used to issue a 401 error, have the container trap the error and forward to the logon page. That worked fairly well with tomcat 4.1.18. I had a testsuite in Struts-Test, HttpUnit and WebTest which was working reasonably well. I updated to tomcat 4.1.29 which passes the http 401 error to the page, with the actual login page. This causes failures in HttpUnit and WebTest which assume a 401 error is a Basic Authentication Error. I thought about throwing / catching other errors but have not completed tests. The sourceforge security filter just does a RequestDispatcher forward to the login page. This works fine on straight jsp pages. However on struts pages there is some additional processing and something (I have not yet figured out) from struts gets put in the response so that there is an IllegalStateException thrown when the filter performs the forward. Additionally, response.redirect has the same issue. The only struts log messages have to do with PropertyMessageResources, which are not there for both straight JSP and struts resources. Does anyone know what in struts could be writing to the response or where to start looking? Thanks in advance. Edgar --- 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]
RE: filters / tomcat / httpunit / webtest
FYI, using HTTP 'error' 202 SC_ACCEPTED (and maybe others) works around the problem. In other words is compatible with IE, Mozilla, etc and still works with HttpUnit / Webtest. I haven't loaded the application too much so I will find out later if this issue is truly resolved. If anyone is familiar with any drawbacks of trapping http error 202, your commentary would be appreciated. Thanks again Edgar -Original Message- From: Edgar P Dollin Sent: Monday, January 12, 2004 7:10 PM To: Struts Users Mailing List Subject: filters / tomcat / httpunit / webtest I have a an interesting issue which at first blush doesn't seem solvable but could be a bug in struts 1.1 or my use of struts. I have a partially implemented struts application which is using filters for security (not the sourceforge security filter). I used to issue a 401 error, have the container trap the error and forward to the logon page. That worked fairly well with tomcat 4.1.18. I had a testsuite in Struts-Test, HttpUnit and WebTest which was working reasonably well. I updated to tomcat 4.1.29 which passes the http 401 error to the page, with the actual login page. This causes failures in HttpUnit and WebTest which assume a 401 error is a Basic Authentication Error. I thought about throwing / catching other errors but have not completed tests. The sourceforge security filter just does a RequestDispatcher forward to the login page. This works fine on straight jsp pages. However on struts pages there is some additional processing and something (I have not yet figured out) from struts gets put in the response so that there is an IllegalStateException thrown when the filter performs the forward. Additionally, response.redirect has the same issue. The only struts log messages have to do with PropertyMessageResources, which are not there for both straight JSP and struts resources. Does anyone know what in struts could be writing to the response or where to start looking? Thanks in advance. Edgar --- 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 --- 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]
RE: [OT] Canoe Webtest / HttpUnit
Thanks for the article. Something about the update from 4.1.18 to 4.1.29 caused my cookie test javascript to give inconsistent feedback in the HttpUnit javascript. I tried another algorithm and worked past the error. BTW for you test junkies, if you used web.xml error-pageerror-code to trap http errors and return a different page, tomcat 4.1.18 doesn't pass on the http error with the page redirect while 4.1.29 does. Tests of pages which take advantage of those automatic redirects will start failing when you do an upgrade. Thanks again. Edgar -Original Message- From: Ted Husted [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 07, 2004 10:44 PM To: Struts Users Mailing List Subject: Re: [OT] Canoe Webtest / HttpUnit I use WebTest a lot. I think you have turn cookies on via the HttpUnit config. http://lists.canoo.com/pipermail/webtest/2003q2/000735.html -Ted. On Wed, 07 Jan 2004 22:28:10 -0500, Edgar P Dollin wrote: I have been struggling with these two testing tools for a while now attempting to retrofit http tests over an existing working application. JavaScript has been a bear, stuff that works on Mozilla and IE breaks in HttpUnit (not that the review didn't turn up myriads of errors). Repairing the scripts has really strengthened the code. I know that others on this list use Canoe Webtest. It is much nicer writing Webtest scripts than HttpUnit java code. However, I am ready to give up on WebTest, but before I do would like to hear if others have had similar problems. The issue I can't seem get around is that my site requires cookies. I have a hidden field and some javascript to test if cookies are enabled and value the hidden field. Webtest won't value the field and won't let me set the value of the field. Additionally, this issue cropped up when I upgraded from Tomcat 4.1.18 to 4.1.29. Any insight is welcome. Thanks. Edgar --- 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: struts-user- [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]
[OT] Canoe Webtest / HttpUnit
I have been struggling with these two testing tools for a while now attempting to retrofit http tests over an existing working application. JavaScript has been a bear, stuff that works on Mozilla and IE breaks in HttpUnit (not that the review didn't turn up myriads of errors). Repairing the scripts has really strengthened the code. I know that others on this list use Canoe Webtest. It is much nicer writing Webtest scripts than HttpUnit java code. However, I am ready to give up on WebTest, but before I do would like to hear if others have had similar problems. The issue I can't seem get around is that my site requires cookies. I have a hidden field and some javascript to test if cookies are enabled and value the hidden field. Webtest won't value the field and won't let me set the value of the field. Additionally, this issue cropped up when I upgraded from Tomcat 4.1.18 to 4.1.29. Any insight is welcome. Thanks. Edgar --- 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]
RE: Design Questions
-Original Message- From: Scott McClure [mailto:[EMAIL PROTECTED] Sent: Saturday, January 03, 2004 10:50 AM To: [EMAIL PROTECTED] Subject: Design Questions First, I was thinking about using a single UserForm to validate all forms relating to a user, for instance. The problem is, is that some fields would not be necessary for update actions and their validation code would throw a ActionError with the default value. I could use conditional validation in the ActionForm based upon the ActionMapping, but that would create ties between the config file and code that I am not sure I want to make. What is your opinion? In your load action, always fill out the entire form. As long as you session based form beans and don't use the reset (for checkboxes) the data will pass without input fields in the jsp. Next, I am trying to tackle the problem of the granularity of my Action objects. At first, I thought about using a DispatchAction, but that only allows me to use one ActionForm for all of the Actions in that class. Then, I thought that maybe wildcards would solve my problem. Wildcards, though, seem like a security concern, where it would be theoretically possible to run an action that is not intended to be run (to exploit any handling errors). Also, I am not sure if that solves any granularity problems, but merely simplifies configuration in the config file. Are there any other good solutions for solving granularity problems? Did I mis-understand DispatchAction? General comments on security with wildcards would also be very interesting. I am a believer in standard actions and have your business classes implement interfaces for the actions to use. So in the save/update/delete sequence you have a single action which calls standard functions in your business classes. Also, slightly off-topic of my previous questions, what naming conventions do people use for application messages? In struts I have seen a general format of prompt.*, heading.*, and using page specific messages under the page name. What are some suggestions? I want to resolve to a naming standard now so I dont have to go through and change everything if it becomes a code managibilty concern. If you can name them package.class.messageKey or url.field.messageKey it works well as well. Thanks, Scott Good luck Edgar - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: .NET: We are just like Struts... only better.
It is a complement that Microsoft is worried about the feature set of struts. However, a lot of the stuff that comes in ASP.NET sounds good compared to the java equivalents. Edgar -Original Message- From: Vic Cekvenich [mailto:[EMAIL PROTECTED] Sent: Thursday, December 25, 2003 6:16 AM To: [EMAIL PROTECTED] Subject: .NET: We are just like Struts... only better. Just like everyone else. http://msdn.microsoft.com/asp.net/default.aspx?pull=/library/e n-us/dnaspp/html/aspnet-aspnet-j2ee-struts.asp This was fun to read, it puts a smile on my face. Somone has a chip on their sholder. * Main point made in there: Do not use JDBC, you make us look bad, use an auto caching DAO (data caching in data layer, get it). Clients I see in real life do, but some people on this list dont use a DAO and do caching in layers other than Model. * Struts framework is ... many of its key components have been absorbed into the main J2EE framework. - not one! CommonsBeans? CommonsCollections? CommonsValidator? Tiles? Action? FormBean? It's a community of users, not a vendor thing. I do not think they get it. They think Sun does Struts? Look MS.There is no vendor. It' called open source. If Sun shuts down... it will have no impact on the market (for example jRockit JVM, one of 6 VM's I know - http://www.j2eegeek.com/blog/archives/2003_09_01_j2eegeek_arch ive.html#106336646351242237 ) Save session state to db... I hope no one here does that (but I do think that if .Net suggests for them to do it, GREAT) Version is a strength of .Net? Have you ever had .DLL hell? OK, I do not think the author knows that J2EE comes with built in JAAS and... it's declerative role based security. Struts and other tags uses Servlets (since 2.2, go read JavaDoc) Role based API. Again, I do not think the Author is familiar with localization in Java... for example JSTL's localization. Again... on testing, I happen to use OpenSta that runs circles. I think he is implying that I can't test in J2EE. The benefit of MVC layers is that you can test each layer. PageController is an MVC? Looks a lot like MV... with a small c. This is commic: How to migrate Struts to ASP. ?? That is what I want to do, get propiratory with a Vendor, who want's choice? You know, clients no longer say should I use .Net or Struts, topic just does not come up for large projects. Oh, does it run on the largest comercial platform, Linux? I do my development on Linux, w/Eclipse and Tomcat and pgSQL. but, every 3 months, I reformat my windows machinee and re-install XP. I do not do this with Linux(Fedora)... and I guess my new OSX is BSD, but I have had it less than 3 months. .V - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How find DataSource?
It can be done, use poolman. Easiest DB pool to get going, works well with more DB than others. http://sourceforge.net/projects/poolman Edgar -Original Message- From: Vic Cekvenich [mailto:[EMAIL PROTECTED] Sent: Monday, December 22, 2003 4:50 PM To: [EMAIL PROTECTED] Subject: Re: How find DataSource? e-denton Java Programmer wrote: Has anyone set up a connection pool using web.xml? Steps? Examples? Tips? No one has, it can't be done. You can declare it in web.xml, that's all. Read Rick Reumans tutorial on ibatis dao and ibatis petstore 3 example and do that, and you will be in a good place. It's sad, no books on this. All JDBC books talk about JDBC 1.0, not about JDBC 3 pooleddatasource, or DAO. Vic, I might have two problems with keeping it in a static block. 1. My container can be passivated, so everything must be serializable. Passivation is not a good idea ever, so just ignore it. Change the co-lo or host if you have to. It sure does not give scalability to the host or to app. hth, .V - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Source code for Mastering Jakarta Struts
Buy the book. Edgar -Original Message- From: deepak saini [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 23, 2003 6:27 AM To: [EMAIL PROTECTED] Subject: Source code for Mastering Jakarta Struts hi! any idea from where cna i get the source code of Mastering Jakarta Struts Regards Deepak Saini _ Marriage? http://www.bharatmatrimony.com/cgi- bin/bmclicks1.cgi?74 Join BharatMatrimony.com for free. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Connection Pooling
Drop connection pooling in struts and either go to Container pooling or use a product like Poolman (on sourceforge). Struts DataSource is no longer supported. Edgar -Original Message- From: hernux [mailto:[EMAIL PROTECTED] Sent: Thursday, December 18, 2003 1:39 AM To: [EMAIL PROTECTED] Subject: Connection Pooling Hi all, I'm having problems with db pooling, in my sistem, there is a process that creates lot's of subsystems, and it opens lots of connections in the pool... I have to create 380 subsystems, but I can't create more than 4 at once.at number 5, pool dies .. out of conexions it sais.. So, I got two cuestions... 1- what am I doing wrong?... 2- is it posible to clean the pool by code, avoiding to restart tomcat every time pool dies? I'm using struts dbpooling .. here's my config: data-source set-property property=autoCommit value=false / set-property property=description value=Conexión a la base de datos / set-property property=driverClass value=org.postgresql.Driver / set-property property=maxCount value=256 / set-property property=minCount value=20 / set-property property=user value=xxx / set-property property=password value=xxx / set-property property=url value=jdbc:postgresql://xxx/xxx / /data-source Thanx... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Generate Java class from xml?
Castor from exolab http://www.castor.org/ is an excellent xml parser. There is also an interesting project for xml - beans http://xml.apache.org/xmlbeans. Edgar -Original Message- From: Adam Hardy [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 17, 2003 8:31 PM To: Struts Users Mailing List Subject: Re: Generate Java class from xml? Hmm, looks pretty good but it doesn't seem to do what I need. Thanks though. On 12/17/2003 11:54 PMnbsp;Mark Lowe wrote: Dont know about using digester but html parser is a handy library. http://htmlparser.sourceforge.net/ Might help you do what you want. On 17 Dec 2003, at 22:45, Adam Hardy wrote: Hi Christopher, just a quick question about Digester, perhaps you can save me the effort of reading up on it to find out myself, but will Digester be able to parse HTML? I am dealing with the Internet Explorer bookmarks export file. I have already tried JAXB but JAXB chokes on it, saying that the XML is not well-formed. The bookmarks file has quite a few unpaired p and dt elements, which is obviously bad XML. Thanks Adam On 12/17/2003 09:38 PMnbsp;Christopher Milton wrote: I use Digester which is used by Struts itself. http://jakarta.apache.org/commons/digester/ http://www.google.com/search?q=jakarta+digester http://www.javaranch.com/newsletter/August2003/ TouringTheCommonsPart2.html --- John Smart [EMAIL PROTECTED] wrote: There's also XMLBeans (http://xml.apache.org/xmlbeans/) , which, unlike Castor, works with JDK 1.4... Martin Gainty wrote: Castor (http://www.castor.org) which generate the java classes with marshall and unmarshall methods, but it is not finished, doesn't care to namespaces, owns severals bugs ... The second one is Xml Spy 5.0, it generate classes from an xsd file which wrap on the Dom Tree, but all facets are not implemented as enumeration ... but I think that a better version will come soon. Generates JAXP compliant Java Beans http://www.altova.com/features_java.html -Martin - Original Message - From: Vicky [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, December 17, 2003 2:01 PM Subject: Generate Java class from xml? Does anyone have an idea of how i can generate .java file from xml file? Tools like jakrata digester, JOX are there but both of them are useful in populating java beans from xml. My requirement is to generate .java file from .xml with getters and setters methods for xml elements/attributes. I also tried JAXB. But JAXB generates bunch of files and most of them are interfaces, which is not going to work for me. For e.g. i have following xml file and i want to generate Address.java file with getters/setters. Any ideas? ?xml version='1.0' encoding='UTF-8' ? Address FirstName type=String/ PoBox type=int/ .. /Address Thanks, Vicky -- struts 1.1 + tomcat 5.0.16 + java 1.4.2 Linux 2.4.20 Debian - 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] -- struts 1.1 + tomcat 5.0.16 + java 1.4.2 Linux 2.4.20 Debian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tabbed menus using Tiles
Try struts-menu at sourceforge. It integrates very well and gives you nice choices for menus without writing a lot of javascript. Edgar -Original Message- From: Gopal Venkata Achi [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 10, 2003 3:36 PM To: Struts Users Mailing List Subject: Tabbed menus using Tiles Hi All, I am presently designing a web application, and curious to learn whether there is any way we can create and use the tabbed menus using Struts libraries. We have chosen tiles for the layout design already. I appreciate any help. cheers gopal - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] Log4J and Pre-Processor
The difference between scientists and engineers The funny part is they are both right. The hard part is deciding which you are and living with the decision. Edgar -Original Message- From: Ted Husted [mailto:[EMAIL PROTECTED] You might first run some load tests to see if the boolean statements do have a non-negligable performance impact. It's easy to loose something like this in the rounding, and there may be better places to spend your optimization dollars. As scientists, we should should more than feel, we should know. -Original Message- From: Kirk Wylie [mailto:[EMAIL PROTECTED] So if you care THAT much about 5ns per call, do it this way (through compilation) and let the java compiler do the work for you. For this, even if you decide to pre-process, you don't have to pre-process. But do you really care that much about 5ns? Are you SURE you care that much about 5ns? Kirk Wylie M7 Corporation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to detect that session has expired ?
If you use container authentication or filters, this isn't an issue. The user will never get to an action class with an invalid session. Edgar -Original Message- From: Kirk Wylie [mailto:[EMAIL PROTECTED] Sent: Monday, December 08, 2003 1:19 PM To: Struts Users Mailing List Subject: Re: How to detect that session has expired ? Ashish Kulkarni wrote: HI if u are using servelt 2.3 , then u can use servelt filter, in this filter u can have logic to check session before each request so u dont need to add any code in jsp or action class If he's using Servlet 2.3, then he can also use the ServletContextListener in conjunction, where is where the logic for whether the session has been restarted could likely belong. Kirk Wylie M7 Corporation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts User Roles
I wasn't aware that such a concept existed. There are roles for container managed security, is that what you are refering to? Edgar -Original Message- From: Tiago Henrique Costa Rodrigues Alves [mailto:[EMAIL PROTECTED] Sent: Monday, December 08, 2003 1:06 PM To: Struts Users Mailing List (E-mail) Subject: Struts User Roles Where can I find Struts Roles documentation? Tiago Henrique C. R. Alves - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: HELP: about to get datasource of struts and pass to logic bea ns...
Don't spend the time to get DataSource working. It is deprecated and will be removed from struts in 1.2. I use Poolman at sourceforge (I highly reccomend it for non-j2ee projects). Most others use the DataSource supplied with the container. Edgar -Original Message- From: Caroline Jen [mailto:[EMAIL PROTECTED] Sent: Monday, December 08, 2003 4:29 PM To: Struts Users Mailing List Subject: Re: HELP: about to get datasource of struts and pass to logic beans... There are lots of classes involved. I will give you an example: 1. my LogonAction calls EditorService.java (business delegate) 2. EditorService.java calls MySQLEditorDAO.java (data access object implements EditorDAO.java, which is a data access interface) 3. the MySQLEditorDAO.java returns EditorBean.java (a Java bean with three properties) Here is my LogonAction.java: package org.apache.artimus.logon; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.Action; import org.apache.struts.action.ActionError; import org.apache.struts.action.ActionErrors; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionServlet; import org.apache.artimus.lang.Tokens; public final class LogonAction extends Action { public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws java.lang.Exception { // Obtain username and password from web tier String username = ((LogonForm) form).getUsername(); String password = ((LogonForm) form).getPassword(); EditorService service = new EditorService(); EditorBean editor = service.findEditorData( username ); HttpSession session = request.getSession(); session.setAttribute( editor, editor ); // Log this event, if appropriate if (servlet.getDebug() = Tokens.DEBUG) { StringBuffer message = new StringBuffer(LogonAction: User '); message.append(username); message.append(' logged on in session ); message.append(session.getId()); servlet.log(message.toString()); } // Return success return (mapping.findForward(Tokens.VALID)); } } // End LogonAction Here is the EditorService.java: package org.apache.artimus.logon; import org.apache.artimus.logon.dao.*; public class EditorService { EditorDAO ed = new MySQLEditorDAO(); public EditorBean findEditorData( String username ) { return ed.findEditor( username ); } } Here is the EditorDAO.java: package org.apache.artimus.logon.dao; import org.apache.artimus.logon.EditorBean; import org.apache.artimus.logon.exceptions.EditorDAOSysException; public interface EditorDAO.java { public EditorBean findEditor( String username ) throws EditorDAOSysException; } Here is the MySQLEditorDAO.java: package org.apache.artimus.logon.dao; import java.io.IOException; import java.sql.Connection; import java.sql.ResultSet; import java.sql.Statement; import java.sql.SQLException; import org.apache.artimus.logon.EditorBean; import org.apache.artimus.logon.exceptions.EditorDAOSysException; import org.apache.artimus.ConnectionPool.DBConnection; public class MySQLEditorDAO implements EditorDAO { // Here the return type is EditorBean public EditorBean findEditor( String username ) throws EditorDAOSysException { Connection conn = null; Statement stmt = null; ResultSet rs = null; try { conn = DBConnection.getDBConnection(); stmt = conn.createStatement(); String query = SELECT user_role, journal_category FROM members WHERE user_name = ' + username + '; rs = stmt.executeQuery( query ); if (rs.next()) { return new EditorBean( username, rs.getString( user_role ), rs.getString( journal_category ) ); } else { System.out.println( invalid user name ); return null; } } catch (SQLException se) { throw new EditorDAOSysException(SQLException: + se.getMessage()); } finally { if ( conn != null ) { try { rs.close(); rs = null; stmt.close(); stmt = null; conn.close(); } catch( SQLException sqlEx ) { System.out.println( Problem occurs while closing + sqlEx ); } conn = null; } } } } Here is the EditorBean.java: package
RE: [FRIDAY] YA Stuts In Action / JUnit in Action Trivia Quiz
My apologies. I just replied w/o thinking. Please remove me from the competition. Edgar -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED] Sent: Thursday, November 27, 2003 11:33 PM To: Struts Users Mailing List Cc: [EMAIL PROTECTED] Subject: RE: [FRIDAY] YA Stuts In Action / JUnit in Action Trivia Quiz Garrgh! And it was the first one of his trivias I knew the answer for. :-( Even spent 5 minutes googling the bonus question, and emailing Ted just now. I really should read the latest emails first when I come back from leave. Sigh. Hey Ted, How about a new question for those of us who didnt get our answer in before the result was prematurely revealed. (ie anyone who answered before Edgars post is still in the running but anyone after (like me :- ) has to answer a new question)??? -Original Message- From: Edgar P Dollin [mailto:[EMAIL PROTECTED] Sent: Thursday, 27 November 2003 21:35 To: 'Ted Husted'; Struts Users Mailing List Subject: RE: [FRIDAY] YA Stuts In Action / JUnit in Action Trivia Quiz 1) Computing Machinery and Intelligence 2) Alan M. Turing Bonus I Have No Mouth and I Must Scream Edgar PS, never read any Turing, but now I understand his influence. Still haven't read an Ellison, my patience with Science Fiction left after 30 years of Trek. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [FRIDAY] YA Stuts In Action / JUnit in Action Trivia Quiz
1) Computing Machinery and Intelligence 2) Alan M. Turing Bonus I Have No Mouth and I Must Scream Edgar PS, never read any Turing, but now I understand his influence. Still haven't read an Ellison, my patience with Science Fiction left after 30 years of Trek. -Original Message- From: Ted Husted [mailto:[EMAIL PROTECTED] Sent: Thursday, November 27, 2003 12:56 AM To: Struts Users Mailing List Subject: [FRIDAY] YA Stuts In Action / JUnit in Action Trivia Quiz Last time, we asked contestants to identify the cartoonist responsible for this gem: Tour of Accounting: Over here we have our random number generator. NINE NINE NINE NINE NINE NINE Are you sure that's random? That's the problem with randomness: You can never be sure. The answer, of course, is: Scott Adams, born June 8, 1957, who launched the Dilbert strip in 1989. From the several correct responses, we arbitrarily selected BECKY L. NORUM as our winning contestant. (Becky, please send your surface mail address to [EMAIL PROTECTED], and indicate whether you would like JUnit in Action or Struts in Action) NEXT: In 1950, the journal MIND, a Quarterly Review of Psychology and Philosophy, published a seminal paper regarding artificial intelligence. 1 What was the title of the paper? 2 Who was the author of the paper? Any contestants correctly answering these two questions will qualify for this week's drawing. As always, the correct answers are the ones that I expect :) ** BONUS QUESTION ** 3 The author of this paper used his initials for his first and middle name. What Hugo-winning story by Harlan Ellison regarding artificial intelligence features a protagonist whose name are these same two initials? Any contestant correctly answering the bonus question will also qualify, regardless. :) [I do love my Ellison!] The contest will run until Thursday, December 4, 2003, 23:59:59, so everyone has a chance to participate. The lucky winner selected from the correct responses will receive their choice of either a signed copy of Struts in Action *OR* JUnit in Action. PLEASE be sure to reply to [EMAIL PROTECTED] If you have an interesting science fiction or computer science question that is hard, or at least fun, to google, please send it to me. The first to suggest a question that we use also wins! -Ted. PLEASE be sure to reply to [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]
RE: Server manged vs. struts managed db pools
There is another issue regarding connection pooling in struts vs connection pooling in the container. In struts the war file contains all the information the app needs to run. With container pooling (at least with tomcat and resin) you have to coordinate the container configuration with struts configuration. With a single container running multiple apps this is a bit of an issue. Edgar -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED] Sent: Monday, November 24, 2003 11:03 PM To: Struts Users Mailing List Subject: RE: Server manged vs. struts managed db pools Quoting Edgar P Dollin [EMAIL PROTECTED]: I like struts managed db pools, however, the struts developers aren't too happy about the quality and the dependency on the commons-pooling library and are attempting to phase it out. The existing connection pool in struts-legacy.jar (and the one in commons-dbcp.jar nowdays) works fine. However, there are several important pros for using container managed connection pools: * A connection pool implementation provided by your app server is likely to be optimized for better performance on that particular app server than a generic pool included with the app. * A connection pool implementation provided by your app server is likely to be supported by the graphical admin tools of that app server, versus having to be hand configured in struts-config.xml. * On some app servers, you can dynamically tweak the characteristics of the connection pool (such as how many active connections are allowed) without restarting the app. That's not the case for a pool included inside the app, where you have to go tweak struts-config.xml and restart. * A connection pool provided by your app server vendor is accessible (via JNDI) *anywhere* in your application, versus having to be passed in as a parameter to any method that needs it (or making your business logic dependent on the servlet API in order to access application scope attributes). * In environments where you have two or three different deployment scenarios (say, development, test, and production) you can deploy exactly the same WAR file in all three places, yet have each of them talk to the correct database simply by administering the server. No tweaking of the struts-config.xml file to reflect which environment you are deploying to. The only reason Struts ever included a connection pool in the first place is that most standalone servlet containers at that time didn't support JNDI-based pools. Now, that is no longer an issue, and I would always recommend using the container's facilities for that purpose. Edgar Craig -Original Message- From: Nathan Maves [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 18, 2003 2:52 PM To: Struts Users Mailing List Subject: Server manged vs. struts managed db pools Are there any pro/con 's for either? Nathan - 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: Types supported by DynaActionForm (or DynaValidatorForm)
There is some contradiction when it comes to types in ActionForms. The general idea of struts is to put a bunch of Strings (or booleans) between the application and view layer so that after unsuccessful validation the framework can return the typed values unchanged. In certain cases, individual developers put in support for types other than Strings for certain features. The bottom line is, until there is more concensus on the use of data types, use non String ActionForm properties at your own risk. Edgar -Original Message- From: Sasha Borodin [mailto:[EMAIL PROTECTED] Sent: Monday, November 24, 2003 6:10 PM To: Struts Users Mailing List Subject: Types supported by DynaActionForm (or DynaValidatorForm) OK, in the Struts manual, it says: The types supported by DynaActionForm include: - java.sql.Date - java.sql.Time - java.sql.Timestamp ...(among others)... What does supported mean though? Cause if I try to specify a java.sql.Date field in my form in struts-config: form-bean name=commissionReport type=org.apache.struts.validator.DynaValidatorForm form-property name=payDate type=java.sql.Date/ /form-bean ...and then submit a form, I get a ConversionException: org.apache.commons.beanutils.ConversionException at org.apache.commons.beanutils.converters.SqlDateConverter.conve rt(SqlDateConv erter.java:162) And upon searching the archives, I found suggestions to use SimpleDateFormat to do convert Strings--Dates manually. So what does support mean? Is there any automated (non-custom) way to do this, so I can just say (Date) dynaForm.get('dateField') :-) Thanks! -Sasha Borodin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Does Taglibs cause any performance Issues ???
Tags stay in memory (in pools) based on the tags used and the parameter values of the tags. If memory is an issue then you can disable tag pooling. If cpu performance is an issue (pooling the tags saves object instantiation and release) then leave tag pooling in place. Edgar -Original Message- From: Shakti [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 25, 2003 6:16 AM To: Struts Users Mailing List Subject: Does Taglibs cause any performance Issues ??? Hi All, I want to know whether use of taglibs in jsp cause any kind of performance issues. Someone told me that i should avoid using taglibs becuz they r being loaded into memory and in many cases during stress testing applications have failed because of excess use of taglibs . I want to know your views regarding this ! Cheers.. Shakti - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Server manged vs. struts managed db pools
I will speak about tomcat since that is the one I have used most recently. The web.xml file which is in the war file has a reference to the JNDI objects created by the container. Say you have the same application deployed multiple times (one for each customer). In my application(s), each customer has a separate physical database which means that you have to mess with server.xml in the web container configuration to add the additional database for each customer added (not really an issue if you are adding context elements for virtual servers). Additionally, you don't need a configuration parameter in your application for the JNDI database handle as it can be hardcoded and only change struts-config.xml to reference the correct database. http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-how to.html Edgar -Original Message- From: Vic Cekvenich [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 25, 2003 6:17 AM To: [EMAIL PROTECTED] Subject: Re: Server manged vs. struts managed db pools Edgar P Dollin wrote: There is another issue regarding connection pooling in struts vs connection pooling in the container. In struts the war file contains all the information the app needs to run. With container pooling (at least with tomcat and resin) you have to coordinate the container configuration with struts configuration. With a single container running multiple apps this is a bit of an issue. Edgar I have that same example. The war has JNDI. How the connection pool is provided is of no issue for the war. It works great. You can just lean on J2EE and let it take you home. .V - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Reporting System
Jasper reports is pretty good. http://jasperreports.sourceforge.net Edgar -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 25, 2003 9:35 AM To: Struts-User Subject: Reporting System Hello, we are looking for a good ReportingSystem. We want to create Reports easy in a Struts Web Applikation. Any ideas ? Mit freundlichen Grüßen Christian Reps, Dipl. Inf. (FH) Web Applications - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Token documentation
I haven't seen any but there isn't really much to document. You put an integer into the form with a value that is updated by the action. This value must change from request to request, typically it is incremented. You must carry a hidden field in the jsp to carry the token to the following request (if you don't have the hidden field and are using session beans the value will always be correct, with request beans it will always be incorrect). The load action also puts the token value into the session so the next action can check the value. When the target action is invoked, it picks up the token and checks the value against the actionform. If the value is not the same, i.e. the user hit the back button and resubmitted, you have an error situation. You can forward to an error page or take whatever action you deem necessary at that point. Edgar -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, November 21, 2003 11:52 AM To: [EMAIL PROTECTED] Subject: RE: Token documentation ok, I will try to get this book. And what about online documentation? Extranet [EMAIL PROTECTED] - 11/21/2003 05:22 PM Please respond to [EMAIL PROTECTED] To:struts-user cc: Subject:RE: Token documentation I found the description of how and when to use tokens in The Struts Framework, Practical Guide for Java Programming by Sue Spielman very useful. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, November 21, 2003 11:19 AM To: [EMAIL PROTECTED] Subject: Token documentation Hi all, I have problems with the refresh button of my brower: it resend automatically the form to the server. I found the mailing archive that with the use of tokens, I can avoid that. But I don't really understand how I have to use it properly. Can someone tell me when i could find a good documentation concerning this point? Is it a recommanding desing to associated with tokens ? thanks, Ludo. This message and any attachments (the message) is intended solely for the addressees and is confidential. If you receive this message in error, please delete it and immediately notify the sender. Any use not in accord with its purpose, any dissemination or disclosure, either whole or partial, is prohibited except formal approval. The internet can not guarantee the integrity of this message. BNP PARIBAS (and its subsidiaries) shall (will) not therefore be liable for the message if modified. - Ce message et toutes les pieces jointes (ci-apres le message) sont etablis a l'intention exclusive de ses destinataires et sont confidentiels. Si vous recevez ce message par erreur, merci de le detruire et d'en avertir immediatement l'expediteur. Toute utilisation de ce message non conforme a sa destination, toute diffusion ou toute publication, totale ou partielle, est interdite, sauf autorisation expresse. L'internet ne permettant pas d'assurer l'integrite de ce message, BNP PARIBAS (et ses filiales) decline(nt) toute responsabilite au titre de ce message, dans l'hypothese ou il aurait ete modifie. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This message and any attachments (the message) is intended solely for the addressees and is confidential. If you receive this message in error, please delete it and immediately notify the sender. Any use not in accord with its purpose, any dissemination or disclosure, either whole or partial, is prohibited except formal approval. The internet can not guarantee the integrity of this message. BNP PARIBAS (and its subsidiaries) shall (will) not therefore be liable for the message if modified. - Ce message et toutes les pieces jointes (ci-apres le message) sont etablis a l'intention exclusive de ses destinataires et sont confidentiels. Si vous recevez ce message par erreur, merci de le detruire et d'en avertir immediatement l'expediteur. Toute utilisation de ce message non conforme a sa destination, toute diffusion ou toute publication, totale ou partielle, est interdite, sauf autorisation expresse. L'internet ne permettant pas d'assurer l'integrite de ce message, BNP PARIBAS (et ses filiales) decline(nt) toute responsabilite au titre de ce message, dans l'hypothese ou il aurait ete modifie. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: URGENT:static methods in JSPs
All the tags us introspection to access the objects. Introspection works only on non-static public fields and methods. You must find a way, possible with a façade, to make your static method non-static. Edgar -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 19, 2003 6:18 PM To: [EMAIL PROTECTED] Subject: URGENT:static methods in JSPs Hi i have a static method in one of my bean classes as public static List getCountriesListing() , and i am trying to call this collection in my options tag as html:options collection=countriesListing.countriesListing labelProperty=countryName property=countryCode / But the JSP page gives an error saying : Cannot find bean under name countriesListing.countriesListing Do i also need to create a setter for this method to be recognized as a bean or something? --Mohan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: MessageResources...
A brute force approach is to loop through the context objects looking for ActionMessages or ActionError objects which contain the key you are looking for. Of course, once you have it, just put the key somewhere for future reference. Edgar -Original Message- From: Mitesh Patel [mailto:[EMAIL PROTECTED] Sent: Thursday, November 20, 2003 9:22 AM To: '[EMAIL PROTECTED]' Subject: MessageResources... Hi, Using Struts 1.1b2 Is it possible to get the message-resource parameter in the struts-config file from a customTag? message-resources parameter=com.misys.sts.ms.customiser.utils.ApplicationResources / (Any examples would be much appreciated) Thanks Mitesh Patel -- -- This email message is intended for the named recipient only and may be privileged and/or confidential. If you are not the intended or named recipient or have received this email in error then you should not copy, forward or disclose it to any other person. The views and opinions expressed in this e-mail are those of the sender and may not represent the views and opinions of Misys Securities Trading Systems. If you have received this email in error you should destroy it or contact postmaster [EMAIL PROTECTED] so that we may take appropriate action. -- -- - - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Large scale Internationalization using struts
There have been lots of discussions of this on the archives. As released, there are no on the fly changes to the messages. There are many solutions in the archives although you might have to role your own using the ideas presented. Edgar -Original Message- From: Linus Nikander [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 19, 2003 3:44 AM To: [EMAIL PROTECTED] Subject: Large scale Internationalization using struts I posted this same question a few months back but didn't really get any answers that helped me decide on what to do. So here goes again: The thing I've been looking at Internationalization issues concerned with Struts. The thought of being able to change the whole language of a site simply by changing the locale of the user really appeals to me. All examples i've seen so far use parallel versions of the ApplicationResources.properties file to accomplish this. Whilst this may be feasibel for a fairly small site I don't see how this solution would hold up for a large site (with serveral hundred concurrent requests to anyone of several thousand pages). The problems/questions I can see are: As a single textfile is used, when there are several thousand entries it will become difficult to manage. Can updates be made, during operation, to the content ? What happens if a user requests the files content while it is being edited ? Is the textfile cached for performance, or will concurrent calls compete for the same file-resource ? As I'm probably not the first person who is trying to use Struts on a larger scale for internationalization issues I thought someone might have a better solution. Suggestions ? //Linus Nikander - [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Which framework to choose?
You are right. This is not the right forum. The reason you are asking on this forum (you will get a good answer quickly) is the reason you are using struts and the reason struts has a future. All the other frameworks except for JSF and Microsoft are of technical interest only. Edgar -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 18, 2003 11:07 AM To: [EMAIL PROTECTED] Subject: Which framework to choose? Hi all, Altough this might not be the right place to ask, but I'm just curious. Recently I see a lot of different frameworks which pretty much promise the same functionality as the Struts framework. For instance I found: struts webwork Spring etc... Which one is the best? I have been using Struts for some time now... But maybe some other framework has more future then Struts. I would like to hear your opionions... Thanks, Regards, Harm de Laat Informatiefabriek The Netherlands - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Server manged vs. struts managed db pools
I like struts managed db pools, however, the struts developers aren't too happy about the quality and the dependency on the commons-pooling library and are attempting to phase it out. Edgar -Original Message- From: Nathan Maves [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 18, 2003 2:52 PM To: Struts Users Mailing List Subject: Server manged vs. struts managed db pools Are there any pro/con 's for either? Nathan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Wanted API to handle user roles
Write your own and implement with a filter. Edgar -Original Message- From: Zsolt Koppany [mailto:[EMAIL PROTECTED] Sent: Monday, November 03, 2003 9:56 AM To: Tomcat Users List; Struts Users Mailing List Subject: Wanted API to handle user roles Hi, I'm searching for a Java library to implement Role based access in a Web application. This API must support some kind of hierarchy. For example a user might have all roles in a project (project administrator) but only limited (or no) roles in an other project. As far as I know, tomcat supports only user based roles, thus a user has a role assigned to him everywhere. Any suggestion? Zsolt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Mappings
Has anyone encoded map keys as path parameters in the struts config? I am doing this but was wondering if there were any 'gotchas' I haven't forseen. What I am doing (in MockStrutsTestCase) is using the 'success' forward from an action be conditional or hard-coded. If it was conditional (developer would use the 'key' as the path in struts-config) the forward path is looked up elsewhere, else it is used as is. Thanks in advance. Edgar - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Session Timeout on post
Strictly a container issue. If you keep the login information in hidden fields, you will be able to reinstate the user session although the session information will be gone. You should be able to post the submited record however. You can use a filter for this. Edgar -Original Message- From: Srinivas Gunturu [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 28, 2003 4:48 PM To: Subject: Session Timeout on post Is there a recommended way of handling session timeouts? Especially when a user fills out a form and submits after session has timedout. Using Tomcat realm is the preferred/recommended way or is there any other alternative in Struts? TIA - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Please help: Cannot find message resources under key org.apa che. struts.action. MESSAGE
Looks like you need a file ApplicationResources.properties in your /WEB-INF/classes directory. Edgar -Original Message- From: Prashanth Narayanan [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 29, 2003 4:57 PM To: 'Struts Users Mailing List' Subject: Please help: Cannot find message resources under key org.apache. struts.action. MESSAGE still couldn't resolve this any help will be appreciated - this is my first struts example! -Original Message- From: Prashanth Narayanan Sent: Wednesday, October 29, 2003 1:54 PM To: '[EMAIL PROTECTED]' Subject: Cannot find message resources under key org.apache.struts.action. MESSAGE hi, i am getting the following message: org.apache.jasper.JasperException: Cannot find message resources under key org.apache.struts.action.MESSAGE at org.apache.jasper.servlet.JspServletWrapper.service(JspServlet Wrapper.java:2 54) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet .java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) ... i am running struts 1.1 on apache 4.1. and this is the most basic example: -- my BookView.jsp -- %@ page language=java % %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % %@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic % html:html locale=true head html:base/ title bean:message key=index.title/ /title /head body h2BookView/h2 /body /html:html -- from my web.xml: -- web-app servlet servlet-nameaction/servlet-name servlet-classorg.apache.struts.action.ActionServlet/servlet-class init-param param-nameapplication/param-name param-valueApplicationResources/param-value /init-param init-param param-nameconfig/param-name param-value/WEB-INF/struts-config.xml/param-value /init-param init-param my struts-config.xml: ?xml version=1.0 encoding=ISO-8859-1 ? !DOCTYPE struts-config PUBLIC -//Apache Software Foundation//DTD Struts Configuration 1.0//EN http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd; struts-config message-resources parameter=ApplicationResources.properties/ /struts-config any help will be much appreciated, thanks, -prash. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts-config
Very cool, exactly what I was looking for. Edgar -Original Message- From: Kris Schneider [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 28, 2003 8:22 AM To: Struts Users Mailing List Subject: RE: Struts-config Or, if you're using Ant, try the optional xmlvalidate task (this is almost exactly one of the examples given): xmlvalidate file=struts-config.xml dtd publicId=-//Apache Software Foundation//DTD Struts Configuration 1.1//EN location=struts-config_1_1.dtd/ /xmlvalidate http://ant.apache.org/manual/OptionalTasks/xmlvalidate.html Quoting Matt Raible [EMAIL PROTECTED]: 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 -- 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]
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]
StrutsTestCase and Multiple Struts Configuration files
Has anyone used StrutsTestCase with multiple comma-delimited struts configuration files and multiple message files. If so are there any issues which might make it less straight forward than straight struts? Thanks Edgar - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tags creating Tags
There is a little more overhead than this. You are now taking control of the struts tag lifespan. Currently, assuming tag pooling, this is done by the container based on a hash of the parameter values. If you are careful you can piggyback on that by synchronizing the internal tag instantiation with your tag. You could instantiate the internal tag on every reference, but that would be a step back in terms of efficiency. Then any jsp parameters you will be passing to the internal tag must be passed prior to invoking the tag. Additionally, each of the methods of the Tag or BodyTag interfaces must be implemented and call the internally referenced tag based on the requirements of the tag. Most of the struts tags don't have a 'real' body so this is not that important. If you were considering wrapping the iterate tag, you would have an interesting problem. Edgar -Original Message- From: Lukas Bradley [mailto:[EMAIL PROTECTED] Sent: Monday, October 27, 2003 10:25 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: Tags creating Tags Mike emailed me this idea last night, and I think it's the best yet. Brilliant solution, Mike. Lukas Mike Jasnowski [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Going from your example, I'm not sure why you even need to subclass a Struts tag to get the output you described. You should be able to code something like this on your JSP: lukas:myTag lang=en html:file property=formFile styleClass=FormField/ /lukas:myTag The tag handling flow would look like (similar to what you proposed earlier): myTag.doStartTag(); pageContext.getOut().println(tabletrtd); *include output of body of custom tag here, which might be Struts tags which are invoked. myTag.doEndTag(); pageContext.getOut().println(/td/tr/table); Which would evaluate to table tr td input type=file name=formFile value= class=FormField /td /tr /table All this w/o changing or subclassing a Struts tag, the only Custom tag work is myTag. HTH, Mike -Original Message- From: Lukas Bradley [mailto:[EMAIL PROTECTED] Sent: Sunday, October 26, 2003 7:34 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Tags creating Tags Hi all, Maybe I'm just tired, but the answer to this is not to be found. I could me making this harder than it is, or something might be right in front of me, and I don't see it. What I want is a custom tag that creates other custom tags. Here is a simple example: lukas:myTag lang=en / Should produce something like this: table trtdEnglish/td/tr trtdhtml:file property=formFile styleClass=FormField//td/tr !-- Imagine a lot more custom tags here -- /table Which should then evaluate to: table trtdEnglish/td/tr trtdinput type=file name=formFile value= class=FormField/td/tr !-- Imagine a lot more custom tags rendering here. -- /table I've thought about trying to extend BodyTagSupport, return EVAL_BODY_BUFFERED in doStartTag(), modify the bodyContent in doAfterBody(), then return EVAL_PAGE() in doEndTag(). However, BodyContent has a protected constructor, and no way to set its content. I want to maintain the functionality gained from Struts-like custom tags, while extracting the creation of them in a super-duper momma tag. Any help? Lukas - 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
Stuts menu can do all of that. Be prepared to write some customizations since there are inconsistencies in the capabilities between the menu displayers. I have it working fine with tiles and struts with authentication http://www.abmga.org using a drop down displayer. Edgar -Original Message- From: Adam Hardy [mailto:[EMAIL PROTECTED] Sent: Thursday, October 23, 2003 6:26 AM To: Struts Users Mailing List Subject: struts-menu Hi All, I am writing the menu part of my app right now and I have basically made us of tiles-def.xml to specify what links I want in each page, which seems a very handy way of doing it. In my menu Tile I have a couple of links as well that will always appear and vary depending on whether the user is logged in what role they have. Then I remembered that there is a struts-menu add-on at sourceforge, which I checked out. I was looking for anything that I might have forgotten that could pop up later and bite me. Obviously it wasn't exactly possible to find such unknown info, so I thought I'd list my menu requirements here and see if any can tell me that I've forgotten something important. Basically the site is a small e-commerce outfit selling webservices. My menu is meant to be / do the following: (1) a run-of-the-mill list of context relative links (2) no javascript (3) several permanent, static links, e.g. home, about, contact (4) several permanent toggling links, e.g. register or login or logout (5) several context sensitive links, e.g. to other components of the site That seems to be it AFAIK. Any comments would be welcome, thanks Adam -- struts 1.1 + tomcat 5.0.12 + java 1.4.2 Linux 2.4.20 RH9 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [Poll] Action Form data types
None of the above. I use java data types but use getters and setters in the ActionForm to perform the casting and any other manipulations necessary. Edgar Mainguy, Mike wrote: Here's my weekly(ish) question: For the purposes of this discussion, ActionForms also mean DynaActionForms and the like... Where does everyone cast their (String) request parameters to the 'proper' datatype? #1 My ActionForms only have Strings, I manually cast stuff somewhere else. #2 My ActionForms only have Strings, I let (BeanUtils, JDBC,...) cast stuff for me somewhere else. #3 My ActionForms have java Datatypes, I let Struts(yeah, beanutils, I know) cast stuff for me. #4 I use strings for everything, I don't need to cast. - This message and its contents (to include attachments) are the property of Kmart Corporation (Kmart) and may contain confidential and proprietary information. You are hereby notified that any disclosure, copying, or distribution of this message, or the taking of any action based on information contained herein is strictly prohibited. Unauthorized use of information contained herein may subject you to civil and criminal prosecution and penalties. If you are not the intended recipient, you should delete this message immediately. - 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: DynaActionForms
Interesting idea. My other choice is to stick a map in a standard action form. What view technology are you using with these lists? Edgar -Original Message- From: Robert Taylor [mailto:[EMAIL PROTECTED] Sent: Monday, October 13, 2003 4:07 PM To: Struts Users Mailing List Subject: RE: DynaActionForms Edgar, have you thought about using indexed properties together with ListUtils.lazylist() with DynaActionForms. I've successfully used them with DynaActionForms where my fields are completely dynamic. Just a thought. robert -Original Message- From: Edgar P Dollin [mailto:[EMAIL PROTECTED] Sent: Monday, October 13, 2003 4:39 PM To: Struts Users Mailing List Subject: RE: DynaActionForms Thanks for the input. I did some more research and I think I understand the forms a little better. The following code will create a DynaActionForm with one String field: FormBeanConfig formBean = new FormBeanConfig(); FormPropertyConfig fpc = null; fpc = new FormPropertyConfig(); fpc.setName(testField1); fpc.setType(java.lang.String.class.getName()); fpc.setInitial(testField1Value); formBean.addFormPropertyConfig(fpc); formBean.setType(org.apache.struts.action.DynaActionForm.class .getName()); formBean.freeze(); DynaActionFormClass dFC = DynaActionFormClass.createDynaActionFormClass(formBean); DynaActionForm dynaForm = (DynaActionForm) dFC.newInstance(); I think I know the answer already (my apologies), but will this code break with new releases of struts. Thanks Edgar -Original Message- From: Nick [mailto:[EMAIL PROTECTED] Sent: Monday, October 13, 2003 2:41 PM To: Struts Users Mailing List Subject: Re: DynaActionForms I do not believe that you can do dynamically add fields to a DynaForm, as the config is frozen at app startup. Might work with an internal HashMap though. On Mon, Oct 13, 2003 at 03:31:32PM -0400, Chen, Gin wrote: I'm assuming that he meant create a new property that is not already defined in the struts-config. In which case I think your reply would fail with an property not found type exception. :-/ One way around this is to have a Hashmap within the hashmapped dynaform. That will allow you to do something like: Hashmap myDynaproperties = (Hashmap)myDynaform.get(dynaProperties); myDynaproperties.set(foo, bar); Etc. Another possibility (although I havent tried it) is to operate directly on the map. myDynaproperties.getMap().put(foo, bar); -Tim -Original Message- From: Carlos Sanchez [mailto:[EMAIL PROTECTED] Sent: Monday, October 13, 2003 3:21 PM To: 'Struts Users Mailing List' Subject: RE: DynaActionForms yourdynaform.set(propertyname,propertyvalue); -Mensaje original- De: Edgar P Dollin [mailto:[EMAIL PROTECTED] Enviado el: lunes, 13 de octubre de 2003 19:35 Para: Struts Users Mailing List Asunto: DynaActionForms I have an application with configuration files already. Rather than have struts-config configure DynaForms, I would like to populate the forms myself. Does anyone have any experience with how this behaves in struts? Thanks 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Nick Heudecker SystemMobile, Inc. Email: [EMAIL PROTECTED] 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: DynaActionForms
Doesn't this answer require an [OT] designation. -Original Message- From: Mark Galbreath [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 14, 2003 7:03 AM To: Struts Users Mailing List Subject: RE: DynaActionForms Yes. -Original Message- From: Edgar P Dollin [mailto:[EMAIL PROTECTED] Sent: Monday, October 13, 2003 1:35 PM ...I would like to populate the (DynaAction)forms myself. Does anyone have any experience with how this behaves in struts? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: DynaActionForms
My question was regarding, JSTL, Velocity, etc. I prefer the standard tags with the nested extensions and standard JSP expressions (I can read the JSP after I walk away for a week), which is probably what I will end up doing. Yes, you answered my question. I don't use reset, if I can help it. BTW, since you are really putting a collection in a form, do you really need to use a DynaForm? Thanks Edgar -Original Message- From: Robert Taylor [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 14, 2003 8:18 AM To: Struts Users Mailing List Subject: RE: DynaActionForms I'm not sure what you mean when you ask what view technology. You can find ListUtils here: http://jakarta.apache.org/commons/collections/api/org/apache/c ommons/collect ions/ListUtils.html I've rendered these lists using a variety of html:* .../ components - checkboxes, multiboxes, select lists, text, hidden, etc... I admit, I had a hard time getting my head around how to use indexed properties and dynamically generated fields but they work. You will most likely have to subclass the DynaActionForm and override the reset(). Heres a link to using indexed properties: http://jakarta.apache.org/struts/faqs/indexedprops.html Let me know if I answered your question. robert -Original Message- From: Edgar P Dollin [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 14, 2003 8:12 AM To: Struts Users Mailing List Subject: RE: DynaActionForms Interesting idea. My other choice is to stick a map in a standard action form. What view technology are you using with these lists? Edgar -Original Message- From: Robert Taylor [mailto:[EMAIL PROTECTED] Sent: Monday, October 13, 2003 4:07 PM To: Struts Users Mailing List Subject: RE: DynaActionForms Edgar, have you thought about using indexed properties together with ListUtils.lazylist() with DynaActionForms. I've successfully used them with DynaActionForms where my fields are completely dynamic. Just a thought. robert -Original Message- From: Edgar P Dollin [mailto:[EMAIL PROTECTED] Sent: Monday, October 13, 2003 4:39 PM To: Struts Users Mailing List Subject: RE: DynaActionForms Thanks for the input. I did some more research and I think I understand the forms a little better. The following code will create a DynaActionForm with one String field: FormBeanConfig formBean = new FormBeanConfig(); FormPropertyConfig fpc = null; fpc = new FormPropertyConfig(); fpc.setName(testField1); fpc.setType(java.lang.String.class.getName()); fpc.setInitial(testField1Value); formBean.addFormPropertyConfig(fpc); formBean.setType(org.apache.struts.action.DynaActionForm.class .getName()); formBean.freeze(); DynaActionFormClass dFC = DynaActionFormClass.createDynaActionFormClass(formBean); DynaActionForm dynaForm = (DynaActionForm) dFC.newInstance(); I think I know the answer already (my apologies), but will this code break with new releases of struts. Thanks Edgar -Original Message- From: Nick [mailto:[EMAIL PROTECTED] Sent: Monday, October 13, 2003 2:41 PM To: Struts Users Mailing List Subject: Re: DynaActionForms I do not believe that you can do dynamically add fields to a DynaForm, as the config is frozen at app startup. Might work with an internal HashMap though. On Mon, Oct 13, 2003 at 03:31:32PM -0400, Chen, Gin wrote: I'm assuming that he meant create a new property that is not already defined in the struts-config. In which case I think your reply would fail with an property not found type exception. :-/ One way around this is to have a Hashmap within the hashmapped dynaform. That will allow you to do something like: Hashmap myDynaproperties = (Hashmap)myDynaform.get(dynaProperties); myDynaproperties.set(foo, bar); Etc. Another possibility (although I havent tried it) is to operate directly on the map. myDynaproperties.getMap().put(foo, bar); -Tim -Original Message- From: Carlos Sanchez [mailto:[EMAIL PROTECTED] Sent: Monday, October 13, 2003 3:21 PM To: 'Struts Users Mailing List' Subject: RE: DynaActionForms yourdynaform.set(propertyname,propertyvalue); -Mensaje original- De: Edgar P Dollin [mailto:[EMAIL PROTECTED] Enviado el: lunes, 13 de octubre de 2003 19:35 Para: Struts Users Mailing List Asunto: DynaActionForms I
RE: Passing parameters between forms
My preference is to emulate the session functionality in your own classes, i.e. publish / subscribe. Stick a static map in your class and use a unique key generated from objects both threads are aware of to index the object, then you can pull it out when you need to. Synchronize if you need to as well. I like this better because then you can run junit tests w/o worring about the container. Edgar -Original Message- From: Shyam A [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 14, 2003 8:39 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: Passing parameters between forms Carey, Thanks for your mail. I knew about the option you suggested and mentioned it in my mail. quote: I know I can save the foo attribute into session in Action A class and access it in Action B, or set the scope of Form A to session in struts-config and access Form A from Action B. unquote: However, the disadvantage of this option is that I need to use session scope for the forms, which I would like to avoid. I also know it is possible to pass the form attribute as a request parameter as follows: html:link page=Action B?parameter=value But, this allows the user to see the parameters being passed. I would rather use buttons for the link and post the form. Do you have any suggestions/comments? Thanks, Shyam --- Carey Nation [EMAIL PROTECTED] wrote: I have some vague memory (perhaps completely wrong) that the forms are stored wherever they are stored using the names that you specify in struts-config. It may not be the nicest way to do this, but I'm pretty sure that, given session scope on your forms, you can do something like (FormA)forma = session.getAttribute(FormA); HTH, Carey - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ 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]
RE: Basic tag library question
Use the HTML:TEXT with readonly=true/false. The true or false can be rendered either with a JSP expression or JSTL. Edgar -Original Message- From: Jacob Wilson [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 14, 2003 7:01 PM To: [EMAIL PROTECTED] Subject: Basic tag library question Hi... Is there any tld that is available to handle my input type=image apart from the struts html tld??? I need to make the image disabled or enabled based on the security level that I will be getting from DB... I know we can do this thru the struts html tag lib werein we can set the default attribute to either true or false!! Was wondering whether there are any other taglibs... I checked the input tag lib from jakarta, they do not have it for image!!! Let me know and also please correct me if I had mentioned anything wrong above... Thanks. -Jacob. - Do you Yahoo!? The New Yahoo! Shopping - with improved product search - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Converting to Struts, where to put Servlet init() code?
I have done authentication filters and they work very nicely with struts. Edgar -Original Message- From: Wendy Smoak [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 14, 2003 6:43 PM To: [EMAIL PROTECTED] Subject: Converting to Struts, where to put Servlet init() code? I'm converting an existing webapp to Struts. I have some code in a Servlet init() method, and I don't immediately see where I should put it. This is an authentication/authorization webapp, and the code in question sets up an authentication handler object to be used by every subsequent request. What's guaranteed to get executed before the Action code? (I'm almost thinking Filter, and to put the object in Application scope, but I'm not sure yet.) Any advice? -- Wendy Smoak Applications Systems Analyst, Sr. Arizona State University, PA, IRM - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DynaActionForms
I have an application with configuration files already. Rather than have struts-config configure DynaForms, I would like to populate the forms myself. Does anyone have any experience with how this behaves in struts? Thanks Edgar - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: DynaActionForms
Thanks for the input. I did some more research and I think I understand the forms a little better. The following code will create a DynaActionForm with one String field: FormBeanConfig formBean = new FormBeanConfig(); FormPropertyConfig fpc = null; fpc = new FormPropertyConfig(); fpc.setName(testField1); fpc.setType(java.lang.String.class.getName()); fpc.setInitial(testField1Value); formBean.addFormPropertyConfig(fpc); formBean.setType(org.apache.struts.action.DynaActionForm.class.getName()); formBean.freeze(); DynaActionFormClass dFC = DynaActionFormClass.createDynaActionFormClass(formBean); DynaActionForm dynaForm = (DynaActionForm) dFC.newInstance(); I think I know the answer already (my apologies), but will this code break with new releases of struts. Thanks Edgar -Original Message- From: Nick [mailto:[EMAIL PROTECTED] Sent: Monday, October 13, 2003 2:41 PM To: Struts Users Mailing List Subject: Re: DynaActionForms I do not believe that you can do dynamically add fields to a DynaForm, as the config is frozen at app startup. Might work with an internal HashMap though. On Mon, Oct 13, 2003 at 03:31:32PM -0400, Chen, Gin wrote: I'm assuming that he meant create a new property that is not already defined in the struts-config. In which case I think your reply would fail with an property not found type exception. :-/ One way around this is to have a Hashmap within the hashmapped dynaform. That will allow you to do something like: Hashmap myDynaproperties = (Hashmap)myDynaform.get(dynaProperties); myDynaproperties.set(foo, bar); Etc. Another possibility (although I havent tried it) is to operate directly on the map. myDynaproperties.getMap().put(foo, bar); -Tim -Original Message- From: Carlos Sanchez [mailto:[EMAIL PROTECTED] Sent: Monday, October 13, 2003 3:21 PM To: 'Struts Users Mailing List' Subject: RE: DynaActionForms yourdynaform.set(propertyname,propertyvalue); -Mensaje original- De: Edgar P Dollin [mailto:[EMAIL PROTECTED] Enviado el: lunes, 13 de octubre de 2003 19:35 Para: Struts Users Mailing List Asunto: DynaActionForms I have an application with configuration files already. Rather than have struts-config configure DynaForms, I would like to populate the forms myself. Does anyone have any experience with how this behaves in struts? Thanks 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Nick Heudecker SystemMobile, Inc. Email: [EMAIL PROTECTED] Web: http://www.systemmobile.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: JavaServer Faces
I have been triing to avoid this issue, but I can't help stick my foot in my mouth. Struts works but so do a lot of technologies. Struts is about the COMMUNITY. I have never been on a more supportive, active, relevant communitity of developers. As long as the community keeps producing stuff which is relevant to the community it will continue to be relevant. Edgar -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED] Sent: Friday, October 10, 2003 6:25 PM To: Struts Users Mailing List Subject: Re: JavaServer Faces Susan Bradeen wrote: Thank you, Craig, for the umpteenth time for saying this. Why are so many - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts Design Issue - Search Functionality - Best Practices
I believe this feature is implemented in struts-layout http://struts.application-servers.com/ Edgar -Original Message- From: Chawla, Yogesh [mailto:[EMAIL PROTECTED] Sent: Friday, September 26, 2003 2:19 AM To: 'Struts Users Mailing List' Subject: Struts Design Issue - Search Functionality - Best Practices Hi, Design Requirement - Show a list of Search records. The screen will have buttons for Previous/Next Month. On clicking these records would be shown. Issues - a) How to store data and best practices to be followed in Struts. Return back a Collection of Form Beans and iterate over these. However certain other fields are required to be stored also which are not displayable. i.e. Current Date which is a hidden parameter. Any comments ? b) Use a single Form Bean which has variables like String[] to store the array of Displayable Fields. However, this seems to be a less than perfect solution. Any comments ??? c) Use Generic Search - Search on different modules, with different fields ? Any Brilliant Guru contributions for this one..Sure need some wizard out here... Pls. advise on the best approach for the Search functionality. We need to design an application which has Search on each and every page. Thanks for your time , Regards, Yogesh DISCLAIMER: The information in this message is confidential and may be legally privileged. It is intended solely for the addressee. Access to this message by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, or distribution of the message, or any action or omission taken by you in reliance on it, is prohibited and may be unlawful. Please immediately contact the sender if you have received this message in error. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Menu based on Tiles
Look at struts menu on sourceforge. Edgar -Original Message- From: Sudip Kumar Bhattacharya [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 24, 2003 3:45 AM To: [EMAIL PROTECTED] Subject: Menu based on Tiles Hi I need to create a menu using tiles. The menu is a vertical menu, where the categories list comes as bold, and the currently selected menu should be expanded to show the submenus. The currently selected submenu's hyperlink should be disabled, rest have to be enabled. What is the best way to design such a tile? Are there any sample codes for the same? PS: I am not sure if the question belongs to this list, but in case it doesn't can somebody please direct me to the proper list.. Thanks, Sudip - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] STL startup times - is caching going on?
Custom tags are cached in most containers (tag pooling). If the parameters to a tag are the same the same instance of a tag object is used. It is up to the container when to discard / garbage collect the tag instances. I don't know if this is the problem / issue here but hope it helps. Edgar -Original Message- From: Richard Mixon (qwest) [mailto:[EMAIL PROTECTED] Sent: Saturday, September 20, 2003 11:35 PM To: Struts Users Mailing List Subject: [OT] STL startup times - is caching going on? This is a little off-topic, but I am using the Struts EL taglibs in the applications this is happening. Any suggestions, ideas are appreciated. (I also posted on the Jakarta taglibs list). I am having an issue with large startup times the first time one of my pages runs that uses JSTL mostly the core library. Subsequent requests (even for different users on different data) take much, much less time. Here is a little more detail. Any ideas are much appreciated. My ISP is pretty irate because we suck up huge amounts of CPU each time it happens. We are using Tomcat 4.1.24, Java 1.4.1 and Struts 1.1. OK, the page uses a couple of nested foreach loops to generate a grid/chart of SVG markup language. It also uses a couple of small foreach loops to generate tick marks on an axis. It looks something like: Chart page embed tag include JSP/JSTL page to generate footer. include JSP/JSTL page to generate x and y axis JSTL markup to generate main body of chart include JSP/JSTL page to generate footer. The request takes a half second to build the Java objects that the JSTL code uses to render on the page. But the rendering takes 45 second on a 650MHZ Sun SPARC III machine and almost that long on a fast Windows machine (2500 MHZ). The second and subsequent times the chart rendering drops down to less than 200 milliseconds. Then about five minutes later, if the chart is requested again, it takes the 45 seconds to generate, then 200 milliseconds for subsequent requests. Thanks in advance - Richard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: multiple forms with the same formBean
Use multiple form-bean entries for the same form and struts will keep them separate. Edgar -Original Message- From: Rajat Pandit [mailto:[EMAIL PROTECTED] Sent: Friday, September 19, 2003 4:21 AM To: [EMAIL PROTECTED] Subject: multiple forms with the same formBean hello, i am using multiple forms in one page which are attached to the same form bean. now the problem is that when there is an validation error and the page is returned back to INPUT all the forms in the page are prefilled with the same value. i am giving the struture of my jsp pls help as this is urgent logic:iterate id=product name=PRODUCTS html:form action=/Bid name=bidForm !-- form content -- html:text name=bidForm property=amount !-- end of form content -- ?html:form /logic:iterate this will print the form n times on the page.. now suppose the first form is submitted with some eror then the bean bidForm will be saved with this value and in all the iterated forms will be prefilled with the same.. any clues. am i doing it the wrong way or any better way to do the same thing. regards rajat __ 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]
RE: Design Question
I have special field objects which with separate methods for jsp setting and database setting which also track changes. Then I can use reflection to the specific type and see if any of the objects in the database changed and are not confused by spurious instance variables. You can then create methods for checkpointing the data so if you have a complex set of updates you can know the status at any point. The main drawback and one I am still working on) is that for reflection to work with the field objects directly they need to be public. The Bean Utils will still work as long as your getters and setters follow the Java Bean spec. Edgar -Original Message- From: sean schofield [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 17, 2003 9:57 AM To: [EMAIL PROTECTED] Subject: Design Question I am working on a struts-based web application and I have an interesting design issue that I'd like to get some feedback on. I think this problem is actually quite generic and there must be some good ideas out there already that I could sponge off! Basically I have a struts form with a bunch of fields that will be presented to the user through the usual JSP-based view. The user will have the opportunity to makes edits and then submit to an action. What I would like to do is be able to identify which fields changed and then take certain actions based on these changes. Here is one rough ideas I have so far. Any thoughts on this plus additional ideas would be greatly appreciated. 1.) Extend ActionForm and customize the populate method so that it makes a copy of the old version of the form that is already stored in the session (since it will have session scope) 2.) Populate new form 3.) Compare two forms and store list of changes in new form 4.) Discard copy of old. Any thoughts, comments? TIA, sean - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: searching on client side.
Use javascript and a button to invoke the browser find function. Edgar -Original Message- From: imran ali [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 17, 2003 4:17 PM To: Struts Users Mailing List Subject: searching on client side. Hi All, I am having a table in my jsp. I have a text box which takes value of a particular column, make search on that column and finally displays only those rows which have those columns. And if I again want to search on some other column it will search in initial collection of values and will give me result. How can I achieve it on client side itself without going to server. Please help . Imran. Imran ___ Click to Order Your Prints For Delivery Anywhere in India at http://www.kodakexpress.co.in - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Errors / Messages
In validate, if you add an error to the message list, validator returns without forwarding. Has anyone done anything with an alternate message file or prioritized messages, so you can add a message yet still forward. Thanks in advance. Edgar - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Errors / Messages
I would like the action to perform (not fail as validator specifies) but give feedback to the user about the entered data. For example in certain fields you can use a table as a select but override the selection, and other input would be added to the selection. You would want to let the user know that the information was added to the allowed list. I am doing your other selection in the action class as well. My intermeditate solution, is to extend the ActionForm and add an informational message ActionMessages property and a special tag for displaying any pending informational messages. Edgar -Original Message- From: Max Cooper [mailto:[EMAIL PROTECTED] Sent: Monday, September 15, 2003 5:38 AM To: Struts Users Mailing List Subject: Re: Errors / Messages Edgar, What is your aim in doing this? If there is a validation error, the Struts framework sends the user back to the input page to inform them of the problem, and possibly allow them to fix it and resubmit. If the request still gets passed to the action, the action will need to do conditional processing based on the presence of errors, and then it is unclear how control will pass back to Struts so that it can send the user back to the input page to inform them of what went wrong. I have sometimes thought about having the action produce a validation-style error if something goes wrong in processing the request, after which it could pass control back to the Struts framework to send the user back to the input page. You can of course add another forward or something, but it would be nice if you could just tell Struts more cleary that something went wrong and that Struts should send the user back to the input form (as it does with a validation error), but I am not sure if there is an elegant way to do that. This is distinct from your proposed flow, but it seems the same feature (tell Struts there was an error and user should be sent back to input form) could support both of our scenarios. What is the scenario you wish to support with the control flow that are looking for? -Max - Original Message - From: Edgar P Dollin [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, September 15, 2003 2:54 AM Subject: Errors / Messages In validate, if you add an error to the message list, validator returns without forwarding. Has anyone done anything with an alternate message file or prioritized messages, so you can add a message yet still forward. 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]
RE: Easy Question
Boolean form properties are cool too (at least in my experience)... Edgar -Original Message- From: Michael Ruppin [mailto:[EMAIL PROTECTED] Sent: Friday, September 12, 2003 3:14 PM To: Struts Users Mailing List Subject: RE: Easy Question Non-String Form bean properties are evil though, you'll thank yourself later if you use Strings. As long as the String is set to something sensible like true or false, your checkbox will be properly set. I'm sure there are ample posts on the pros cons of this approach, here's one pro thread: http://marc.theaimsgroup.com/?l=struts-userm= 106159073522015w=2 m Slattery, Tim - BLS [EMAIL PROTECTED] wrote: Sorry for emailing so many questions. My last one (i promise) is, how do I set an to display as checked? The property attribute of the tag should point to a boolean property of the FormBean. If that property is true the box will be checked. -- Tim Slattery [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 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts with a DHTML menu
Struts-menu works pretty well. http://sourceforge.net/project/showfiles.php?group_id=48726 Edgar -Original Message- From: Mahbub ul Huq Bin Kabir [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 10, 2003 11:39 PM To: [EMAIL PROTECTED] Subject: Struts with a DHTML menu Hi, I'm using Struts from few months. I almost completed my project now want to add a drop down menu to my project with customized security level. Is there any good build in DHTML menu that can be integrate with my struts project. I'll be very happy if I get any reply. Thanks, Mahbub _ STOP MORE SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to reference multiple form beans from one VelocityLayoutS ervlet set of page fragments?
I have gotten two html:forms two work in a limited fashion with struts. Note that your always visible form, doesn't have to be connected with a struts action so the problems with actions wouldn't apply. Also, the rules for forms are different if you are using tiles since each tile has an action and I believe tiles works with Velocity. Edgar -Original Message- From: Mike Kienenberger [mailto:[EMAIL PROTECTED] Sent: Thursday, September 04, 2003 6:34 PM To: Struts Users Mailing List Subject: How to reference multiple form beans from one VelocityLayoutServlet set of page fragments? I need to have two forms displayed on the same Velocity template page. I can receive a reference to one form bean via the ActionMapping. I've been unable to determine how to gain a reference to the second form bean. Reference to how it could be done in pure jsp: http://www.mail-archive.com/[EMAIL PROTECTED]/msg22976.html Reference to how multiple forms may not work with Velocity: http://www.mail-archive.com/[EMAIL PROTECTED]/msg06945.html Contrary reference that it might be possible to reference multiple forms with $form in Velocity: http://www.mail-archive.com/[EMAIL PROTECTED]/msg05261.html Probably unimportant details: I'm using Struts 1.1, Tomcat 4.1.27, the Validator, and the VelocityLayoutServlet from Velocity-tools-1.0. I've got my layout broken out into the generic standard: layout header menu body footer I've got a form that is generally visible in the menu section. I have arbitrary forms that can appear in the body section, and these I plan to pass by the action mapping. I'm using org.apache.struts.validator.DynaValidatorForm for all Form Beans. Thanks! -Mike - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Migrating to struts
This would depend how your application was architected. If you do ONLY jsp (i.e. sql and logic in the page), then basically you are re-writing the application by cutting back-end code out of your jsp pages and creating business logic classes and action class. If your application is reasonably well architected, then you are probably going to be creating DynaForms in xml and on each jsp replacing validation logic, message logic, etc to utilize struts features. Edgar -Original Message- From: Prashanth.S [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 02, 2003 8:25 AM To: [EMAIL PROTECTED] Subject: Migrating to struts Hi all, i asked this question previously and i havent got reply...I need to know how best can we migrate from present running application which uses jsp[and lot of custom taglibs] to struts... Any url reference would also be usefull Thanks in advance Prashanth - Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: nested tags
With 1.1 they work fine. My understanding is that all the tags are in a static state but should continue to function as is. Edgar -Original Message- From: Erez Efrati [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 26, 2003 7:59 AM To: 'Struts Users Mailing List' Subject: nested tags Hi all, What is the status with nested:xxx tags? Should I use them or should I avoid using them? Thanks, Erez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: how to switch of logging with log4j at initialization
Since you are still having problems, I would set up a simple test app with a class or two and a clean classpath. Edgar -Original Message- From: Martin Monsorno [mailto:[EMAIL PROTECTED] Sent: Thursday, April 03, 2003 2:37 AM To: 'Struts Users Mailing List' Cc: 'Niesen, Nathan'; Edgar Dollin Subject: Re: how to switch of logging with log4j at initialization Craig R. McClanahan [EMAIL PROTECTED] writes: [...] As I wrote as an answer to Edgar Dollin, my problem is not that log4j is used, but that my log4j configuration seems to be not the only one used, as I set the logging for com.apache to a file with ERROR level, but the output for (some of?) the commons-classes is logged anyway to stdout. Assuming that com.apache is not a typo, you might try org.apache instead. Yes, it's a typo. Unfortunately NOT in my log4j.configuration, only in my posting, so no luck with this, too :-( -- Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts Console
James: Would there be any interest in getting struts console to support struts-menu. Thanks Edgar - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: StrutsMenu Coolmenu4 images
I am not a committer so I am guessing to some degree, but it looks like the image is not being passed through to coolmenus (look at the generated code for save). I am not a coolmenu expert either so I don't know if coolmenus doesn't support the image or if struts-menu just didn't generate the code required. Since both coolmenus and strutsmenu are open source it shouldn't be too hard to figure out the missing link. My apologies for not being of more help. Edgar -Original Message- From: Jack Zakarian [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 19, 2003 11:08 AM To: Edgar Dollin Subject: RE: StrutsMenu Coolmenu4 images Hi Edgar, I checked the generated HTML and it contained a base tag base href=http://d5l8ql11:9081/wp/; and the menu script of : script type=text/javascript !-- oCMenu.makeMenu('MainMenu','','Home','/wp/return-mainmenu.do', '','','',' ','','','','','',0,'','',''); oCMenu.makeMenu('Action','','Action'+cmTopMenuImage+'','','',' ','','','' ,'','','','',0,'','',''); oCMenu.makeMenu('TCancel','Action','Cancel','','','','','','', '','','',' ',0,'submitAction(ServiceInvoice/add.do)','',''); oCMenu.makeMenu('TClear','Action','Clear','','','','','','','' ,'','','', 0,'submitAction(ServiceInvoice/add.do)','',''); oCMenu.makeMenu('TReset','Action','Reset','','','','','','','' ,'','','', 0,'submitAction(ServiceInvoice/edit.do)','',''); oCMenu.makeMenu('TSave','Action','Save','','','','','','','',' ','','',0, 'submitAction(ServiceInvoice/save.do)','',''); oCMenu.makeMenu('Query','','Query'+cmTopMenuImage+'','','','', '','','',' ','','','',0,'','',''); oCMenu.makeMenu('TField','Query','Field','','','','','','','', '','','',0 ,'submitAction(ServiceInvoice/edit.do)','',''); oCMenu.makeMenu('TList','Query','List','summary.do','','','',' ','','','' ,'','',0,'','',''); oCMenu.makeMenu('TNew','Query','New','add.do','','','','','',' ','','','' ,0,'','',''); oCMenu.makeMenu('Add','','Add'+cmTopMenuImage+'','','','','',' ','','','' ,'','',0,'','',''); oCMenu.makeMenu('TAdd','Add','New Record','add.do','','','','','','','','','',0,'','',''); oCMenu.makeMenu('TDetail','Add','Detail','','','','','','','', '','','',0 ,'submitAction(ServiceInvoice/adddetail.do)','',''); oCMenu.makeMenu('Delete','','Delete'+cmTopMenuImage+'','','',' ','','','' ,'','','','',0,'','',''); oCMenu.makeMenu('TRecord','Delete','Record','','','','','','', '','','',' ',0,'submitAction(ServiceInvoice/delete.do)','',''); oCMenu.makeMenu('TSelected','Delete','Selected Detail','','','','','','','','','','',0,'submitAction(Service Invoice/de letedetail.do)','',''); oCMenu.construct(); //-- /script My men-config.xml contains : Menu name=MainMenu title=menu.home.title page=return-mainmenu.do/ Menu name=Action title=menu.action.title Item name=TCanceltitle=menu.action.cancel onClick=submitAction(quot;ServiceInvoice/add.doquot;)/ Item name=TClear title=menu.action.clear onClick=submitAction(quot;ServiceInvoice/add.doquot;)/ Item name=TReset title=menu.action.reset onClick=submitAction(quot;ServiceInvoice/edit.doquot;)/ Item name=TSave title=menu.save.title onClick=submitAction(quot;ServiceInvoice/save.doquot;) image=images/save.gif/ /Menu Menu name=Query title=menu.query.title Item name=TField title=menu.query.field onClick=submitAction(quot;ServiceInvoice/edit.doquot;)/ Item name=TList title=menu.query.list location=summary.do/ Item name=TNew title=menu.query.new location=add.do/ /Menu Menu name=Addtitle=menu.add.title Item name=TAdd title=menu.add.new location=add.do/ Item name=TDetailtitle=menu.add.detail onClick=submitAction(quot;ServiceInvoice/adddetail.doquot;)/ /Menu Menu name=Delete title=menu.delete.title Item name=TRecordtitle=menu.delete.record onClick=submitAction(quot;ServiceInvoice/delete.doquot;)/ Item name=TSelected title=menu.delete.selected onClick=submitAction(quot;ServiceInvoice/deletedetail.doquot;)/ /Menu Side not: I haven't tried you suggestion for LookupDispatchAction yet. I tried different combinations of wp/images/save.gif, /images/save.gif, /wp/images/save.gif but no luck. Thanks, Jack -Original Message- From: Edgar Dollin [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 19, 2003 10:21 AM To: 'Jack Zakarian'; '[EMAIL PROTECTED]' Subject: RE: StrutsMenu Coolmenu4 images I would start by looking at the generated HTML. One other thing to check is if your pages have any path information, i.e. struts modules or general application context then the images need either absolute images
RE: StrutsMenu
Matt: The links below don't seem to do any role stuff that I can find. BTW: there are some bugs in the dhtmlDropdown.jsp with IE6. Maybe I am reading the code incorrectly but the DropDown displayer never calls isAllowed or works with an object that does The coolmenu displayer does makes calls although it's structure is a tad different than the drop down. I have started doing the analysis of where to put the checks to enable the role/permission implementation. The tree menu link is really interesting. The guy and his bud's are really good. BTW: I reworked the cookies and got the menu's to act consistently from page to page. Thanks again Edgar -Original Message- From: Matt Raible [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 11, 2003 9:35 PM To: Edgar Dollin Cc: 'Struts Users Mailing List' Subject: 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
FW: Running unit tests for Validator used with Struts
Use StrutsTestCase, http://strutstestcase.sourceforge.net. It does the whole struts cycle and allows test of all struts components. Edgar -Original Message- From: otisg [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 26, 2003 4:51 PM To: '[EMAIL PROTECTED]' Subject: Q: Running unit tests for Validator used with Struts Hello, It is almost impossible to get anyone attention on struts-user. I'm using Struts and Validator with it. I wrote a custom Validator and want to write a unit test for it. My Validator has a method like this: public static boolean validateStartLetter( Object bean, ValidatorAction validatorAction, Field field, ActionErrors errors, HttpServletRequest request ) { String value = ValidatorUtil.getValueAsString(bean, field.getProperty()); if ((GenericValidator.isBlankOrNull(value)) || !Character.isLetter(value.charAt(0))) { errors.add(field.getKey(), Resources.getActionError(request, validatorAction, field)); } return errors.isEmpty(); } I am running JUnit from Ant to run my unit test class. Apparently this doesn't work because the instance of ActionErrors passed to this method is null, causing a NPE. I wanted to check the unit tests for Validator in Struts (FieldChecks) to see how you wrote your unit tests, so that this NPE is avoided, but I could not find any unit tests for it. Are there really no unit tests there? Regardless, how would you go about running unit tests for a custom validator from something like Ant? It seems to me that doing that may be impossible, because there is no Struts running to instantiate ActionErrors, there is no HttpServletRequest, and so on. Is there a way to do this? Thanks, Otis Get your own 800 number Voicemail, fax, email, and a lot more http://www.ureach.com/reg/tag - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] Resin to Tomcat Conversion
Has anyone done a conversion from a another j2ee container (in my case caucho/resin) to tomcat? If so do you have any war stories? Thanks Edgar -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: FW: dataSources outside of actionservlet
Another option is to aquire the database connection via jndi when you need it. Edgar -Original Message- From: Matthias Bauer [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 9:05 AM To: 'Struts Users Mailing List' Subject: Re: FW: dataSources outside of actionservlet The normal thing to is the following: You aquire a database connection in the action class and pass it on as a parameter to the bean's database methods. --- Matthias Mark wrote: Sorry to repost this question, but the more i think about it the more i think it a reasonable one (please tell me if i'm wrong). -- Forwarded Message From: Mark Lowe [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] Date: Tue, 17 Dec 2002 09:03:33 +0100 To: Struts Users Mailing List [EMAIL PROTECTED] Subject: dataSources outside of actionservlet hello you'll all have to forgive my stupidity but i've been having real problems trying to reference the datasource specified in config.xml in my business logic classes. I've been very good and seperated everything as one should. but i really need a straight answer to this (i.e. an example that works). For maximum code re-use, business logic beans should be designed and implemented so that they do not know they are being executed in a web application environment now i've only seen examples referencing the datasource inside an action servlet, this appears to go against the design pattern. So how do i do this? have i neglected to find the correct example? why are all the examples of how to reference the datasource breaking the aforementioned priciple? please i'm very confused .. many thanks in advance mark -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- End of Forwarded Message -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: dataSources outside of actionservlet
Context env = (Context) new InitialContext().lookup(java:comp/env); DataSource ds = (DataSource) env.lookup(yourconnection); conn = ds.getConnection(); Edgar -Original Message- From: Mark [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 10:13 AM To: Struts Users Mailing List Subject: Re: dataSources outside of actionservlet I know that , i've read that .. But I what i really want to know is this Without importing any servlet stuff Some_means_of_getting_to_details_in_config_xml.getDatasource(mykey); Many thanks mark On 17-12-2002 15:17, Edgar P. Dollin [EMAIL PROTECTED] wrote: Another option is to aquire the database connection via jndi when you need it. Edgar -Original Message- From: Matthias Bauer [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 9:05 AM To: 'Struts Users Mailing List' Subject: Re: FW: dataSources outside of actionservlet The normal thing to is the following: You aquire a database connection in the action class and pass it on as a parameter to the bean's database methods. --- Matthias Mark wrote: Sorry to repost this question, but the more i think about it the more i think it a reasonable one (please tell me if i'm wrong). -- Forwarded Message From: Mark Lowe [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] Date: Tue, 17 Dec 2002 09:03:33 +0100 To: Struts Users Mailing List [EMAIL PROTECTED] Subject: dataSources outside of actionservlet hello you'll all have to forgive my stupidity but i've been having real problems trying to reference the datasource specified in config.xml in my business logic classes. I've been very good and seperated everything as one should. but i really need a straight answer to this (i.e. an example that works). For maximum code re-use, business logic beans should be designed and implemented so that they do not know they are being executed in a web application environment now i've only seen examples referencing the datasource inside an action servlet, this appears to go against the design pattern. So how do i do this? have i neglected to find the correct example? why are all the examples of how to reference the datasource breaking the aforementioned priciple? please i'm very confused .. many thanks in advance mark -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- End of Forwarded Message -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Struts and session
You don't forward from the filter, you send an error to the container. The container has a configurable login page i.e. from web.xml. error-page error-code401/error-code location/WEB-INF/jsp/requestUserLogin.jsp/location /error-page Edgar -Original Message- From: Justin Ashworth [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 17, 2002 11:16 AM To: 'Struts Users Mailing List' Subject: Re: Struts and session Hi Doug, The filter does work with Struts - it just doesn't make use of it. Your request goes through the filter even before the Struts ActionServlet is invoked, so all of this happens before Struts comes into the picture in a request. You really don't need struts for this - you are basically just getting a session attribute and if it comes back null you forward to a login page, using a RequestDispatcher. Having to hard-code (or config file) the login page URL is the only thing that Struts would be able to help with here, but as far as I've seen Struts doesn't provide any help in Filters. If anybody knows of a way to take advantage of a global forward from the struts-config.xml file in a Filter, that would be very useful information. Thanks, Justin - Original Message - From: Doug Ogateter [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Tuesday, December 17, 2002 11:04 AM Subject: Re: Struts and session Justin: Thank you for reply. That's a good idea. One more question, can filter works with struts? Doug Justin Ashworth [EMAIL PROTECTED] wrote:Hi Doug, We use a javax.servlet.Filter to check for an expired session. I found this idea on some website or in the Struts-User archives and it makes the most sense to me. All requests go through the filter before they hit the servlet, so this is the perfect place to check for whether or not a user is logged in - it's hidden away and it's executed before anything else. Just create a class that implements javax.servlet.Filter. There are three methods to implement in this class, but the real work will be done in the doFilter() method. In doFilter() you can call request.getSession().getAttribute(someAttribute) on an attribute that should always be there if the session is valid, and if it's not there forward them to the login screen (this will be a RequestDispatcher.forward() and not a Struts ActionForward). Your doFilter() method will be specific to your application, but the other two methods you need to implement, getFilterConfig() and setFilterConfig() are just a basic getter and setter for a FilterConfig member variable. Also, it is good practice that if you aren't forwarding back to the login page in your doFilter method, you call filterChain.doFilter(request, response). filterChain is a parameter to this method and represents a chain of filters you have configured in your web.xml file. See the JavaDoc for more info. Your entry for the filter in your web.xml file will look something like this: LoginFilter com.d.p.w.LoginFilter LoginFilter *.do If you plan well you should also be able to figure out which page the user was heading to when their session timed out and pass that back to the login screen so that they go directly to it after login. I can't give an example of this because we haven't implemented it yet. HTH, Justin - Original Message - From: Doug Ogateter To: Struts Users Mailing List Sent: Tuesday, December 17, 2002 9:26 AM Subject: Struts and session Greetings: I am using struts1.1b2 to implement a web application. I have a question regarding to implementing session timeout. When session is invalidated, user who has logged in the system should be forwarded to login page. I am not clear about the followings, and hope someone can help me out. 1. Should I use request.getSession(false) to check if session is timeout? If so, that means for every request, it will check if session is invaildate. Will it cause performance problem? If not, which methods should I call to check it? 2. If I should use request.getSession(false) to check session timeout, where should I write the code? Should I write the code in every action class? 3. There are many methods related to session, such as getCreationTime, getLastAccessedTime,..Where and how should I use them in the implementation? 4.From my understanding, I can set timeout in web.xml or use setMaxInactiveIterval(int ..). Usually which way should be use? 5. After user login, I want to forward the user to the page where he was when session timeout. Where should I save the information(with the information, I know where I should forward the user to)? I searched the archive. However, it seems that I can't find the specific info. Your help is highly appreicated. Doug - Post your free ad now! Yahoo! Canada Personals -- To
RE: [OT] Overloaded setters in JavaBeans
I believe if you really need both setters, you should create both getters. Edgar -Original Message- From: Sri Sankaran [mailto:[EMAIL PROTECTED]] Sent: Friday, December 13, 2002 1:54 PM To: 'Struts Users Mailing List' Subject: [OT] Overloaded setters in JavaBeans It is now a well-known fact on this list that if you are trying to access a property using a tag you had better not have an overloaded setter for this property. In other words don't do private String foo; public String getFoo() { return foo; } public void setFoo(String x) { foo = x; } public void setFoo(int i) { foo = + x; } Equally well-known is the reason -- 'tis the JavaBeans specification. So, I went looking. Section 7.1 (Accessor methods) reads Begin quote --- Properties are always accessed via method calls on their owning object. For readable properties there will be a getter method to read the property value. For writable properties there will be a setter method to allow the property value to be updated. --- End quote Section 8.3 (Design Patterns for Properties) reads Begin quote --- By default, we use design patterns to locate properties by looking for methods of the form: public PropertyType getPropertyName(); public void setPropertyName(PropertyType a); If we discover a matching pair of getPropertyName and setPropertyName methods that take and return the same type, then we regard these methods as defining a read-write property whose name will be propertyName. ... If we find only one of these methods, then we regard it as defining either a read-only or a writeonly property called propertyName --- End quote It doesn't say anything about not overloading the accessors. So, why then do we get the error? Sri -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: how do i set the HTML name attribute of an input element?
If you look at the generated HTML, the name is actually the property (plus any nesting information). Edgar -Original Message- From: Andy Kriger [mailto:[EMAIL PROTECTED]] Sent: Friday, December 13, 2002 4:02 PM To: 'Struts Users Mailing List' Subject: how do i set the HTML name attribute of an input element? I would like to set the HTML name attribute of an input element (e.g. image). The name attribute in Struts html-tag land refers to the form bean backing the HTML form. Is there a different attribute that handles the HTML name attribute? thx andy -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Finding app context in action class???
Request.getSession(); -Original Message- From: Pete Serafin [mailto:[EMAIL PROTECTED]] Sent: Saturday, December 14, 2002 11:32 AM To: '[EMAIL PROTECTED]' Subject: RE: Finding app context in action class??? This is close, but I am hoping to accomplish with just an Action class. I dont want to extend my class into any form of ActionServlet , servlet, or anything like that. Is it possible to get access from an Action page the way you can get access to the session? -Original Message- From: D, Gopinath (MED) [mailto:[EMAIL PROTECTED]] Sent: Sat 12/14/2002 1:26 AM To: Pete Serafin Cc: Subject: FW: Finding app context in action class??? This is how i've used the context in my application. It loads objects(say collections) into servletContext. In struts you would refer them as : html:select property=severity html:options name=severityList/ /html:select Hope this is what you are looking for ?? Any comments.. /* * ContextTest.java */ package examples.struts.action; import java.io.IOException; import javax.servlet.RequestDispatcher; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import javax.servlet.http.HttpServletResponse; import javax.servlet.ServletContext; import org.apache.struts.action.Action; import org.apache.struts.action.ActionServlet; import java.util.Vector; import java.util.ArrayList; /** * This ContextTest loads the objects into servletcontext, which could be used in the applications. * Say your objects has to be shared in your applications. this class the cache objects into session from this servlet context. * This servlet is loaded on startup on the server. Ref web.xml * p * The init() method loads all cache objecst into servletContext. * The destory() method removes all cache objects reference from servletContext. * @author */ public class ContextTest extends ActionServlet { ServletContext servletContext = null; /** * Init method loads all cacheobjects into servletContext. */ public void init() throws javax.servlet.ServletException { super.init(); ArrayList aSeverity = new ArrayList(); System.out.println(Action Servlet:Init - Begin); Vector vSeverity = SeverityCache.getInstance().getCache(); int sevSize = vSeverity.size(); for(int k=0; ksevSize; k++){ SeverityObject sevObj = (SeverityObject)vSeverity.elementAt(k); aSeverity.add(sevObj.getValue()+ - +sevObj.getShortName();); } System.out.println(Action Servlet - Loaded SeverityCache); servletContext = getServletContext(); servletContext.setAttribute(severityList,aSeverity); System.out.println(Action Servlet:Init - End); } /** * Destroy removes all cache objects reference from servletContext. */ public void destroy() { System.out.println(ActionServlet:Destroy - Begin); super.destroy(); servletContext.setAttribute(severityList,null); System.out.println(ActionServlet:Destroy - End); } protected void process(HttpServletRequest req, HttpServletResponse res) throws ServletException, java.io.IOException { System.out.println(Process); super.process(req,res); } } -Original Message- From: Pete Serafin [mailto:[EMAIL PROTECTED]] Sent: Saturday, December 14, 2002 12:28 PM To: [EMAIL PROTECTED] Subject: Finding app context in action class??? Its been a while since Ive had to write code to access the application context from a struts action class and I have forgotten how to do so. Can anyone give point me in the right direction as to how to do this? THIS E-MAIL MESSAGE ALONG WITH ANY ATTACHMENTS IS INTENDED ONLY FOR THE ADDRESSEE and may contain confidential and privileged
RE: Finding app context in action class???
Request.getSession().getServletContext(); Edgar -Original Message- From: Pete Serafin [mailto:[EMAIL PROTECTED]] Sent: Saturday, December 14, 2002 11:57 AM To: 'Struts Users Mailing List'; 'Struts Users Mailing List' Subject: RE: Finding app context in action class??? Edgar, I think you misunderstood me. I meant is there a similar way to access the application context in the same way you can access the session. I know request.getSession returns a session object how do I get an application object? In a jsp, its referenced as application. How is it referenced in the acition class? -Original Message- From: Edgar P. Dollin [mailto:[EMAIL PROTECTED]] Sent: Sat 12/14/2002 10:42 AM To: 'Struts Users Mailing List' Cc: Subject: RE: Finding app context in action class??? Request.getSession(); -Original Message- From: Pete Serafin [mailto:[EMAIL PROTECTED]] Sent: Saturday, December 14, 2002 11:32 AM To: '[EMAIL PROTECTED]' Subject: RE: Finding app context in action class??? This is close, but I am hoping to accomplish with just an Action class. I dont want to extend my class into any form of ActionServlet , servlet, or anything like that. Is it possible to get access from an Action page the way you can get access to the session? -Original Message- From: D, Gopinath (MED) [mailto:[EMAIL PROTECTED]] Sent: Sat 12/14/2002 1:26 AM To: Pete Serafin Cc: Subject: FW: Finding app context in action class??? This is how i've used the context in my application. It loads objects(say collections) into servletContext. In struts you would refer them as : html:select property=severity html:options name=severityList/ /html:select Hope this is what you are looking for ?? Any comments.. /* * ContextTest.java */ package examples.struts.action; import java.io.IOException; import javax.servlet.RequestDispatcher; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import javax.servlet.http.HttpServletResponse; import javax.servlet.ServletContext; import org.apache.struts.action.Action; import org.apache.struts.action.ActionServlet; import java.util.Vector; import java.util.ArrayList; /** * This ContextTest loads the objects into servletcontext, which could be used in the applications. * Say your objects has to be shared in your applications. this class the cache objects into session from this servlet context. * This servlet is loaded on startup on the server. Ref web.xml * p * The init() method loads all cache objecst into servletContext. * The destory() method removes all cache objects reference from servletContext. * @author */ public class ContextTest extends ActionServlet { ServletContext servletContext = null; /** * Init method loads all cacheobjects into servletContext. */ public void init() throws javax.servlet.ServletException { super.init(); ArrayList aSeverity = new ArrayList(); System.out.println(Action Servlet:Init - Begin); Vector vSeverity = SeverityCache.getInstance().getCache(); int sevSize = vSeverity.size(); for(int k=0; ksevSize; k++){ SeverityObject sevObj = (SeverityObject)vSeverity.elementAt(k); aSeverity.add(sevObj.getValue()+ - +sevObj.getShortName();); } System.out.println(Action Servlet - Loaded SeverityCache
RE: Why is token checking only available when control has passed to the Action class?
One solution is to make the increment of the array size a separate request so that your Bean can be expanded, i.e. insert rows, add record. Edgar -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 12, 2002 6:21 PM To: '[EMAIL PROTECTED]' Subject: Why is token checking only available when control has passed to the Action class? Hi all, I have a fairly involved problem surrounding token checking for request reload management. There are various methods available in the Action class such as saveToken, resetToken and isTokenValid which are all very useful in helping manage reload requests. All these methods operate off a token stored in the session, which these methods access directly from the request object. There is no dependence on the form object for these methods. A problem arises when, during the normal processing of a request, the form object is modified in such a way that array elements in the form are removed. For example, an array of transactions in the initial request has 10 elements in it, during action processing this array is resized due to some business rule down to 5 transactions. The array has only 5 elements in it now. The next screen is displayed. If a reload request is sent now, the number of transactions in the request is still 10 but the form object only has a transaction array with 5 elements in it. When the request processor attempts to populate the form object with the request data an ArrayIndexOutOfBoundsException occurs which is understandable but very undesirable. Should the token functions be moved into the org.apache.struts.util .RequestUtil class so that they are available to the RequestProcessor? We can then check for reloads prior to the form object being populated in the processPreprocess method in the RequestProcessor. Very interested in anyone's thoughts on this. It looks like we will have to set something up ourselves to do this but if Struts itself could change to accommodate this it would be very useful. Regards, Steve Akins Team Leader, Frameworks, J2EE Engineering Development Centre Financial Services Australia Technology ( +61 3 8641 2846 2 +61 3 8641 4152 : [EMAIL PROTECTED] National Australia Bank Limited 4th Floor/ 500 Bourke St Melbourne, Victoria 3000 __ The information contained in this email communication may be confidential. You should only read, disclose, re-transmit, copy, distribute, act in reliance on or commercialise the information if you are authorised to do so. If you are not the intended recipient of this email communication, please notify us immediately by email to [EMAIL PROTECTED] or reply by email direct to the sender and then destroy any electronic or paper copy of this message. Any views expressed in this email communication are those of the individual sender, except where the sender specifically states them to be the views of a member of the National Australia Bank Group of companies. The National Australia Bank Group of companies does not represent, warrant or guarantee that the integrity of this communication has been maintained nor that the communication is free of errors, virus or interference. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Validate - Struts-Config.xml - input attribute
Has anyone ever asked for the ability to control the input attribute, i.e. for validation in a multipage form? Edgar To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Struts Console
Is there a way to copy entries as the normal cut and paste windoze operations don't seem to function. Thanks Edgar -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Page scope bean and nested:iterate
If you look at the tag, I believe it is keeping a reference to the original property of the bean, and basing everything from that. Edgar -Original Message- From: Jim Krygowski [mailto:[EMAIL PROTECTED]] Sent: Friday, December 13, 2002 11:39 AM To: 'Struts Users Mailing List' Subject: RE: Page scope bean and nested:iterate Hi Sri- Thanks for trying. If I don't nest the element.getName() in the logic tag it completely blows up with a big fat NullPointerException. The element is definitely not there. I stepped through the code and it looks like id is always getting removed from the page context! This is the code that does the work: if (iterator.hasNext()) { Object element = iterator.next(); if (element == null) pageContext.removeAttribute(id); else pageContext.setAttribute(id, element); lengthCount++; started = true; if (indexId != null) pageContext.setAttribute(indexId, new Integer(getIndex())); return (EVAL_BODY_TAG); } else return (SKIP_BODY); element is always null (even though stuff is rendering on my JSP) so the id is always getting pulled out of the pageContext. But index id keeps getting set. This is pretty confusing, I don't know if I should trust my debugger or not, but it definitely looks like something strange is going on. All this makes me wonder if the Nested code is doing an end run around the id and just passing references to the containing object to its nested tags? jk -Original Message- From: Sri Sankaran [mailto:[EMAIL PROTECTED]] Sent: Friday, December 13, 2002 11:24 AM To: Struts Users Mailing List Subject: RE: Page scope bean and nested:iterate The id attribute of the nested:iterate is a handle to the current element in the iteration. So, by definition, the reference cannot be null -- 'cos if it were, you'd be out of the iteration. Make sense? So, methinks you *shouldn't* need to test if it is present. I know all this doesn't explain your NPE. Just for grins can you try changing the nested:write property=name/ to %=element.getName()% If 'element' is null, *that* should blow up too. I am puzzled as to how the bean at element can be null. Sorry if this didn't help any bit. Sri -Original Message- From: Jim Krygowski [mailto:[EMAIL PROTECTED]] Sent: Friday, December 13, 2002 10:51 AM To: Struts Users Mailing List Subject: Page scope bean and nested:iterate Hi- I'm using nested:iterate and have not been successful in using the id attribute of the iterate tag. The documentation for nested:iterate is just the documentation for logic:iterate so I would imagine that nested:iterate should support id. I have some code like where theBean is the source of the objects I'm iterating over: nested:iterate id=element indexId=currentIndex property=theBean logic:present name=element %=element.hashCode()%br /logic:present nested:write property=name/br %=currentIndex.intValue()% /nested:iterate The following code runs and outputs just the value of the name and the current index number. If I removed the logic:present, I get a runtime error because element is null. I think this should work, but it doesn't. Why? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: nested tag error
As an aside on this issue, I have found that using XML syntax for jsp helpful as it would have given you a message about unmatched tags. Not just jsp but also html and other tags (handy for really large tables, etc). Edgar -Original Message- From: Cory Newey [mailto:[EMAIL PROTECTED]] Sent: Friday, December 13, 2002 11:10 AM To: '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]' Subject: Re: nested tag error Your problem is that your opening nested:select tag is closed (see the '/' at the end?). Change the tag to: nested:select property=bar and everything should work. [EMAIL PROTECTED] 12/13/02 08:54AM Here's a snippet of JSP which is not working: nested:nest property=foo nested:select property=bar / nested:options collection=prompt_set property=key labelProperty=value / /nested:select /nested:nest It is giving a compile error org.apache.jasper.JasperException: Options tag must be nested in a Select tag. I tried changing nested:select,nested:options to html:select,html:options but then the tag doesn't find the nested property. How can I fix the above snippet? Brian (using struts1.1 beta1, Tomcat 4.1.12) -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: How to Format default input text value according to user request?
If I were doing this I would do it either in the validate() or reset() functions of my form bean during the load action. Edgar -Original Message- From: Renato Aganippe [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 11, 2002 4:18 AM To: 'Struts Users Mailing List' Subject: Re: How to Format default input text value according to user request? Miguel, Thanks for your answer but I don't have any problem with bean:write tag but with html:text tag. Regards, Renato - Original Message - From: Míguel Ángel Mulero Martínez [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, December 11, 2002 10:13 AM Subject: RE: How to Format default input text value according to user request? The Locale object exists in the Actions. Use an Action before the JSP that creates this bean. In this way you can format the text before call the bean:write Regards, Miguel -Mensaje original- De: Renato Aganippe [mailto:[EMAIL PROTECTED]] Enviado el: miércoles, 11 de diciembre de 2002 9:48 Para: Struts Users Mailing List Asunto: How to Format default input text value according to user request? Hello everybody, Please help, I can't get through this problem and it drives me crazy! I need to initialize the default field value from a html:text tag with a timestamp field from a Bean according to the user's request Locale. I am looking for an equivalent of formatKey attribute from bean:write Thanks a lot, Renato -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Constructing absolute URL in struts 1.1-b2
This is a known bug and the solution is not known at this time although it is stated it will be fixed. If you need an immediate solution you might consider using javax.servlet.RequestDispatcher from ServletRequest.getRequestDispatcher. Edgar -Original Message- From: Andrew Watters [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 11, 2002 9:37 AM To: '[EMAIL PROTECTED]' Subject: Constructing absolute URL in struts 1.1-b2 I'm trying to create an absolute URL to redirect to. The URL is generated dynamically at runtime so I can't declare it in the config file for the module. My controller code ends with - String url = getPaymentServerUrl(); // Returns an absolute URL ActionForward forward = new ActionForward(url, true); return forward; I have tried all the different ActionForward constructors but Struts always pre-pends the web app name and module name so that it tries to redirect to /webapp/module/http://www.etc.com/etc instead of http://www.etc.com/etc Any suggestions would be greatly appreciated. Andrew -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Constructing absolute URL in struts 1.1-b2
I use the RequestDispatcher without a problem. I don't believe struts does commits (I think I read something about tiles making commits however). Edgar -Original Message- From: Andrew Watters [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 11, 2002 9:56 AM To: [EMAIL PROTECTED] Subject: Re: Constructing absolute URL in struts 1.1-b2 Thanks Edgar for your prompt reply. It is good to know I'm not going mad - I searched the archives but couldn't find anything. I tried both request.getRequestDispatcher.forward and response.sendRedirect but in both cases I got an IllegalStateException because the response was already committed. I haven't done anything to commit the response in my controller, I think, so I assumed that the struts framework had done so. Is this assumption correct do you know? Thanks again for your help. Andrew - Original Message - From: Edgar P. Dollin [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Wednesday, December 11, 2002 2:51 PM Subject: RE: Constructing absolute URL in struts 1.1-b2 This is a known bug and the solution is not known at this time although it is stated it will be fixed. If you need an immediate solution you might consider using javax.servlet.RequestDispatcher from ServletRequest.getRequestDispatcher. Edgar -Original Message- From: Andrew Watters [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 11, 2002 9:37 AM To: '[EMAIL PROTECTED]' Subject: Constructing absolute URL in struts 1.1-b2 I'm trying to create an absolute URL to redirect to. The URL is generated dynamically at runtime so I can't declare it in the config file for the module. My controller code ends with - String url = getPaymentServerUrl(); // Returns an absolute URL ActionForward forward = new ActionForward(url, true); return forward; I have tried all the different ActionForward constructors but Struts always pre-pends the web app name and module name so that it tries to redirect to /webapp/module/http://www.etc.com/etc instead of http://www.etc.com/etc Any suggestions would be greatly appreciated. Andrew -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: dynamically disable a input field.
A couple of choices: Actually put the html:text inside the logic and use an else clause. Use struts-EL for the disabled attribute calculation ${OrganizationSession.isProvider==0?disabled:enabled} Edgar -Original Message- From: Mouratidis, Georg [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 10, 2002 6:40 AM To: '[EMAIL PROTECTED]' Subject: dynamically disable a input field. Greetings i want to disable some input elements but only if a bean property is not set: e.g. logic:equal name=OrganizationSession property=isProvider value=0 here i want to set a variable to be used than in each input element. e.g. something like disabled=disabled /logic:equal in the inputs than i would like to use the above setted variable. somthing like : html:text name=CatalogProfileDataForm property=catalogID disabled=value of the above variable named disabled/ is this possible? can somebody help? any other suggestions? thx in advance mit freundlichen Grüßen Georg XL. Mouratidis Web Application Developer Heiler|Software AG Mittlerer Pfad 9 D-70499 Stuttgart Tel: 0711-139 84-265 Fax: 0711-866 63 01 Email: [EMAIL PROTECTED] Connecting Buyer and Supplier http://www.heiler.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Forcing SSL for index page of application
I am no expert but here is the IE developers link for SSL http://www.microsoft.com/technet/treeview/default.asp?url=/TechNet/prodt echnol/ie/reskit/ie5/part1/ch06digi.asp Edgar -Original Message- From: Matt Raible [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 10, 2002 6:07 PM To: '[EMAIL PROTECTED]' Subject: Forcing SSL for index page of application I'm trying to replicate the behavior that occurs when you set transport-guaranteeCONFIDENTIAL/transport-guarantee to confidential in web.xml. If I do this, when I hit the index.jsp page of my webapp, I am automatically redirected to https://localhost/myappname. However, I have a different SSL port setup for testing, and I'd like to only switch on one page, the index.jsp page. So I've added the following scriplet to my index.jsp and it works great in Mozilla, but fails in IE. IE prompts me with the certificate information, and then gives a Cannot Find Server error. Any ideas? % // TODO: Make this into a tag library Boolean secureLogin = (Boolean)application.getAttribute(Constants.SECURE_LOGIN); System.out.println(secureLogin: + secureLogin); if (secureLogin.booleanValue()) { // make sure we're using https if (request.getScheme().equals(http)) { String redirectString = SslUtil.getRedirectString(request, application, true); System.out.println(redirecting to: + response.encodeRedirectURL(redirectString)); % logic:redirect href=%=response.encodeRedirectURL(redirectString)%/ % } } % Everything looks the same in Tomcat's log when using either browser. Thanks, Matt -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Multiple Submit Buttons + Internationalisation
LookupDispatchAction is not for everyone in every situation. Understanding the mechanism can help you really solve your issues. Edgar -Original Message- From: Gemes Tibor [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 7:53 AM To: Struts Users Mailing List Subject: Re: Multiple Submit Buttons + Internationalisation 2002. december 9. 13:48 dátummal John D Hume ezt írtad: You could probably compare pRequest.getParameter(Submit) against the internationalized string, though it might be better to go a way that won't make you dependent on those labels. You could flip it around and decide based on the Name of the submit button. Something like: LookupDispatchAction? http://husted.com/struts/tips/003.html Hth, Tib -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Multiple Submit Buttons + Internationalisation
If you want creater control of the button or if you want to use anchors or you have subclassed other classes to get where you are going. The list is pretty large. Edgar -Original Message- From: Gemes Tibor [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 8:57 AM To: Struts Users Mailing List Subject: Re: Multiple Submit Buttons + Internationalisation 2002. december 9. 14:55 dátummal Edgar P. Dollin ezt írtad: LookupDispatchAction is not for everyone in every situation. Understanding the mechanism can help you really solve your issues. Yes, you're right. But the details he provided us about his problem were exactly the same LookupDispathAction was created for imho. So I dared to suggest it. However if it doesn't fit the thread-starter I reckon he will provide more details. While I am writing this I try hard to come up with a case which LookupDispathAction doesn't solve and has the same charasteristics the thread-starter required. I cannot find it. Ideas? Tib -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: How to switch debug off?
Look in web.xml under the init-params for struts. There is a debug level. It is described in the manual. Edgar -Original Message- From: Zsolt Koppany [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 3:45 PM To: 'Struts Users Mailing List' Subject: How to switch debug off? After I start tomcat with struts, I see a lot of log messages. How can I switch that off? I mean messages such as: 2002-12-09 21:41:55,536 DEBUG digester.Digester.sax - startElement(,display-name,display-name) [main] 2002-12-09 21:41:55,537 DEBUG commons.digester.Digester - Pushing body text '' [main] 2002-12-09 21:41:55,538 DEBUG commons.digester.Digester - New match='web-app/display-name' [main] 2002-12-09 21:41:55,539 DEBUG commons.digester.Digester - No rules found matching 'web-app/display-name'. [main] 2002-12-09 21:41:55,539 DEBUG digester.Digester.sax - characters(CodeBeamer) [main] 2002-12-09 21:41:55,541 DEBUG digester.Digester.sax - endElement(,display-name,display-name) [main] 2002-12-09 21:41:55,542 DEBUG commons.digester.Digester - match='web-app/display-name' [main] 2002-12-09 21:41:55,543 DEBUG commons.digester.Digester - bodyText='CodeBeamer' [main] 2002-12-09 21:41:55,568 DEBUG commons.digester.Digester - No rules found matching 'web-app/display-name'. [main] -- Zsolt -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: any way to turn a checkbox on based on a request value?
JavaScript... ;-} -Original Message- From: Andy Kriger [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 4:18 PM To: 'Struts Users Mailing List' Subject: any way to turn a checkbox on based on a request value? I want to have a checkbox checked when a given request attribute is true. The attribute value is not a bean, it is a Boolean object (which makes sense for an on/off control). Is there any way to do this? thx andy -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: JSTL Struts-EL missing from 12/8 12/9 Nightlies!
The last time this happened, Craig said it was something with the build. -Original Message- From: Karr, David [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 7:32 PM To: 'Struts Users Mailing List' Subject: RE: JSTL Struts-EL missing from 12/8 12/9 Nightlies! No idea. This is the second time in the last month or so this has happened, and I don't think I ever knew why it happened the first time. It will be fixed. -Original Message- From: Hohlen, John [mailto:[EMAIL PROTECTED]] It looks as the JSTL implementation Struts-EL libraries were not included in the 12/8 12/9 nightly Struts builds. I noticed this first b/c the size of the zips went from 23M to 20M. Anybody know what's going on here? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]