Re: Re[2]: Are you sure?
Hi Dima, list, [Dima wrote] we tried to use this (form.onsumbit=return f()) but encountered a problem: if JavaScript is disabled in browser the submiting goes on without confirmation dialogue and other stuff done by JS (wich in our case was more important). We solved this by setting input.type=button instead of submit and submitting the form from JacaScript. But this caused another problem (though less important): now user can not submit form pressing Enter being at text input, he must click the button. [end of quote] Personally, I would not consider this as a problem. I noticed that quite some users mistakenly press the Enter key, without yet wanting to submit. So I tried your sollution, and it works fine, making the html:submit into a html:button, which calls a javascript function which calls submit. But since the official submit button has now disappeared, pressing enter results in the next button being processed by default, which is the cancel button (which I would not want either). So by implementing this, I cannot use html:cancel anymore. What would be the best sollution for that? I thought of putting a javascript function goCancel() under a html:button, which does this: document.myform.action=somenextpage.do; document.myform.submit(); However I wonder if there are any smarter sollutions. Is there for example some way to set IsCancelled to true from the jsp, so I can just use the same actions as i do with submit? thanks, Rinke Tuesday, March 23, 2004, 11:43:54 AM, you wrote: JS Try with this - JS html:form action=/adddate JS name=dateForm JS type=nl.rinke.DateForm JS onsubmit=return areyousure() JS Should work JS -Original Message- JS From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] JS Sent: Tuesday, March 23, 2004 3:10 PM JS To: [EMAIL PROTECTED] JS Subject: are you sure? JS Hi list, JS Still a struts newbie, I try to write an are you sure javascript JS confirmation box for my submit button. JS The question is: how can I prevent the form from being submitted JS when the user clicks no? JS In the Jsp, I put the following code in the head: JS SCRIPT LANGUAGE=javascript JSfunction areyousure(){ JS var agree = false; JS agree = confirm(are you sure?); JS if(agree){ JS ... some code which is not important JS } JS return agree; JS} JS /SCRIPT JS And the form tag looks like this: JS html:form action=/adddate JS name=dateForm JS type=nl.rinke.DateForm JS onsubmit=areyousure() JS Whatever the user clicks, yes or no, the form JS gets submitted. I want to stop submitting the JS form when the user click no. JS thanks, Rinke JS - JS To unsubscribe, e-mail: struts-user- [EMAIL PROTECTED] JS For additional commands, e-mail: [EMAIL PROTECTED] JS - JS To unsubscribe, e-mail: struts-user- [EMAIL PROTECTED] JS For additional commands, e-mail: [EMAIL PROTECTED] -- Best regards, Dmitriimailto:[EMAIL PROTECTED] - To unsubscribe, e-mail: struts-user- [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] colorparam0100,0100,0100/param--- End of forwarded message --- --- End of forwarded message --- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
are you sure?
Hi list, Still a struts newbie, I try to write an are you sure javascript confirmation box for my submit button. The question is: how can I prevent the form from being submitted when the user clicks no? In the Jsp, I put the following code in the head: SCRIPT LANGUAGE=javascript function areyousure(){ var agree = false; agree = confirm(are you sure?); if(agree){ ... some code which is not important } return agree; } /SCRIPT And the form tag looks like this: html:form action=/adddate name=dateForm type=nl.rinke.DateForm onsubmit=areyousure() Whatever the user clicks, yes or no, the form gets submitted. I want to stop submitting the form when the user click no. thanks, Rinke - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to set the selected value in an select rendered by optionsCollection
Hi Nagiel, if (sb.getTitle().equals(Mr.)) formularBean.setTestSelect(sb.getTitle()) in your preprocessing action class to set the value of testSelect, which will automatically add the SELECTED attribute on the option tag? because of the fact, that i´ve got no access to this bean in my preprocessing action. testSelect is a member of the upcoming DynaActionValidatorForm with is initiatet during the html:form/ tag of my JSP. You are right the sbBean and the DynaActionValidatorForm have exactly the same members which seems to be a big design failure in my application. I should get rid of the sbBean and initiate the DynaActionValidatorForm earlier in my preprocessing action. But how ??? Does anyone have an example how to retrieve a DynaActionValidatorForm from the mapping ? And, if i use the DynaActionValidatorForm earlier in my preprocessing action, store it in requestScope, does the html:form/ Tag take notice of it, or simply 'overrides' it ? It is my first Struts app and this is quit complex for me, hope Nagiel or someone else will help. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
row counts in logic:iterate...
colorparam0100,0100,0100/paramnewbie question: I have a jsp which displays several rows with a logic:iterate, also using the indexId-tag. colorparam7F00,,7F00/paramFontFamilyparamCourier New/paramlogic:iteratecolorparam,,/param colorparam,7F00,/paramnamecolorparam,,/param=colorparam,,FF00/paramdateFormcolorparam,,/param colorparam,7F00,/parampropertycolorparam,,/param=colorparam,,FF00/paramrawcolorparam,,/param colorparam,7F00,/paramidcolorparam,,/param=colorparam,,FF00/paramfoocolorparam,,/param colorparam,7F00,/paramindexIdcolorparam,,/param=colorparam,,FF00/paramctrcolorparam,,/param colorparam7F00,,7F00/paramcolorparam,,/param colorparam0100,0100,0100/paramFontFamilyparamArial/param I'd like to display row numbers in my table. But the ctr-variable is 0- based, and I would like to present 1 as the first number to my users. Now, this should work, isn't it?? tdboldcolorparam7F00,,/paramFontFamilyparamCourier New/param%=/boldcolorparam0100,0100,0100/param colorparam,,/paramctrcolorparam0100,0100,0100/param colorparam,,/param+colorparam0100,0100,0100/param colorparam,,/param1colorparam0100,0100,0100/param boldcolorparam7F00,,/param%/td /bold/colorFontFamilyparamARIAL/paramI would guess: ctr and 1 are added, and is then cast to a string, and then print it in my table column. Then why do i get this error? colorparam0100,0100,0100/paramFontFamilyparamTimes New Roman/parambiggeroperator + cannot be applied to java.lang.Integer,int [javac] out.print( ctr + 1 ); ^ It also does not work when I create a new variabel with %! int i=0; %, and then try to set this i as i = ctr + 1, same error. So how can I get this row number printed in my table, inside the jsp?? RinkeFontFamilyparamArial/paramsmaller - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
(Fwd) row counts in logic:iterate...
Sorry, my mailer messed up the last one, so here again... newbie question: I have a jsp which displays several rows with a logic:iterate, also using the indexId-tag. logic:iterate name=dateForm property=raw id=foo indexId=ctr I'd like to display row numbers in my table. But the ctr-variable is 0- based, and I would like to present 1 as the first number to my users. Now, this should work, isn't it?? td%= ctr + 1 %/td I would guess: ctr and 1 are added, and is then cast to a string, and then printed in my table column. Then why do i get this error? operator + cannot be applied to java.lang.Integer, int [javac] out.print( ctr + 1 ); It also does not work when I create a new variable with %! int i=0; % , and then try to set this i as i = ctr + 1, same error. So how can I get this row number printed in my table, inside the jsp, as ctr + 1??? Rinke - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: error no getter method defined while inside logic:iterate
Hi Niall, List thanks for you answer. I tried out you suggestion (literary and in several variations), but it does not help: still the same error. no getter defined. If you have any other suggestions, I'd be happy. Otherwise I will just try a workaround which is not such a nice sollution, but it will work I guess: just put everything, all different fields, in one long array, in stead of working with the array[0].fieldname option. rinke On 25 Feb 2004, at 10:00, Niall Pemberton wrote: Inside the logic:iterate the beans returned by your getRaw() method should be exposed with the name you specify in the iterate's 'id' attribute. So something along the lines of. logic:iterate name=dateForm property=raw id=foo indexId=ctr tr tdbean:write name=ctr //td tdhtml:text name=foo property=time //td /tr /logic:iterate Niall - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, February 24, 2004 12:11 PM Subject: error no getter method defined while inside logic:iterate Hi list, I am having a form which contains a single property, an array with RawRecord, a simple java bean which simply contains 4 strings, including getters, setters and a constructor. In my jsp, it works fine when i make a call like this: html:text name=dateForm property=rawRecord[1].time / where dateform is the name of my action form, and rawRecord is the array in which the RawRecord beans reside. However, as soon as I put this inside a logic:iterate loop, all goes wrong: I get the following error: No getter for property time of bean org.apache.struts.taglib.html.BEAN which is a lie, because there is a getter for my property, otherwise the thing wouldn't have been working without the logic:iterate tag. The jsp looks like this: logic:iterate name=dateForm property=raw id=foo indexId=ctr tr td%= ctr %/td td html:text name=dateForm property=rawRecord[1].time / /td ... The DateForm looks like this public class DateForm extends ActionForm { //fields private RawRecord raw[]; public DateForm() { raw = new RawRecord[3]; raw[0] = new RawRecord(,,,); raw[0] = new RawRecord(,,,); raw[0] = new RawRecord(,,,); } //getters setters public RawRecord getRawRecord(int index) { return raw[index]; } public RawRecord[] getRaw { return raw; } public void setRaw(RawRecord[] records) { raw = records; } + some reset stuff The RawRecord bean is really just a class with four strings as fields, + getters + setters + a constructor I did not include struts-config.xml, because it is correct: the dateform is normally declared as a form bean, and the action is not even used yet, as the error takes place before that stage. And struts-config worked without that logic:iterate tag... SO, how can I get this to work inside the logic:iterate tags?? What am i doing wrong here?? thanks, Rinke - 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]
error no getter method defined while inside logic:iterate
Hi list, I am having a form which contains a single property, an array with RawRecord, a simple java bean which simply contains 4 strings, including getters, setters and a constructor. In my jsp, it works fine when i make a call like this: html:text name=dateForm property=rawRecord[1].time / where dateform is the name of my action form, and rawRecord is the array in which the RawRecord beans reside. However, as soon as I put this inside a logic:iterate loop, all goes wrong: I get the following error: No getter for property time of bean org.apache.struts.taglib.html.BEAN which is a lie, because there is a getter for my property, otherwise the thing wouldn't have been working without the logic:iterate tag. The jsp looks like this: logic:iterate name=dateForm property=raw id=foo indexId=ctr tr td%= ctr %/td td html:text name=dateForm property=rawRecord[1].time / /td ... The DateForm looks like this public class DateForm extends ActionForm { //fields private RawRecord raw[]; public DateForm() { raw = new RawRecord[3]; raw[0] = new RawRecord(,,,); raw[0] = new RawRecord(,,,); raw[0] = new RawRecord(,,,); } //getters setters public RawRecord getRawRecord(int index) { return raw[index]; } public RawRecord[] getRaw { return raw; } public void setRaw(RawRecord[] records) { raw = records; } + some reset stuff The RawRecord bean is really just a class with four strings as fields, + getters + setters + a constructor I did not include struts-config.xml, because it is correct: the dateform is normally declared as a form bean, and the action is not even used yet, as the error takes place before that stage. And struts-config worked without that logic:iterate tag... SO, how can I get this to work inside the logic:iterate tags?? What am i doing wrong here?? thanks, Rinke - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
multiple records in one form
Hi List, I would like to create a form, with which the user fills in a number of say 10 records, in one and the same form. When clicking submit, all of the 10 records (with each 4 fields) should be updated to the database simulataneously. I found an item in the archives about this, but the answer, a single phrase use indexed properties was too cryptic for me as a newby to struts. I know I have to use String array properties (String[]) in stead of normal String properties, and use a logic:iteratetag, but I cannot seem to get it to work. I am not sure how to set the exact attributes of the logic:iterate tag, and how to point them to which Collection, and I seem to have problems too with the id attribute of logic:iterate: though I set it, the following bean:write name=... does not seem to connect to this id attribute - which it should if I understand it well. I get an error that the bean with this name is unknown. Does somebody have a working example for me available, which I could try out? I am real new to this, so I am afraid that short cryptic answers won't do for me :-( but working examples will help a lot more... :-) thanks, Rinke - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
spontaneous disappering ApplicationResources.properties
Hi list, I have a weird problem with all of my struts applications. the file ApplicationResources.properties, usually in WEB- INF/classes, is disappearing spontaneously every now and then. this happens with all of my projects. I tried and set the attributes of the file on read-only, but that does not help. Though i learned to live with it by having backups available, it is quite irritating. Has anyone else experienced this? Is it some weird setting or what? I'm using Eclipse 2.1.0 on a win2000 platform. Thanks, Rinke - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Link and Arrays
Hello everyone.. I have a problem and I would like to know if anyone knows an answer to this problem .. I have a string array (String[] tokens) with some values and I want to use one of those values as a value for a paramater of a link I'm using... Here is what I tried to do: html:link forward=somewhere paramId=noteId paramName=tokens[1]somewhere/html:link Thanks in advance for any advice! mail2web - Check your email from the web at http://mail2web.com/ . - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat 5
Hi friends, Anybody using Tomcat 5? Everything allright with it? Specially when using it with struts. Paulo
Re: dynamic generation of select fields problem
Ruben, I guess that you can't access a property using a sintax of function in: html-el:select property=value(campos${st.count}) Maybe you need to use the sintax of array: html-el:select property=value[campos${st.count}] Certo? Paulo Marcio - Original Message - From: Ruben Pardo [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, December 05, 2003 4:07 PM Subject: dynamic generation of select fields problem Hi everybody! This is my problem, i've to generate a variable quantity of select fields. The solution i thougth was a map backed form, that dynamically generate the names of this fields with JSTL, something like this: c:forEach items=${sessionScope} var =farmacia varStatus=st . html-el:select property=value(campos${st.count}) .. .. /html:select /c:forEach but qhen i try to run this, i've got an NullPointerException saying me that no getter for property value(campo1) ... I don't know what could be the problem, or how i can solve in other way. Thanks a lot and any type of help could be aprecciated. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
checkbox onclick event not getting called
Hi, My code is like the following, when I click the checkbox, nothing happened (the 'add' button suppose to get disabled). I put a alert statment in the javascript, and didn't get it showed when click the checkbox... seems the function didn't get called at all, can anybody tell me why? Thanks a lot! SCRIPT LANGUAGE=JavaScript function check(element) { alert(getting called); document.myform.add.disabled = ( element.checked ); } html:form action=myAction name=myForm html:submit propery=add value=Add/ input type=checkbox onclick=check(this) name=myname value=myvalue/ - Do you Yahoo!? Free Pop-Up Blocker - Get it now
RE: checkbox onclick event not getting called
It's still not working. Any other option? I am using Mozilla, will that be the reason? Jimmy Emmanual [EMAIL PROTECTED] wrote:try onclick=check(this.myname) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 25, 2003 11:20 AM To: [EMAIL PROTECTED] Subject: checkbox onclick event not getting called Hi, My code is like the following, when I click the checkbox, nothing happened (the 'add' button suppose to get disabled). I put a alert statment in the javascript, and didn't get it showed when click the checkbox... seems the function didn't get called at all, can anybody tell me why? Thanks a lot! function check(element) { alert(getting called); document.myform.add.disabled = ( element.checked ); } [input] - Do you Yahoo!? Free Pop-Up Blocker - Get it now - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Free Pop-Up Blocker - Get it now
disable submit button unless all required fields are filled
Hi, I want to have the submit button disabled unless the required text field is filled by the user. I have two buttons in the form, submit and cancel. The cancel button should always be enabled. Can anybody help me? Please! Thanks in advance! - Do you Yahoo!? Free Pop-Up Blocker - Get it now
Re: AW: JavaScript function inside JSP not working
Thanks for all the input. So what's the solution to my problem, can anybody give me a sample code? --- [EMAIL PROTECTED] wrote: Hi Firat, thanks for your answer - i'm not sure, but i guess the origin question is about refering to a form element by name, not by index. Problems potentially occur, if a JSP is composed dynamically by multiple JSP fragments, declaring their own form tags. Hence you maybe can't refer a certain form within the JSP by index, because the position within the view isn't clear. Greetings Mario -Ursprüngliche Nachricht- Von: Firat TIRYAKI [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 20. November 2003 10:05 An: Struts Users Mailing List Betreff: Re: JavaScript function inside JSP not working If you are trying to refer to one of the forms in your document, there is an array object holding all the forms in JavaScript. So you can call your form by; myForm=document.forms[0]; now myForm is the object that holds the reference to your first form in the browser. F. - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, November 20, 2003 10:58 AM Subject: AW: JavaScript function inside JSP not working Hi, as far as i know, the html:form-tag doesn't support an attribute called 'name'. Maybe you'll take a look at http://jakarta.apache.org/struts/userGuide/struts-html.html#form (if there is a way to give the form element a name in order to refer to it by this name, i am very interested in the answer :o)) Greetings Mario Gleichmann -Ursprungliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 20. November 2003 04:57 An: [EMAIL PROTECTED] Betreff: JavaScript function inside JSP not working I include the following javascript function in my .jsp file, but this function is not being called at all. I won't even get any javascript error on build if I tried to change to some bogus function name, Can anybody please tell me why? What I want to do here is: disable the submit button until the required text field was filled. SCRIPT LANGUAGE=JavaScript function checkField() { return(!document.form1.textfield.value == ) } /SCRIPT html:form action=myAction name=form1 onsubmit=checkField() html:text property=textfield html:submit property=submit value=Submit /html:form __ Do you Yahoo!? Free Pop-Up Blocker - Get it now http://companion.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - 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!? Free Pop-Up Blocker - Get it now http://companion.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How to identify submit button in JSP
Hi, I am new to struts, now I have trouble figuring this out. I do need to have this done, please help! My problem is the submit button didn't react to changes on checkbox, is that because I didn't identify the button correctly or anything else I did wrong? My jsp code is like the following: (if I add 'disabled=true' in submit, the button will always be disabled). SCRIPT LANGUAGE=JavaScript function Disable() { frm=document.forms[form1] if(frm.ids.checked) {frm.modify.disabled=false} else {frm.modify.disabled=true} } /SCRIPT html:form action=/Myaction name=form1 type=MyformType input type=submit name=add value=Add/ input type=submit name=modify value=Modify/ input type=submit name=delete value=Delete/ % while (iterator.hasNext()) { String v1=...; % input type=checkbox name=ids value=v1 onClick=Disable();/something % } % What I eventually want to do is to disable this 'modify' button when no checkbox or more than one are selected. In other word, only enable it when only one checkbox is selected, this is just the first step, but it's not working. Thanks in advance! __ 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: How to identify submit button in JSP
That's what I did. But the 'modify' button didn't react at all. --- Yann Lebreton [EMAIL PROTECTED] wrote: Try: function Disable() { frm=document.forms['form1'] if(frm.ids.checked) {frm.modify.disabled=false} else {frm.modify.disabled=true} } Or simpler: function Disable() { frm=document.form1; frm.modify.disabled = !( frm.ids.checked ); } -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 19, 2003 8:30 AM To: [EMAIL PROTECTED] Subject: How to identify submit button in JSP Hi, I am new to struts, now I have trouble figuring this out. I do need to have this done, please help! My problem is the submit button didn't react to changes on checkbox, is that because I didn't identify the button correctly or anything else I did wrong? My jsp code is like the following: (if I add 'disabled=true' in submit, the button will always be disabled). SCRIPT LANGUAGE=JavaScript function Disable() { frm=document.forms[form1] if(frm.ids.checked) {frm.modify.disabled=false} else {frm.modify.disabled=true} } /SCRIPT html:form action=/Myaction name=form1 type=MyformType input type=submit name=add value=Add/ input type=submit name=modify value=Modify/ input type=submit name=delete value=Delete/ % while (iterator.hasNext()) { String v1=...; % input type=checkbox name=ids value=v1 onClick=Disable();/something % } % What I eventually want to do is to disable this 'modify' button when no checkbox or more than one are selected. In other word, only enable it when only one checkbox is selected, this is just the first step, but it's not working. Thanks in advance! __ 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] __ 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: How to identify submit button in JSP
Well, I have a couple of other forms with the same form name 'idForm' but diffrent action, does that cause the problem? How should I handle that? I checked the form name in html output, it is right. I didn't get any javascript error. Thanks. --- Yann Lebreton [EMAIL PROTECTED] wrote: Do you have other forms in the page? In the html output did you check the form name? Do you get a javascript error ? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 19, 2003 9:41 AM To: Struts Users Mailing List Subject: RE: How to identify submit button in JSP That's what I did. But the 'modify' button didn't react at all. --- Yann Lebreton [EMAIL PROTECTED] wrote: Try: function Disable() { frm=document.forms['form1'] if(frm.ids.checked) {frm.modify.disabled=false} else {frm.modify.disabled=true} } Or simpler: function Disable() { frm=document.form1; frm.modify.disabled = !( frm.ids.checked ); } -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 19, 2003 8:30 AM To: [EMAIL PROTECTED] Subject: How to identify submit button in JSP Hi, I am new to struts, now I have trouble figuring this out. I do need to have this done, please help! My problem is the submit button didn't react to changes on checkbox, is that because I didn't identify the button correctly or anything else I did wrong? My jsp code is like the following: (if I add 'disabled=true' in submit, the button will always be disabled). SCRIPT LANGUAGE=JavaScript function Disable() { frm=document.forms[form1] if(frm.ids.checked) {frm.modify.disabled=false} else {frm.modify.disabled=true} } /SCRIPT html:form action=/Myaction name=form1 type=MyformType input type=submit name=add value=Add/ input type=submit name=modify value=Modify/ input type=submit name=delete value=Delete/ % while (iterator.hasNext()) { String v1=...; % input type=checkbox name=ids value=v1 onClick=Disable();/something % } % What I eventually want to do is to disable this 'modify' button when no checkbox or more than one are selected. In other word, only enable it when only one checkbox is selected, this is just the first step, but it's not working. Thanks in advance! __ 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] __ 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] __ 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]
JavaScript function inside JSP not working
I include the following javascript function in my .jsp file, but this function is not being called at all. I won't even get any javascript error on build if I tried to change to some bogus function name, Can anybody please tell me why? What I want to do here is: disable the submit button until the required text field was filled. SCRIPT LANGUAGE=JavaScript function checkField() { return(!document.form1.textfield.value == ) } /SCRIPT html:form action=myAction name=form1 onsubmit=checkField() html:text property=textfield html:submit property=submit value=Submit /html:form __ Do you Yahoo!? Free Pop-Up Blocker - Get it now http://companion.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
reacting to changes on the checkbox
I wonder if there is a struts way for reacting to changes on the checkbox and making changes to other controls as a result. What I would like to happen is to disable a submit button when no checkbox is selected, and enable it when only one checkbox is selected, disable it again if more than one checkbox are selected. Can anybody show me a example code? Thanks a bunch! __ 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:select
how can i default a countrylist, i mean set the selected country ? I want the selected to be 'BE' my code: html:select property=user.countryCode styleClass=contentsmall html:options labelProperty=nam collection=countriesList property=countryId / /html:select Thanks ! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Dynamic Layouts in Tiles
Is there any reason why I cannot use the names in tiles definitions in tiles-def.xml as the reference in forwards inside Action subclasses? Can I just use return (new ActionForward([NAME OF TILES DEFINITION])); rather than, e.g., return (new ActionForward(mapping.getInput()));? Thanks, Micael - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
validation
Question: Is there an easy way to create a dummy field for 'retype pasword' ? And is it possible to validate this retype 'password field' with the validator plugin ? If so how ? Thanks ! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
format string bean write - property editor
Hello I read this mailing list since 1 year, but it is my first question :-) I have a bean with a string property, this string is big and it is not a trouble but in one use of the bean:write in a jsp, i wish to reduce on the screen the size of the string (but not in the bean) I can't find any use of PropertyEditor, perhaps is it a good idea? perhaps do you have other idea ? I can perhaps to extend the tag with a new attribut like maxscreensize, what do you think about it ? many think in advance ** L'ADSL A 20 EUR/MOIS** Avec Tiscali, l'ADSL est à 20 EUR/mois. Vous pourrez chercher longtemps avant de trouver moins cher ! Pour profiter de cette offre exceptionnelle, cliquez ici : http://register.tiscali.fr/adsl/ Offre soumise à conditions. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
validator
Hello all: I'm having problems using the Validator plugin to check a date field. In the form i have a simple textbox and I'm using the following validation: field property=users.userDate depends=date arg0 key=user.date/ var var-namedatePattern/var-name var-valueMM/dd//var-value /var /field On submit I get the error: datePattern has no properties. I traced down the error to a line of code where de length of the variables is tested: if(datePattern.lenght0){ This code is generated by Validator so I don't know what to do about it. Any ideas? Thanks in advanced. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to pull messages from multiple Bundles?
I asked virtually the same question yesterday and got a similar answer. Unfortunately this seems to imply that the jsp has to know about how you arrange your message files which is disappointing. - Original Message - From: Thomas Cornet [EMAIL PROTECTED] Newsgroups: Struts Sent: Wednesday, September 17, 2003 8:04 AM Subject: Re: How to pull messages from multiple Bundles? I'm doing the same thing on my current webapp. You can define as many ressources as you want in your struts-config.xml. Let's define two ressources in your struts-config.xml kile this (the bundle attribute allows to identify ressources) message-resources parameter=package.ressources.default / message-resources key=buttons parameter=package.ressources.buttons / message-resources key=errors parameter=package.ressources.errors / and one in your struts-config-module.xml message-resources parameter=package.module.ressources.default / Then, in your module page : a) doing bean:message key=my.key / will search the property in 'package/module/ressources/default.properties' b) doing bean:message bundle=errors key=invalid / will get the message from 'package/ressources/errors/properties' Conclusion : you can split all your general messages into several message-ressources in your struts-config.xml, and each bundle will be accessible from any module. HTH, Thomas At 18:14 17/09/2003, you wrote: Hi, I want to seperate my message bundle into multiple bundles instead of just using one big block. (For eg) GenericMessages error.invalid={0} contians invalid data. Module1Messages invalid.amount={0} must be atleast 5. I do my validation by myself (not using the Validator) So the application component that identifies these errors creates action errors like: ActionError e= new ActionError(error.invalid, arg1); and then add the ActionErrors to the request scope and they are displayed via html:errors tag Now if all the keys comes from the same bundle it is not a problem. If i want to display both the messages error.invalid invalid.amount how would i do that? Appreciate any help Manglu - 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]
Multiple message resource files
I am trying to use 2 message resource files in my application. My struts-config.xml has: message-resources parameter=ApplicationResources null=false / message-resources parameter=MyWebAppResources null=false / The errors are added in an Action bean with statements like: errors.add(ToteNotFound, new ActionError(error.tote.toteNotFound)); and displayed on the jsp with: html:errors/ However, messages are only displayed from the last file listed in struts-config.xml (in this example, from MyWebResources.properties). Any message in the other file is not recognised and results in something like: ???en_US.error.tote.toteNotFound??? How do I persuade my application to display errors from either of two files? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tiles Definition problem
Bryce, You don't have to write the path wbeginning witha a slash. Try this: forward name=defaulttile redirect=true path=default.layout/ Antonio Gonzalez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How to get Messages Resources from the validate method?
In order to avoid using the deprecated getResources method from the ActionServlet, I would like to know how to get access to the module message resources bundles configured in the struts-config.xml from the ActionForm validate method. Thanks. Antonio Gonzalez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: RE: Does Tiles supports skins???
Cal, Thanks, it works but I have an additional question. Creating a tiles action and using the findAttributeNames method of the Component Context, I get only the put attributes, but how can I get the path of the definition?, because I have different layouts for the skins. I read in the Tiles Advanced Features how can I switch the path including a path with the Request Dispatcher class, but I should read first the path attribute to change the skin directory. Thanks in advance. Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Does Tiles supports skins???
Hi, I am am newbie working with Struts and Tiles and I am having problems to develop and application that the user can make a choice among the differents skins from the application. The layout I'm currently using is the classic one (header, menu, body and footer) Each skin has its own css's, layouts, images, and the header, menu and footer. I have the tiles defined in the tile-defs.xml for the default skin and my first thought was to overload the whole tile definition at runtime through a jsp,using the user skin preference that I have in session. But does not work, because when I put in the value a %= = the results is an empty string form this tile. Does someone know a method to do this? Thanks folks. Antonio González - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts + jetty
i would like to know if anyone has successfully installed struts on jetty and what problems they ran into. I am developing a struts application that i would like to integrate with jetty to form a standalone application. thanks Louis
messages into struts 1.1
Hi everyone, Is anybody knows how to use messages system of struts. I just want to print some information on the user screen, so I use an ActionMessages object, then i fill it with ActionMessage, I save it, and in my jsp, I use the tag html:messages id=messages in which messages is the name of my svaed object, but nothing is printed out? So perhaps I do not use correctly this? Cheers Pierre Accédez au courrier électronique de La Poste : www.laposte.net ; 3615 LAPOSTENET (0,34/mn) ; tél : 08 92 68 13 50 (0,34/mn) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Io exception
I'm trying to install our app at a new client. Everything seems to normal - Tomcat is OK, my app comes up - but I can't get a connection to the database. Here the error: Io exception: The Network Adapter could not establish the connection. Any suggestions? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
bean:write question
hello i have a class wich contains another class like class user which contains a class adress in a response. i'd like to write the properties in a jsp it morks well for the property of user with bean:write, but the property adress write the reference (call .toString()). that's what i waited, but not wanted :-) is there a simple way to write the property of adress ? (i have to logic:iterate around it) thanks Julien Gaucher - SPECIAL ADSL L'ADSL à partir de 15,95 EUR/mois et le modem ADSL offert ? C'est en exclusivité chez Tiscali ! Pour profiter de cette offre, cliquez ici: http://register.tiscali.fr/adsl/ Offre soumise à conditions. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: bean:write question
hello i have a class wich contains another class like class user which contains a class adress in a response. i'd like to write the properties in a jsp bean:write name=user property=address.city / hth, Tib thanks couldn't have been more simple ! - SPECIAL ADSL L'ADSL à partir de 15,95 EUR/mois et le modem ADSL offert ? C'est en exclusivité chez Tiscali ! Pour profiter de cette offre, cliquez ici: http://register.tiscali.fr/adsl/ Offre soumise à conditions. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Compiling Javascript files in order to render tags
Hi There, I'm trying to implement bilingual Javascript menues in my Struts web application. My server is SilverStream 3.7. The problem is that the .js files are not compiled so the menu labels are left as 'bean:message key=label.options /' instead of being compiled into 'Options'. I don't want to include all the javascript in my page because I need it accessable to several pages. Has anyone come across this problem, or know how to compile .js files? Thanks, Kim - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Validator Question
K Pullin Upgrading from 1.1 beta 2 to beta 3 got rid of this problem for me. However upgrading to RC1 introduced a further problem - see my message to the group of a few minutes ago. rt. --- In [EMAIL PROTECTED], [EMAIL PROTECTED] wrote: I've got 3 fields on a form and in the validation.xml file I have all 3 fields as required. I also have other criteria on the fields - range checks, masks, number of characters, etc... When I submit the form, it first checks to see if the required fields have values in them. If so, it then goes on to the other check. What is happening though is that until I enter in values to all of the required fields, it will not check the additional rules around the other fields. I can understand that this should happen when a field is blank, but it shouldn't affect the other fields on the screen from validating the rest of their rules in they have values. I have the following setup: Field 1: (left blank) Field 2: (left blank) Field 3: Test I have a rule around Field 3 that says it must be numeric. But if I leave the first 2 fields blank, then the test of Field 3 is not occuring until I enter in values in the other fields. 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: Where are my ActionForm's changes?
I removed name and type attributes from my html:form tag. I also changed the name of the form in action-mappings but still the same problem. Is there a bug in Struts that the nested tags don't work with objects? Thanks, Marwan --- In [EMAIL PROTECTED], Sri Sankaran [EMAIL PROTECTED] wrote: Get rid of the 'name' and 'type' attributes from the html:form. The reasons? * they are deprecated. See http://jakarta.apache.org/struts/userGuide/struts-html.html#form * they are not necessary * in your case the action mapping is referring to the form-bean by the name 'myForm' and the html:form's 'name' attribute is indicating that a form named 'updateOrderForm' be used. These will result in two instances of the same class. Not what you want Hope that helps Sri -Original Message- From: MarwanSalam [EMAIL PROTECTED] [mailto:marwansalam@y...] Sent: Thursday, February 20, 2003 3:58 PM To: [EMAIL PROTECTED] Subject: Re: Where are my ActionForm's changes? Hi Sri, You got it right. This is the code from my Action class that checks for the changes and forwards the request to the same page again(I tried to forward to a view-only page(showorderdetails.jsp) for testing purposes and the changes still were not reflected). UpdateOrdersAction.java - UpdateOrderForm updateOrderForm = (UpdateOrderForm) form; if (updateOrder.equalsIgnoreCase(action)) { List parametersList = updateOrderForm.getParameterList(); int size = parametersList.size(); for (int i = 0; i size; i++) { OrderDetailModel model = ((UpdateOrderForm) form).getOrderDetail (i); logger.debug(Form model is: + model); } Iterator iter = parametersList.iterator(); if (logger.isDebugEnabled()) { while (iter.hasNext()) { OrderDetailModel orderDetail = (OrderDetailModel)iter.next(); logger.debug(orderDetail.toString()); } } logger.debug( Forwarding to 'edit' page); NDC.pop(); return (mapping.findForward(edit)); // this will take you back to the same page } Here is an excerpt from updateorder.jsp: - html:form action=updateOrder name=updateOrderForm type=mypackage.UpdateOrderForm scope=session html:hidden property=action value=updateOrder / logic:iterate id=parameter name=updateOrderForm property=parameterList tr tdbean:write name=parameter property=orderLineNumber //td tdbean:write name=parameter property=itemName //td tdbean:write name=parameter property=quantityOrdered //td tdhtml:text name=parameter property=quantityCancelled indexed=true size=3 maxlength=3//td tdhtml:text name=parameter property=status indexed=true size=3 maxlength=3//td /tr /logic:iterate html:submit/ /html:form I appreciate your help. Marwan --- In [EMAIL PROTECTED], Sri Sankaran [EMAIL PROTECTED] wrote: What I have gleaned so far, is * the user is viewing JSP-1 * the user updates the data and submits (invoking the action mapping you have shown (path=/updateOrder) Questions: * Are you detecting the updated data value(s) in your action? * Where is the user being directed? If showorderdetails.jsp or updateorder.jsp what is mapping for those pages? * Where are you noticing problems? Remember that if you go to new page and it uses a form-bean of the same class but referred to by a different name, a new instance will be used. Sri -Original Message- From: MarwanSalam [EMAIL PROTECTED] [mailto:marwansalam@y...] Sent: Thursday, February 20, 2003 1:55 PM To: [EMAIL PROTECTED] Subject: Re: Where are my ActionForm's changes? Thanks Sri for the quick reply. The first of two assumptions you mentioned below are not true but I am not sure about the third one: forwarding to an action that is re- initializing the form. My ActionForm.reset() is as follows: public void reset(ActionMapping mapping, HttpServletRequest request) { action = null; } And here is my action-mapping: action path=/updateOrder type=MyAction name=myForm scope=session validate=false input=/updateorder.jsp forward name=update path=/showorderdetails.jsp/ forward name=edit path=/updateorder.jsp/ /action The reset method does not have any code that initializes the form parameters so I don't know why this is happening. Marwan --- In [EMAIL PROTECTED], Sri Sankaran [EMAIL PROTECTED] wrote: I'm not sure I understand completely. Are you returning to the same page after the form is submitted? What are you doing in the reset() and Action? That notwithstanding, here are some possibilities: * The text fields are not within a form * You are re-directing to the page and not forwarding * You are forwarding (or redirecting) to an action that is re-initializing the form
Re: Where are my ActionForm's changes?
Hi Sri, Below is the generated HTML source. It indicates the correct form name updateOrderForm. The debug statements are all over the place and they do not indicate any updated value from my form. That's the weired thing. Nothing is changed inside the form and nothing is changed in the Action either. form name=updateOrderForm method=post action=/supplyWeb/updateOrder.do input type=hidden name=action value=updateOrder Thanks, Marwan --- In [EMAIL PROTECTED], Sri Sankaran [EMAIL PROTECTED] wrote: Are the debug statements in the action showing the updated values? Can you check the source of the generated HTML and ensure that the name of the form matches the value of the 'name' attribute of your action mapping? Sri -Original Message- From: MarwanSalam [EMAIL PROTECTED] [mailto:marwansalam@y...] Sent: Friday, February 21, 2003 11:22 AM To: [EMAIL PROTECTED] Subject: Re: Where are my ActionForm's changes? I removed name and type attributes from my html:form tag. I also changed the name of the form in action-mappings but still the same problem. Is there a bug in Struts that the nested tags don't work with objects? Thanks, Marwan --- In [EMAIL PROTECTED], Sri Sankaran [EMAIL PROTECTED] wrote: Get rid of the 'name' and 'type' attributes from the html:form. The reasons? * they are deprecated. See http://jakarta.apache.org/struts/userGuide/struts-html.html#form * they are not necessary * in your case the action mapping is referring to the form-bean by the name 'myForm' and the html:form's 'name' attribute is indicating that a form named 'updateOrderForm' be used. These will result in two instances of the same class. Not what you want Hope that helps Sri -Original Message- From: MarwanSalam [EMAIL PROTECTED] [mailto:marwansalam@y...] Sent: Thursday, February 20, 2003 3:58 PM To: [EMAIL PROTECTED] Subject: Re: Where are my ActionForm's changes? Hi Sri, You got it right. This is the code from my Action class that checks for the changes and forwards the request to the same page again(I tried to forward to a view-only page(showorderdetails.jsp) for testing purposes and the changes still were not reflected). UpdateOrdersAction.java - UpdateOrderForm updateOrderForm = (UpdateOrderForm) form; if (updateOrder.equalsIgnoreCase(action)) { List parametersList = updateOrderForm.getParameterList(); int size = parametersList.size(); for (int i = 0; i size; i++) { OrderDetailModel model = ((UpdateOrderForm) form).getOrderDetail (i); logger.debug(Form model is: + model); } Iterator iter = parametersList.iterator(); if (logger.isDebugEnabled()) { while (iter.hasNext()) { OrderDetailModel orderDetail = (OrderDetailModel)iter.next(); logger.debug(orderDetail.toString()); } } logger.debug( Forwarding to 'edit' page); NDC.pop(); return (mapping.findForward(edit)); // this will take you back to the same page } Here is an excerpt from updateorder.jsp: - html:form action=updateOrder name=updateOrderForm type=mypackage.UpdateOrderForm scope=session html:hidden property=action value=updateOrder / logic:iterate id=parameter name=updateOrderForm property=parameterList tr tdbean:write name=parameter property=orderLineNumber //td tdbean:write name=parameter property=itemName //td tdbean:write name=parameter property=quantityOrdered //td tdhtml:text name=parameter property=quantityCancelled indexed=true size=3 maxlength=3//td tdhtml:text name=parameter property=status indexed=true size=3 maxlength=3//td /tr /logic:iterate html:submit/ /html:form I appreciate your help. Marwan --- In [EMAIL PROTECTED], Sri Sankaran [EMAIL PROTECTED] wrote: What I have gleaned so far, is * the user is viewing JSP-1 * the user updates the data and submits (invoking the action mapping you have shown (path=/updateOrder) Questions: * Are you detecting the updated data value(s) in your action? * Where is the user being directed? If showorderdetails.jsp or updateorder.jsp what is mapping for those pages? * Where are you noticing problems? Remember that if you go to new page and it uses a form-bean of the same class but referred to by a different name, a new instance will be used. Sri -Original Message- From: MarwanSalam [EMAIL PROTECTED] [mailto:marwansalam@y...] Sent: Thursday, February 20, 2003 1:55 PM To: [EMAIL PROTECTED] Subject: Re: Where are my ActionForm's changes? Thanks Sri for the quick reply. The first of two assumptions you mentioned below are not true but I am not sure about the third one: forwarding to an action that is re- initializing the form. My
Re: Where are my ActionForm's changes?
That was the output of the JSP on the client side. This is the source JSP: html:form action=updateOrder html:hidden property=action value=updateOrder / logic:iterate id=parameter name=updateOrderForm property=parameterList tr tdbean:write name=parameter property=orderLineNumber //td tdbean:write name=parameter property=itemName //td tdbean:write name=parameter property=quantityOrdered //td tdhtml:text name=parameter property=quantityShipped indexed=true size=3 maxlength=3//td tdhtml:text name=parameter property=comment indexed=true size=20 maxlength=20//td /tr /logic:iterate html:submit/ /html:form Marwan --- In [EMAIL PROTECTED], Ray Madigan [EMAIL PROTECTED] wrote: Should the form really be html:form and input be some other html -Original Message- From: Sri Sankaran [mailto:Sri.Sankaran@s...] Sent: Friday, February 21, 2003 10:41 AM To: Struts Users Mailing List Subject: RE: Where are my ActionForm's changes? Sorry; nothing jumps out from what you have sent. Sri -Original Message- From: Marwan [EMAIL PROTECTED] [mailto:marwansalam@y...] Sent: Friday, February 21, 2003 12:08 PM To: [EMAIL PROTECTED] Subject: Re: Where are my ActionForm's changes? Hi Sri, Below is the generated HTML source. It indicates the correct form name updateOrderForm. The debug statements are all over the place and they do not indicate any updated value from my form. That's the weired thing. Nothing is changed inside the form and nothing is changed in the Action either. form name=updateOrderForm method=post action=/supplyWeb/updateOrder.do input type=hidden name=action value=updateOrder Thanks, Marwan --- In [EMAIL PROTECTED], Sri Sankaran [EMAIL PROTECTED] wrote: Are the debug statements in the action showing the updated values? Can you check the source of the generated HTML and ensure that the name of the form matches the value of the 'name' attribute of your action mapping? Sri -Original Message- From: MarwanSalam [EMAIL PROTECTED] [mailto:marwansalam@y...] Sent: Friday, February 21, 2003 11:22 AM To: [EMAIL PROTECTED] Subject: Re: Where are my ActionForm's changes? I removed name and type attributes from my html:form tag. I also changed the name of the form in action-mappings but still the same problem. Is there a bug in Struts that the nested tags don't work with objects? Thanks, Marwan --- In [EMAIL PROTECTED], Sri Sankaran [EMAIL PROTECTED] wrote: Get rid of the 'name' and 'type' attributes from the html:form. The reasons? * they are deprecated. See http://jakarta.apache.org/struts/userGuide/struts- html.html#form * they are not necessary * in your case the action mapping is referring to the form-bean by the name 'myForm' and the html:form's 'name' attribute is indicating that a form named 'updateOrderForm' be used. These will result in two instances of the same class. Not what you want Hope that helps Sri -Original Message- From: MarwanSalam [EMAIL PROTECTED] [mailto:marwansalam@y...] Sent: Thursday, February 20, 2003 3:58 PM To: [EMAIL PROTECTED] Subject: Re: Where are my ActionForm's changes? Hi Sri, You got it right. This is the code from my Action class that checks for the changes and forwards the request to the same page again(I tried to forward to a view-only page(showorderdetails.jsp) for testing purposes and the changes still were not reflected). UpdateOrdersAction.java - UpdateOrderForm updateOrderForm = (UpdateOrderForm) form; if (updateOrder.equalsIgnoreCase(action)) { List parametersList = updateOrderForm.getParameterList(); int size = parametersList.size(); for (int i = 0; i size; i++) { OrderDetailModel model = ((UpdateOrderForm) form).getOrderDetail (i); logger.debug(Form model is: + model); } Iterator iter = parametersList.iterator(); if (logger.isDebugEnabled()) { while (iter.hasNext()) { OrderDetailModel orderDetail = (OrderDetailModel)iter.next(); logger.debug(orderDetail.toString()); } } logger.debug( Forwarding to 'edit' page); NDC.pop(); return (mapping.findForward(edit)); // this will take you back to the same page } Here is an excerpt from updateorder.jsp: - html:form action=updateOrder name=updateOrderForm type=mypackage.UpdateOrderForm scope=session html:hidden property=action value=updateOrder / logic:iterate id=parameter name=updateOrderForm property=parameterList tr tdbean:write name=parameter property=orderLineNumber //td tdbean:write name=parameter property=itemName //td tdbean:write name=parameter property=quantityOrdered //td tdhtml:text name=parameter property
Where are my ActionForm's changes?
Hi, I am using the login:iterate tag to display a collection of objects. The objects have attributes that some can be edited by the user. After the user changes some values and submits back to the Action class, the values that were changed in the JSP are not reflected in the form. I know that because I tried to iterate through the collection and displayed the values retained from both the ActionForm.reset() and from the Action class. No changes are retained; only the original values. I am using Struts 1.1-b3. Here is my ActionForm: private List parameterList = new ArrayList(); public List getParameterList() { return parameterList; } public void setParameterList(List parameterList) { this.parameterList = parameterList; } public MyObject getMyObject(int index) { return (MyObject) parameterList.get(index); } What's wrong? Marwan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Where are my ActionForm's changes?
Thanks Sri for the quick reply. The first of two assumptions you mentioned below are not true but I am not sure about the third one: forwarding to an action that is re- initializing the form. My ActionForm.reset() is as follows: public void reset(ActionMapping mapping, HttpServletRequest request) { action = null; } And here is my action-mapping: action path=/updateOrder type=MyAction name=myForm scope=session validate=false input=/updateorder.jsp forward name=update path=/showorderdetails.jsp/ forward name=edit path=/updateorder.jsp/ /action The reset method does not have any code that initializes the form parameters so I don't know why this is happening. Marwan --- In [EMAIL PROTECTED], Sri Sankaran [EMAIL PROTECTED] wrote: I'm not sure I understand completely. Are you returning to the same page after the form is submitted? What are you doing in the reset() and Action? That notwithstanding, here are some possibilities: * The text fields are not within a form * You are re-directing to the page and not forwarding * You are forwarding (or redirecting) to an action that is re-initializing the form. Will need to see the necessary action mappings too. Sri -Original Message- From: MarwanSalam [EMAIL PROTECTED] [mailto:marwansalam@y...] Sent: Thursday, February 20, 2003 1:09 PM To: [EMAIL PROTECTED] Subject: Where are my ActionForm's changes? Hi, I am using the login:iterate tag to display a collection of objects. The objects have attributes that some can be edited by the user. After the user changes some values and submits back to the Action class, the values that were changed in the JSP are not reflected in the form. I know that because I tried to iterate through the collection and displayed the values retained from both the ActionForm.reset() and from the Action class. No changes are retained; only the original values. I am using Struts 1.1-b3. Here is my ActionForm: private List parameterList = new ArrayList(); public List getParameterList() { return parameterList; } public void setParameterList(List parameterList) { this.parameterList = parameterList; } public MyObject getMyObject(int index) { return (MyObject) parameterList.get(index); } What's wrong? Marwan -- --- 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: Where are my ActionForm's changes?
Hi Sri, You got it right. This is the code from my Action class that checks for the changes and forwards the request to the same page again(I tried to forward to a view-only page(showorderdetails.jsp) for testing purposes and the changes still were not reflected). UpdateOrdersAction.java - UpdateOrderForm updateOrderForm = (UpdateOrderForm) form; if (updateOrder.equalsIgnoreCase(action)) { List parametersList = updateOrderForm.getParameterList(); int size = parametersList.size(); for (int i = 0; i size; i++) { OrderDetailModel model = ((UpdateOrderForm) form).getOrderDetail(i); logger.debug(Form model is: + model); } Iterator iter = parametersList.iterator(); if (logger.isDebugEnabled()) { while (iter.hasNext()) { OrderDetailModel orderDetail = (OrderDetailModel)iter.next(); logger.debug(orderDetail.toString()); } } logger.debug( Forwarding to 'edit' page); NDC.pop(); return (mapping.findForward(edit)); // this will take you back to the same page } Here is an excerpt from updateorder.jsp: - html:form action=updateOrder name=updateOrderForm type=mypackage.UpdateOrderForm scope=session html:hidden property=action value=updateOrder / logic:iterate id=parameter name=updateOrderForm property=parameterList tr tdbean:write name=parameter property=orderLineNumber //td tdbean:write name=parameter property=itemName //td tdbean:write name=parameter property=quantityOrdered //td tdhtml:text name=parameter property=quantityCancelled indexed=true size=3 maxlength=3//td tdhtml:text name=parameter property=status indexed=true size=3 maxlength=3//td /tr /logic:iterate html:submit/ /html:form I appreciate your help. Marwan --- In [EMAIL PROTECTED], Sri Sankaran [EMAIL PROTECTED] wrote: What I have gleaned so far, is * the user is viewing JSP-1 * the user updates the data and submits (invoking the action mapping you have shown (path=/updateOrder) Questions: * Are you detecting the updated data value(s) in your action? * Where is the user being directed? If showorderdetails.jsp or updateorder.jsp what is mapping for those pages? * Where are you noticing problems? Remember that if you go to new page and it uses a form-bean of the same class but referred to by a different name, a new instance will be used. Sri -Original Message- From: MarwanSalam [EMAIL PROTECTED] [mailto:marwansalam@y...] Sent: Thursday, February 20, 2003 1:55 PM To: [EMAIL PROTECTED] Subject: Re: Where are my ActionForm's changes? Thanks Sri for the quick reply. The first of two assumptions you mentioned below are not true but I am not sure about the third one: forwarding to an action that is re- initializing the form. My ActionForm.reset() is as follows: public void reset(ActionMapping mapping, HttpServletRequest request) { action = null; } And here is my action-mapping: action path=/updateOrder type=MyAction name=myForm scope=session validate=false input=/updateorder.jsp forward name=update path=/showorderdetails.jsp/ forward name=edit path=/updateorder.jsp/ /action The reset method does not have any code that initializes the form parameters so I don't know why this is happening. Marwan --- In [EMAIL PROTECTED], Sri Sankaran [EMAIL PROTECTED] wrote: I'm not sure I understand completely. Are you returning to the same page after the form is submitted? What are you doing in the reset() and Action? That notwithstanding, here are some possibilities: * The text fields are not within a form * You are re-directing to the page and not forwarding * You are forwarding (or redirecting) to an action that is re-initializing the form. Will need to see the necessary action mappings too. Sri -Original Message- From: MarwanSalam [EMAIL PROTECTED] [mailto:marwansalam@y...] Sent: Thursday, February 20, 2003 1:09 PM To: [EMAIL PROTECTED] Subject: Where are my ActionForm's changes? Hi, I am using the login:iterate tag to display a collection of objects. The objects have attributes that some can be edited by the user. After the user changes some values and submits back to the Action class, the values that were changed in the JSP are not reflected in the form. I know that because I tried to iterate through the collection and displayed the values retained from both the ActionForm.reset() and from the Action class. No changes are retained; only the original values. I am using Struts 1.1-b3. Here is my ActionForm: private List parameterList = new ArrayList(); public List getParameterList() { return parameterList; } public void setParameterList(List parameterList) { this.parameterList = parameterList; } public MyObject getMyObject(int index
Could not find Java 1.4 encode method
Hi, I upgraded from Struts v1.02 to v1.1-b3 and now I am getting the below error stack. Doesn't 1.1-b3 run on JRE 1.3.1? Marwan 2003-02-19 13:49:00,383 [8585544 DEBUG Servlet.Engine.Transports:9 - util.RequestUtils(1869)] - Could not find Java 1.4 encode method. Using deprecated version. java.lang.NoSuchMethodException: encode at java.lang.Class.getMethod0(Native Method) at java.lang.Class.getMethod(Class.java:928) at org.apache.struts.util.RequestUtils.encodeURL (RequestUtils.java:1859) at org.apache.struts.util.RequestUtils.computeURL (RequestUtils.java:514) at org.apache.struts.taglib.html.LinkTag.calculateURL (LinkTag.java:495) at org.apache.struts.taglib.html.LinkTag.doStartTag(LinkTag.java:353) at _showcategories_jsp_57._jspService(_showcategories_jsp_57.java:278) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:142) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.runtime.JspServlet$JspServletWrapper.service (JspServlet.java:312) at org.apache.jasper.runtime.JspServlet.serviceJspFile (JspServlet.java:487) at org.apache.jasper.runtime.JspServlet.service(JspServlet.java:620) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.ibm.servlet.engine.webapp.StrictServletInstance.doService (ServletManager.java:827) at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service (StrictLifecycleServlet.java:167) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Struts and Design Patterns
Figures... I own the book and left it at work. Anyone care to save me a trip into the office to verify this? Thanks, Matt --- In [EMAIL PROTECTED], Jerome Jacobsen [EMAIL PROTECTED] wrote: This has already been done by Ted in his book, I think. At least in the downloadable draft version there is a Patterns chapter. Actually it is Appendix D. -Original Message- From: Matt Raible [mailto:matt@r...] Sent: Monday, February 17, 2003 11:57 AM To: [EMAIL PROTECTED] Subject: [OT] Struts and Design Patterns I'm writing a chapter on Struts for a book, Professional JSP 2.0, from Wrox (http://www.wrox.com/books/1861008325.htm). The reason I'm sending this post is to verify my belief of the different design patterns that Struts implements. From the Core J2EE Design Patterns book (by Alur, Crupi, and Malks), there are 6 patterns discussed: Intercepting Filter Front Controller View Helper Composite View Service to Worker Dispatcher View In Struts, I'm assuming the following: Front Controller (ActionServlet) View Helper (ActionForm) Composite View (Tiles) Service to Worker (ActionServlet to your Actions) Dispatcher View (RequestProcessor) Thanks, Matt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Attribute indexed invalid according to the specified TLD
Hi, I am getting Attribute indexed invalid according to the specified TLD in my JSP. Here is part of my ActionForm: private List parameterList = new ArrayList(); public List getParameterList() { logger.debug(List size is: + this.parameterList.size()); return parameterList; } public void setParameterList(List parameterList) { this.parameterList = parameterList; } public OrderDetailModel getOrderDetail(int index) { return (OrderDetailModel) parameterList.get(index); } Here is the code in my Action where I set the form on the session: updateOrderForm.setParameterList(orderDetailList); //orderDetailList is my ArrayList object session.setAttribute(updateOrderForm, updateOrderForm); Here is my JSP: html:form action=updateOrder.do name=updateOrderForm type=com.academy.ordering.forms.UpdateOrderForm logic:iterate id=parameter name=updateOrderForm property=parameterList tr bgcolor=%= bgColor % tdhtml:text name=parameter property=orderLineNumber indexed=true //td tdhtml:text name=parameter property=itemName indexed=true //td tdhtml:text name=parameter property=quantityOrdered indexed=true //td /tr /logic:iterate input type=submit valueUpdate /html:form I looked at the Struts html:text tag description, http://jakarta.apache.org/struts/struts-html.html#text, and it says that I can use indexed. I am using Struts 1.0.2. I am doing something wrong? Thanks, Marwan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Error 500: Cannot retrieve definition for form bean null
Hi, I am getting Error 500: Cannot retrieve definition for form bean null when I use the form tag html:form action=/updateOrder.do. However, if I use form action=updateOrder.do method=post, I don't get that error. Is there something wrong I am doing? Here is the action-mapping from struts-config: actionpath=/updateOrder type=mypackage.UpdateOrdersAction name=updateOrderForm scope=session validate=false input=/updateorder.jsp forward name=update path=/showorderdetails.jsp/ forward name=edit path=/updateorder.jsp/ /action Here is my form-bean definition from struts-config: form-bean name=updateOrderForm type=mypackage.UpdateOrderForm/ Thanks, Marwan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Need Advise: use Struts/XSLT
Yes, the power of xml is Soap. And actually this is the main reason behind my question: web-services. I have worked on xsp, like it and dislike it! As i understand from this discussion, cocoon and struts are not possible to integrate, or at least work together. Thanks, Rabih. --- In [EMAIL PROTECTED], Oguz Kologlu [EMAIL PROTECTED] wrote: There is actually a lot of work being done on cocoon. Cocoon in fact resembles struts in many ways - the developers will freely admit they take the best ideas from each project to integrate into cocoon. Some of the features: - schematron ( same as validators ) - internationalisation support - sub applications - xmlforms ( similar to form beans ) ( w3c standard ) etc, etc. There are also xsp's ( xml - jsp ) but I have never used them. I think one of the shortfalls of cocoon is pipeline processing where you cannot change the direction of a pipeline once processing has begun ( since processing is based on sax events). We have worked around this with a variety of custom actions but it would be a hard work in a small team where you don't have much time for RD (play time). Another issue is that it is very loosely coupled and you can easily end up lost in a large project - especially for newbies. Having said that, you can get work done very quickly as well. It is worth evaluating - you can cut out a couple of layers of processing using cocoon instead of struts/JSF/clxx. hope this helps Oz -Original Message- From: Rabih Yazbeck [mailto:rablists@y...] Sent: Wednesday, 12 February 2003 10:46 PM To: 'Struts Users Mailing List' Subject: RE: Need Advise: use Struts/XSLT What about Cocoon integration with Struts? Is it possible that cocoon handle the presentation layer while Sturts focus on the controller? Even though Cocoon has released a version 2, but I think there is anymore much work on Cocoon, am I right? Thanks, and yes I believe in the power of XML/XSLT.. World is moving toward this approach, and I wish there is more support for it in Struts. - Rabih -Original Message- From: ROSSEL Olivier [mailto:olivier.rossel@a...] Sent: 12 February 2003 10:29 To: 'Struts Users Mailing List' Subject: RE: Need Advise: use Struts/XSLT -Message d'origine- De: Oguz Kologlu [mailto:ozkologlu@o...] Date: mercredi 12 février 2003 11:15 À: Struts Users Mailing List Objet: RE: Need Advise: use Struts/XSLT Hi, There is an article on theserverside.com that discusses this issue at: To oversimplify - it says you should develop JSP Documents ( well formed xml ) and use xslt for presentation/rendering/i18n etc. XSLT is very powerful if you can manage things in your XSLT such as document(url) where the URL is also a dynamic XML document. Aggregation is also a very useful feature. To me the (too basic) process of 1 XML- 1 XSLT-whatever is not that useful. For example it is interesting to have 2 XMLs- 1 XSLT- 1 XSLT- whatever or to have XML-XSLT-whatever ^ | XSLT ^ | XML I admit that it is quite an advanced usage of XML pipelines. Cocoon handles that very nicely. PS: for those who don't understand the power of the last pipeline discribed, think about such a pipeline: XML-XSLT-whatever ^ | XSLT ^ | XHTML Struts ceates the XML. Dreamweaver creates the XHTML (with custom tags to be XSLT- processed). Did you say total separation of concerns? This e-mail is intended only for the above addressee. It may contain privileged information. If you are not the addressee you must not copy, distribute, disclose or use any of the information in it. If you have received it in error please delete it and immediately notify the sender. Security Notice: all e-mail, sent to or from this address, may be accessed by someone other than the recipient, for system management and security reasons. This access is controlled under Regulation of Investigatory Powers Act 2000, Lawful Business Practises. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: posting an updated collection back to Action
Hi, I looked at all your the responses to this thread and then looked at Ted Husted's Struts Tip #6 - Use an array to capture multiple parameters to solve my problem. However, I still have some problems when I submit my changes(even if I don't change anything). My ActionForm looks like this: private String[] orderLineNumber = null; private String[] quantityShipped = null; private String[] quantityCancelled = null; with setters and getters for these attributes. In the ActionForm constructor there is nothing to initialize the arrays. After submitting the form, I am trying to access these arrays in the Action class like this: String[] lineNumber = (UpdateForm)form.getOrderLineNumber(); and I get a java.lang.NullPointerException on this exact line. My JSP looks like this: %List orderDetailList=(List)session.getAttribute(Constants.ORDERS);% code form action=updateOrder.do method=post logic:iterate id=orderDetail name=orderDetailList tdbean:write name=orderDetail property=orderLineNumber/td tdhtml:text name=orderDetail property=quantityShipped //td tdhtml:text name=orderDetailproperty=quantityCancelled//td /logic:iterate input type=submit valueUpdate /form /code This is still not working. The lines in the JSP are objects and not Strings. My JSP is retrieving a collection of these objects to display in a grid as you see above. Can I have these objects in my ActionForm instead of defining arrays for each column in the JSP? All I need to do is retrieve the grid of data from the JSP to my Action class with one submit button. That's all. Thanks, Marwan --- In [EMAIL PROTECTED], John Espey [EMAIL PROTECTED] wrote: You can create indexed properties ( getOrderDetail(int), setOrderDetail(int, string) ) You have to back them whatever way you see fit (I've used arrays in the past but I had to make sure they were sized propertly on each call). On your JSP, the resulting names for your input fields will need to be indexed: html:text name=orderDetail property=quantityShipped [${index}]/ will work if you are using the EL version of the html taglib. (Although I'm not sure the name property has to be specified if you use the html:form tag instead of the form tag as you've shown here) -Original Message- From: MarwanSalam [EMAIL PROTECTED] [mailto:marwansalam@y...] Sent: Monday, February 10, 2003 5:46 PM To: [EMAIL PROTECTED] Subject: posting an updated collection back to Action Hi, I have a list of line items displayed in a JSP where some of the attributes can be edited. I would like to capture the updated data by the user to return it to my Action class so I can modify my model accordingly. Here is my JSP code: form action=updateOrder.do method=post input type=hidden name=action value=updateOrder logic:iterate id=orderDetail type=OrderDetailModel collection=%= orderDetailList % tdhtml:text name=orderDetail property=quantityShipped//td /logic:iterate input type=submit valueUpdate Order /form I know my ActionForm class has to have a property called orderDetailList. But the question is, how will the correct index be updated since my list can contain many OrderDetailModel's? Should I add a method in my ActionForm class like getOrderDetailList.get (index)? Help!!! - 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]
posting an updated collection back to Action
Hi, I have a list of line items displayed in a JSP where some of the attributes can be edited. I would like to capture the updated data by the user to return it to my Action class so I can modify my model accordingly. Here is my JSP code: form action=updateOrder.do method=post input type=hidden name=action value=updateOrder logic:iterate id=orderDetail type=OrderDetailModel collection=%= orderDetailList % tdhtml:text name=orderDetail property=quantityShipped//td /logic:iterate input type=submit valueUpdate Order /form I know my ActionForm class has to have a property called orderDetailList. But the question is, how will the correct index be updated since my list can contain many OrderDetailModel's? Should I add a method in my ActionForm class like getOrderDetailList.get (index)? Help!!! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
BeanUtils.copyProperties() vs. ActionForm-Value Object mapper
I just found this mapper at: http://www.mycgiserver.com/~andrej/technical/struts/struts.jsp I am just starting to look into this. I can see right away that the advantage to using the mapper is that it's not as ugly. I think this mapper is a step in the right direction, but the fact that it doesn't handle Collection or ints, longs, etc is going to kill me. Anyone know of a better tool out there? Also, I am assuming that the BeanUtils.copyProperties() method will not handle nested beans. So I will have to manually do that copy properties on the nested beans and then manually set those back to the parent bean? Thanks, Trevor - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
j_security_check with LogonAction
Hi, I am trying to use j_security_check Servlet to authenticate users from a login.jsp. However, if I do this, I will not be able to take advantage of LogonAction class where I need to set certain session and request attributes. If I submit the logon form to LogonAction, I can forward the request from LogonAction to j_security_check but the request object will stay there and I can not forward again using mapping.findForward(success) to a different page since the response is already commited at that point. Is there a way to work around this? Marwan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Cannot find bean categoryArray in scope request
Hi, I am using Struts where I have an ShowCategoriesAction that extends Action. In the perform method, I am reading data from the database and storing it in a collecion object(ArrayList). Then I am using request.setAttribute(categoryArray, myCollectionObject) to set it on the request. I have verified that the collection has actual data before forwarding to the JSP. Now, when I call mapping.findForward(success) from the perform method, it forwards the request to a showCategories.jsp page where I use the following Struts tag: code logic:iterate id=category type=myPackage.Category name=categoryArray scope=request html:link page=/showItems.do name=category property=mapping bean:write name=category property=categoryName filter=true/ /html:link /logic:iterate /code I get this error: boldcodeError 500: Cannot find bean categoryArray in scope request /code/bold I even tried to put the object on the session and the application and look it up in the iterate tag and still the same problem. I tried to print the attributes on the request object from the JSP and it did show the categoryArray object there. But apparantly it was null. Can anyone help me in figuring out what the problem is. I am using WebSphere 4.0.3 for the Servlet container. Thanks, Marwan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
I Frames
How can we I frames with Struts?I wan't to click on one link and display its content in the same page but invisible frame Vinay - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Exception handling - DispatchAction
Hi all, I'm using a DispatchAction. I'm using the attached ExceptionHandler. In my handler I'm not able to catch the exception. I also attached my struts-config.xml global-exceptions element. Also the stack trace I get is attached... Any ideas? Kind regards java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:209) at com.mycompany.struts.actions.DispatchAction.execute(DispatchAction.java:93) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:442) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:264) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1109) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:452) at javax.servlet.http.HttpServlet.service(HttpServlet.java:126) at javax.servlet.http.HttpServlet.service(HttpServlet.java:103) at com.caucho.server.http.FilterChainServlet.doFilter(FilterChainServlet.java:96) at com.caucho.server.http.Invocation.service(Invocation.java:312) at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:135) at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:244) at com.caucho.server.http.HttpRequest.handleConnection(HttpRequest.java:163) at com.caucho.server.TcpConnection.run(TcpConnection.java:137) at java.lang.Thread.run(Thread.java:536) Caused by: com.mycompany.commons.component.ComponentException: This is my message at com.mycompany.commons.component.ComponentValidator.validateComponent(ComponentValidator.java:23) at com.mycompany.myapp.MyApp.validateMyAppComponent(MyApp.java:420) at com.mycompany.myapp.MyApp.getInstance(MyApp.java:113) at com.mycompany.myapp.http.SystemAction.getThreads(SystemAction.java:238) struts-config.xml Description: Binary data ComponentExceptionHandler.java Description: Binary data -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Any Struts-based calendar examples out there?
One open source project (Roller) I work on has a JSP Tag Library calendar - you might be able to tweak it. Project Page: http://rollerweblogger.org/ And there's also a big calendar as part of it - example at: http://www.rollerweblogger.org/page/roller/Archives For my favorite javascript-based popup-calendar, check out: http://www.mattkruse.com/javascript/calendarpopup/ #2 is my fav. Matt --- In [EMAIL PROTECTED], James Mitchell [EMAIL PROTECTED] wrote: This should give you a few ideas.although it requires javascript: http://javascript.internet.com/calendars/ -- James Mitchell Software Engineer/Struts Evangelist http://www.open-tools.org/ The man who does not read good books has no advantage over the man who cannot read them. - Mark Twain (1835-1910) -Original Message- From: Trevor Morris [mailto:morr0209@t...] Sent: Wednesday, January 22, 2003 9:34 PM To: [EMAIL PROTECTED] Subject: Any Struts-based calendar examples out there? I have to create a calendar page to display meetings, etc. As you know, anything date-related is not the easiest task in the world. I have found a JSP-based calendar, but it would require some extensive rework to get rid of all the scriplet code. Short deadline + overworked programmer = trying to steal code instead of reinventing the wheel ;) Anyone seen anything in any struts example code out there? Trevor -- To unsubscribe, e-mail: mailto:struts-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:struts-user-help@j... -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe@j... For additional commands, e-mail: mailto:struts-user-help@j... -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Struts starts to return blank files after the application has been running a while
I have an unpleasant problem that is difficult to reproduce. The application which involves basic CRUD of a database, and uploading of files, works for a while (between 10 and 30 posts), then stops. I have been trying to solve this problem for 2 days now! A search of this list didnt help. The nature of the stops working is that any post or get returns a blank page. I have single stepped through the ActionServlet, and identified that The code is still executing The process method of the action is executing The correct forward (for example /Admin/Brand/Home.jsp) is being returned The ActionServlet tries to forward to this, and nothing happens Further: once it has stopped working when I view the root directory using the url http://mysite:8080/; I can see all the files, but when I click on any of them (even HTML) blank content is returned. Rerunning Tomcat is the only option that fixes it My system is Microsoft Windows XP Professional 5.1.2600 Service pack 1 build 2600 Tomcat 4.1.18 (compiled from the source code) Struts 1.1-b3 (compiled from the source code) JDK 1.4.1_01 When debugging and single stepping I am using Eclipse 2.0.02 I realise there is very little to go on here! I am hoping that someone has met an identical problem, and will recognise it. Phil Rice -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
How to use Tiles or templates with CSS and Javascript
Where do you add your Javascript when using Tiles? You are not supposed to put content into the template file. Say you have the standard template: html:html head titleblah/title /head body tiles:insert attribute=header/ tiles:insert attribute=body/ tiles:insert attribute=footer/ /body /html My javascript needs to be called with body onload=start(). Where do you put the Javascript and this start() function call? The javascript is needed in the header section, but you cannot put it in the header section as the body and head tags have already been defined. Is my only choice to put the javascript and start() call in the template file itself? If that is the case, Tiles is not accomplishing anything for me. Same question about where to put a link to an external stylesheet. Or am I just missing something obvious? Thanks. Trevor -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
sslext, JasperException
i'm using tiles and definitions as ActionForwards and this is working fine. And i installed sslext and the example application also works fine. But when i try to forward to definitions, when the SecurePlugin is loaded (like forward name=start path=.app.Welcome/) i get this org.apache.jasper.JasperException: Exception forwarding for name welcome: javax.servlet.ServletException: Servlet.init() for servlet action threw exception at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:248) when i comment out !-- plug-in className=org.apache.struts.action.SecurePlugIn set-property property=httpPort value=8080/ set-property property=httpsPort value=8443/ /plug-in -- in my struts-config.xml this exception is not thrown, but without the Plugin SSL isn't working... can anybody tell me if this is a problem of the SecurePlugin or if a just got something wrong with my configuration ? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
How to integrate servlet with parameters into tiles definition
Hi, I have been having a problem integrating a servlet into a tiles definition. It takes a config file as parameter config and I have tried to directly call the servlet by putting it in the tiles-def.xml file like this: definition name=.gradebook.Assignments extends=.gradebook.Base put name=zcontent value=http://localhost:8080/gradebooktest/servlet/Forum/ All I get is a blank content area even though when I call the servlet directly with that URL , it works ok. Next I tried to make a jsp that extends this servlet. almost the same thing. It can display through the browser direct, but says cannot read config file when I put it in the tiles definition as a JSP. is there some issue with struts/tiles as far as passing paramters down to the parts of a tiles-def? any work arounds or hints greatly appreciated. thanks Brian -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Struts and TagLibrary Xtags
George, Stxx: Struts for transforming XML with XSL (stxx) is an extension of the struts framework to support XML and XSL without changing the functionality of struts . You can download it in - http://www.oroad.com/opencode/stxx/ Xtags is supposed to do similar stuff, but if it does not work with higher versions of Struts - then it is not the path I would look into. Thanks V --- In [EMAIL PROTECTED], Mouratidis, Georg [EMAIL PROTECTED] wrote: the dis is that it does not work with struts 1.1.2!?! this is my experience. i have been trying since two days but i have no results only errors. And nobody could help in this list. BTW: What is Stxx? Where can i download this? thanks george -Original Message- From: Rajshree Vivekanandan [mailto:rajshree_68@y...] Sent: Mittwoch, 8. Januar 2003 19:09 To: [EMAIL PROTECTED] Subject: Struts and TagLibrary Xtags Has anyone worked with tagLibrary Xtags in Struts? If so, could you please help me. I know it is different from Stxx, by allowing XML to be styled and processed from directly within a JSP page using familiar XSLT and XPath techniques. Can you also give me (dis)/advandatges of Xtags over Stxx. Thank you V __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe@j... For additional commands, e-mail: mailto:struts-user-help@j... -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe@j... For additional commands, e-mail: mailto:struts-user-help@j... -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Struts and Taglibrary XTags
Has anyone worked with tagLibrary Xtags in Struts? If so, could you please help me. I know it is different from Stxx, by allowing XML to be styled and processed from directly within a JSP page using familiar XSLT and XPath techniques. Can you also give me (dis)/advandatges of Xtags over Stxx. Thank you V -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
extending ActionMappings in Struts 1.1 ?
How do i deploy an extended ActionMapping in Struts 1.1 ? i.e. a class derived from org.apache.struts.action.ActionMapping with additional fields for properties set by set-property/ tags in my struts-config.xml file. With Struts 1.0 this was working fine by declaring a init-param param-namemapping/param-name param-valueNameOfMyExtendedActionMappingClass/param-value /init-param in the servlet/-Element used to deploy my org.apache.struts.action.ActionServlet in my web.xml file. However, Struts 1.1 seems to ignore this init-param/ and simply passes an ActionMapping to my Actions' execute methods. Consequently Java throws a ClassCastException when i try to cast the passed mapping-Object back to my Class-type. any help would be greatly appreciated. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: login mechanism
I have my ActionServlet mapped to *.do and an ActionFilter mapped to that same url-pattern. In ActionFilter, I check to see if there is a UserForm in the session, and secondly to see if request.getRemoteUser() returns null. If either of these occur, I call my Business Delegate (UserManager in my case) to get the user's information. Currently, it talks to a database to get the information, but it easily could talk to a Directory Server like LDAP. Here's some code from my doFilter method: UserForm userForm = (UserForm) session.getAttribute(Constants.USER_KEY); ServletContext ctx = filterConfig.getServletContext(); String username = request.getRemoteUser(); // user authenticated, empty user object if ((username != null) (userForm == null)) { try { UserManager mgr = new UserManagerImpl((String) ctx.getAttribute(Constants.DAO_TYPE)); UserForm user = mgr.getUser(username); session.setAttribute(Constants.USER_KEY, user); } catch (Exception e) { log.error(Error getting user's information, e); e.printStackTrace(); ActionErrors errors = new ActionErrors(); errors.add(ActionErrors.GLOBAL_ERROR, new ActionError(errors.general)); while (e != null) { errors.add(ActionErrors.GLOBAL_ERROR, new ActionError(errors.detail, e.getMessage())); e = (Exception) e.getCause(); } request.setAttribute(Globals.ERROR_KEY, errors); // forward to the error page RequestDispatcher dispatcher = request.getRequestDispatcher(/error.jsp); dispatcher.forward(request, response); return; // stop processing } } --- In [EMAIL PROTECTED], usha [EMAIL PROTECTED] wrote: Hi can you tell me briefly how you are using filtes in security-example application. Thanks usha Matt Raible wrote: You could use a filter to map to all your protected resources. This is what I do in the security-example application I recently wrote. You can download the source at: http://javawebapps.com/downloads/security-example.zip (14MB) HTH, Matt --- In [EMAIL PROTECTED], usha [EMAIL PROTECTED] wrote: Hi Sorry what you mean by proxy. i didn't get you actually i wanted to authenticate logged in user against the users that are there in the database, and when ever they bookmark some page and if they go to that page directly i wanted to display the login page after they login sussefully only . right now with form based authentication i am getting this , but i had some drawbacks as i mentioned in the previous mail. is there a standard way i can use for user login checks. thanks usha Eddie Bush wrote: Write a proxy to retrieve the user data you wish to put in the session. The proxy will check to see if a user has been authenticated (request.getUserPrincipal() != null), and, if they have, it will check to see if your user data has been created yet. If it has, it will just take it from the session and return it. If it hasn't, it will create it, save it to the session, and return it. That help? usha wrote: Hi i am new to structs. right now i am using in my project form based authentication. with this i have some problems like i cannot instantiate some of session veriable upon logging etc. is there any standard mechnism for loging using sturcts. i am using JBoss as my application server. Thanks in advance usha.. -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe@j... For additional commands, e-mail: mailto:struts-user-help@j... -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe@j... For additional commands, e-mail: mailto:struts-user-help@j... -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe@j... For additional commands, e-mail: mailto:struts-user-help@j... -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: [Validator] Client-side works, but not server-side
Actually, I'm not getting the famous Struts blank screen of nothingness, but rather, it seems that validation is just not kicking in - it routes me to my success page. I am using the forwardInput=true on my controller element and have the input specified as editProfile where my forward is below: forward name=editProfile path=/userProfile.do/ I've tried using the path instead (input=/userProfile.do) and it doesn't seem to work either. I'm sure it's something simple, I just can't seem to figure it out right now. Thanks, Matt --- In [EMAIL PROTECTED], Michelle Wynn [EMAIL PROTECTED] wrote: I assume you are only getting nothing when the server side validation fails. If you are getting nothing when the validation doesn't fail that is another problem. If it is the former, I suspect your problem is related to your input parameter in the action mapping. I had a similar situation (blank screen when server side validation failed and javascript was turned off). Turned out Input was set to an invalid path, once it was corrected, it worked like a charm. Matt Raible matt@raibledesigTo: [EMAIL PROTECTED] ns.com cc: Subject: [Validator] Client-side works, but not server-side 12/29/2002 05:58 PM Please respond to Struts Users Mailing List I have the following defined in validation.xml: form name=userForm field property=username depends=required,email msg name=required key=errors.required/ msg name=email key=errors.email/ arg0 key=userForm.username/ /field /form And this works great for prompting me with client-side validation, but when I turn off Javascript to test server-side validation, I get nothing. Any ideas? I'm using inputForward=true on my controller, but I changed to be a regular path to /editProfile.do and still I get no server-side validation. Here is my action-mapping: action path=/saveUser type=org.appfuse.webapp.actions.UserAction name=userForm scope=session input=/userProfile.do parameter=action unknown=false validate=true/ Any ideas? I'm fairly confident that I have things configured correctly, as the client-side validation works. Suggestions are appreciated. Thanks, Matt -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe@j... For additional commands, e-mail: mailto:struts-user-help@j... -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: login mechanism
You could use a filter to map to all your protected resources. This is what I do in the security-example application I recently wrote. You can download the source at: http://javawebapps.com/downloads/security-example.zip (14MB) HTH, Matt --- In [EMAIL PROTECTED], usha [EMAIL PROTECTED] wrote: Hi Sorry what you mean by proxy. i didn't get you actually i wanted to authenticate logged in user against the users that are there in the database, and when ever they bookmark some page and if they go to that page directly i wanted to display the login page after they login sussefully only . right now with form based authentication i am getting this , but i had some drawbacks as i mentioned in the previous mail. is there a standard way i can use for user login checks. thanks usha Eddie Bush wrote: Write a proxy to retrieve the user data you wish to put in the session. The proxy will check to see if a user has been authenticated (request.getUserPrincipal() != null), and, if they have, it will check to see if your user data has been created yet. If it has, it will just take it from the session and return it. If it hasn't, it will create it, save it to the session, and return it. That help? usha wrote: Hi i am new to structs. right now i am using in my project form based authentication. with this i have some problems like i cannot instantiate some of session veriable upon logging etc. is there any standard mechnism for loging using sturcts. i am using JBoss as my application server. Thanks in advance usha.. -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe@j... For additional commands, e-mail: mailto:struts-user-help@j... -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Unable to compile class (The major.minor version '48.0' is too recent for this tool to understand)
I'm trying to start up the struts-example application and I'm receiving the following compilation error when I go to http://localhost:8080/struts-example Has anyone had this error before? I can't seem to find a solution for it anywhere. - Billy - org.apache.jasper.JasperException: Unable to compile class for JSPerror: Invalid class file format in C:\j2sdk1.4.1_01\jre\lib\rt.jar(java/lang/Object.class). The major.minor version '48.0' is too recent for this tool to understand. C:\Program Files\Apache Tomcat 4.0\work\localhost\struts-example\index$jsp.java:0: Class java.lang.Object not found in class javax.servlet.GenericServlet. package org.apache.jsp; ^ 2 errors at org.apache.jasper.compiler.Compiler.compile(Compiler.java:284) at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:546) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspSe rvlet.java:177) at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja va:189) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:243) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 66) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja va:201) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 66) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:2 46) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 64) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2344) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164 ) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 66) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve. java:170) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 64) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170 ) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 64) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 64) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java :163) at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5 66) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943) at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java: 1011) at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1106 ) at java.lang.Thread.run(Thread.java:536) mail2web - Check your email from the web at http://mail2web.com/ . -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
JDK 1.4 and struts
There were a couple of messages the other day concerning Struts failing to work correctly under the 1.4 JDK. I'd like to add some evidence to that. Sun's 1.4 JDK (at least the Linux version) seems to have serious problems w/ the classpath. After upgrading to 1.4.0_01, and then 1.4.1_01, Struts no longer works on my machine. Specifically, when dispatching to an Action subclass, the JVM cannot seem to find org.apache.struts.action.Action -- despite knowing all about ActionServlet and a bunch of other classes in the struts.jar file. Someone stated recently that Struts DOES WORK w/ JDK1.4. Which OS is that? And does anyone have positive experience using Struts w/ JDK1.4 on Linux? --- John Byrd [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
RE: Best practices using value objects
Thanks but I still does not understand what to do with the attributes representing a list of other value objects. I will have to write two converters for each VO in the tree. Is that it or am I missing something? Stephan -Message d'origine- De : David Graham [mailto:[EMAIL PROTECTED]] Envoyé : 14 octobre, 2002 14:32 À : [EMAIL PROTECTED] Objet : Re: Best practices using value objects You can use BeanUtils.copyProperties to copy properties between forms and value beans. Dynamic forms have nothing to do with this. Your form could be dynamic or static. I would only add properties to the value bean if it ends up in the database. Also, it's best practice to not use Vector. Your variable should be of type List and implemented with ArrayList instead of Vector. Dave From: [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Best practices using value objects Date: Mon, 14 Oct 2002 11:48:25 -0400 Best practices using value objects I still have questions regarding best practices, the use value object and of the beanutil package. How would you convert a value object to a form bean if a property of the VO is a list of other object that would need to be converted to a form? Here is an example of what I am trying to do. I have value objects coming from the business tier. VOSchool String address Vector students VOStudent String name int status boolean isPresident Vector courses I have a page with a lists of all students names, a radio button to indicate if he is the president and a checkbox that changed the status is selected. I think I need a StudentForm with all the info from the VO plus a boolean isSelected property. My SchoolForm need all info from the VO plus a president property. - How can I best reuse by VOs? - Should I add a property to the VOs? How? - Are the forms dynamic forms? - Should I copy all attributes form the VO to a form? - Do I need to write a converter for all my VOs, VO to form and form to VO? I think it is a very common problem but I was not able to find a pretty solution nor an example on how to do this. Thanks Stephan _ Chat with friends online, try MSN Messenger: http://messenger.msn.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Nested form and value object conversion
Does anyone had experience using nested form when populated from value object? Suppose I want to show a list of object and have one text field or checkbox for each row. These two properties of the form map to two properties of the value objects. In order to do this, I need to iterate in each child form. My question is; What is the best way to achieve this? The best I could come out was to use the copyProperties of beanutils and to write a converter to convert each value object to a form and another to convert each form to a value object I asked this before but I do not think I was clear on what I wanted to do exactly. Thank you. Stephan -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
i18n of internal messages
Hi, I need to customise some internal messages (org.apache.struts.taglib.LocalStrings.properties, org.apache.struts.util.LocalStrings.properties...). I first apply the rules for i18n : I created a ApplicationResources_fr_FR.properties I put it in the WEB-INF/classes directory and put the following code in my web.wml file web-app servlet servlet-nameaction/servlet-name servlet-classorg.apache.struts.action.ActionServlet/servlet-class init-param param-nameapplication/param-name param-valueApplicationResources/param-value It works fine for keys like struts.welcome but messages for keys like lookup.bean (member of org.apache.struts.util.LocalStrings.properties) can't be overwritten. I secondly tried to put a LocalStrings_fr_FR.properties in the WEB-INF/classes directory but it doesn't work either. I've not managed to understand how the internal messages location was set. Is there a better solution than replacing the original messages files in the my struts.jar file ? -- Faites un voeu et puis Voila ! www.voila.fr -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
String indexed properties
I added support for tags to access properties throught a string index; in practice you can access to a bean method like 'getContents(String index)' using a tag like 'bean:write name=bean property=contents{the String index}/'. If anybody is interested in, mail me to [EMAIL PROTECTED]
what to store in session?
Consider following situation. User is logging into web application. What to store in session? 1. User object - it can be a large one (about 30 attributes, Strings, associated Objects). In this situation will be only one request to database (on user logon). Then all data will be taken from this object. 2. Put in session only user unique identifier (key) and then load neccessary data from database only when it's requested. Which one is better approach? md -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
ServletException with Nested Taglib and Template Taglib in Struts 1b1
Hi all, I'm trying to use Nested and Template taglibs in Struts R1B1. It seems it doesn't work together. I have a ServletException in the DoEndTag() method of Insert Tag (Template taglib). If I remove my template stuff in my JSPs (I keep Nested stuff only), it works propertly. Is there someone who could help me? Thanks -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
html:file property type ?
Which must be the type of the property of a formbean when used as property-attribute of a html:file tag. And how is this html:file handled, should one implement some sort of multipart request handler in the formbean ? thx -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Tag development
Hi I have some trouble in developping a tag. my tag will be included between a html:form and /html:form and I need to know the name of this form. Is their a way to get it in the tag I'm writing. for example if I use: html:form action=/news.do myTag:aNewTag ... /myTag:aNewTag ... /html I want html which look like: form name=newsForm action=... script displayCalendar(newsForm); /script ... /form So in this example I need to get the String newsForm in my tag aNewTag Thank you for your help Barry BURNEREAU -- Profitez des 2 offres exceptionnelles Tiscali ! Internet Gratuit le Jour et Modem ADSL remboursé Cliquez ici, http://register.tiscali.fr/forfaits_ls/ Offres soumises à conditions. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Connection Pool Sample
Hi, I would like to see a sample where the Connction Pool mechanism of struts is implementet. Can anyone please point one out for me? thanx, rainer
RE: the best way to log action hits
Log4J can do appends in a database, so just log to a database and a file. The contribs have a JdbcAppender. You might want to check on the AsyncAppender to avoid having the logging calls being executed while the user waits for the request and to delay the performance hit of the insert (logging call). So your jsp can query a table, very easy. Daniel Hi, I need to change my webapp to log the number of hits certain actions get and from which session etc etc. Can anyone point me towards the right way to look at doing this. Ideally I would use Log4J or something similar, but I'm a bit worried about having to parse lots of large text files every time my boss wants a gander (especially if he insists on having it done as a jsp page). I know this isn't strictly struts related, but any stabs at how other people have done *in their struts app* appreciated, Caoilte mail2web - Check your email from the web at http://mail2web.com/ . -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: logic:iterate Strin :Problem
Hello! If i use it like this I obtain the following error: javax.servlet.jsp.JspException: org.apache.jasper.compiler.ParseException at org.apache.struts.taglib.template.InsertTag.doEndTag(InsertTag.java:149) Thx for your answers * SchlumbergerSema Arnaud FARINE Ingénieur chargé d'études Tel: 04.97.15.79.18 [EMAIL PROTECTED] 150, Allée Pierre Ziller Les Bouillides - BP279 06905 Sophia-Antipolis Cedex Fax: 04.94.15.89.01 * Hi Use bean:write name=val / Inside your iterate As I understand you you just want to display things... Bean:write does a toString (or something like that) of the bean if not property is mentioned. Regards Mikael At 14:50 2002-03-01 +0100, you wrote: Hi! I use a Vector object which contains String Object. This Vector is in a JavaBeans, so I've got a getter method, which returns the Vector. When I want to iterate the list by: logic:iterate id=val type=java.lang.String name=user property=infoDB /logic:iterate How replace the ? by a good code?! I haven't idea! If my Vector contains some other complex object (others beans for examples), this works well. How do I to diplay my String(s)? Thx for your answers * SchlumbergerSema Arnaud FARINE Ingénieur chargé d'études Tel: 04.97.15.79.18 [EMAIL PROTECTED] 150, Allée Pierre Ziller Les Bouillides - BP279 06905 Sophia-Antipolis Cedex Fax: 04.94.15.89.01 * -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re : logic:iterate String
If I write this I obtain somthing like this: [myval1,myval2] Why I've got [ and ,? Thx * SchlumbergerSema Arnaud FARINE Ingénieur chargé d'études Tel: 04.97.15.79.18 [EMAIL PROTECTED] 150, Allée Pierre Ziller Les Bouillides - BP279 06905 Sophia-Antipolis Cedex Fax: 04.94.15.89.01 * -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
logic:iterate String.
Hi! I use a Vector object which contains String Object. This Vector is in a JavaBeans, so I've got a getter method, which returns the Vector. When I want to iterate the list by: logic:iterate id=val type=java.lang.String name=user property=infoDB /logic:iterate How replace the ? by a good code?! I haven't idea! If my Vector contains some other complex object (others beans for examples), this works well. How do I to diplay my String(s)? Thx for your answers * SchlumbergerSema Arnaud FARINE Ingénieur chargé d'études Tel: 04.97.15.79.18 [EMAIL PROTECTED] 150, Allée Pierre Ziller Les Bouillides - BP279 06905 Sophia-Antipolis Cedex Fax: 04.94.15.89.01 * -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Struts runtime failure on Weblogic 5.1Sp8 (in custom tag 'message')
hello, I'm trying to run the Struts 1.0 Example application using WebLogic 5.1 (Service Pack 8) on NT2000. I'm deploying the Struts-Example application as a .war file. I followed all the steps in the ReadMe and Install documentation. However, upon starting the server and trying access the root page, I encounter the following run-time exception: E ServletContext-strutsexample root cause of ServletException javax.servlet.ServletException: runtime failure in custom tag 'message'at jsp_servlet._index._jspService(_index.java, Compiled Code)at weblogic.servlet.jsp.JspBase.service (JspBase.java:27) at weblogic.servlet.internal.ServletStubImpl.invokeServlet (ServletStubImpl.java:105) at weblogic.servlet.internal.ServletStubImpl.invokeServlet (ServletStubImpl.java:123) at weblogic.servlet.internal.ServletContextImpl.invokeServlet (ServletContextImpl.java:742) at weblogic.servlet.internal.ServletContextImpl.invokeServlet (ServletContextImpl.java:686) at weblogic.servlet.internal.ServletContextManager.invokeServ let(ServletContextManager.java:247) at weblogic.socket.MuxableSocketHTTP.invokeServlet (MuxableSocketHTTP.java:361) at weblogic.socket.MuxableSocketHTTP.execute (MuxableSocketHTTP.java:261) at weblogic.kernel.ExecuteThread.run (ExecuteThread.java, Compiled Code) I've search the mailing list archives, and it seems that others have had a similar problem. However, I did not find a documented solution that works for me. Here's some more details about my particular situation: 1) I have to modify the DocType statement in the web.xml file to use DTD Web Application 1.2 instead of DTD Web Application 2.2. This prevents the following error msg from occurring when starting the webserver. [ExternalEntity] : Could not resolve entity '-//Sun Microsystems, Inc. //DTD Web Application 2.2//EN'. Check your dtd reference. 2) The struts.jar and *.tld files are located in my the webapps/WEB-INF/lib folder. 3) As suggested in another mail msg, I added the following jar as the first statement in my classpath: c\:jakarta-struts\webapps\wlssp8-struts.jar 4) As stated in the Install documentation, I've manually extracted the ApplicationResources.properties from the *.war file and copied it to the _tmp_war folder created by WebLogic. Any help would be greatly appreciated as I am totally stuck. Thanks, Pierre --- L'e-mail gratuit pas comme les autres. Pour créer votre adresse : http://www.nomade.fr/courrier/ouvrir.asp NOMADE.FR, pourquoi chercher ailleurs ? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Struts IDE
Hi, Are there any IDE which helps the designer to view HTML pages having struts tags incorporated in it? (i.e For brevity's sake, only a snippet of the HTML code is given below html:select property=type html:options collection=collection1 property=value labelProperty=label/ /html:select TIA, Jerome *** Any opinions expressed in this email are those of the individual and not necessarily those of GamCom Solutions Ltd (herein after GamCom) and/or its subsidiaries. This email and any files transmitted with it, including replies and forwarded copies (which may contain alterations) subsequently transmitted from GamCom and/or its subsidiaries, are confidential and solely for the use of the intended recipient. If you are not the intended recipient or the person responsible for delivering to the intended recipient, be advised that you have received this email in error and that any use is strictly prohibited; please notify us immediately and do not disclose, distribute, or retain this email or any part of it. We believe but do not warrant that this e-mail and any attachments are virus free. You must therefore take full responsibility for virus checking. GamCom and/or its subsidiaries reserve the right to monitor all email communications through their networks. If you have received this email in error please notify GamCom by telephone on +44 (0)20 8838 5441 or via email to [EMAIL PROTECTED] , including a copy of this message. *** -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Grid View
Hi all, Could u guys please help me out here. What we want to do is to be able to display a list of taxpayers along with specific attributes that we can either check or uncheck using checkboxes, then submit the form and update these attributes. Has anyone got nay experience with Grid like views in struts? Please HHEELLPP!!! Thanx!! ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com **
RE: logic:equal tag with more than one value?
yes, u just nest your logic tags, this is equivalent to AND logic... logic... sdsdcsdcdo somethingsdcsdc /logic... /logic... this is equivalent to OR, seperate single logic tags each testing for some value/condition logic... sdsdcsdcdo somethingsdcsdc /logic... logic... sdsdcsdcdo somethingsdcsdc /logic... -Original Message- From: Marcel Andres [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 04, 2001 2:46 PM To: struts-user Subject: logic:equal tag with more than one value? Hello, I could not find information on the following topic: I would like to use the logic:equal tag, but instead of using just one value to compare, I would like to use several values. Is this possible without the if-then-else-tag or switch-tag from Niall Pemberton? Is there an other possibility to do this compare? Thanks, Marcel ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com **
Re: Tomcat 4.0b7 and struts-example webapp
Informative error messages and docs generally hasten developer time investment (and hoperfully adoption) of a new technology. So I would say yes! :) On Fri, 31 Aug 2001, Remy Maucherat wrote: leaving them in jasper. Can someone point me to where I can discern the differences between the different lib directories in Catalina? Also, one of the causes of these problems is that the error message printed out doesn't mention the XML parser at all (so people then think it's a Tomcat 4 problem). Wouldn't it be a good idea to fix that too ? cheers, -Ian -- Ian Kallen [EMAIL PROTECTED] | AIM: iankallen
RE: STRANGE: session.invalidate() is not invalidating the session
i'm having the same problem , please help anyone? -Original Message- From: Shamdasani Nimmi-ANS004 [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 29, 2001 9:32 PM To: struts-user@jakarta. apache. org (E-mail) Subject: STRANGE: session.invalidate() is not invalidating the session Hi, I noticed a peculiar thing. In my application I have a logout link on pages. This link control goes to 'Logout' action where I clean up the session variables and then invalidate the session with: session.invalidate(); and this class forwards it to Logout.jsp which just has the goodbye message. I have noticed that at this point if I keep going back with the back key of my browser to the point where jsessionid is part of the URL, i.e., http://localhost:8080/msqc/logon.do;jsessionid=149062E2E0A77480075991317505D 453 and do the browser refresh here then I can go back into the application without having to log in again. It is as if the session is still alive. All the screens(incl. the above URL point) going backwards from Logout.jsp do show the page expired message but doing refresh on the above URL screen only brings back the application Could someone please explain this to me? Has anyone else seen this? BTW I am using Tomcat 4.0 and Struts 1.1(same happens with 1.0 too) TIA. -Nimmi ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com **
RE: Attribute value should be quoted
send a copy of your jsp, its usually a html tag just above or below the line in question -Original Message- From: David Corbin [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 29, 2001 4:04 PM To: Struts User Subject: Attribute value should be quoted I'm getting the following exception from a particular JSP: org.apache.jasper.compiler.ParseException: .\AddCompany.jsp(58,36) Attribute value should be quoted at org.apache.jasper.compiler.JspReader.parseToken(JspReader.java:478) at org.apache.jasper.compiler.JspReader.parseAttributeValue(JspReader.java:524) at org.apache.jasper.compiler.JspReader.parseTagAttributes(JspReader.java:635) at org.apache.jasper.compiler.Parser$Tag.accept(Parser.java:798) at org.apache.jasper.compiler.Parser.parse(Parser.java:1077) at org.apache.jasper.compiler.Parser.parse(Parser.java:1042) at org.apache.jasper.compiler.Parser$Tag.accept(Parser.java:833) at org.apache.jasper.compiler.Parser.parse(Parser.java:1077) at org.apache.jasper.compiler.Parser.parse(Parser.java:1042) at org.apache.jasper.compiler.Parser.parse(Parser.java:1038) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:209) at org.apache.jasper.servlet.JspServlet.doLoadJSP(JspServlet.java:612) at org.apache.jasper.servlet.JasperLoader12.loadJSP(JasperLoader12.java:146) The line in question reads: html:text size=40 property=description / if the syntactical color is correct, my quotes are balanced. It looks just like one from another page that works fine. I do have the %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % at the top of the .JSP file. I'm baffled. Any ideas? Thanks. David Corbin ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com **
RE: Tokens?
Title: Message one would typically use tokens as a means to prevent the user from submitting a page twice when it is undesirable to do so...if u would like more info and some examples let me know -Original Message-From: Steven Leija [mailto:[EMAIL PROTECTED]]Sent: Wednesday, August 29, 2001 5:24 PMTo: 'Struts ([EMAIL PROTECTED])'Subject: Tokens? Hello All, I'm going over the Action javadocs and came across several methods that use the keyword of "token". The docs aren't very intuitive on what exactly defines a token. What do the token methods do? generateToken() resetToken() saveToken() isTokenValid() Have a good one, Steven ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com **
RE: Attribute value should be quoted
excellent -Original Message- From: David Corbin [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 30, 2001 11:51 AM To: [EMAIL PROTECTED] Subject: Re: Attribute value should be quoted Thanks. I found it, and your assessment was correct. Silly me for trusting the compiler - Original Message - From: Dudley Butt@i-Commerce [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, August 30, 2001 4:35 AM Subject: RE: Attribute value should be quoted send a copy of your jsp, its usually a html tag just above or below the line in question -Original Message- From: David Corbin [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 29, 2001 4:04 PM To: Struts User Subject: Attribute value should be quoted I'm getting the following exception from a particular JSP: org.apache.jasper.compiler.ParseException: .\AddCompany.jsp(58,36) Attribute value should be quoted at org.apache.jasper.compiler.JspReader.parseToken(JspReader.java:478) at org.apache.jasper.compiler.JspReader.parseAttributeValue(JspReader.java:524) at org.apache.jasper.compiler.JspReader.parseTagAttributes(JspReader.java:635) at org.apache.jasper.compiler.Parser$Tag.accept(Parser.java:798) at org.apache.jasper.compiler.Parser.parse(Parser.java:1077) at org.apache.jasper.compiler.Parser.parse(Parser.java:1042) at org.apache.jasper.compiler.Parser$Tag.accept(Parser.java:833) at org.apache.jasper.compiler.Parser.parse(Parser.java:1077) at org.apache.jasper.compiler.Parser.parse(Parser.java:1042) at org.apache.jasper.compiler.Parser.parse(Parser.java:1038) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:209) at org.apache.jasper.servlet.JspServlet.doLoadJSP(JspServlet.java:612) at org.apache.jasper.servlet.JasperLoader12.loadJSP(JasperLoader12.java:146) The line in question reads: html:text size=40 property=description / if the syntactical color is correct, my quotes are balanced. It looks just like one from another page that works fine. I do have the %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % at the top of the .JSP file. I'm baffled. Any ideas? Thanks. David Corbin ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com ** ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com **
RE: Tomcat 4.0b7 and struts-example webapp
Does this mean that TC 4.0b7's web.xml parsing is not backwards compatible to the older webapp format? This sounds like a bug, not a feature. I'm using a webapp that just runs dropped into a TC 3.2.x installation straight out of the struts distribution. On Wed, 29 Aug 2001, Thinh Doan wrote: I got this same error running under Jrun. Look into web.xml and make sure struts stuff is there (tlds etc..) T. -Original Message- From: Ian Kallen [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 29, 2001 4:17 PM To: [EMAIL PROTECTED] Subject: Tomcat 4.0b7 and struts-example webapp IIRC, the struts-example from struts 1.0 was happy with most of the recent Tomcat 3.2.x releases but with 4.0b7, it's not picking up the ApplicationResources.properties file. yes, it's in /struts-example/WEB-INF/classes/org/apache/struts/webapp/example/Application Resources.properties and web.xml has: servlet-nameaction/servlet-name servlet-classorg.apache.struts.action.ActionServlet/servlet-class init-param param-nameapplication/param-name param-valueorg.apache.struts.webapp.example.ApplicationResources/param-va lue /init-param right out of the war file... This is the error: javax.servlet.ServletException: Cannot find message resources under key org.apache.struts.action.MESSAGE So what's up? Is there something extra to setup the classpaths inside webapps under Tomcat 4.0? cheers, -Ian -- Ian Kallen [EMAIL PROTECTED] | AIM: iankallen cheers, -Ian -- Ian Kallen [EMAIL PROTECTED] | AIM: iankallen
Re: Tomcat 4.0b7 and struts-example webapp
Thanks! For the record, mv $CATALINA_HOME/jasper/crimson.jar $CATALINA_HOME/lib/crimson.jar mv $CATALINA_HOME/jasper/jaxp.jar $CATALINA_HOME/lib/jaxp.jar seems to have fixed it! -Ian On Thu, 30 Aug 2001, Remy Maucherat wrote: Does this mean that TC 4.0b7's web.xml parsing is not backwards compatible to the older webapp format? This sounds like a bug, not a feature. I'm using a webapp that just runs dropped into a TC 3.2.x installation straight out of the struts distribution. I tried it, and the error is confusing. Actually, the problem is caused because there's no XML parser (which is only mentioned in the logs). After I add one, the app works fine, and the messages are displayed correctly (so the properties file gets correctly loaded). Remy cheers, -Ian -- Ian Kallen [EMAIL PROTECTED] | AIM: iankallen
Tomcat 4.0b7 and struts-example webapp
IIRC, the struts-example from struts 1.0 was happy with most of the recent Tomcat 3.2.x releases but with 4.0b7, it's not picking up the ApplicationResources.properties file. yes, it's in /struts-example/WEB-INF/classes/org/apache/struts/webapp/example/ApplicationResources.properties and web.xml has: servlet-nameaction/servlet-name servlet-classorg.apache.struts.action.ActionServlet/servlet-class init-param param-nameapplication/param-name param-valueorg.apache.struts.webapp.example.ApplicationResources/param-value /init-param right out of the war file... This is the error: javax.servlet.ServletException: Cannot find message resources under key org.apache.struts.action.MESSAGE So what's up? Is there something extra to setup the classpaths inside webapps under Tomcat 4.0? cheers, -Ian -- Ian Kallen [EMAIL PROTECTED] | AIM: iankallen
RE: looking for success stories
We've just finished phase1 of our system for the South African Revenue Services, an online tax return system, check it out on www.ipayment.co.za Unfortunately though, to get the full appreciation for the site one has to register as a taxpayer, but basically we used Tomcat, Struts and JBoss. The user is able to register and recieve and send their tax returns/payments electronically -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 22, 2001 10:06 PM To: [EMAIL PROTECTED] Subject: looking for success stories Hello, We are currently in the early design stages of an extremely high profile application and I am considering using Struts. I have used it in the past for several very small applications with no more than a couple concurrent users. But since we only get one shot at making this application work (or we'll all be out on our arses) I must make a very convincing case for Struts. Does anyone have any success stories that they'd like to share? Or can anyone point me in the direction of any articles or web pages or whatever where I may find info? By the way, we are going to deploy on Websphere (we're currently on 3.5.3 but will hopefully move to 4.0 before we roll it out) so I'd be especially interested if anyone has successfully deployed on WAS. Thanks! -Eric Stievater [EMAIL PROTECTED] *** IMPORTANT NOTE * The opinions expressed in this message and/or any attachments are those of the author and not necessarily those of Brown Brothers Harriman Co., its subsidiaries and affiliates (BBH). There is no guarantee that this message is either private or confidential, and it may have been altered by unauthorized sources without your or our knowledge. Nothing in the message is capable or intended to create any legally binding obligations on either party and it is not intended to provide legal advice. BBH accepts no responsibility for loss or damage from its use, including damage from virus. ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com **
RE: use of logic-tags
i'm using Nials new tags, I've built them into my struts.jar file what version of struts r u using. If u like I can send u my jar file and tld, very easy to get working...let me know -Original Message- From: Heritier Arnaud [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 23, 2001 2:08 PM To: '[EMAIL PROTECTED]' Subject: RE: use of logic-tags I think that you could implements rapidly somethink like : tag:if condition=???Boolean expression??? tag:thenHere it's evaluate only if condition is truetag:then/ tag:elseHere it's evaluate only if condition is falsetag:else/ tag:if/ arno -Message d'origine- De: Marcel Andres [SMTP:[EMAIL PROTECTED]] Date: jeudi 23 aout 2001 13:55 A: struts-user Objet: use of logic-tags Hi all, Two general questions: 1. Has someone an idea how to implement an ELSE with the logic-tags? Till now, I always made something like this (example): logic:equal . /logic:equal logic:notEqual . /logic:notEqual 2. Instead of using a string, which I can set to true or false, is there a possiblity to set a property to true or false (boolean) in the form, and use it later on from a jsp page? Thanks Marcel ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com **
Hi All, especially Nial Pemberton and Ted Husted - Re Logic Tags
Hi All, I just want to know wether Nials extra logic tags will ever be put into the Struts build? Thanx Regards, Dudley Butt Software Analyst/Developer Phone: +27 (0)21 936 7517 Mobile: +27 (0)83 327 5709 E-mail: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com **
Re: struts-user Digest 22 Aug 2001 16:40:53 -0000 Issue 668
Thanks for the idea Bill, this idea looks a little more elegant than my Struts hack idea since it wouldn't involve having to re-hack Struts each time it is re-released. I'll want to mull it over some more but at first glance this looks pretty doable. Also thanks to Tuesday's reply from Robert Parker. I'm not sure we can achieve the results we need using the static web app mappings in the war file alone. The reason is that we need to dynamically add a prefixing layer to our URIs to distinguish between the app root and the doc root. The web.xml mapping file would indeed allow us to map from /bar to /foo/bar, but in our case we also need to dynamically map to other app root prefixes as well. The main problem is that Struts [v1.0] seems to assume that the app root is always going to be a simple hardcoded slash / when in our case, if it is used at all, it is actually going to need to be dynamically generated as something resembling /prefixspec/. As such, we either need a way to dynamically prefix to the app root, or we need to remove the app root prefix altogether and enforce the use of relative URLs across all of our Struts based applications (which is also problematic). Bill's idea would provide a slicker way of undoing what Struts does to the prefix layer of our URIs, but it would be nice if Struts would allow us to dynamically map the absolute path prefix somehow to begin with. Thanks again, David McLure [EMAIL PROTECTED] [EMAIL PROTECTED] Date: Wed, 22 Aug 2001 10:01:47 -0400 To: [EMAIL PROTECTED] From: Bill Clinton [EMAIL PROTECTED] Subject: Re: Relative URL problem in action taglib processing Message-ID: [EMAIL PROTECTED] David, I am doing something similiar in an application I am working on. While I am not stripping the slash, I am modifying the path returned by an action mapping by adding parameters to it without modifying any Struts code. I recommend this solution (or something similar): Write an extension of ActionForward called SlashlessActionForward. Make the constructor of this object take an Action forward object like this: public SlashlessActionForward(ActionForward forward) { setName(forward.getName()); setPath(forward.getPath()); setRedirect(forward.getRedirect()); } now, override the getPath() method to return the path without the slash. (you would also need to overide setPath() to set a String property in your class) you can now use this in an ActionClass perform method like this: SlashlessActionForward forward = new SlashlessActionForward(mapping.findForward(success)); return forward; Bill -- Date: Tue, 21 Aug 2001 15:21:05 +1000 To: [EMAIL PROTECTED] From: Robert Parker [EMAIL PROTECTED] Subject: Re: Relative URL problem in action taglib processing Message-ID: 004a01c12a01$13b50990$[EMAIL PROTECTED] - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, August 21, 2001 3:49 PM Subject: Relative URL problem in action taglib processing Preliminary testing would indicate that this hack does seem to work, but I can't help but wonder: are we missing something? Is there an easier, more elegant way to achieve relative paths in action parameter references? I have been deploying my apps as webapps using a war file, that way, the paths are relative to the root directory of the deployed webapp. regards Rob
Relative URL problem in action taglib processing
We have encountered a minor problem using Struts with our back end architecture at Fidelity Investments. Using Struts version 1.0, all action references always end up translated to absolute paths when the JSP is translated to HTML. For example, an action=foo.do in a JSP is later converted into action=/foo.do in the resulting HTML file, even if it actually needs to remain a relative reference foo.do in order to work in our back end architecture. This is no real surprise I suppose, as the use of the absolute slash is mentioned in the Struts specification. As a result, we are considering hacking the Struts code in a couple of places to strip the absolute slash off of the front of the action reference path name before writing the HTML, and then re-adding it back again on the action mapping. After some investigation, it appears that this hack can be isolated to two spots: 1. org.apache.struts.util.ResponseUtils.write : Code to strip the prefixed slash from the beginning of the action= string just before it is written out to the response. 2. org.apache.struts.action.ActionMappings.findMapping : Code to prefix the slash back onto the front of the action= string (assuming the mapping can't be found without it). This seems to be the least painful solution because it seems to be isolated to two spots in the code and it does not involve hacking any taglibs which we don't want to touch since we would forever be hacking new taglibs for the rest of time. Preliminary testing would indicate that this hack does seem to work, but I can't help but wonder: are we missing something? Is there an easier, more elegant way to achieve relative paths in action parameter references? Thanks, David McLure [EMAIL PROTECTED] [EMAIL PROTECTED]