RE: Can I use RequestProcessor to handle session?
yes and probably the right way to do -Original Message- From: Samanth Athrey [mailto:[EMAIL PROTECTED] Sent: Thursday, November 06, 2003 10:35 AM To: [EMAIL PROTECTED] Subject: Can I use RequestProcessor to handle session? Hello Gurus I am trying to handle session timeout by extending RequestProcessor. Since the processPreprocess(...) method is called before the Action.execute(..) method, am trying to add that piece of code to check if the session is valid. The problem am facing is, if i return false from this method, the requestProcessor will stop processing and return the control back to doGet or doPost method in ActionServlet. How do I redirect it to login.jsp or index.jsp from there? Any help/tips would be really great. Thanx. Sam - 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] Security Folter
Does anyone know if SecurityFilter supports encrypted passwords for a DB realm, or must passwords be stored in plain text? http://securityfilter.sourceforge.net/ Thanks! Mike __ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
html:submit and 2 buttons
Hello just a little question about the taglib i want to have one form with 2 buttons in it one button should do new the other update how can i make my action class know which button was hit? additionally i want that the buttons get there labels from a property file that works as shown below but how can i now make my action class know which button is hit? html-el:submit bean-el:message key=search.new//html-el:submit
FAQ (Passing Variables Between Actions); But, Stuck and Need Help
Passing variables from one action to another is a frequently asked question. The answer is to use either hidden fields or a session object. The story starts with searching the database. My application offers options to search the database by author, title of the article, article ID, or . I have a drop-down list in my JSP for visitors to make a selection. By clicking on one of those options, the property dispatch is set. And the visitor fills out the text field to set keyValue. With both dispatch and keyValue forwarded to an action; say, Action ONE, the desired articles can be retrieved from the database. So far so good. What I have handled next is the author's page of the web site. An author can only view his own articles and perform update, delete, save, ... functions. I use the hidden field technique to handle it. The property dispatch is arbitrarily set as author (needless to say) and keyValue can be obtained by String username = request.getRemoteUser(); And, html:hidden property=dispatch value=author/ html:hidden property=keyValue value=%=username%/ are forwarded to the same action (Action ONE) for processing. Again, no problem. Now, the application has another user case - editors. An editor only retrieve and view all articles in his/her own field of specialization. I arbitrarily set dispatch as field_of_specialization and use the hidden field technique: html:hidden property=dispatch value=field_of_Specialization/ Nonetheless, the way to get the value the editor's field of specialization is from the database. Because editors are registered members of the web site, the application should be able to look for his/her profile and obtain his/her field of specialization in the database once an editor successfully logs into the web site. Therefore, it takes an action (Action TWO) that tells the business tier to find the keyValue in the database. And should I put the keyValue in a session object. I have tried to handle this situation again and again in many different ways. I am very frustrated and need help -- how does a user go from by clicking a button in a JSP to go to Action TWO (get the keyValue) and then forward this keyValue and html:hidden property=dispatch value=field_of_Specialization/ to Action ONE for retrieving the desired articles from the database? __ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Trouble redirecting
Marcella, Does this work ? I've tried it and can't exit from the context path, the url returned is always like /context/http://www.yahoo.fr; !!! If anyone has a clue, i wonder why it works for you and not for me - Original Message - From: Marcella Turner [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, November 06, 2003 3:33 AM Subject: Re: Trouble redirecting Hubert, I can't thank you enough for this fix! It really saved me when nothing else was working. Thank you, Thank you, Thank you - and long live the struts-user list :) Marcella From: Hubert Rabago [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: Trouble redirecting Date: Wed, 5 Nov 2003 12:12:16 -0800 (PST) public ActionForward execute(...) { response.sendRedirect(http://www.yahoo.com;); return null; } --- Marcella Turner [EMAIL PROTECTED] wrote: Hubert, Thanks for this suggestion, I would like to try it. So, in my action I have: response.sendRedirect(http://www.yahoo.com;); How/where am I returning a NULL? Thanks, Marcella From: Hubert Rabago [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: Trouble redirecting Date: Wed, 5 Nov 2003 10:56:31 -0800 (PST) It looks like you're not the first to have redirect=true backfire on you when trying to redirect to an absolute path. I wonder why that is. You can try response.sendRedirect() within your action class and just return null. --- Marcella Turner [EMAIL PROTECTED] wrote: Hi Rick and Hubert, Thanks for giving my problem some thought. My action mapping is below: action path=/verifyXYZ name=obtainXYZFormBean scope=request type=my.package.actions.VerifyXYZAction input=/SelectXYZ.jsp validate=true forward name=success path=/SelectTerms.jsp /forward forward name=back path=/ViewPrices.jsp /forward forward name=failure path=/SelectSPR.jsp /forward forward name=goSpt path=http://www.yahoo.com; redirect=true/ /action I believe that I will need to construct an absolute path in order to redirect to the other app, however since I can't get the redirect to work to http://www.yahoo.com yet I'm waiting to construct the real absolute path just yet. From: Rick Reumann [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: Trouble redirecting Date: Wed, 05 Nov 2003 12:33:56 -0500 Marcella Turner wrote: The contextPath may prove to be a real problem for me since I would like to transfer control to a servlet in a different contextPath than the one my app is in. Why don't you post the syntax of the exact page you are trying to redirect to. As far as I know you will need the full http:// path to redirect to an application in a totally different context from a forward mapping. Are you putting in the full path to this other servlet you want to redirect to? -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Is your computer infected with a virus? Find out with a FREE computer virus scan from McAfee. Take the FreeScan now! http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Crave some Miles Davis or Grateful Dead? Your old favorites are always playing on MSN Radio Plus. Trial month free! http://join.msn.com/?page=offers/premiumradio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree - To
RE: validator, range
I've used constants before, for date format pattern and maxlength. And looks like i'm using the appropriate validator afterall. So, maxInt is 2147483647. Can you give me the exact maxFloat value...? hehe...just kidding. Thanks Dave. -Original Message- From: David Friedman [mailto:[EMAIL PROTECTED] Sent: Thursday, November 06, 2003 1:17 PM To: Struts Users Mailing List Subject: RE: validator, range Why not just setup a few constants and use them later as your ${var:max} where appropriate? I got the maxInteger value from echo printing Integer.MAX_VALUE. Once you define a constant for maxInteger or maxFloat, just reference it as your var {$maxFloat} or var {$maxInteger}. form-validation global constant constant-namemaxInteger/constant-name constant-value2147483647/constant-value /constant /global formset !-- for a bean named valid -- form name=valid field property=username depends=required,integer,intRange arg0 key=buy.program.fieldname / arg1 name=range key=${var:min} resource=false/ arg2 name=range key=${var:max} resource=false/ var var-namemin/var-name var-value10/var-value /var var var-namemax/var-name !-- SEE the constant used below for the intRange? --- var-value${maxInteger}/var-value /var /field /form /form-validation -Original Message- From: Budi Rostiarso [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 05, 2003 10:19 PM To: [EMAIL PROTECTED] Subject: validator, range Hi all, quick question on validation: Can we setup validator with rules like x must be equal or greater than 8, just to limit the lower bound ? Currently, i use the range validator, which means i have to specify the lower and upper bound, right? Any clues and pointers appreciated. Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OT - what is a blonk
Nottingham Forest beat Luton 2 -1 I assume the rest of your question was an attempt at humor. Cheers Mark On Thursday, November 6, 2003, at 05:03 AM, [EMAIL PROTECTED] wrote: This is off topic but I couldn't wait til casual friday... I have the following problem in my web-app. When I try and get a blonk off of the bloon-arg processor my ding-dong crashes and I get a knack-trace that says unable to agnagle blonk in any rope - what is a blonk? I have the following line in my struts-config: insist find=blonk or=die/ My question is: Who won the FA cup in 1959? Thanks for all your help. Heya Gosper CSC Australia 212 Northbourne Ave, Braddon ACT 2612 Ph: +61 (0) 2 6246 8155 Fax: +61 (0) 2 62468100 MOB: 0401 611779 --- - This is a PRIVATE message. If you are not the intended recipient, please delete without copying and kindly advise us by e-mail of the mistake in delivery. NOTE: Regardless of content, this e-mail shall not operate to bind CSC to any order or other contract unless pursuant to explicit written agreement or government initiative expressly permitting the use of e-mail for such purpose. --- - - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
org.apache.jasper.JasperException: Cannot find message resources under key org.apache.struts.action.MESSAGE
Hi there, i get the following message by start a jsp/java application which use struts. (Tomcat 4.1.24) My web.xml contains: servlet servlet-nameideal/servlet-name servlet-classorg.tzi.ideal.ui.servlet.ExtendedActionServlet/servlet-class init-param param-nameconfig/param-name param-value/WEB-INF/struts-config.xml/param-value /init-param init-param param-namedebug/param-name param-value3/param-value /init-param init-param param-namedetail/param-name param-value3/param-value /init-param init-param param-nameconfigFileName/param-name param-value/WEB-INF/config.cfg/param-value /init-param load-on-startup1/load-on-startup /servlet servlet-mapping servlet-nameideal/servlet-name url-pattern*.do/url-pattern /servlet-mapping session-config session-timeout60/session-timeout /session-config welcome-file-list welcome-filejsp/index.jsp/welcome-file /welcome-file-list taglib taglib-uri/WEB-INF/tlds/struts-bean.tld/taglib-uri taglib-location/WEB-INF/tlds/struts-bean.tld/taglib-location /taglib taglib taglib-uri/WEB-INF/tlds/struts-html.tld/taglib-uri taglib-location/WEB-INF/tlds/struts-html.tld/taglib-location /taglib taglib taglib-uri/WEB-INF/tlds/struts-logic.tld/taglib-uri taglib-location/WEB-INF/tlds/struts-logic.tld/taglib-location /taglib taglib taglib-uri/WEB-INF/tlds/struts-nested.tld/taglib-uri taglib-location/WEB-INF/tlds/struts-nested.tld/taglib-location /taglib taglib taglib-uri/WEB-INF/tlds/struts-template.tld/taglib-uri taglib-location/WEB-INF/tlds/struts-template.tld/taglib-location /taglib taglib taglib-uri/WEB-INF/tlds/struts-tiles.tld/taglib-uri taglib-location/WEB-INF/tlds/struts-tiles.tld/taglib-location /taglib taglib taglib-urihttp://jakarta.apache.org/taglibs/log-1.0/taglib-uri taglib-location/WEB-INF/tlds/taglibs-log.tld/taglib-location /taglib taglib taglib-urihttp://jakarta.apache.org/taglibs/xtags-1.0/taglib-uri taglib-location/WEB-INF/tlds/taglibs-xtags.tld/taglib-location /taglib /web-app My struts-config.xml contains: struts-config form-beans form-bean name=loginUserForm type=org.tzi.ideal.ui.form.LoginUserForm/ form-bean name=registerUserForm type=org.tzi.ideal.ui.form.RegisterUserForm/ form-bean name=showCategoriesForm type=org.tzi.ideal.ui.form.ShowCategoriesForm/ form-bean name=addMetadataForm type=org.tzi.ideal.ui.form.AddMetadataForm/ form-bean name=modifyCategoryNameForm type=org.tzi.ideal.ui.form.ModifyCategoryNameForm/ form-bean name=deleteMetadataForm type=org.tzi.ideal.ui.form.DeleteMetadataForm/ form-bean name=deleteCategoryForm type=org.tzi.ideal.ui.form.DeleteCategoryForm/ form-bean name=showModifyCategoryForm type=org.tzi.ideal.ui.form.ShowModifyCategoryForm/ form-bean name=commitFeedbackForm type=org.tzi.ideal.ui.form.CommitFeedbackForm/ form-bean name=showIcoForm type=org.tzi.ideal.ui.form.ShowIcoForm/ /form-beans global-forwards forward name=showLogin path=/jsp/login.jsp redirect=true/ forward name=showRegistration path=/jsp/register.jsp redirect=true/ forward name=showRegisterSuccessful path=/jsp/register_success.jsp redirect=true/ forward name=showIco path=/jsp/ico.jsp redirect=true/ forward name=showCategories path=/jsp/category.jsp redirect=true/ forward name=showCreateCategory path=/jsp/category_create.jsp redirect=true/ forward name=showModifyCategory path=/jsp/category_modify.jsp redirect=true/ forward name=showModifyCategoryOverview path=/jsp/category_modify_overview.jsp redirect=true/ forward name=showNavigation path=/jsp/navigation.jsp redirect=true/ forward name=error path=/jsp/error.jsp redirect=true/ /global-forwards action-mappings action path=/repaintMain type=org.tzi.ideal.ui.action.RepaintMainAction validate=false/ action path=/showRegistration type=org.tzi.ideal.ui.action.ShowRegistrationAction validate=false/ action path=/registerUser
Re: FAQ (Passing Variables Between Actions); But, Stuck and Need Help
On 11/06/2003 08:26 AM Caroline Jen wrote: Passing variables from one action to another is a frequently asked question. The answer is to use either hidden fields or a session object. [snip...] Now, the application has another user case - editors. An editor only retrieve and view all articles in his/her own field of specialization. I arbitrarily set dispatch as field_of_specialization and use the hidden field technique: html:hidden property=dispatch value=field_of_Specialization/ Nonetheless, the way to get the value the editor's field of specialization is from the database. Because editors are registered members of the web site, the application should be able to look for his/her profile and obtain his/her field of specialization in the database once an editor successfully logs into the web site. Therefore, it takes an action (Action TWO) that tells the business tier to find the keyValue in the database. And should I put the keyValue in a session object. One method that I use is to create a user bean and store that in the session at login. This bean could include your editor's field of specialization, so that you don't need an extra action. Secondly, you could drop the Action One by incorporating the field of specialization as a part of one SQL statement, so that you never actually extract the field of specialization from the DB. I.e. something like this: SELECT article_title, article_text FROM app_user, article WHERE app_user.user_name = ? AND app_user.field_of_specialization = article.field_of_specialization Alternatively if you still want to do 2 actions, I have seen people handle it in various ways: (1) get the action-forward in your action and modify the path to add a query_string with your keyValue on it (2) put the keyValue in a cookie (3) as you said, put it in the session. 2 3 have the disadvantage that they could be overwritten if the user has more than one browser window open. HTH 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: html:submit and 2 buttons
You can just use JavaScript passing some parameters You can also try this approach: http://husted.com/struts/tips/003.html -Original Message- From: Frers Michael [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 05, 2003 6:54 PM To: Struts Users Mailing List Subject: html:submit and 2 buttons Hello just a little question about the taglib i want to have one form with 2 buttons in it one button should do new the other update how can i make my action class know which button was hit? additionally i want that the buttons get there labels from a property file that works as shown below but how can i now make my action class know which button is hit? html-el:submit bean-el:message key=search.new//html-el:submit - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re[4]: EL Expression in html:hidden tag
Hello, Monday, November 3, 2003, 7:20:31 PM, you wrote: KS I'm jumping in late on this thread, but why bother using Struts-EL at all under KS JSP 2.0? The original (RT) tags should be magically EL-aware as long as the app KS uses a Servlet 2.4 format web.xml, right? Oh, really? I didn't know that. So I can work with the normal struts lib? I just need to declare a 2.4 web-app? Thanks, Arne - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
struts-menu and internationalization
Has anyone used internationalization in the struts-menu ? If so, could you explain me how I can do it. I tried the following : menu-config.xml: Menu name=organisation title=label.logout Item name=organisationOverview title=label.overview forward=/organisation/searchFirstLetter / /Menu and in listMenu.jsp: menu:useMenuDisplayer name=listMenu bundle=org.apache.struts.action.MESSAGE menu:displayMenu name=organisation/ menu:displayMenu name=salesrep/ menu:displayMenu name=logout/ /menu:useMenuDisplayer but this did not work. any help is very appreciated Koen Boutsen FREE ADHD DVD or CD-Rom (your choice) - click here! http://ad.doubleclick.net/clk;6413623;3807821;f?http://mocda2.com/1/c/563632/131726/311392/311392 AOL users go here: http://ad.doubleclick.net/clk;6413623;3807821;f?http://mocda2.com/1/c/563632/131726/311392/311392 This offer applies to U.S. Residents Only - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
dynamically populating options in form
Hi, We have two select boxes in an HTML form. Based on the option that the user selects in the first box and some other considerations, the contents in the second box get populated. Are there any reasonable means of doing this in struts with minimal use of JavaScript ? Thanks in advance Anindito - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Basic JSTL Question...
Hi... I would appreciate if someone out there helps me with these basic JSTL questions... 1. In c:foreach how do I check whether the collection contains values??? When it has values, it iterates a loop fine... Now, if I want to specify 'No records' how do I do that??? 2. How do I check condition.s.. for eg. I wanna alternate row colors... when I do this, it doesn't work... c:when test=${ (count.index%2) != 0 } tr bgcolor=aa /c:when c:otherwise tr bgcolor=bb /c:otherwise Wat's the right way to do this??? Thanx. -Jacob - Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard
RE: dynamically populating options in form
Well at the least you would probably want to use some javascript to trigger the submission of the form onchange of the first select so that you can populate the second select based on the first's value over on the server side and then redisplay the form. To do it without any javascript you would need to use a second submit button to do this, which the user would need to click after having entered a value in the first field. -Original Message- From: Anindito De [mailto:[EMAIL PROTECTED] Sent: Thursday, 6 November 2003 19:00 To: [EMAIL PROTECTED] Subject: dynamically populating options in form Hi, We have two select boxes in an HTML form. Based on the option that the user selects in the first box and some other considerations, the contents in the second box get populated. Are there any reasonable means of doing this in struts with minimal use of JavaScript ? Thanks in advance Anindito - 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: Basic JSTL Question...
1) See operators (empty) http://developer.java.sun.com/developer/technicalArticles/javaserverpages/fa ster/ 2) it goes : c:choose c:when/c:when c:otherwise/c:otherwise /c:choose -Original Message- From: Jacob Wilson [mailto:[EMAIL PROTECTED] Sent: Thursday, November 06, 2003 1:04 PM To: [EMAIL PROTECTED] Subject: Basic JSTL Question... Hi... I would appreciate if someone out there helps me with these basic JSTL questions... 1. In c:foreach how do I check whether the collection contains values??? When it has values, it iterates a loop fine... Now, if I want to specify 'No records' how do I do that??? 2. How do I check condition.s.. for eg. I wanna alternate row colors... when I do this, it doesn't work... c:when test=${ (count.index%2) != 0 } tr bgcolor=aa /c:when c:otherwise tr bgcolor=bb /c:otherwise Wat's the right way to do this??? Thanx. -Jacob - Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
upload validation failures are blanking my form values
Hi, I've got a bizarre bug with the struts-upload tools. Struts-upload works when, 1) everything validates correctly. 2) there is a validation error and you do not attempt to upload a file. but it breaks as soon as i try to upload a file and there is a validation error for any reason. The errors get reported correctly and I get returned to the input page BUT all the form fields are blanked. This does NOT happen if I do not attempt to upload a file. I have confirmed this also happens in the struts-upload example webapp. Has anyone else been infuriated by this bug and found any workarounds? I'm not using a nightly build. cheers, caoilte - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: html:submit and 2 buttons
Your action can read the value attribute of your submit tag. This is the label in your case. bean-el:message key=search.new/ Use the request.getParameter to find out which button was clicked. Give each of your submit buttons a different NAME. request.getParameter(NAME) will return the label of the submit button clicked or null. Phil --- Arik Levin ( Tikal ) [EMAIL PROTECTED] wrote: You can just use JavaScript passing some parameters You can also try this approach: http://husted.com/struts/tips/003.html -Original Message- From: Frers Michael [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 05, 2003 6:54 PM To: Struts Users Mailing List Subject: html:submit and 2 buttons Hello just a little question about the taglib i want to have one form with 2 buttons in it one button should do new the other update how can i make my action class know which button was hit? additionally i want that the buttons get there labels from a property file that works as shown below but how can i now make my action class know which button is hit? html-el:submit bean-el:message key=search.new//html-el:submit - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] = Java Web Application Architect mapimage.com - Java and GIS struts1.1:tomcat4.1.27:linuxRH8 __ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
request processor error.
Just an hour before my websphere 5.0 was working properly but suddenly it started giving following error and my websphere 5.0 server automatically stus down after few minutes. and this error comes in a loop and finally it throws StackoverFlow exception Will any body help me to underrstand the error and problem with websphere server or struts application at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServle tInstance.java:110) at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecy cleServlet.java:174) at com.ibm.ws.webcontainer.servlet.ServicingServletState.service(StrictLifecycl eServlet.java:333) at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecyc leServlet.java:116) at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java :258) at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidSer vletReferenceState.java:42) at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletIns tanceReference.java:40) at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch( WebAppRequestDispatcher.java:872) at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppReques tDispatcher.java(Compiled Code)) at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequest Dispatcher.java:173) at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:10 69) at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcesso r.java:274) at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProces sor.java:455) at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequ estProcessor.java:320) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1480) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:506) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) thanks in advace... abhijeet - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
validwhen + struts 1.1
I am currently using struts 1.1. Is there a way I can use the "validwhen" functionality of future coming struts 1.2. Something like I can take only the class files of validwhen and use it along with struts 1.1 can someone detail me on this? Thanks in advance Vara Prasad
Re: upload validation failures are blanking my form values
i am waiting for an answer as well. i also had a similar problem Caoilte O'Connor wrote: Hi, I've got a bizarre bug with the struts-upload tools. Struts-upload works when, 1) everything validates correctly. 2) there is a validation error and you do not attempt to upload a file. but it breaks as soon as i try to upload a file and there is a validation error for any reason. The errors get reported correctly and I get returned to the input page BUT all the form fields are blanked. This does NOT happen if I do not attempt to upload a file. I have confirmed this also happens in the struts-upload example webapp. Has anyone else been infuriated by this bug and found any workarounds? I'm not using a nightly build. cheers, caoilte - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Rajat Pandit | [EMAIL PROTECTED] +91 612 3117606 [ Developer and Part Time Human Being] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: org.apache.jasper.JasperException: Cannot find message resources under key org.apache.struts.action.MESSAGE
Hello Andreas, do you have your IdealMessageResources file in your WEB-INF directory? *** ASnd Hi there, ASnd i get the following message by start a jsp/java application which use ASnd struts. (Tomcat 4.1.24) ASnd My web.xml contains: ASnd servlet ASnd servlet-nameideal/servlet-name ASnd servlet-classorg.tzi.ideal.ui.servlet.ExtendedActionServlet/servlet-class ASnd init-param ASnd param-nameconfig/param-name ASnd param-value/WEB-INF/struts-config.xml/param-value ASnd /init-param ASnd init-param ASnd param-namedebug/param-name ASnd param-value3/param-value ASnd /init-param ASnd init-param ASnd param-namedetail/param-name ASnd param-value3/param-value ASnd /init-param ASnd init-param ASnd param-nameconfigFileName/param-name ASnd param-value/WEB-INF/config.cfg/param-value ASnd /init-param ASnd load-on-startup1/load-on-startup ASnd /servlet ASnd servlet-mapping ASnd servlet-nameideal/servlet-name ASnd url-pattern*.do/url-pattern ASnd /servlet-mapping ASnd session-config ASnd session-timeout60/session-timeout ASnd /session-config ASnd welcome-file-list ASnd welcome-filejsp/index.jsp/welcome-file ASnd /welcome-file-list ASnd taglib ASnd taglib-uri/WEB-INF/tlds/struts-bean.tld/taglib-uri ASnd taglib-location/WEB-INF/tlds/struts-bean.tld/taglib-location ASnd /taglib ASnd taglib ASnd taglib-uri/WEB-INF/tlds/struts-html.tld/taglib-uri ASnd taglib-location/WEB-INF/tlds/struts-html.tld/taglib-location ASnd /taglib ASnd taglib ASnd taglib-uri/WEB-INF/tlds/struts-logic.tld/taglib-uri ASnd taglib-location/WEB-INF/tlds/struts-logic.tld/taglib-location ASnd /taglib ASnd taglib ASnd taglib-uri/WEB-INF/tlds/struts-nested.tld/taglib-uri ASnd taglib-location/WEB-INF/tlds/struts-nested.tld/taglib-location ASnd /taglib ASnd taglib ASnd taglib-uri/WEB-INF/tlds/struts-template.tld/taglib-uri ASnd taglib-location/WEB-INF/tlds/struts-template.tld/taglib-location ASnd /taglib ASnd taglib ASnd taglib-uri/WEB-INF/tlds/struts-tiles.tld/taglib-uri ASnd taglib-location/WEB-INF/tlds/struts-tiles.tld/taglib-location ASnd /taglib ASnd taglib ASnd taglib-urihttp://jakarta.apache.org/taglibs/log-1.0/taglib-uri ASnd taglib-location/WEB-INF/tlds/taglibs-log.tld/taglib-location ASnd /taglib ASnd taglib ASnd taglib-urihttp://jakarta.apache.org/taglibs/xtags-1.0/taglib-uri ASnd taglib-location/WEB-INF/tlds/taglibs-xtags.tld/taglib-location ASnd /taglib ASnd /web-app ASnd My struts-config.xml contains: ASnd struts-config ASnd form-beans ASnd form-bean name=loginUserForm ASnd type=org.tzi.ideal.ui.form.LoginUserForm/ ASnd form-bean name=registerUserForm ASnd type=org.tzi.ideal.ui.form.RegisterUserForm/ ASnd form-bean name=showCategoriesForm ASnd type=org.tzi.ideal.ui.form.ShowCategoriesForm/ ASnd form-bean name=addMetadataForm ASnd type=org.tzi.ideal.ui.form.AddMetadataForm/ ASnd form-bean name=modifyCategoryNameForm ASnd type=org.tzi.ideal.ui.form.ModifyCategoryNameForm/ ASnd form-bean name=deleteMetadataForm ASnd type=org.tzi.ideal.ui.form.DeleteMetadataForm/ ASnd form-bean name=deleteCategoryForm ASnd type=org.tzi.ideal.ui.form.DeleteCategoryForm/ ASnd form-bean name=showModifyCategoryForm ASnd type=org.tzi.ideal.ui.form.ShowModifyCategoryForm/ ASnd form-bean name=commitFeedbackForm ASnd type=org.tzi.ideal.ui.form.CommitFeedbackForm/ ASnd form-bean name=showIcoForm ASnd type=org.tzi.ideal.ui.form.ShowIcoForm/ ASnd /form-beans ASnd global-forwards ASnd forward name=showLogin path=/jsp/login.jsp redirect=true/ ASnd forward name=showRegistration path=/jsp/register.jsp redirect=true/ ASnd forward name=showRegisterSuccessful ASnd path=/jsp/register_success.jsp redirect=true/ ASnd forward name=showIco path=/jsp/ico.jsp redirect=true/ ASnd forward name=showCategories path=/jsp/category.jsp redirect=true/ ASnd forward name=showCreateCategory ASnd path=/jsp/category_create.jsp redirect=true/ ASnd
RE: dynamically populating options in form
Something like Below .. The Onchange event will trigger the Submission to another action which then keeps the collection in request/session scope and select Box B is then populated ..See the code below .. script function callAction(){ document.forms[0].action = %=request.getContextPath()%/populateAction.do; document.forms[0].submit(); } script html:select property=A onchange=callAction(); html:options collection=collection1 name=Form property=value labelProperty=label / /html:select html:select property=B html:options collection=collection.areas name=Form property=value labelProperty=label / /html:select -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED] Sent: Thursday, November 06, 2003 4:39 PM To: Struts Users Mailing List Subject: RE: dynamically populating options in form Well at the least you would probably want to use some javascript to trigger the submission of the form onchange of the first select so that you can populate the second select based on the first's value over on the server side and then redisplay the form. To do it without any javascript you would need to use a second submit button to do this, which the user would need to click after having entered a value in the first field. -Original Message- From: Anindito De [mailto:[EMAIL PROTECTED] Sent: Thursday, 6 November 2003 19:00 To: [EMAIL PROTECTED] Subject: dynamically populating options in form Hi, We have two select boxes in an HTML form. Based on the option that the user selects in the first box and some other considerations, the contents in the second box get populated. Are there any reasonable means of doing this in struts with minimal use of JavaScript ? Thanks in advance Anindito - 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]
AW: org.apache.jasper.JasperException: Cannot find message resour ces under key org.apache.struts.action.MESSAGE
merci - that´s it ! -Ursprüngliche Nachricht- Von: Dirk Markert [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 6. November 2003 13:06 An: Struts Users Mailing List Betreff: Re: org.apache.jasper.JasperException: Cannot find message resources under key org.apache.struts.action.MESSAGE Hello Andreas, do you have your IdealMessageResources file in your WEB-INF directory? *** ASnd Hi there, ASnd i get the following message by start a jsp/java application which use ASnd struts. (Tomcat 4.1.24) ASnd My web.xml contains: ASnd servlet ASnd servlet-nameideal/servlet-name ASnd servlet-classorg.tzi.ideal.ui.servlet.ExtendedActionServlet/servlet-class ASnd init-param ASnd param-nameconfig/param-name ASnd param-value/WEB-INF/struts-config.xml/param-value ASnd /init-param ASnd init-param ASnd param-namedebug/param-name ASnd param-value3/param-value ASnd /init-param ASnd init-param ASnd param-namedetail/param-name ASnd param-value3/param-value ASnd /init-param ASnd init-param ASnd param-nameconfigFileName/param-name ASnd param-value/WEB-INF/config.cfg/param-value ASnd /init-param ASnd load-on-startup1/load-on-startup ASnd /servlet ASnd servlet-mapping ASnd servlet-nameideal/servlet-name ASnd url-pattern*.do/url-pattern ASnd /servlet-mapping ASnd session-config ASnd session-timeout60/session-timeout ASnd /session-config ASnd welcome-file-list ASnd welcome-filejsp/index.jsp/welcome-file ASnd /welcome-file-list ASnd taglib ASnd taglib-uri/WEB-INF/tlds/struts-bean.tld/taglib-uri ASnd taglib-location/WEB-INF/tlds/struts-bean.tld/taglib-location ASnd /taglib ASnd taglib ASnd taglib-uri/WEB-INF/tlds/struts-html.tld/taglib-uri ASnd taglib-location/WEB-INF/tlds/struts-html.tld/taglib-location ASnd /taglib ASnd taglib ASnd taglib-uri/WEB-INF/tlds/struts-logic.tld/taglib-uri ASnd taglib-location/WEB-INF/tlds/struts-logic.tld/taglib-location ASnd /taglib ASnd taglib ASnd taglib-uri/WEB-INF/tlds/struts-nested.tld/taglib-uri ASnd taglib-location/WEB-INF/tlds/struts-nested.tld/taglib-location ASnd /taglib ASnd taglib ASnd taglib-uri/WEB-INF/tlds/struts-template.tld/taglib-uri ASnd taglib-location/WEB-INF/tlds/struts-template.tld/taglib-location ASnd /taglib ASnd taglib ASnd taglib-uri/WEB-INF/tlds/struts-tiles.tld/taglib-uri ASnd taglib-location/WEB-INF/tlds/struts-tiles.tld/taglib-location ASnd /taglib ASnd taglib ASnd taglib-urihttp://jakarta.apache.org/taglibs/log-1.0/taglib-uri ASnd taglib-location/WEB-INF/tlds/taglibs-log.tld/taglib-location ASnd /taglib ASnd taglib ASnd taglib-urihttp://jakarta.apache.org/taglibs/xtags-1.0/taglib-uri ASnd taglib-location/WEB-INF/tlds/taglibs-xtags.tld/taglib-location ASnd /taglib ASnd /web-app ASnd My struts-config.xml contains: ASnd struts-config ASnd form-beans ASnd form-bean name=loginUserForm ASnd type=org.tzi.ideal.ui.form.LoginUserForm/ ASnd form-bean name=registerUserForm ASnd type=org.tzi.ideal.ui.form.RegisterUserForm/ ASnd form-bean name=showCategoriesForm ASnd type=org.tzi.ideal.ui.form.ShowCategoriesForm/ ASnd form-bean name=addMetadataForm ASnd type=org.tzi.ideal.ui.form.AddMetadataForm/ ASnd form-bean name=modifyCategoryNameForm ASnd type=org.tzi.ideal.ui.form.ModifyCategoryNameForm/ ASnd form-bean name=deleteMetadataForm ASnd type=org.tzi.ideal.ui.form.DeleteMetadataForm/ ASnd form-bean name=deleteCategoryForm ASnd type=org.tzi.ideal.ui.form.DeleteCategoryForm/ ASnd form-bean name=showModifyCategoryForm ASnd type=org.tzi.ideal.ui.form.ShowModifyCategoryForm/ ASnd form-bean name=commitFeedbackForm ASnd type=org.tzi.ideal.ui.form.CommitFeedbackForm/ ASnd form-bean name=showIcoForm ASnd type=org.tzi.ideal.ui.form.ShowIcoForm/ ASnd /form-beans ASnd global-forwards ASnd forward name=showLogin path=/jsp/login.jsp redirect=true/ ASnd forward name=showRegistration path=/jsp/register.jsp redirect=true/ ASnd forward name=showRegisterSuccessful ASnd path=/jsp/register_success.jsp redirect=true/ ASnd forward name=showIco
RE: struts-menu and internationalization
I use struts menu, with the CoolMenu displayer, and everything works fine. Your config looks ok. What exactly isn't working? There is a struts-menu specific mailing list, which would be a more approriate place to ask for help. Paul -Original Message- From: koen boutsen [mailto:[EMAIL PROTECTED] Sent: 06 November 2003 10:44 To: [EMAIL PROTECTED] Subject: struts-menu and internationalization Has anyone used internationalization in the struts-menu ? If so, could you explain me how I can do it. I tried the following : menu-config.xml: Menu name=organisation title=label.logout Item name=organisationOverview title=label.overview forward=/organisation/searchFirstLetter / /Menu and in listMenu.jsp: menu:useMenuDisplayer name=listMenu bundle=org.apache.struts.action.MESSAGE menu:displayMenu name=organisation/ menu:displayMenu name=salesrep/ menu:displayMenu name=logout/ /menu:useMenuDisplayer but this did not work. any help is very appreciated Koen Boutsen FREE ADHD DVD or CD-Rom (your choice) - click here! http://ad.doubleclick.net/clk;6413623;3807821;f?http://mocda2.com/1/c/563632 /131726/311392/311392 AOL users go here: http://ad.doubleclick.net/clk;6413623;3807821;f?http://mocda2.com/1/c/563632 /131726/311392/311392 This offer applies to U.S. Residents Only - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ** Axios Email Confidentiality Footer Privileged/Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should destroy this message, and notify us immediately. If you or your employer does not consent to Internet email messages of this kind, please advise us immediately. Opinions, conclusions and other information expressed in this message are not given or endorsed by my Company or employer unless otherwise indicated by an authorised representative independent of this message. WARNING: While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted via electronic mail attachments we cannot guarantee that attachments do not contain computer virus code. You are therefore strongly advised to undertake anti virus checks prior to accessing the attachment to this electronic mail. Axios Systems Ltd grants no warranties regarding performance use or quality of any attachment and undertakes no liability for loss or damage howsoever caused. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Re[4]: EL Expression in html:hidden tag
Yup, that's the theory anyway. As of JSP 2.0 (with a Servlet 2.4 format web.xml that has not explicity deactivated EL evaluation), request-time attribute values can be specified using either the familiar scriptlet expression (%= %) or the EL (${}). So, any pre-JSP 2.0 tags that have attributes with rtexprvaluetrue/rtexprvalue in their TLD file will automatically be able to use the EL for request-time attribute values. Quoting Arne Brutschy [EMAIL PROTECTED]: Hello, Monday, November 3, 2003, 7:20:31 PM, you wrote: KS I'm jumping in late on this thread, but why bother using Struts-EL at all under KS JSP 2.0? The original (RT) tags should be magically EL-aware as long as the app KS uses a Servlet 2.4 format web.xml, right? Oh, really? I didn't know that. So I can work with the normal struts lib? I just need to declare a 2.4 web-app? Thanks, Arne -- 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]
Re: intRange Validation works but displays always null
Untill now no solutions where found for this problem. Anybody has the solution ? thx. Hello Martin, change arg0 key=insertData.p_datum_t / to arg0 key=errors.range / *** MG Hello togehter, MG i have a problem with range validation. I think it is a simple thing but I MG can't get it solved. MG I already searched the archive but can't find a solution. MG I defined a Form in validation.xml with a field like this: MG field property=p_datum_t depends=integer,intRange MG arg0 key=insertData.p_datum_t / MG arg1 name=intRange key=${var:min} resource=false/ // Tried it MG already with name=range MG arg2 name=intRange key=${var:max} resource=false/ MG var MG var-namemin/var-name MG var-value1/var-value MG /var MG var MG var-namemax/var-name MG var-value31/var-value MG /var MG /field MG in Application Resources the entry is: MG errors.range=i{0}/i ist nicht im Bereich von {1} bis {2}. MG Results in my jsp to message : MG Datum ist nicht im Bereich von null bis null MG Why does it not Display not Datum ist nicht im Bereich von 1 bis 31? MG Thanks in advance, MG Martin Grüneberg MG - MG To unsubscribe, e-mail: [EMAIL PROTECTED] MG For additional commands, e-mail: [EMAIL PROTECTED] Regards, Dirk +--- Quality leads ---+ | Dirk Markert [EMAIL PROTECTED] | | Dr. Markert Softwaretechnik AG | | Joseph-von-Fraunhofer-Str. 20 | | 44227 Dortmund | +-- to success! -+ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Security Folter
I haven't tried it myself, but I did get a bug report from someone trying to do that. The bug was fixed, so I think it is working now. SecurityFilter doesn't come with any realm implementations(*), but you can use the CatalinaRealmAdapter to wrap a realm from Tomcat that will do password encryption for you. -Max (*) It does come with a trivial realm for the example app, a SimpleRealmBase class that can be extended if you want to write your own simple realm and not have to deal with Principal objects, and it comes with the CatalinaRealmAdapter, which allows you to use any of the realm implementations that come with Tomcat. On Wed, 2003-11-05 at 23:12, Mike Duffy wrote: Does anyone know if SecurityFilter supports encrypted passwords for a DB realm, or must passwords be stored in plain text? http://securityfilter.sourceforge.net/ Thanks! Mike __ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Max Cooper [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: upload validation failures are blanking my form values
Maybe this archive thread can help you? http://marc.theaimsgroup.com/?t=10475202833r=1w=2 Susan On 11/06/2003 06:22:05 AM Caoilte O'Connor wrote: Hi, I've got a bizarre bug with the struts-upload tools. Struts-upload works when, 1) everything validates correctly. 2) there is a validation error and you do not attempt to upload a file. but it breaks as soon as i try to upload a file and there is a validation error for any reason. The errors get reported correctly and I get returned to the input page BUT all the form fields are blanked. This does NOT happen if I do not attempt to upload a file. I have confirmed this also happens in the struts-upload example webapp. Has anyone else been infuriated by this bug and found any workarounds? I'm not using a nightly build. cheers, caoilte - 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 and internationalization
When a user logs in, I give him a default language, e.g. English, and create the appropriate Locale. This user sees the menu in the correct language. When this user switches his language, by clicking an image, I create another Locale, e.g. French. All the other labels I use, change into the wright language, but the menulabels stay in the original language. Thanks in advance Koen -- - Original Message - DATE: Thu, 6 Nov 2003 12:46:13 From: Paul McCulloch [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Cc: I use struts menu, with the CoolMenu displayer, and everything works fine. Your config looks ok. What exactly isn't working? There is a struts-menu specific mailing list, which would be a more approriate place to ask for help. Paul -Original Message- From: koen boutsen [mailto:[EMAIL PROTECTED] Sent: 06 November 2003 10:44 To: [EMAIL PROTECTED] Subject: struts-menu and internationalization Has anyone used internationalization in the struts-menu ? If so, could you explain me how I can do it. I tried the following : menu-config.xml: Menu name=organisation title=label.logout Item name=organisationOverview title=label.overview forward=/organisation/searchFirstLetter / /Menu and in listMenu.jsp: menu:useMenuDisplayer name=listMenu bundle=org.apache.struts.action.MESSAGE menu:displayMenu name=organisation/ menu:displayMenu name=salesrep/ menu:displayMenu name=logout/ /menu:useMenuDisplayer but this did not work. any help is very appreciated Koen Boutsen FREE ADHD DVD or CD-Rom (your choice) - click here! http://ad.doubleclick.net/clk;6413623;3807821;f?http://mocda2.com/1/c/563632 /131726/311392/311392 AOL users go here: http://ad.doubleclick.net/clk;6413623;3807821;f?http://mocda2.com/1/c/563632 /131726/311392/311392 This offer applies to U.S. Residents Only - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ** Axios Email Confidentiality Footer Privileged/Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should destroy this message, and notify us immediately. If you or your employer does not consent to Internet email messages of this kind, please advise us immediately. Opinions, conclusions and other information expressed in this message are not given or endorsed by my Company or employer unless otherwise indicated by an authorised representative independent of this message. WARNING: While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted via electronic mail attachments we cannot guarantee that attachments do not contain computer virus code. You are therefore strongly advised to undertake anti virus checks prior to accessing the attachment to this electronic mail. Axios Systems Ltd grants no warranties regarding performance use or quality of any attachment and undertakes no liability for loss or damage howsoever caused. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] FREE ADHD DVD or CD-Rom (your choice) - click here! http://ad.doubleclick.net/clk;6413623;3807821;f?http://mocda2.com/1/c/563632/131726/311392/311392 AOL users go here: http://ad.doubleclick.net/clk;6413623;3807821;f?http://mocda2.com/1/c/563632/131726/311392/311392 This offer applies to U.S. Residents Only - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
data-source connection keeps closing
After days of googling and trawling through the mail archives, I still can't find any explanation for this... I'm trying to get a DataSource that's been configured in struts-config.xml and use the connection in my Model. Every time I try to use the connection it says that it has closed (before even getting the chance to create a statement!). The connection that is returned sure enough has the correct URL, user, password driver, and independent tests have confirmed that mysql is running, that permissions are acceptable for that user, it's accessible from Java, blah blah... I've looked through most of the examples listed on the struts resources pages, but I can't seem to find anything that has a simple direct-to-jdbc example. Currently I'm not in a position to be using anything like Hibernate, etc, so all those examples are kinda not helpful in my situation. QUESTION: Does anyone have a simple canonical example of connecting to a JDBC database (preferably MySQL) via struts? I'm using Tomcat 4.1, MySQL 4.1.0, MySQL Connector 3.0.9 and struts 1.2. Error is as follows: 14:21:44,750 DEBUG QueryAction:55 - dataSource = [EMAIL PROTECTED] 14:21:45,561 DEBUG QueryAction:59 - myConnection = [EMAIL PROTECTED] 14:21:45,636 DEBUG QueryAction:61 - queryModel = [EMAIL PROTECTED] 14:21:45,677 DEBUG Model:109 - findNodes(null) 14:21:45,682 DEBUG Model:384 - readAll(node) 14:21:45,687 DEBUG Model:385 - connection = [EMAIL PROTECTED] 14:21:45,712 ERROR Model:392 - SQL Exception java.sql.SQLException: Connection is closed. at org.apache.commons.dbcp.DelegatingConnection.checkOpen(DelegatingConnect ion.java:245) at org.apache.commons.dbcp.DelegatingConnection.createStatement(DelegatingC onnection.java:170) at com.imc.semantic.Model.readAll(Model.java:389) struts-config.xml: data-sources data-source type=org.apache.commons.dbcp.BasicDataSource set-property property=driverClassName value=org.gjt.mm.mysql.Driver/ set-property property=url value=jdbc:mysql://localhost/semantic/ set-property property=username value=root/ set-property property=password value=/ set-property property=maxActive value=10 / set-property property=maxWait value=5000 / set-property property=defaultAutoCommit value=false / set-property property=defaultReadOnly value=false / set-property property=validationQuery value=SELECT COUNT(*) FROM node / /data-source /data-sources and the Java code in the Action: public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { DataSource dataSource; QueryModel queryModel = null; Connection myConnection = null; try { dataSource = getDataSource(request); // dataSource = servlet.findDataSource(null); logger.debug(dataSource = + dataSource); if (dataSource != null) { myConnection = dataSource.getConnection(); logger.debug(myConnection = + myConnection); queryModel = new QueryModel(myConnection); logger.debug(queryModel = + queryModel); } else { throw new Exception(dataSource was null); } } catch (SQLException e) { getServlet().log(Connection.process, e); } finally { // enclose this in a finally block // to make sure the connection is closed try { if (myConnection != null) myConnection.close(); } catch (SQLException e2) { getServlet().log(Connection.close, e2); } } --- David Parry Pronoia: the irrational feeling that forces are working behind your back to make your life better. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: data-source connection keeps closing
David, hope this helps: data-sources data-source type=com.mysql.jdbc.jdbc2.optional.MysqlDataSource set-property property=autoCommit value=true/ set-property property=description value=MySql Data Source/ set-property property=driverClass value=com.mysql.jdbc.Driver/ set-property property=maxCount value=10/ set-property property=minCount value=2/ set-property property=user value=dbuser/ set-property property=password value=x/ set-property property=url value=jdbc:mysql://localhost/collection/ /data-source /data-sources I'm using the latest stable mysql driver mysql-connector-java-3.0.9-stable-bin.jar. This is not the best example since it accesses the db from within a jsp: Connection conn = null; DataSource dataSource = null; try { dataSource = (DataSource) getServletContext().getAttribute(Action.DATA_SOURCE_KEY); conn = dataSource.getConnection(); Statement s = conn.createStatement(); ResultSet rs = s.executeQuery( select count(*) from collection.web_users); if (rs.next()) { % Number of users defined=%=rs.getInt(1) % % } } catch (SQLException sqle) { log(Connection.process, sqle); } finally { //enclose this in a finally block to make //sure the connection is closed try { if (conn != null) conn.close(); } catch (SQLException e) { log(Connection.close, e); } } % met vriendelijke groeten, salutations sincères, kind regards, Geert Van Landeghem Reynders Etiketten NV tel: +32 3 460.32.81 gsm: +32 477.75.95.33 mailto:[EMAIL PROTECTED] Give me the power to accept the things i cannot change, the strength to change the things i can change, and the insight to tell the difference -Original Message- From: David Parry [mailto:[EMAIL PROTECTED] Sent: donderdag 6 november 2003 14:41 To: [EMAIL PROTECTED] Subject: data-source connection keeps closing After days of googling and trawling through the mail archives, I still can't find any explanation for this... I'm trying to get a DataSource that's been configured in struts-config.xml and use the connection in my Model. Every time I try to use the connection it says that it has closed (before even getting the chance to create a statement!). The connection that is returned sure enough has the correct URL, user, password driver, and independent tests have confirmed that mysql is running, that permissions are acceptable for that user, it's accessible from Java, blah blah... I've looked through most of the examples listed on the struts resources pages, but I can't seem to find anything that has a simple direct-to-jdbc example. Currently I'm not in a position to be using anything like Hibernate, etc, so all those examples are kinda not helpful in my situation. QUESTION: Does anyone have a simple canonical example of connecting to a JDBC database (preferably MySQL) via struts? I'm using Tomcat 4.1, MySQL 4.1.0, MySQL Connector 3.0.9 and struts 1.2. Error is as follows: 14:21:44,750 DEBUG QueryAction:55 - dataSource = [EMAIL PROTECTED] 14:21:45,561 DEBUG QueryAction:59 - myConnection = [EMAIL PROTECTED] 14:21:45,636 DEBUG QueryAction:61 - queryModel = [EMAIL PROTECTED] 14:21:45,677 DEBUG Model:109 - findNodes(null) 14:21:45,682 DEBUG Model:384 - readAll(node) 14:21:45,687 DEBUG Model:385 - connection = [EMAIL PROTECTED] 14:21:45,712 ERROR Model:392 - SQL Exception java.sql.SQLException: Connection is closed. at org.apache.commons.dbcp.DelegatingConnection.checkOpen(DelegatingConnect ion.java:245) at org.apache.commons.dbcp.DelegatingConnection.createStatement(DelegatingC onnection.java:170) at com.imc.semantic.Model.readAll(Model.java:389) struts-config.xml: data-sources data-source type=org.apache.commons.dbcp.BasicDataSource set-property property=driverClassName value=org.gjt.mm.mysql.Driver/ set-property property=url value=jdbc:mysql://localhost/semantic/ set-property property=username value=root/ set-property property=password value=/ set-property property=maxActive value=10 / set-property property=maxWait value=5000 / set-property property=defaultAutoCommit value=false / set-property property=defaultReadOnly value=false / set-property property=validationQuery value=SELECT COUNT(*) FROM node / /data-source /data-sources and the Java code in the Action: public ActionForward execute(ActionMapping mapping,
Re: upload validation failures are blanking my form values
it's not quite the same problem as that guy is having. I don't mind file fields being blanked, because chances are the validation error is from that particular file being too big. my problem is that every single field in the form is being blanked (ie text ones which describe the file too, not just the file one), and that this only happens when you upload a file (ie it won't happen on exactly the same page if you don't try to upload the file and there is a validation error). i think this must be a bug in struts, caoilte On Thursday 06 November 2003 14:33, Susan Bradeen wrote: Maybe this archive thread can help you? http://marc.theaimsgroup.com/?t=10475202833r=1w=2 Susan On 11/06/2003 06:22:05 AM Caoilte O'Connor wrote: Hi, I've got a bizarre bug with the struts-upload tools. Struts-upload works when, 1) everything validates correctly. 2) there is a validation error and you do not attempt to upload a file. but it breaks as soon as i try to upload a file and there is a validation error for any reason. The errors get reported correctly and I get returned to the input page BUT all the form fields are blanked. This does NOT happen if I do not attempt to upload a file. I have confirmed this also happens in the struts-upload example webapp. Has anyone else been infuriated by this bug and found any workarounds? I'm not using a nightly build. cheers, caoilte --- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts + itext
Gonzalez, Probably more than you need but here is an example: package com.wrappedapps.boutique.view.admin; import java.io.*; import java.util.*; import java.text.*; import java.awt.Color; import javax.servlet.*; import javax.servlet.http.*; import org.apache.struts.action.*; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import com.lowagie.text.*; import com.lowagie.text.pdf.codec.GifImage; import com.lowagie.text.pdf.PdfWriter; import com.wrappedapps.boutique.Constants; import com.wrappedapps.boutique.business.*; import com.wrappedapps.boutique.persistancy.*; public class BuildTransactionSearchPDFAction extends Action { // Logging support private static final Log m_log = LogFactory.getLog(BuildTransactionSearchPDFAction.class); public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { HttpSession session = request.getSession(); ServletContext context = servlet.getServletContext(); IDataAccess dao = DataAccessObject.getInstance(); BoutiqueConfig config = (BoutiqueConfig) session.getAttribute(Constants.BOUTIQUE_CONFIG); //Fetch transactions ArrayList transIds = (ArrayList)session.getAttribute(Constants.TRANSACTION_SEARCH_RESULT); //Get requested Transactions and place Collection in request ArrayList transactions = new ArrayList(); for (int i = 0; i transIds.size(); ++i) { Integer tI = (Integer) transIds.get(i); int transId = tI.intValue(); TransactionRecord tr = dao.getTransaction(transId); transactions.add(tr); } //Create TransactionSearch pdf and print to ByteArrayOutputStream //step 1: creation of a document-object Document document = new Document(PageSize.A4, 50, 50, 50, 50); ByteArrayOutputStream baos = new ByteArrayOutputStream(); try { // step 2: PdfWriter.getInstance(document, baos); // step 3: we open the document document.open(); // Text fonts Font boldWhite = new Font(Font.HELVETICA, 8, Font.BOLD, Color.WHITE); Font boldBlack = new Font(Font.HELVETICA, 8, Font.BOLD, Color.BLACK); //Table BG colors Color even = new Color(92, 124, 177); Color odd = new Color(64, 91, 134); // step 4: Build header with branding logo, date and # of transactions Table hdrTbl = buildHeaderTable(config, transactions.size(), boldBlack); document.add(hdrTbl); //Create a new Table presenting each TransactionRecord for(int i = 0; i transactions.size(); ++i) { TransactionRecord tr = (TransactionRecord)transactions.get(i); CustomerInfo cust = tr.getCustomer(); boolean isEven = ((i % 2) == 0); //Build encapsulating table Table transT = new Table(2); transT.setWidth(80); transT.setWidths(new int[]{5, 75}); transT.setSpacing(1); transT.setBorder(Rectangle.NO_BORDER); transT.setAlignment(Element.ALIGN_CENTER); transT.setTableFitsPage(true); //Numbered Transaction Cell Cell tnC = new Cell(new Phrase( + (i + 1) + ., boldBlack)); tnC.setBorder(Rectangle.NO_BORDER); tnC.setVerticalAlignment(Element.ALIGN_TOP); tnC.setHorizontalAlignment(Element.ALIGN_CENTER); transT.addCell(tnC); //Build TransactionRecord Table Table trT = new Table(2, 7); trT.setWidth(75); // percentage trT.setSpacing(1); trT.setWidths(new int[] {13, 62}); // percentage trT.setAlignment(Element.ALIGN_CENTER); trT.setBorderWidth(0);
RE: Struts-Validation
yes Rickas exactly like what you mentioned what I did is first I just called super.validate() in my validate method of ActionForm then did the custon validation...btw is there any way in which I can validate those fields in framework itself..??? one like NotRequiredIf...?? like I should restrict the user to enter either CreditCardId text box or radio button which represent NoCreditCardId and not both If so I should throw err msg. -Ram -Original Message- From: Rick Reumann [mailto:[EMAIL PROTECTED] Sent: Thursday, November 06, 2003 12:13 AM To: Struts Users Mailing List Subject: Re: Struts-Validation Ramadoss Chinnakuzhandai wrote: yesI should restrict the user to enter both fields i.e they should enter anyone of the fields and not both. These option I think is to use the validate method in your ActionForm and then first call your validation framework and then do the check for the custom stuff you need to take care of public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { ServletContext application = getServlet().getServletContext(); ActionErrors errors = new ActionErrors(); //parameter will tell it what validation to look at String parameter = request.getParameter( mapping.getParameter() ); Validator validator = Resources.initValidator( parameter, this, application, request, errors, page); try { validatorResults = validator.validate(); } catch (ValidatorException e) { log.error(e.getMessage(), e); } //!! now do the custom stuff.. comparing the fields etc and add //any more errors to errors return errors; } -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: html:submit and 2 buttons
I have often added form properties to represent flags for the different button actions to process. My ActionForm would have two properties update and new: setUpdate(boolean flag){} boolean isUpdate() For the submit buttons: html:submit property=update value=true / If I have to use an image for the submit button I generally will have a hidden flag form field that I populate in the JavaScript onclick event handler. HTH, Greg -Original Message- From: Philip Mark Donaghy [mailto:[EMAIL PROTECTED] Sent: Thursday, November 06, 2003 6:23 AM To: Struts Users Mailing List Subject: RE: html:submit and 2 buttons Your action can read the value attribute of your submit tag. This is the label in your case. bean-el:message key=search.new/ Use the request.getParameter to find out which button was clicked. Give each of your submit buttons a different NAME. request.getParameter(NAME) will return the label of the submit button clicked or null. Phil --- Arik Levin ( Tikal ) [EMAIL PROTECTED] wrote: You can just use JavaScript passing some parameters You can also try this approach: http://husted.com/struts/tips/003.html -Original Message- From: Frers Michael [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 05, 2003 6:54 PM To: Struts Users Mailing List Subject: html:submit and 2 buttons Hello just a little question about the taglib i want to have one form with 2 buttons in it one button should do new the other update how can i make my action class know which button was hit? additionally i want that the buttons get there labels from a property file that works as shown below but how can i now make my action class know which button is hit? html-el:submit bean-el:message key=search.new//html-el:submit - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] = Java Web Application Architect mapimage.com - Java and GIS struts1.1:tomcat4.1.27:linuxRH8 __ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree - 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 + itext
Thank you ! -Mensaje original- De: Greg Hess [mailto:[EMAIL PROTECTED] Enviado el: jueves, 06 de noviembre de 2003 15:21 Para: 'Struts Users Mailing List' Asunto: RE: Struts + itext Gonzalez, Probably more than you need but here is an example: package com.wrappedapps.boutique.view.admin; import java.io.*; import java.util.*; import java.text.*; import java.awt.Color; import javax.servlet.*; import javax.servlet.http.*; import org.apache.struts.action.*; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import com.lowagie.text.*; import com.lowagie.text.pdf.codec.GifImage; import com.lowagie.text.pdf.PdfWriter; import com.wrappedapps.boutique.Constants; import com.wrappedapps.boutique.business.*; import com.wrappedapps.boutique.persistancy.*; public class BuildTransactionSearchPDFAction extends Action { // Logging support private static final Log m_log = LogFactory.getLog(BuildTransactionSearchPDFAction.class); public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { HttpSession session = request.getSession(); ServletContext context = servlet.getServletContext(); IDataAccess dao = DataAccessObject.getInstance(); BoutiqueConfig config = (BoutiqueConfig) session.getAttribute(Constants.BOUTIQUE_CONFIG); //Fetch transactions ArrayList transIds = (ArrayList)session.getAttribute(Constants.TRANSACTION_SEARCH_RESULT); //Get requested Transactions and place Collection in request ArrayList transactions = new ArrayList(); for (int i = 0; i transIds.size(); ++i) { Integer tI = (Integer) transIds.get(i); int transId = tI.intValue(); TransactionRecord tr = dao.getTransaction(transId); transactions.add(tr); } //Create TransactionSearch pdf and print to ByteArrayOutputStream //step 1: creation of a document-object Document document = new Document(PageSize.A4, 50, 50, 50, 50); ByteArrayOutputStream baos = new ByteArrayOutputStream(); try { // step 2: PdfWriter.getInstance(document, baos); // step 3: we open the document document.open(); // Text fonts Font boldWhite = new Font(Font.HELVETICA, 8, Font.BOLD, Color.WHITE); Font boldBlack = new Font(Font.HELVETICA, 8, Font.BOLD, Color.BLACK); //Table BG colors Color even = new Color(92, 124, 177); Color odd = new Color(64, 91, 134); // step 4: Build header with branding logo, date and # of transactions Table hdrTbl = buildHeaderTable(config, transactions.size(), boldBlack); document.add(hdrTbl); //Create a new Table presenting each TransactionRecord for(int i = 0; i transactions.size(); ++i) { TransactionRecord tr = (TransactionRecord)transactions.get(i); CustomerInfo cust = tr.getCustomer(); boolean isEven = ((i % 2) == 0); //Build encapsulating table Table transT = new Table(2); transT.setWidth(80); transT.setWidths(new int[]{5, 75}); transT.setSpacing(1); transT.setBorder(Rectangle.NO_BORDER); transT.setAlignment(Element.ALIGN_CENTER); transT.setTableFitsPage(true); //Numbered Transaction Cell Cell tnC = new Cell(new Phrase( + (i + 1) + ., boldBlack)); tnC.setBorder(Rectangle.NO_BORDER); tnC.setVerticalAlignment(Element.ALIGN_TOP); tnC.setHorizontalAlignment(Element.ALIGN_CENTER); transT.addCell(tnC); //Build TransactionRecord Table Table trT = new Table(2, 7); trT.setWidth(75); // percentage trT.setSpacing(1);
RE: upload validation failures are blanking my form values
Try setting the redirect=true for your error action forward. Not exactly sure of the exact problem but this has solved my problems with error reporting with forms with file uploads. HTH, Greg -Original Message- From: Caoilte O'Connor [mailto:[EMAIL PROTECTED] Sent: Thursday, November 06, 2003 6:22 AM To: [EMAIL PROTECTED] Subject: upload validation failures are blanking my form values Hi, I've got a bizarre bug with the struts-upload tools. Struts-upload works when, 1) everything validates correctly. 2) there is a validation error and you do not attempt to upload a file. but it breaks as soon as i try to upload a file and there is a validation error for any reason. The errors get reported correctly and I get returned to the input page BUT all the form fields are blanked. This does NOT happen if I do not attempt to upload a file. I have confirmed this also happens in the struts-upload example webapp. Has anyone else been infuriated by this bug and found any workarounds? I'm not using a nightly build. cheers, caoilte - 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: validwhen + struts 1.1
Blankvalidwhen is in CVS right now. Check out nightly build if it's worth it to you. -Original Message- From: Vara Prasad Reddy [mailto:[EMAIL PROTECTED] Sent: Thursday, November 06, 2003 5:32 AM To: struts Subject: validwhen + struts 1.1 Importance: High I am currently using struts 1.1. Is there a way I can use the validwhen functionality of future coming struts 1.2. Something like I can take only the class files of validwhen and use it along with struts 1.1 can someone detail me on this? Thanks in advance Vara Prasad
[OT - Design] Needing Fast Access to 300,000 Records
Hi All - I've been trying to figure out a good way of handling something, and just can't quite seem to get a grip on the best approach. Here's what I've got: Two database tables - Table 1 has a BILLING_CODE and an ACCOUNT_CODE. Table 2 has the ACCOUNT_CODE and other account information (name, address, etc.) The tables are linked by ACCOUNT_CODE. Table 1: Table 2: BILLING_CODEACCOUNT_CODE ACCOUNT_CODENAMEADDRESS ... 1234ABC1 ABC1blahblah 1234ABC2 ABC2blahblah 1234ABC3 ABC3blahblah 5678DEF1 DEF1blahblah 5678DEF2 DEF2blahblah I need to be able to rapidly access the information in table 2 either through the BILLING_CODE, or directly through the ACCOUNT_CODE. I can create a POJO containing the BILLING_CODE and a List object to hold a second POJO for the table 2 info. Or I can use a Map. Either way doesn't give me a good method of accessing the table 2 information based on ACCOUNT_CODE. Two other bits of info - the combined number of records exceeds 300,000, so I have a scaling issue. Second, I'd like to load everything in a plug-in using iBatis dbLayer and store it in application scope (to eliminate db calls as the webapp is used.) Does anyone have any experience in handling something like this? How did you do it? Thanks... Jerry Jalenak Development Manager, Web Publishing LabOne, Inc. 10101 Renner Blvd. Lenexa, KS 66219 (913) 577-1496 [EMAIL PROTECTED] This transmission (and any information attached to it) may be confidential and is intended solely for the use of the individual or entity to which it is addressed. If you are not the intended recipient or the person responsible for delivering the transmission to the intended recipient, be advised that you have received this transmission in error and that any use, dissemination, forwarding, printing, or copying of this information is strictly prohibited. If you have received this transmission in error, please immediately notify LabOne at the following email address: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: jsp output to file
To achive this I generaly use a utility method as defined below, note the path argument will contain a full url including the session Id key as the jsp is generaly relying on session data to build the output for example(http://localhost/myapp/someAction.do;jsessionid=thesessionid). The return can then be saved to file. public static String executeHTTPRequest(String path) { String htmlContent = null; ByteArrayOutputStream bout = new ByteArrayOutputStream(); try { URL jspPage = new URL(path); InputStream is = jspPage.openStream(); BufferedInputStream bin = new BufferedInputStream(is,1024); int data; while((data = bin.read())0) { bout.write(data); } bin.close(); is.close(); htmlContent = new String(bout.toByteArray()).trim(); } catch(Exception e) { if(m_log.isErrorEnabled()) m_log.error(ToolBox ERROR: executeHTTPRequest(path)path= + path + e); } return htmlContent; } HTH, Greg -Original Message- From: Jack Bakker [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 05, 2003 11:17 PM To: [EMAIL PROTECTED] Subject: jsp output to file I have a multi page wizard which ultimately produces 10 output pages which show data entered into the form(s). The user then reviews the output pages, can modify input data, and then can click a final submit button when satisfied with their entries. So far so good. At this final submission, I want to render the same 10 output pages but this time save them as html files on the server. i.e., how can I, from one action, call 10 other actions and instead of returning output to the browser, save as a server-side html files. -- jack - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT - Design] Needing Fast Access to 300,000 Records
Jerry Jalenak wrote: Hi All - I've been trying to figure out a good way of handling something, and just can't quite seem to get a grip on the best approach. Here's what I've got: Two database tables - Table 1 has a BILLING_CODE and an ACCOUNT_CODE. Table 2 has the ACCOUNT_CODE and other account information (name, address, etc.) The tables are linked by ACCOUNT_CODE. Table 1: Table 2: BILLING_CODEACCOUNT_CODE ACCOUNT_CODENAMEADDRESS ... 1234ABC1 ABC1blahblah 1234ABC2 ABC2blahblah 1234ABC3 ABC3blahblah 5678DEF1 DEF1blahblah 5678DEF2 DEF2blahblah I need to be able to rapidly access the information in table 2 either through the BILLING_CODE, or directly through the ACCOUNT_CODE. I can create a POJO containing the BILLING_CODE and a List object to hold a second POJO for the table 2 info. Or I can use a Map. Either way doesn't give me a good method of accessing the table 2 information based on ACCOUNT_CODE. Two other bits of info - the combined number of records exceeds 300,000, so I have a scaling issue. Second, I'd like to load everything in a plug-in using iBatis dbLayer and store it in application scope (to eliminate db calls as the webapp is used.) That is ridiculous!! Why stop there, why not just write your own SQL engine in Java? Say 300,000 records times 500 bytes for each record in memory... I can't begin to ... You can easily get sub second response scelable, that is a very, very, small database for a SQL engine. Post the the SQL command that is giving you performance problem. What DB are you using? iBatis is nicely going to cache duplicate requests and flush, that's all, its a DAO. .V Does anyone have any experience in handling something like this? How did you do it? Thanks... Jerry Jalenak Development Manager, Web Publishing LabOne, Inc. 10101 Renner Blvd. Lenexa, KS 66219 (913) 577-1496 [EMAIL PROTECTED] This transmission (and any information attached to it) may be confidential and is intended solely for the use of the individual or entity to which it is addressed. If you are not the intended recipient or the person responsible for delivering the transmission to the intended recipient, be advised that you have received this transmission in error and that any use, dissemination, forwarding, printing, or copying of this information is strictly prohibited. If you have received this transmission in error, please immediately notify LabOne at the following email address: [EMAIL PROTECTED] -- Victor Cekvenich, Struts Instructor (215) 321-9146 Advanced Struts Training http://basebeans.com/do/cmsPg?content=TRAINING Server Side Java training with Rich UI, mentoring, designs, samples and project recovery in North East. Simple best practice basic Portal, a Struts CMS, Membership, Forums, Shopping and Credit processing, http://basicportal.com software, ready to develop/customize; requires a db to run. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: jsp output to file
Thanks, I'll give this a try. -- jack -Original Message- From: Greg Hess [mailto:[EMAIL PROTECTED] Sent: Thursday, November 06, 2003 9:47 AM To: 'Struts Users Mailing List' Subject: RE: jsp output to file To achive this I generaly use a utility method as defined below, note the path argument will contain a full url including the session Id key as the jsp is generaly relying on session data to build the output for example(http://localhost/myapp/someAction.do;jsessionid=thesessionid). The return can then be saved to file. public static String executeHTTPRequest(String path) { String htmlContent = null; ByteArrayOutputStream bout = new ByteArrayOutputStream(); try { URL jspPage = new URL(path); InputStream is = jspPage.openStream(); BufferedInputStream bin = new BufferedInputStream(is,1024); int data; while((data = bin.read())0) { bout.write(data); } bin.close(); is.close(); htmlContent = new String(bout.toByteArray()).trim(); } catch(Exception e) { if(m_log.isErrorEnabled()) m_log.error(ToolBox ERROR: executeHTTPRequest(path)path= + path + e); } return htmlContent; } HTH, Greg -Original Message- From: Jack Bakker [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 05, 2003 11:17 PM To: [EMAIL PROTECTED] Subject: jsp output to file I have a multi page wizard which ultimately produces 10 output pages which show data entered into the form(s). The user then reviews the output pages, can modify input data, and then can click a final submit button when satisfied with their entries. So far so good. At this final submission, I want to render the same 10 output pages but this time save them as html files on the server. i.e., how can I, from one action, call 10 other actions and instead of returning output to the browser, save as a server-side html files. -- jack - 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]
multibox - Null attribute name ServletException
I tried to use multibox. I copied the code snippet from Struts in Action, but I got: [ServletException in:/WEB-INF/jsp/form/multiboxTest.jsp] Null attribute name' --- This is my multiboxTest.jsp: %@ 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:form action=/Multibox table border=0 width=100% logic:iterate id=item property=items html:multibox property=selectedItems bean:write name=item/ /html:multibox bean:write name=item/ /logic:iterate !-- Buttons -- tr td html:submit property=ok onclick=bCancel=false; bean:message key=button.ok/ /html:submit nbsp; html:submit property=cancel onclick=bCancel=true; bean:message key=button.cancel/ /html:submit /td /tr /table /html:form --- This is my ActionForm: MultiboxForm .java public class MultiboxForm extends ActionForm { private String[] selectedItems = {}; private String[] items = { UPS, FedEx, Airborne }; public String[] getSelectedItems() { return this.selectedItems; } public void setSelectedItems(String[] selectedItems) { this.selectedItems = selectedItems; } public ActionErrors validate( ActionMapping mapping, HttpServletRequest request) { ActionErrors errors = new ActionErrors(); return errors; } }
Access message resources from Action?
This seems like a simple thing to do, and I could swear I've seen it answered on the list - but I can't find it! How do I access the message resources that I get at from a JSP using bean:write locale=localeObj key=message.key/ from an Action? -- Brice D. Ruth Sr. IT Analyst Fiskars Brands, Inc. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT - Design] Needing Fast Access to 300,000 Records
--- Jerry Jalenak [EMAIL PROTECTED] wrote: Hi All - I've been trying to figure out a good way of handling something, and just can't quite seem to get a grip on the best approach. Here's what I've got: Two database tables - Table 1 has a BILLING_CODE and an ACCOUNT_CODE. Table 2 has the ACCOUNT_CODE and other account information (name, address, etc.) The tables are linked by ACCOUNT_CODE. Table 1: Table 2: BILLING_CODEACCOUNT_CODE ACCOUNT_CODE NAMEADDRESS ... 1234ABC1 ABC1 blahblah 1234ABC2 ABC2 blahblah 1234ABC3 ABC3 blahblah 5678DEF1 DEF1 blahblah 5678DEF2 DEF2 blahblah I need to be able to rapidly access the information in table 2 either through the BILLING_CODE, or directly through the ACCOUNT_CODE. I can create a POJO containing the BILLING_CODE and a List object to hold a second POJO for the table 2 info. Or I can use a Map. Either way doesn't give me a good method of accessing the table 2 information based on ACCOUNT_CODE. Two other bits of info - the combined number of records exceeds 300,000, so I have a scaling issue. No you don't (unless you're using MS Access :-). 300k records is a very small database. Second, I'd like to load everything in a plug-in using iBatis dbLayer and store it in application scope (to eliminate db calls as the webapp is used.) This is a premature optimization. Write the simplest solution possible (ie. read from database each time) and then optimize if needed. A properly configured database will perform table joins in less than a second. In my experience, joining on CHAR fields is slower than joining on INTEGER fields but if they're properly indexed the performance will be fine. David Does anyone have any experience in handling something like this? How did you do it? Thanks... Jerry Jalenak Development Manager, Web Publishing LabOne, Inc. 10101 Renner Blvd. Lenexa, KS 66219 (913) 577-1496 [EMAIL PROTECTED] This transmission (and any information attached to it) may be confidential and is intended solely for the use of the individual or entity to which it is addressed. If you are not the intended recipient or the person responsible for delivering the transmission to the intended recipient, be advised that you have received this transmission in error and that any use, dissemination, forwarding, printing, or copying of this information is strictly prohibited. If you have received this transmission in error, please immediately notify LabOne at the following email address: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT - Design] Needing Fast Access to 300,000 Records
Vic - This is still in the design stage, so I don't have a SQL statement to provide. I'm looking for the best approach to handling what is essentially a table lookup where I need two keys (BILLING_ACCOUNT and ACCOUNT_CODE) The scenario is this: When one of my clients logs on to the webapp, the app determines the BILLING_ACCOUNTs the client has assigned, then explodes the BILLING_ACCOUNTs into the composite ACCOUNT_CODES. As an example, I've got one client with 54 BILLING_ACCOUNTs; these explode to over 30,000 ACCOUNT_CODES. I am trying to eliminate 30,000 db calls to get the account information - that's why I'm looking to pre-load the table(s) in a plug-in and access everything in memory. Make sense? Jerry Jalenak Development Manager, Web Publishing LabOne, Inc. 10101 Renner Blvd. Lenexa, KS 66219 (913) 577-1496 [EMAIL PROTECTED] -Original Message- From: Vic Cekvenich [mailto:[EMAIL PROTECTED] Sent: Thursday, November 06, 2003 8:46 AM To: [EMAIL PROTECTED] Subject: Re: [OT - Design] Needing Fast Access to 300,000 Records Jerry Jalenak wrote: Hi All - I've been trying to figure out a good way of handling something, and just can't quite seem to get a grip on the best approach. Here's what I've got: Two database tables - Table 1 has a BILLING_CODE and an ACCOUNT_CODE. Table 2 has the ACCOUNT_CODE and other account information (name, address, etc.) The tables are linked by ACCOUNT_CODE. Table 1: Table 2: BILLING_CODEACCOUNT_CODE ACCOUNT_CODENAMEADDRESS ... 1234ABC1 ABC1blahblah 1234ABC2 ABC2blahblah 1234ABC3 ABC3blahblah 5678DEF1 DEF1blahblah 5678DEF2 DEF2blahblah I need to be able to rapidly access the information in table 2 either through the BILLING_CODE, or directly through the ACCOUNT_CODE. I can create a POJO containing the BILLING_CODE and a List object to hold a second POJO for the table 2 info. Or I can use a Map. Either way doesn't give me a good method of accessing the table 2 information based on ACCOUNT_CODE. Two other bits of info - the combined number of records exceeds 300,000, so I have a scaling issue. Second, I'd like to load everything in a plug-in using iBatis dbLayer and store it in application scope (to eliminate db calls as the webapp is used.) That is ridiculous!! Why stop there, why not just write your own SQL engine in Java? Say 300,000 records times 500 bytes for each record in memory... I can't begin to ... You can easily get sub second response scelable, that is a very, very, small database for a SQL engine. Post the the SQL command that is giving you performance problem. What DB are you using? iBatis is nicely going to cache duplicate requests and flush, that's all, its a DAO. .V Does anyone have any experience in handling something like this? How did you do it? Thanks... Jerry Jalenak Development Manager, Web Publishing LabOne, Inc. 10101 Renner Blvd. Lenexa, KS 66219 (913) 577-1496 [EMAIL PROTECTED] This transmission (and any information attached to it) may be confidential and is intended solely for the use of the individual or entity to which it is addressed. If you are not the intended recipient or the person responsible for delivering the transmission to the intended recipient, be advised that you have received this transmission in error and that any use, dissemination, forwarding, printing, or copying of this information is strictly prohibited. If you have received this transmission in error, please immediately notify LabOne at the following email address: [EMAIL PROTECTED] -- Victor Cekvenich, Struts Instructor (215) 321-9146 Advanced Struts Training http://basebeans.com/do/cmsPg?content=TRAINING Server Side Java training with Rich UI, mentoring, designs, samples and project recovery in North East. Simple best practice basic Portal, a Struts CMS, Membership, Forums, Shopping and Credit processing, http://basicportal.com software, ready to develop/customize; requires a db to run. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This transmission (and any information attached to it) may be confidential and is intended solely for the use of the individual or entity to which it is addressed. If you are not the intended recipient or the person responsible for delivering the transmission to the intended recipient, be advised that you have received this
RE: struts-menu and internationalization
A quick look at the source code suggests that the locale used is either the loacle of the request (set by your browser) or some locale object in some scope. You need to tell the menu:useMenuDisplayer tag how to access your locale object. If for instance you put the user's locale in session scope with a key user.locale then you should use the tag like: menu:useMenuDisplayer name=listMenu bundle=org.apache.struts.action.MESSAGE locale=user.locale Disclaimer: I don't use this functionality - I've just had a quick look at the code. Paul -Original Message- From: koen boutsen [mailto:[EMAIL PROTECTED] Sent: 06 November 2003 13:35 To: Struts Users Mailing List Subject: RE: struts-menu and internationalization When a user logs in, I give him a default language, e.g. English, and create the appropriate Locale. This user sees the menu in the correct language. When this user switches his language, by clicking an image, I create another Locale, e.g. French. All the other labels I use, change into the wright language, but the menulabels stay in the original language. Thanks in advance Koen -- - Original Message - DATE: Thu, 6 Nov 2003 12:46:13 From: Paul McCulloch [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Cc: I use struts menu, with the CoolMenu displayer, and everything works fine. Your config looks ok. What exactly isn't working? There is a struts-menu specific mailing list, which would be a more approriate place to ask for help. Paul -Original Message- From: koen boutsen [mailto:[EMAIL PROTECTED] Sent: 06 November 2003 10:44 To: [EMAIL PROTECTED] Subject: struts-menu and internationalization Has anyone used internationalization in the struts-menu ? If so, could you explain me how I can do it. I tried the following : menu-config.xml: Menu name=organisation title=label.logout Item name=organisationOverview title=label.overview forward=/organisation/searchFirstLetter / /Menu and in listMenu.jsp: menu:useMenuDisplayer name=listMenu bundle=org.apache.struts.action.MESSAGE menu:displayMenu name=organisation/ menu:displayMenu name=salesrep/ menu:displayMenu name=logout/ /menu:useMenuDisplayer but this did not work. any help is very appreciated Koen Boutsen FREE ADHD DVD or CD-Rom (your choice) - click here! http://ad.doubleclick.net/clk;6413623;3807821;f?http://mocda2.com/1/c/56363 2 /131726/311392/311392 AOL users go here: http://ad.doubleclick.net/clk;6413623;3807821;f?http://mocda2.com/1/c/56363 2 /131726/311392/311392 This offer applies to U.S. Residents Only - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ** Axios Email Confidentiality Footer Privileged/Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should destroy this message, and notify us immediately. If you or your employer does not consent to Internet email messages of this kind, please advise us immediately. Opinions, conclusions and other information expressed in this message are not given or endorsed by my Company or employer unless otherwise indicated by an authorised representative independent of this message. WARNING: While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted via electronic mail attachments we cannot guarantee that attachments do not contain computer virus code. You are therefore strongly advised to undertake anti virus checks prior to accessing the attachment to this electronic mail. Axios Systems Ltd grants no warranties regarding performance use or quality of any attachment and undertakes no liability for loss or damage howsoever caused. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] FREE ADHD DVD or CD-Rom (your choice) - click here! http://ad.doubleclick.net/clk;6413623;3807821;f?http://mocda2.com/1/c/563632 /131726/311392/311392 AOL users go here: http://ad.doubleclick.net/clk;6413623;3807821;f?http://mocda2.com/1/c/563632 /131726/311392/311392 This offer applies to U.S. Residents Only - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ** Axios Email Confidentiality Footer Privileged/Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person),
RE: [OT - Design] Needing Fast Access to 300,000 Records
To avoid having 300,000 records sitting in memory I generally have my queries return record id's. My DAO returns an int[] or ResultObjects collection containing record id's that I store in some scope(session) as it takes little mem. The records are not generally all displayed at once so I only fetch the records that will be displayed on a single page and use a pager tag lib to provide paging functionality. The actual recordObjects currently being viewed are put into request scope to reduce mem consumption. Not sure of your iBatis plug-in but maybe you could still page the records and only pass one page of records at a time and use the strategy above. HTH, Greg -Original Message- From: Jerry Jalenak [mailto:[EMAIL PROTECTED] Sent: Thursday, November 06, 2003 9:36 AM To: '[EMAIL PROTECTED]' Subject: [OT - Design] Needing Fast Access to 300,000 Records Hi All - I've been trying to figure out a good way of handling something, and just can't quite seem to get a grip on the best approach. Here's what I've got: Two database tables - Table 1 has a BILLING_CODE and an ACCOUNT_CODE. Table 2 has the ACCOUNT_CODE and other account information (name, address, etc.) The tables are linked by ACCOUNT_CODE. Table 1: Table 2: BILLING_CODEACCOUNT_CODE ACCOUNT_CODE NAMEADDRESS ... 1234ABC1 ABC1 blahblah 1234ABC2 ABC2 blahblah 1234ABC3 ABC3 blahblah 5678DEF1 DEF1 blahblah 5678DEF2 DEF2 blahblah I need to be able to rapidly access the information in table 2 either through the BILLING_CODE, or directly through the ACCOUNT_CODE. I can create a POJO containing the BILLING_CODE and a List object to hold a second POJO for the table 2 info. Or I can use a Map. Either way doesn't give me a good method of accessing the table 2 information based on ACCOUNT_CODE. Two other bits of info - the combined number of records exceeds 300,000, so I have a scaling issue. Second, I'd like to load everything in a plug-in using iBatis dbLayer and store it in application scope (to eliminate db calls as the webapp is used.) Does anyone have any experience in handling something like this? How did you do it? Thanks... Jerry Jalenak Development Manager, Web Publishing LabOne, Inc. 10101 Renner Blvd. Lenexa, KS 66219 (913) 577-1496 [EMAIL PROTECTED] This transmission (and any information attached to it) may be confidential and is intended solely for the use of the individual or entity to which it is addressed. If you are not the intended recipient or the person responsible for delivering the transmission to the intended recipient, be advised that you have received this transmission in error and that any use, dissemination, forwarding, printing, or copying of this information is strictly prohibited. If you have received this transmission in error, please immediately notify LabOne at the following email address: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Access message resources from Action?
((MessageResources) request.getAttribute(Globals.MESSAGES_KEY)).getMessage(locale, message.key) Paul -Original Message- From: Brice Ruth [mailto:[EMAIL PROTECTED] Sent: 06 November 2003 14:51 To: Struts Users Mailing List Subject: Access message resources from Action? This seems like a simple thing to do, and I could swear I've seen it answered on the list - but I can't find it! How do I access the message resources that I get at from a JSP using bean:write locale=localeObj key=message.key/ from an Action? -- Brice D. Ruth Sr. IT Analyst Fiskars Brands, Inc. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ** Axios Email Confidentiality Footer Privileged/Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should destroy this message, and notify us immediately. If you or your employer does not consent to Internet email messages of this kind, please advise us immediately. Opinions, conclusions and other information expressed in this message are not given or endorsed by my Company or employer unless otherwise indicated by an authorised representative independent of this message. WARNING: While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted via electronic mail attachments we cannot guarantee that attachments do not contain computer virus code. You are therefore strongly advised to undertake anti virus checks prior to accessing the attachment to this electronic mail. Axios Systems Ltd grants no warranties regarding performance use or quality of any attachment and undertakes no liability for loss or damage howsoever caused. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Access message resources from Action?
Acton.getResources(HttpServletRequest) or Acton.getResources(HttpServletRequest, String) Then: MessageResources.getMessage(Locale, String) Quoting Brice Ruth [EMAIL PROTECTED]: This seems like a simple thing to do, and I could swear I've seen it answered on the list - but I can't find it! How do I access the message resources that I get at from a JSP using bean:write locale=localeObj key=message.key/ from an Action? -- Brice D. Ruth Sr. IT Analyst Fiskars Brands, Inc. -- 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]
Token and workflow
Hi everyone, I asked for some questions about token and double submissions a couple of weeks ago. Today, i'm back to that problem and more specifically on the workflow. The double submission detection is Ok. But i don't know how to retrieve the normal flow of the application. I explain myself : In my Prepare Action, i use the saveToken() method. Then, the JSP is shown and the user can fill the form. In my Process Action, i use the isTokenValid() then resetToken() methods. If there's just one submission, everything works fine. If there's a double submission, my Process Action class detects it and returns to the JSP (via the Prepare Action class) with an error message on the screen. Everything's fine until this point. But then, what happens ? The user can see the message but nothing can happen.. I can't retrieve the workflow of my application and the user remains on that page with this message whereas the first call of the Process Action class is already finished.. I spent a lot of time on the web searching for examples but unfortunatly, i couldn't find something that suits to my problem.. Thanks in advance, Frederic - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: multibox - Null attribute name ServletException
store the properties in a bean and recall them in your action. F. - Original Message - From: ZYD [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, November 06, 2003 3:52 AM Subject: multibox - Null attribute name ServletException I tried to use multibox. I copied the code snippet from Struts in Action, but I got: [ServletException in:/WEB-INF/jsp/form/multiboxTest.jsp] Null attribute name' --- This is my multiboxTest.jsp: %@ 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:form action=/Multibox table border=0 width=100% logic:iterate id=item property=items html:multibox property=selectedItems bean:write name=item/ /html:multibox bean:write name=item/ /logic:iterate !-- Buttons -- tr td html:submit property=ok onclick=bCancel=false; bean:message key=button.ok/ /html:submit nbsp; html:submit property=cancel onclick=bCancel=true; bean:message key=button.cancel/ /html:submit /td /tr /table /html:form --- This is my ActionForm: MultiboxForm .java public class MultiboxForm extends ActionForm { private String[] selectedItems = {}; private String[] items = { UPS, FedEx, Airborne }; public String[] getSelectedItems() { return this.selectedItems; } public void setSelectedItems(String[] selectedItems) { this.selectedItems = selectedItems; } public ActionErrors validate( ActionMapping mapping, HttpServletRequest request) { ActionErrors errors = new ActionErrors(); return errors; } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: data-source connection keeps closing
Hi David, try to change the connection URL to: jdbc:mysql://localhost/semantic?autoReconnect=true Bye, Alvaro. David Parry wrote: Subject: data-source connection keeps closing From: David Parry [EMAIL PROTECTED] Date: Thu, 6 Nov 2003 14:40:39 +0100 To: [EMAIL PROTECTED] After days of googling and trawling through the mail archives, I still can't find any explanation for this... I'm trying to get a DataSource that's been configured in struts-config.xml and use the connection in my Model. Every time I try to use the connection it says that it has closed (before even getting the chance to create a statement!). The connection that is returned sure enough has the correct URL, user, password driver, and independent tests have confirmed that mysql is running, that permissions are acceptable for that user, it's accessible from Java, blah blah... I've looked through most of the examples listed on the struts resources pages, but I can't seem to find anything that has a simple direct-to-jdbc example. Currently I'm not in a position to be using anything like Hibernate, etc, so all those examples are kinda not helpful in my situation. QUESTION: Does anyone have a simple canonical example of connecting to a JDBC database (preferably MySQL) via struts? I'm using Tomcat 4.1, MySQL 4.1.0, MySQL Connector 3.0.9 and struts 1.2. Error is as follows: 14:21:44,750 DEBUG QueryAction:55 - dataSource = [EMAIL PROTECTED] 14:21:45,561 DEBUG QueryAction:59 - myConnection = [EMAIL PROTECTED] 14:21:45,636 DEBUG QueryAction:61 - queryModel = [EMAIL PROTECTED] 14:21:45,677 DEBUG Model:109 - findNodes(null) 14:21:45,682 DEBUG Model:384 - readAll(node) 14:21:45,687 DEBUG Model:385 - connection = [EMAIL PROTECTED] 14:21:45,712 ERROR Model:392 - SQL Exception java.sql.SQLException: Connection is closed. at org.apache.commons.dbcp.DelegatingConnection.checkOpen(DelegatingConnect ion.java:245) at org.apache.commons.dbcp.DelegatingConnection.createStatement(DelegatingC onnection.java:170) at com.imc.semantic.Model.readAll(Model.java:389) struts-config.xml: data-sources data-source type="org.apache.commons.dbcp.BasicDataSource" set-property property="driverClassName" value="org.gjt.mm.mysql.Driver"/ set-property property="url" value="jdbc:mysql://localhost/semantic"/ set-property property="username" value="root"/ set-property property="password" value=""/ set-property property="maxActive" value="10" / set-property property="maxWait" value="5000" / set-property property="defaultAutoCommit" value="false" / set-property property="defaultReadOnly" value="false" / set-property property="validationQuery" value="SELECT COUNT(*) FROM node" / /data-source /data-sources and the Java code in the Action: public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { DataSource dataSource; QueryModel queryModel = null; Connection myConnection = null; try { dataSource = getDataSource(request); // dataSource = servlet.findDataSource(null); logger.debug("dataSource = " + dataSource); if (dataSource != null) { myConnection = dataSource.getConnection(); logger.debug("myConnection = " + myConnection); queryModel = new QueryModel(myConnection); logger.debug("queryModel = " + queryModel); } else { throw new Exception("dataSource was null"); } } catch (SQLException e) { getServlet().log("Connection.process", e); } finally { // enclose this in a finally block // to make sure the connection is closed try { if (myConnection != null) myConnection.close(); } catch (SQLException e2) { getServlet().log("Connection.close", e2); } } --- David Parry Pronoia: the irrational feeling that forces are working behind your back to make your life better. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Help in Validation.
Hi friends, I am having html:file tag in my form. I want to check whether has selected any file or not. like if the user submits the form without selecting the file, i want to validate. in my validate.xml,. this is the validation i've entered. formset form name=ImportPlanForm field propery = projectFile depends=required arg0 key = ImportProjectPlan.planFile.label/ /field /form /formset i am getting org.apache.commons.beanutils.ConversionException: Cannot assign value of type 'java.lang.String' to property 'projectFile' of type 'org.apache.struts.upload.FormFile' how can i approach. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Can the name attribute be omitted form html:iterate tag ?
Hi The following two code snippets are from Struts in Action, I copied them to my JSP page and ActionForm. but I cannot get it work. I got : [ServletException in:/WEB-INF/jsp/form/multiboxTestSubmit.jsp] Null attribute name' What's wrong with it? What do I need to pay attention to? Please help me out of this, I have been puzzled by it for several days. Thanks in advance. bruce logic:iterate id=item property=items html:multibox property=selectedItems bean:write name=item/ /html:multibox bean:write name=item/ /logic:iterate -- private String[] selectedItems = {}; private String[] items = { UPS, FedEx, Airborne }; public String[] getSelectedItems() { return this.selectedItems; } public void setSelectedItems(String[] selectedItems) { this.selectedItems = selectedItems; }
RE: [OT - Design] Needing Fast Access to 300,000 Records
Hi, But I think over here you are missing one important point. Out of those 3 records, the client will want to browse over only a couple of (may be a couple of hundreds). So as and when he requests, geting a few of them(stanadard pageful records at a time)wont be slow.Just retrieving all the records because just in case the client may need them does not look very efficient approach to me..I am assuming your functionality is something similar... any ideas guys? -Original Message- From: Jerry Jalenak [mailto:[EMAIL PROTECTED] Sent: Thursday, November 06, 2003 3:56 PM To: 'Struts Users Mailing List' Subject: RE: [OT - Design] Needing Fast Access to 300,000 Records Vic - This is still in the design stage, so I don't have a SQL statement to provide. I'm looking for the best approach to handling what is essentially a table lookup where I need two keys (BILLING_ACCOUNT and ACCOUNT_CODE) The scenario is this: When one of my clients logs on to the webapp, the app determines the BILLING_ACCOUNTs the client has assigned, then explodes the BILLING_ACCOUNTs into the composite ACCOUNT_CODES. As an example, I've got one client with 54 BILLING_ACCOUNTs; these explode to over 30,000 ACCOUNT_CODES. I am trying to eliminate 30,000 db calls to get the account information - that's why I'm looking to pre-load the table(s) in a plug-in and access everything in memory. Make sense? Jerry Jalenak Development Manager, Web Publishing LabOne, Inc. 10101 Renner Blvd. Lenexa, KS 66219 (913) 577-1496 [EMAIL PROTECTED] -Original Message- From: Vic Cekvenich [mailto:[EMAIL PROTECTED] Sent: Thursday, November 06, 2003 8:46 AM To: [EMAIL PROTECTED] Subject: Re: [OT - Design] Needing Fast Access to 300,000 Records Jerry Jalenak wrote: Hi All - I've been trying to figure out a good way of handling something, and just can't quite seem to get a grip on the best approach. Here's what I've got: Two database tables - Table 1 has a BILLING_CODE and an ACCOUNT_CODE. Table 2 has the ACCOUNT_CODE and other account information (name, address, etc.) The tables are linked by ACCOUNT_CODE. Table 1: Table 2: BILLING_CODEACCOUNT_CODE ACCOUNT_CODENAMEADDRESS ... 1234ABC1 ABC1blahblah 1234ABC2 ABC2blahblah 1234ABC3 ABC3blahblah 5678DEF1 DEF1blahblah 5678DEF2 DEF2blahblah I need to be able to rapidly access the information in table 2 either through the BILLING_CODE, or directly through the ACCOUNT_CODE. I can create a POJO containing the BILLING_CODE and a List object to hold a second POJO for the table 2 info. Or I can use a Map. Either way doesn't give me a good method of accessing the table 2 information based on ACCOUNT_CODE. Two other bits of info - the combined number of records exceeds 300,000, so I have a scaling issue. Second, I'd like to load everything in a plug-in using iBatis dbLayer and store it in application scope (to eliminate db calls as the webapp is used.) That is ridiculous!! Why stop there, why not just write your own SQL engine in Java? Say 300,000 records times 500 bytes for each record in memory... I can't begin to ... You can easily get sub second response scelable, that is a very, very, small database for a SQL engine. Post the the SQL command that is giving you performance problem. What DB are you using? iBatis is nicely going to cache duplicate requests and flush, that's all, its a DAO. .V Does anyone have any experience in handling something like this? How did you do it? Thanks... Jerry Jalenak Development Manager, Web Publishing LabOne, Inc. 10101 Renner Blvd. Lenexa, KS 66219 (913) 577-1496 [EMAIL PROTECTED] This transmission (and any information attached to it) may be confidential and is intended solely for the use of the individual or entity to which it is addressed. If you are not the intended recipient or the person responsible for delivering the transmission to the intended recipient, be advised that you have received this transmission in error and that any use, dissemination, forwarding, printing, or copying of this information is strictly prohibited. If you have received this transmission in error, please immediately notify LabOne at the following email address: [EMAIL PROTECTED] -- Victor Cekvenich, Struts Instructor (215) 321-9146 Advanced Struts Training http://basebeans.com/do/cmsPg?content=TRAINING Server Side Java training with Rich UI, mentoring, designs, samples and project recovery in North East.
Re: multibox - Null attribute name ServletException
Thanks for your response. Could you give me some hint? I'm a struts newbie. Thanks a lot. - Original Message - From: Firat TIRYAKI [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, November 06, 2003 11:04 PM Subject: Re: multibox - Null attribute name ServletException store the properties in a bean and recall them in your action. F. - Original Message - From: ZYD [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, November 06, 2003 3:52 AM Subject: multibox - Null attribute name ServletException I tried to use multibox. I copied the code snippet from Struts in Action, but I got: [ServletException in:/WEB-INF/jsp/form/multiboxTest.jsp] Null attribute name' --- This is my multiboxTest.jsp: %@ 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:form action=/Multibox table border=0 width=100% logic:iterate id=item property=items html:multibox property=selectedItems bean:write name=item/ /html:multibox bean:write name=item/ /logic:iterate !-- Buttons -- tr td html:submit property=ok onclick=bCancel=false; bean:message key=button.ok/ /html:submit nbsp; html:submit property=cancel onclick=bCancel=true; bean:message key=button.cancel/ /html:submit /td /tr /table /html:form --- This is my ActionForm: MultiboxForm .java public class MultiboxForm extends ActionForm { private String[] selectedItems = {}; private String[] items = { UPS, FedEx, Airborne }; public String[] getSelectedItems() { return this.selectedItems; } public void setSelectedItems(String[] selectedItems) { this.selectedItems = selectedItems; } public ActionErrors validate( ActionMapping mapping, HttpServletRequest request) { ActionErrors errors = new ActionErrors(); return errors; } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT - Design] Needing Fast Access to 300,000 Records
This should all be done is SQL. At a design stage, you take your outputs (mock up html pages or reports. I am sure you or anyone has a screen with 30,000 records on it, or even a 1,000) and do some data model. Based on your analysis you should know the SQL. If this is hard for you, then attach a html mock up of you screen one and screen 2. I will write the SQL for you based on those requirements. So far I think it's a simple 2 way join (people write 12 way joins, or 10 page stored procs, quite possible you are concrend about a problem that does not exist. I tell you it's sub second! Also you just went from 300,000 to 30,000... maybe it's 3,000 or 3,000,000. It does not mater the records, it's a 2 way equi join. ) Recomendation to the list: Please read Celcko's SQL for Smarties, my all time fave for designers. .V Jerry Jalenak wrote: Vic - This is still in the design stage, so I don't have a SQL statement to provide. I'm looking for the best approach to handling what is essentially a table lookup where I need two keys (BILLING_ACCOUNT and ACCOUNT_CODE) The scenario is this: When one of my clients logs on to the webapp, the app determines the BILLING_ACCOUNTs the client has assigned, then explodes the BILLING_ACCOUNTs into the composite ACCOUNT_CODES. As an example, I've got one client with 54 BILLING_ACCOUNTs; these explode to over 30,000 ACCOUNT_CODES. I am trying to eliminate 30,000 db calls to get the account information - that's why I'm looking to pre-load the table(s) in a plug-in and access everything in memory. Make sense? Jerry Jalenak Development Manager, Web Publishing LabOne, Inc. 10101 Renner Blvd. Lenexa, KS 66219 (913) 577-1496 [EMAIL PROTECTED] -Original Message- From: Vic Cekvenich [mailto:[EMAIL PROTECTED] Sent: Thursday, November 06, 2003 8:46 AM To: [EMAIL PROTECTED] Subject: Re: [OT - Design] Needing Fast Access to 300,000 Records Jerry Jalenak wrote: Hi All - I've been trying to figure out a good way of handling something, and just can't quite seem to get a grip on the best approach. Here's what I've got: Two database tables - Table 1 has a BILLING_CODE and an ACCOUNT_CODE. Table 2 has the ACCOUNT_CODE and other account information (name, address, etc.) The tables are linked by ACCOUNT_CODE. Table 1: Table 2: BILLING_CODEACCOUNT_CODE ACCOUNT_CODENAMEADDRESS ... 1234ABC1 ABC1blahblah 1234ABC2 ABC2blahblah 1234ABC3 ABC3blahblah 5678DEF1 DEF1blahblah 5678DEF2 DEF2blahblah I need to be able to rapidly access the information in table 2 either through the BILLING_CODE, or directly through the ACCOUNT_CODE. I can create a POJO containing the BILLING_CODE and a List object to hold a second POJO for the table 2 info. Or I can use a Map. Either way doesn't give me a good method of accessing the table 2 information based on ACCOUNT_CODE. Two other bits of info - the combined number of records exceeds 300,000, so I have a scaling issue. Second, I'd like to load everything in a plug-in using iBatis dbLayer and store it in application scope (to eliminate db calls as the webapp is used.) That is ridiculous!! Why stop there, why not just write your own SQL engine in Java? Say 300,000 records times 500 bytes for each record in memory... I can't begin to ... You can easily get sub second response scelable, that is a very, very, small database for a SQL engine. Post the the SQL command that is giving you performance problem. What DB are you using? iBatis is nicely going to cache duplicate requests and flush, that's all, its a DAO. .V Does anyone have any experience in handling something like this? How did you do it? Thanks... Jerry Jalenak Development Manager, Web Publishing LabOne, Inc. 10101 Renner Blvd. Lenexa, KS 66219 (913) 577-1496 [EMAIL PROTECTED] This transmission (and any information attached to it) may be confidential and is intended solely for the use of the individual or entity to which it is addressed. If you are not the intended recipient or the person responsible for delivering the transmission to the intended recipient, be advised that you have received this transmission in error and that any use, dissemination, forwarding, printing, or copying of this information is strictly prohibited. If you have received this transmission in error, please immediately notify LabOne at the following email address: [EMAIL PROTECTED] -- Victor Cekvenich, Struts Instructor (215) 321-9146 Advanced Struts Training http://basebeans.com/do/cmsPg?content=TRAINING Server Side Java training with Rich UI, mentoring, designs, samples and project recovery in North
Re: Access message resources from Action?
Excellent, thanks. Kris Schneider wrote: Acton.getResources(HttpServletRequest) or Acton.getResources(HttpServletRequest, String) Then: MessageResources.getMessage(Locale, String) Quoting Brice Ruth [EMAIL PROTECTED]: This seems like a simple thing to do, and I could swear I've seen it answered on the list - but I can't find it! How do I access the message resources that I get at from a JSP using bean:write locale=localeObj key=message.key/ from an Action? -- Brice D. Ruth Sr. IT Analyst Fiskars Brands, Inc. -- Brice D. Ruth Sr. IT Analyst Fiskars Brands, Inc. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Token and workflow
Hi everyone, I asked for some questions about token and double submissions a couple of weeks ago. Today, i'm back to that problem and more specifically on the workflow. The double submission detection is Ok. But i don't know how to retrieve the normal flow of the application. I explain myself : In my Prepare Action, i use the saveToken() method. Then, the JSP is shown and the user can fill the form. In my Process Action, i use the isTokenValid() then resetToken() methods. If there's just one submission, everything works fine. If there's a double submission, my Process Action class detects it and returns to the JSP (via the Prepare Action class) with an error message on the screen. Everything's fine until this point. But then, what happens ? The user can see the message but nothing can happen.. I can't retrieve the workflow of my application and the user remains on that page with this message whereas the first call of the Process Action class is already finished.. I spent a lot of time on the web searching for examples but unfortunatly, i couldn't find something that suits to my problem.. Thanks in advance, Frederic - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Security Filter - Active Authentication (Better)
I wrote an implementation of the Active Authentication idea introduced in Java Developers Journal. I like it much better than Security Filter. It allows me to use the TRUE container's standard authentication. Also, I get ALL the features that SecurityFilter provides and ALL the features of container based security. If you would like the code, I would be happy to share it. Also, I'd be happy to upload it to the struts sourceforge site. It is definetly something other people can use and is not specific to my apps. It is only specific to Struts. But, writing implementations for other Web MVC (Model 2) frameworks would be a snap. Brandon Goodin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Best Practices in Struts for Form objects?
Hello, If I have 5 Action classes that all need to reference the same Form object, should I map each Action to the same form name, or use different names for each of the Forms in the Actions? Does it make a difference if Im using session scope vs. request scope? Example using the same form names, same form class: form-bean name=pwForm type=mim.struts.form.SelectForm/ actionpath=/teacherPw type=mim.struts.action.pw.StudentPwAction name=pwForm scope=request validate=false parameter=dispatch forward name=success path=mim.pw.list/ /action actionpath=/studentPw type=mim.struts.action.pw.StudentPwAction name=pwForm scope=request validate=false parameter=dispatch forward name=success path=mim.pw.list/ /action ... 3 more actions Example using diferent form names, same form class: form-bean name=teacherpwForm type=mim.struts.form.SelectForm/ form-bean name=studentpwForm type=mim.struts.form.SelectForm/ actionpath=/teacherPw type=mim.struts.action.pw.StudentPwAction name=teacherpwForm scope=request validate=false parameter=dispatch forward name=success path=mim.pw.list/ /action actionpath=/studentPw type=mim.struts.action.pw.StudentPwAction name=studentpwForm scope=request validate=false parameter=dispatch forward name=success path=mim.pw.list/ /action ... 3 more actions Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT - Design] Needing Fast Access to 300,000 Records
[EMAIL PROTECTED] wrote: retrieving all the records because just in case the client may need them does not look very efficient approach to me. One never designs for all the exceptions of what might be, that would be a bad design. One designs for the likely case only, at least good designers do. The old 80/20 rule. (Unlikely excetiopns you deal with by doing exception procesing) But you design for the rule, else you are fighting your design. .V - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Best Practices in Struts for Form objects?
If all of your Forms have exactly the same properties then use the same form mapping for all your actions. If all of your Forms share some properties then use different forms for each action. Each of these forms would extend a generic form which extends of course ActionForm or ValidatorForm. Phil --- Michael Cardon [EMAIL PROTECTED] wrote: Hello, If I have 5 Action classes that all need to reference the same Form object, should I map each Action to the same form name, or use different names for each of the Forms in the Actions? Does it make a difference if Im using session scope vs. request scope? Example using the same form names, same form class: form-bean name=pwForm type=mim.struts.form.SelectForm/ actionpath=/teacherPw type=mim.struts.action.pw.StudentPwAction name=pwForm scope=request validate=false parameter=dispatch forward name=success path=mim.pw.list/ /action actionpath=/studentPw type=mim.struts.action.pw.StudentPwAction name=pwForm scope=request validate=false parameter=dispatch forward name=success path=mim.pw.list/ /action ... 3 more actions Example using diferent form names, same form class: form-bean name=teacherpwForm type=mim.struts.form.SelectForm/ form-bean name=studentpwForm type=mim.struts.form.SelectForm/ actionpath=/teacherPw type=mim.struts.action.pw.StudentPwAction name=teacherpwForm scope=request validate=false parameter=dispatch forward name=success path=mim.pw.list/ /action actionpath=/studentPw type=mim.struts.action.pw.StudentPwAction name=studentpwForm scope=request validate=false parameter=dispatch forward name=success path=mim.pw.list/ /action ... 3 more actions Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] = Java Web Application Architect mapimage.com - Java and GIS struts1.1:tomcat4.1.27:linuxRH8 __ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Best Practices in Struts for Form objects?
Hello it totally depends what you need. different names: if u use different names than there will be created five different forms, each under an other name. if all are in request it makes not really sense to do this because they are deleted if the request is over. but if you use them in session then it could make sense then you could have up to five formbeans in scope and get to their values every time, but you have to know which form you actually need if they are stored under the same name then only once is created the formbean so values will be availble for every action which uses it (except you explicite destroy it) Michael - Original Message - From: Michael Cardon [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, November 06, 2003 4:35 PM Subject: Best Practices in Struts for Form objects? Hello, If I have 5 Action classes that all need to reference the same Form object, should I map each Action to the same form name, or use different names for each of the Forms in the Actions? Does it make a difference if I'm using session scope vs. request scope? Example using the same form names, same form class: form-bean name=pwForm type=mim.struts.form.SelectForm/ actionpath=/teacherPw type=mim.struts.action.pw.StudentPwAction name=pwForm scope=request validate=false parameter=dispatch forward name=success path=mim.pw.list/ /action actionpath=/studentPw type=mim.struts.action.pw.StudentPwAction name=pwForm scope=request validate=false parameter=dispatch forward name=success path=mim.pw.list/ /action ... 3 more actions Example using diferent form names, same form class: form-bean name=teacherpwForm type=mim.struts.form.SelectForm/ form-bean name=studentpwForm type=mim.struts.form.SelectForm/ actionpath=/teacherPw type=mim.struts.action.pw.StudentPwAction name=teacherpwForm scope=request validate=false parameter=dispatch forward name=success path=mim.pw.list/ /action actionpath=/studentPw type=mim.struts.action.pw.StudentPwAction name=studentpwForm scope=request validate=false parameter=dispatch forward name=success path=mim.pw.list/ /action ... 3 more actions Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT - Design] Needing Fast Access to 300,000 Records
All, Thanks for the comments. It does appear that I am attempting to solve an easy the most difficult way possible. I'm going to go away now and spend some time with my handy dandy SQL book Thanks again! Jerry Jalenak Development Manager, Web Publishing LabOne, Inc. 10101 Renner Blvd. Lenexa, KS 66219 (913) 577-1496 [EMAIL PROTECTED] -Original Message- From: Vic Cekvenich [mailto:[EMAIL PROTECTED] Sent: Thursday, November 06, 2003 9:32 AM To: [EMAIL PROTECTED] Subject: Re: [OT - Design] Needing Fast Access to 300,000 Records [EMAIL PROTECTED] wrote: retrieving all the records because just in case the client may need them does not look very efficient approach to me. One never designs for all the exceptions of what might be, that would be a bad design. One designs for the likely case only, at least good designers do. The old 80/20 rule. (Unlikely excetiopns you deal with by doing exception procesing) But you design for the rule, else you are fighting your design. .V - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This transmission (and any information attached to it) may be confidential and is intended solely for the use of the individual or entity to which it is addressed. If you are not the intended recipient or the person responsible for delivering the transmission to the intended recipient, be advised that you have received this transmission in error and that any use, dissemination, forwarding, printing, or copying of this information is strictly prohibited. If you have received this transmission in error, please immediately notify LabOne at the following email address: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Best Practices in Struts for Form objects?
you probably only want one form set to request scope. If you use different forms, then that form is only valid for the one specific action it is associated with. For instance, if the submitting page contains a form that has a textbox where you can input your name. And you want to display the name on the next page using struts internal form processing, then the forms must be the same. As far as scope, I think you almost always want to use request scope. Session scope does wacky things. Don't think of the data as only being request scope - because as long as your workflow has that form in each page with the associated parameters(if you're not displaying them but need them preserved between requests - use html:hidden) then the data is almost like being session scoped. HTH, Ben From: Michael Cardon [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Best Practices in Struts for Form objects? Date: Thu, 6 Nov 2003 07:35:04 -0800 Hello, If I have 5 Action classes that all need to reference the same Form object, should I map each Action to the same form name, or use different names for each of the Forms in the Actions? Does it make a difference if Im using session scope vs. request scope? Example using the same form names, same form class: form-bean name=pwForm type=mim.struts.form.SelectForm/ actionpath=/teacherPw type=mim.struts.action.pw.StudentPwAction name=pwForm scope=request validate=false parameter=dispatch forward name=success path=mim.pw.list/ /action actionpath=/studentPw type=mim.struts.action.pw.StudentPwAction name=pwForm scope=request validate=false parameter=dispatch forward name=success path=mim.pw.list/ /action ... 3 more actions Example using diferent form names, same form class: form-bean name=teacherpwForm type=mim.struts.form.SelectForm/ form-bean name=studentpwForm type=mim.struts.form.SelectForm/ actionpath=/teacherPw type=mim.struts.action.pw.StudentPwAction name=teacherpwForm scope=request validate=false parameter=dispatch forward name=success path=mim.pw.list/ /action actionpath=/studentPw type=mim.struts.action.pw.StudentPwAction name=studentpwForm scope=request validate=false parameter=dispatch forward name=success path=mim.pw.list/ /action ... 3 more actions Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Frustrated with dial-up? Get high-speed for as low as $26.95. https://broadband.msn.com (Prices may vary by service area.) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Security Filter - Active Authentication (Better)
Hi Brandon, I would be very interested in your implementation. If you don't have it up somewhere already and you don't mind, can you send it to me? thanks, Hubert --- Brandon Goodin [EMAIL PROTECTED] wrote: I wrote an implementation of the Active Authentication idea introduced in Java Developers Journal. I like it much better than Security Filter. It allows me to use the TRUE container's standard authentication. Also, I get ALL the features that SecurityFilter provides and ALL the features of container based security. If you would like the code, I would be happy to share it. Also, I'd be happy to upload it to the struts sourceforge site. It is definetly something other people can use and is not specific to my apps. It is only specific to Struts. But, writing implementations for other Web MVC (Model 2) frameworks would be a snap. Brandon Goodin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Reusing Validation
Resending this since haven't got any responses for a day In summary, here is my question. For those needing more details, look at the entire text below. Is there a way to re-use the validation that is already built on all forms using validator framework? If so how? If not, how can I centralize my validation to one place? Thanks [EMAIL PROTECTED] 11/05/03 10:35AM Hi All, We are developing an intranet site to replace a legacy system which is in place. Legacy system does not have as much extensive validation as the new application does. Intranet site rollout is going to be phased out due to several reasons. While legacy system is up, we have a batch process that transfers data from legacy system to our new database. On the new application, data is entered using work flow format where all data is collected across forms into a mama bean. At the end summary page is presented before data is persisted to db. Most of form validation is done using validator framework. Now, users want to edit legacy data that has been brought over. When they open an existing event, we present them with summary page. Then the user has the option to go to any form in the wizard flow using navigation on left. Since legacy data is not validated, we would like to validate all the data in mama bean and present them with visual indicators for each form in the wizard flow that fails validation. This makes data clean-up very easy. Here is my question. Is there a way to re-use the validation that is already built on all forms using validator framework? If so how? If not, how can I centralize my validation to one place? Thanks for your time. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Security Filter - Active Authentication (Better)
I'm putting it together. If a committer on the Struts sf.net project wants to give me permissions to create a cvs project for this... I'd be happy to. Also, it would be nice to receive back contributions on how to make this better. I'll send a zip to anyone who wants it. Brandon Goodin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Which version of Commons Digester released with Struts 1.1
--- Philip Mark Donaghy [EMAIL PROTECTED] wrote: I would like to debug a problem that I have with Digester. The error is : java.lang.NoSuchMethodException: No such accessible method: addFormBeanConfig() on object: java.lang.String How can I get the version number that is distributed with Struts 1.1. It should be in the digester jar's MANIFEST file. David Phil = Java Web Application Architect mapimage.com - Java and GIS struts1.1:tomcat4.1.27:linuxRH8 __ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
logic:equal using form bean property?
Hi All, I am iterating over a collection and want to display only a single Object. I have a form property(pid) indicating the Object index within the collection. logic:iterate name=products id=product indexId=ctr logic:equal name=createInstanceForm property=pid value=%=ctr% This code generates the following error: Error: No applicable overload for the method named setValue was found in type org/apache/struts/taglib/logic/CompareTagBase. Perhaps you wanted the overloaded version void setValue(java.lang.String $1); instead? ' But when I use a request parameter to indicate the index it works fine: bean:parameter name=pid id=pid / logic:iterate name=products id=product indexId=ctr logic:equal name=pid value=%=ctr% Any help is much appreciated. Cheers, Greg Hess Software Engineer Wrapped Apps Corporation 275 Michael Cowpland Dr. Suite 201 Ottawa, Ontario K2M 2G2 Tel: (613) 591 -7552 Fax: (613) 591-0523 1 (877) 388-6742 www.wrappedapps.com
html:link
Is there any other way to create anchor link in struts 1.1 other than this html:link page=/jsp/employee/CreateEmp.jsp Create /html:link because the above link of code is not creating link in my JSP -- Kri$hn@ - ?: bus: mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] *: +1 (314) 331 - 9897 ?: per: [EMAIL PROTECTED] *: +1 (925) 864 - 0012
Re: logic:equal using form bean property?
If you're using a Servlet 2.3 container you should use the JSTL's c:forEach and c:if tags instead of the Struts tags. What do your getter and setter method for pid look like? David --- Greg Hess [EMAIL PROTECTED] wrote: Hi All, I am iterating over a collection and want to display only a single Object. I have a form property(pid) indicating the Object index within the collection. logic:iterate name=products id=product indexId=ctr logic:equal name=createInstanceForm property=pid value=%=ctr% This code generates the following error: Error: No applicable overload for the method named setValue was found in type org/apache/struts/taglib/logic/CompareTagBase. Perhaps you wanted the overloaded version void setValue(java.lang.String $1); instead? ' But when I use a request parameter to indicate the index it works fine: bean:parameter name=pid id=pid / logic:iterate name=products id=product indexId=ctr logic:equal name=pid value=%=ctr% Any help is much appreciated. Cheers, Greg Hess Software Engineer Wrapped Apps Corporation 275 Michael Cowpland Dr. Suite 201 Ottawa, Ontario K2M 2G2 Tel: (613) 591 -7552 Fax: (613) 591-0523 1 (877) 388-6742 www.wrappedapps.com http://www.wrappedapps.com __ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
radiobutton selected
Hello I use some radiobuttons. I read in the tips from Ted Husted to do it like this : logic:iterate id=i name=listLanguages html:radio property=langCode value=value idName=i/ bean:write name=i property=label/ /logic:iterate for (Iterator iter = list.iterator(); iter.hasNext();){ Language language = (Language) iter.next(); listLanguages.add(new LabelValueBean(language.getLangCode639(), language.getLangCode639())); } req.setAttribute (listLanguages,listLanguages); The next time the user comes on this page, I want the previously selected radiobutton to be selected. Can someone tell me exactly what I have to to, because I'm missing something Thanks Koen Boutsen FREE ADHD DVD or CD-Rom (your choice) - click here! http://ad.doubleclick.net/clk;6413623;3807821;f?http://mocda2.com/1/c/563632/131726/311392/311392 AOL users go here: http://ad.doubleclick.net/clk;6413623;3807821;f?http://mocda2.com/1/c/563632/131726/311392/311392 This offer applies to U.S. Residents Only - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: multibox - Null attribute name ServletException - SOLVED
I change html:iterate tag to: logic:iterate id=item name=multiboxTest property=items the =multiboxTest is the ActionForm bean's name in struts-config.xml. and add getter/setter for items, now it works. Thanks. bruce - Original Message - From: ZYD [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, November 06, 2003 10:23 AM Subject: Re: multibox - Null attribute name ServletException Thanks for your response. Could you give me some hint? I'm a struts newbie. Thanks a lot. - Original Message - From: Firat TIRYAKI [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, November 06, 2003 11:04 PM Subject: Re: multibox - Null attribute name ServletException store the properties in a bean and recall them in your action. F. - Original Message - From: ZYD [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, November 06, 2003 3:52 AM Subject: multibox - Null attribute name ServletException I tried to use multibox. I copied the code snippet from Struts in Action, but I got: [ServletException in:/WEB-INF/jsp/form/multiboxTest.jsp] Null attribute name' --- This is my multiboxTest.jsp: %@ 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:form action=/Multibox table border=0 width=100% logic:iterate id=item property=items html:multibox property=selectedItems bean:write name=item/ /html:multibox bean:write name=item/ /logic:iterate !-- Buttons -- tr td html:submit property=ok onclick=bCancel=false; bean:message key=button.ok/ /html:submit nbsp; html:submit property=cancel onclick=bCancel=true; bean:message key=button.cancel/ /html:submit /td /tr /table /html:form --- This is my ActionForm: MultiboxForm .java public class MultiboxForm extends ActionForm { private String[] selectedItems = {}; private String[] items = { UPS, FedEx, Airborne }; public String[] getSelectedItems() { return this.selectedItems; } public void setSelectedItems(String[] selectedItems) { this.selectedItems = selectedItems; } public ActionErrors validate( ActionMapping mapping, HttpServletRequest request) { ActionErrors errors = new ActionErrors(); return errors; } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: logic:equal using form bean property?
My container is Resin 2.1.10 supporting Servlet 2.3, but have not yet played with any JSTL tag's will convert as a last resort. The method signatures are as follows: public void setPid(String id) { m_pid = id; } public String getPid() { return m_pid; } Thanks, Greg -Original Message- From: David Graham [mailto:[EMAIL PROTECTED] Sent: Thursday, November 06, 2003 11:23 AM To: Struts Users Mailing List Subject: Re: logic:equal using form bean property? If you're using a Servlet 2.3 container you should use the JSTL's c:forEach and c:if tags instead of the Struts tags. What do your getter and setter method for pid look like? David --- Greg Hess [EMAIL PROTECTED] wrote: Hi All, I am iterating over a collection and want to display only a single Object. I have a form property(pid) indicating the Object index within the collection. logic:iterate name=products id=product indexId=ctr logic:equal name=createInstanceForm property=pid value=%=ctr% This code generates the following error: Error: No applicable overload for the method named setValue was found in type org/apache/struts/taglib/logic/CompareTagBase. Perhaps you wanted the overloaded version void setValue(java.lang.String $1); instead? ' But when I use a request parameter to indicate the index it works fine: bean:parameter name=pid id=pid / logic:iterate name=products id=product indexId=ctr logic:equal name=pid value=%=ctr% Any help is much appreciated. Cheers, Greg Hess Software Engineer Wrapped Apps Corporation 275 Michael Cowpland Dr. Suite 201 Ottawa, Ontario K2M 2G2 Tel: (613) 591 -7552 Fax: (613) 591-0523 1 (877) 388-6742 www.wrappedapps.com http://www.wrappedapps.com __ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree - 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]
Usar tipos de datos como Timestamp, BigDecimal
Deseo usar algunos tiops de datos como Timestamp, BigDecimal en algunos campos. Cuál sería la mejor manera de utilizarlos estos. 1.- Crear la clase ActionForm con todos los atributos como string para luego trasladarlos una vez validados a un Bean??? 2.- Crear los atributos en el ActionForm como Timestamp, BigDecimal, etc... pero el momento de asignarles me da errores.?? Por favor si me pueden ayudar. Gracias.
Dynamic Image from DB to JSP
Hi, I have an image in my Database and I want to display it. Before creating the jsp, I ask the image from the DB and put it in my modele (like a InputStream property named photo in an Employe class) In my JSP i want to display this image (so the property) Is it possible to give a binary directly to the html:img tag ? Can i write html:img src=employe.getPhoto()/ Thank's Marc - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Usar tipos de datos como Timestamp, BigDecimal
Milton, Lo major seria declararlos en el actionform como string. Marcos oliva -Original Message- From: Milton Benavides [mailto:[EMAIL PROTECTED] Sent: Thursday, November 06, 2003 8:33 AM To: [EMAIL PROTECTED] Subject: Usar tipos de datos como Timestamp, BigDecimal Deseo usar algunos tiops de datos como Timestamp, BigDecimal en algunos campos. Cuál sería la mejor manera de utilizarlos estos. 1.- Crear la clase ActionForm con todos los atributos como string para luego trasladarlos una vez validados a un Bean??? 2.- Crear los atributos en el ActionForm como Timestamp, BigDecimal, etc... pero el momento de asignarles me da errores.?? Por favor si me pueden ayudar. Gracias. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Dynamic Image from DB to JSP
When the browser encounters the IMG src=some.ext tag, it sends another request for the some.ext resource. You have to serve this through another servlet or action. --- Marc AMIR-TAHMASSEB [EMAIL PROTECTED] wrote: Hi, I have an image in my Database and I want to display it. Before creating the jsp, I ask the image from the DB and put it in my modele (like a InputStream property named photo in an Employe class) In my JSP i want to display this image (so the property) Is it possible to give a binary directly to the html:img tag ? Can i write html:img src=employe.getPhoto()/ Thank's Marc - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Usar tipos de datos como Timestamp, BigDecimal
Esta bien gracias: pero luego como los paso a un Bean que tiene los atributos con los tipos de datos correctos. debido a que luego debo pasar este bean a un EJB que tomará alguna acción.
RE: Dynamic Image from DB to JSP
Marc, That's a tricky one I've planned for but haven't started yet. My research showed the html:img tag should be used with a path. That path can invoke an action (direct, not tiled) that sets the content-type to the right type of image then tosses out the binary stream. So, it should be something like this: html:write get a URL such as /images.do?id=555 or http://somehost/images.do?id=555;. Then your map an action for /images to set the content type, open the database, and print the binary stream appropriately. Sounds a bit list an advertising program, almost. :) If something else works for you, please let me know as this is type of image display is on my to-do list. Regards, David -Original Message- From: Marc AMIR-TAHMASSEB [mailto:[EMAIL PROTECTED] Sent: Thursday, November 06, 2003 11:50 AM To: Struts Users Mailing List Subject: Dynamic Image from DB to JSP Hi, I have an image in my Database and I want to display it. Before creating the jsp, I ask the image from the DB and put it in my modele (like a InputStream property named photo in an Employe class) In my JSP i want to display this image (so the property) Is it possible to give a binary directly to the html:img tag ? Can i write html:img src=employe.getPhoto()/ Thank's Marc - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Security Filter - Active Authentication (Better)
I'm an idiot... I already have CVS access to the sf.net project. Hehe... I'll committ it there. But, I warn you... what I am putting in the CVS is not a full functioning web example... I'll add that later. But, for now it's just code that needs to be organized better. But, it does give you an idea of what is going on with Active Authentication. I'll try to get a working app up tonight. Brandon - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Dynamic Image from DB to JSP
You can also specify a default filename for the image through response.setHeader(Content-Disposition,filename= + imageFilename); so when the user attempts to save the image, he/she doesn't get images.do as the default. --- David Friedman [EMAIL PROTECTED] wrote: Marc, That's a tricky one I've planned for but haven't started yet. My research showed the html:img tag should be used with a path. That path can invoke an action (direct, not tiled) that sets the content-type to the right type of image then tosses out the binary stream. So, it should be something like this: html:write get a URL such as /images.do?id=555 or http://somehost/images.do?id=555;. Then your map an action for /images to set the content type, open the database, and print the binary stream appropriately. Sounds a bit list an advertising program, almost. :) If something else works for you, please let me know as this is type of image display is on my to-do list. Regards, David -Original Message- From: Marc AMIR-TAHMASSEB [mailto:[EMAIL PROTECTED] Sent: Thursday, November 06, 2003 11:50 AM To: Struts Users Mailing List Subject: Dynamic Image from DB to JSP Hi, I have an image in my Database and I want to display it. Before creating the jsp, I ask the image from the DB and put it in my modele (like a InputStream property named photo in an Employe class) In my JSP i want to display this image (so the property) Is it possible to give a binary directly to the html:img tag ? Can i write html:img src=employe.getPhoto()/ Thank's Marc - 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!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Usar tipos de datos como Timestamp, BigDecimal
Milton, Puedes usar el org.apache.commons.beanutils.BeanUtils.populate metodo o crear tu propio metodo en tu action class donde mapeas de string a el type que es correcto. Solamente que tienes que ser un poco cuidadoso con los Timestamp, you uso una conbinacion de BeanUtils populate y mis propios metodos. Marcos -Original Message- From: Milton Benavides [mailto:[EMAIL PROTECTED] Sent: Thursday, November 06, 2003 8:48 AM To: Struts Users Mailing List Subject: RE: Usar tipos de datos como Timestamp, BigDecimal Esta bien gracias: pero luego como los paso a un Bean que tiene los atributos con los tipos de datos correctos. debido a que luego debo pasar este bean a un EJB que tomará alguna acción. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Security Filter - Active Authentication (Better)
okay... I didn't want to commit it to the Struts sf.net cvs until I had it working as a functioning example web app. So, I have my rudimentary conglomeration of files at: http://www.phase.ws/security/security.zip Look for a working example over the next few days on the sourceforge struts project cvs. Thanks, Brandon - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
getting current session in ActionForm
Hi, I get my default values from ActionForm object. But I can not implement localization feature to default values. Because, I can not get current session and struts LOCALE_KEY attribute from session in form object. How can I get current session object in my form object? Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: getting current session in ActionForm
you can do it during the reset which is sent the request along with the actionmapping. I believe the Artimus example does some clever locale_key setting like this. c On Thursday 06 November 2003 18:09, Taner Diler wrote: Hi, I get my default values from ActionForm object. But I can not implement localization feature to default values. Because, I can not get current session and struts LOCALE_KEY attribute from session in form object. How can I get current session object in my form object? Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Redirect to remote website using ActionForward
Hi. Is it possible to redirect to a completely custom URL outside application context using ActionForward? I can see from the docs that I could use a ForwardConfig, but I cannot return a such from the Action execute methods. I could use response.sendRedirect(..) and return null I guess, but that's not nice. Morten - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts Dilemma
Often when writing a bean for use by a tag, I seem to be writing a equivalent method that returns a string value for a boolean property. For example: If I mean to pass a boolean property isInactive, I am also writing a getInactiveFlag which returns N or Y based on isInactive. I use inactiveFlag in my tag definition and inside my tag I check for Y or N. Am I totally missing something or is there a better way to do this? TIA - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Question on storing bean in request context
Good morning (again) I have an Action that is retrieving a javabean object from my database (via iBATIS, thank you very much :)) and I need to store that bean somewhere where a Tile can access it. What I'm doing, is storing it in the request context (request.setAttribute(item,item)) and then my Action returns a forward that is mapped to a tile definition. That tile definition assembles a collection of tiles (which is all working) - the tile that needs to access the information in the bean, then does this: jsp:useBean id=item scope=request type=com.fiskars.webpdb.ItemBean But, when I try to output something, like c:out value=${item.productName} - I get nothing, no errors, no exceptions, nothing. Any ideas? -- Brice D. Ruth Sr. IT Analyst Fiskars Brands, Inc. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts Dilemma
Try the logic:notEqual or logic:equal tags... -Original Message- From: Srinivas Gunturu [mailto:[EMAIL PROTECTED] Sent: Thursday, November 06, 2003 12:30 PM Subject: Struts Dilemma Often when writing a bean for use by a tag, I seem to be writing a equivalent method that returns a string value for a boolean property. For example: If I mean to pass a boolean property isInactive, I am also writing a getInactiveFlag which returns N or Y based on isInactive. I use inactiveFlag in my tag definition and inside my tag I check for Y or N. Am I totally missing something or is there a better way to do this? TIA - 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]
Best Practice : session vs. request attributes
I'm questioning my current design practice regarding Struts forms. Until now, I tend to store all client data in the Struts form and I avoid using other request attributes or session attributes. But, this approach seems limited when I need to display a collection of objects that are very polymorphic. Let's say I need to display a collection of instances of different classes A1, A2 and A3, that all extend the same parent class A. A1, A2 and A3 have a very limited number of common properties (described in class A). If I store the collection of A's in the Struts form (as in indexed property), I do not know to to code a logic:iterate tag in the JSP in order to make sure that I won't loose data from request to request (what preoperty attribute can I write for this tag ?) : logic:iterate name=myForm property=collection_of_As id=A type=WHAT SHOULD I WRITE FOR THIS ATTRIBUTE Therefore, in this case, I want to use a session attribute to store the collection of As. Of course I won't loose client data from request to request (action forward). What is your point of view regarding this matter ? Is it OK using session attributes (performance, memory, etc. ), even if you make sure session attributes are removed when no more needed ? Fred - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts Dilemma
I think the best way to avoid this is to always use Strings and only Strings for all form values (except Collections). Then your action class can convert to/from the desired type when it creates the transfer object to pass to the business delegate. If you combine this approach with the struts validator then you know you can safely create the desired type (for instance java.util.Date) without throwing an exception. -Original Message- From: Srinivas Gunturu [mailto:[EMAIL PROTECTED] Sent: Thursday, November 06, 2003 12:30 PM Subject: Struts Dilemma Often when writing a bean for use by a tag, I seem to be writing a equivalent method that returns a string value for a boolean property. For example: If I mean to pass a boolean property isInactive, I am also writing a getInactiveFlag which returns N or Y based on isInactive. I use inactiveFlag in my tag definition and inside my tag I check for Y or N. Am I totally missing something or is there a better way to do this? TIA - 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: ActionMessage key location
Actually, it doesn't help. How do I then create an ActionMessage referencing the messagesOne resource? Lukas Hope this helps message-resources parameter=MyTerms null=false/ message-resources parameter=MyMsgs null=false key=messagesOne / message-resources parameter=resources.MyOtherMsgs null=false key=messagesTwo / Lukas Bradley [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi all, Is there any way to have an ActionMessage key/value pair defined in a property file other than the default message-resources parameter=MyTerms null=false/ location? It seems to be the only place my errors and messages can be found. Lukas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Question on storing bean in request context
You shouldn't need jsp:useBean. What happens with just: c:out value=${requestScope.item.productName}/ Quoting Brice Ruth [EMAIL PROTECTED]: Good morning (again) I have an Action that is retrieving a javabean object from my database (via iBATIS, thank you very much :)) and I need to store that bean somewhere where a Tile can access it. What I'm doing, is storing it in the request context (request.setAttribute(item,item)) and then my Action returns a forward that is mapped to a tile definition. That tile definition assembles a collection of tiles (which is all working) - the tile that needs to access the information in the bean, then does this: jsp:useBean id=item scope=request type=com.fiskars.webpdb.ItemBean But, when I try to output something, like c:out value=${item.productName} - I get nothing, no errors, no exceptions, nothing. Any ideas? -- Brice D. Ruth Sr. IT Analyst Fiskars Brands, Inc. -- 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]
Re: Best Practice : session vs. request attributes
Is it OK using session attributes (performance, memory, etc. ), even if you make sure session attributes are removed when no more needed ? I ALLWAYS use session for form bean and then clean up. I allways use request for read only beans (c:out, display tag, etc.) And there is a non-standard thing I do with formbeans, that is I implement Collection at BaseBean and have a DAO helper. Makes OO much cleaner. hth, .V - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Question on storing bean in request context
Um (embarrassed) ... I forgot to import the JSTL core taglib ... (/me hides head) Kris Schneider wrote: You shouldn't need jsp:useBean. What happens with just: c:out value=${requestScope.item.productName}/ Quoting Brice Ruth [EMAIL PROTECTED]: Good morning (again) I have an Action that is retrieving a javabean object from my database (via iBATIS, thank you very much :)) and I need to store that bean somewhere where a Tile can access it. What I'm doing, is storing it in the request context (request.setAttribute(item,item)) and then my Action returns a forward that is mapped to a tile definition. That tile definition assembles a collection of tiles (which is all working) - the tile that needs to access the information in the bean, then does this: jsp:useBean id=item scope=request type=com.fiskars.webpdb.ItemBean But, when I try to output something, like c:out value=${item.productName} - I get nothing, no errors, no exceptions, nothing. Any ideas? -- Brice D. Ruth Sr. IT Analyst Fiskars Brands, Inc. -- Brice D. Ruth Sr. IT Analyst Fiskars Brands, Inc. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]