Re: Multiple Message Resource Files
Thank you, I will try that. David Chelimsky wrote: I know that if you're using the jstl tags you can define the bundle in the tags. So instead of: bean:message key="some.label"/> you'd write: fmt:message bundle="${currentBundle}" key="some.label"/> Then you can set the value of currentBundle in your Action based on the current project, or store it in the session when the user selects that project. In any case, I'm not sure if there's an equivalent in the struts bean tags. If not, I'd recommend using the JTSL tags. David Natalie D Rassmann wrote: >Hi, > >My requirement is to have multiple message resource files not based on >Locale but based on the user's project. For example, >I need to create a message bundle for Project A and another one for >Project B. > >MessageResources_ProjectA.properties looks like this: > >label.first = First Name >label.last = Last Name > >MessageResources_ProjectB properties lookes like this: > >label.first = First Initial >label.last = Last Initial > >My question is how do I do this? I believe it works similar to the >Struts Internationaliztion capablity where you can set a locale. >Is there some kind of variable I can set to distinguish what Project to >use? > >Can anyone point me in the right direction? > >Thanks in advance, > >Natalie > > > > > >- >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: passing parameters or object from one action to other
Isn't this just action chaining using HTTP instead of within the jvm? I'm not sure I get the reasons why action chaining is inherently a bad idea, though I do get that there are potential pitfalls if misused, but that's true of many patterns. Can you explain? Or point me to an article that explains? Thanks. Andrew Hill wrote: (Oops. Hit send too soon. Try again!) You can put them in the request as attributes and use a non-redirecting forward *but* then you are 'action chaining'. (Action chains are bad. n'kay) The other alternative - suitable for string parameters - is to make them request parameters by appending to the url. To do this you create a new forward based on the existing forward. ie in your action: ActionForward forward = mapping.findForward(myforward); forward = new ctionForward( addParameterToUrl(forward.getPath(),foo,bar), forward.getRedirect() ); return forward; where addParameterToUrl does something like: private String addParameterToURL(String url, String parameter, String value) { return url + ( (url.indexOf(?)==-1) ? ? : ) + parameter + = + value; } -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, 5 June 2003 19:25 To: [EMAIL PROTECTED] Subject: passing parameters or object from one action to other hi all, I have an action1 whose forward is another action2. I need to pass some parameters or object from action1 to action2 I don't want to put them(parameters or object) in the session. Is there a solution for doing that. thanks in advance Meissa L'integrite de ce message n'etant pas assuree sur internet, Natexis Banques Populaires ne peut etre tenu responsable de son contenu. Toute utilisation ou diffusion non autorisee est interdite. Si vous n'etes pas destinataire de ce message, merci de le detruire et d'avertir l'expediteur. The integrity of this message cannot be guaranteed on the Internet. Natexis Banques Populaires can not therefore be considered responsible for the contents.Any unauthorized use or dissemination is prohibited. If you are not the intended recipient of this message, then please delete it and notify the sender. - 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: nested form of bean:write doesn't work but plain does.
When struts says no getter method, it always gives you something like myClass.myFiled of MyActionForm no getter method. It is because of a bad reference or wrong hierarchy. You better show us the error message, hierarchy of your ActionForm and how you reference them. -Original Message- From: Rick Mann [mailto:[EMAIL PROTECTED] Sent: June 4, 2003 8:31 PM To: Struts Users Mailing List Subject: nested form of bean:write doesn't work but plain does. Hi. I've got a situation where I'm using nested:iterate to iterate over a List of beans, and then using nested:write to render some property (a string). We do this in multiple places in our app, but every now and again, in some instance of the code, it doesn't want to work. In these cases, we get a no getter method exception. However, if the code is switched to use the bean:write form, adding the name attribute, it works fine. Explicitly setting the type on the iterate tag makes no difference. Any ideas? P.S. I would have searched the archives, but they are down for a few days. TIA, -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Multiple Message Resource Files
Can't you just use the bundle att on the Struts message tag? -Original Message- From: David Chelimsky [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 8:55 AM To: Struts Users Mailing List Subject: Re: Multiple Message Resource Files I know that if you're using the jstl tags you can define the bundle in the tags. So instead of: bean:message key=some.label/ you'd write: fmt:message bundle=${currentBundle} key=some.label/ Then you can set the value of currentBundle in your Action based on the current project, or store it in the session when the user selects that project. In any case, I'm not sure if there's an equivalent in the struts bean tags. If not, I'd recommend using the JTSL tags. David Natalie D Rassmann wrote: Hi, My requirement is to have multiple message resource files not based on Locale but based on the user's project. For example, I need to create a message bundle for Project A and another one for Project B. MessageResources_ProjectA.properties looks like this: label.first = First Name label.last = Last Name MessageResources_ProjectB properties lookes like this: label.first = First Initial label.last = Last Initial My question is how do I do this? I believe it works similar to the Struts Internationaliztion capablity where you can set a locale. Is there some kind of variable I can set to distinguish what Project to use? Can anyone point me in the right direction? Thanks in advance, Natalie - 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: passing parameters or object from one action to other
If you take a quick look through the archives you will see it has been discussed quite a bit not all that long ago. -Original Message- From: David Chelimsky [mailto:[EMAIL PROTECTED] Sent: Thursday, 5 June 2003 20:59 To: Struts Users Mailing List Subject: Re: passing parameters or object from one action to other Isn't this just action chaining using HTTP instead of within the jvm? I'm not sure I get the reasons why action chaining is inherently a bad idea, though I do get that there are potential pitfalls if misused, but that's true of many patterns. Can you explain? Or point me to an article that explains? Thanks. Andrew Hill wrote: (Oops. Hit send too soon. Try again!) You can put them in the request as attributes and use a non-redirecting forward *but* then you are 'action chaining'. (Action chains are bad. n'kay) The other alternative - suitable for string parameters - is to make them request parameters by appending to the url. To do this you create a new forward based on the existing forward. ie in your action: ActionForward forward = mapping.findForward(myforward); forward = new ctionForward( addParameterToUrl(forward.getPath(),foo,bar), forward.getRedirect() ); return forward; where addParameterToUrl does something like: private String addParameterToURL(String url, String parameter, String value) { return url + ( (url.indexOf(?)==-1) ? ? : ) + parameter + = + value; } -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, 5 June 2003 19:25 To: [EMAIL PROTECTED] Subject: passing parameters or object from one action to other hi all, I have an action1 whose forward is another action2. I need to pass some parameters or object from action1 to action2 I don't want to put them(parameters or object) in the session. Is there a solution for doing that. thanks in advance Meissa L'integrite de ce message n'etant pas assuree sur internet, Natexis Banques Populaires ne peut etre tenu responsable de son contenu. Toute utilisation ou diffusion non autorisee est interdite. Si vous n'etes pas destinataire de ce message, merci de le detruire et d'avertir l'expediteur. The integrity of this message cannot be guaranteed on the Internet. Natexis Banques Populaires can not therefore be considered responsible for the contents.Any unauthorized use or dissemination is prohibited. If you are not the intended recipient of this message, then please delete it and notify the sender. - 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: Multiple Message Resource Files
yes -Original Message- From: Mike Jasnowski [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 8:58 AM To: Struts Users Mailing List Subject: RE: Multiple Message Resource Files Can't you just use the bundle att on the Struts message tag? -Original Message- From: David Chelimsky [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 8:55 AM To: Struts Users Mailing List Subject: Re: Multiple Message Resource Files I know that if you're using the jstl tags you can define the bundle in the tags. So instead of: bean:message key=some.label/ you'd write: fmt:message bundle=${currentBundle} key=some.label/ Then you can set the value of currentBundle in your Action based on the current project, or store it in the session when the user selects that project. In any case, I'm not sure if there's an equivalent in the struts bean tags. If not, I'd recommend using the JTSL tags. David Natalie D Rassmann wrote: Hi, My requirement is to have multiple message resource files not based on Locale but based on the user's project. For example, I need to create a message bundle for Project A and another one for Project B. MessageResources_ProjectA.properties looks like this: label.first = First Name label.last = Last Name MessageResources_ProjectB properties lookes like this: label.first = First Initial label.last = Last Initial My question is how do I do this? I believe it works similar to the Struts Internationaliztion capablity where you can set a locale. Is there some kind of variable I can set to distinguish what Project to use? Can anyone point me in the right direction? Thanks in advance, Natalie --- - - 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: Multiple Message Resource Files
I suppose I could but can I make that a variable that I can get out of the session? Mike Jasnowski wrote: Can't you just use the "bundle" att on the Struts message tag? -Original Message- From: David Chelimsky [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 05, 2003 8:55 AM To: Struts Users Mailing List Subject: Re: Multiple Message Resource Files I know that if you're using the jstl tags you can define the bundle in the tags. So instead of: bean:message key="some.label"/> you'd write: fmt:message bundle="${currentBundle}" key="some.label"/> Then you can set the value of currentBundle in your Action based on the current project, or store it in the session when the user selects that project. In any case, I'm not sure if there's an equivalent in the struts bean tags. If not, I'd recommend using the JTSL tags. David Natalie D Rassmann wrote: >Hi, > >My requirement is to have multiple message resource files not based on >Locale but based on the user's project. For example, >I need to create a message bundle for Project A and another one for >Project B. > >MessageResources_ProjectA.properties looks like this: > >label.first = First Name >label.last = Last Name > >MessageResources_ProjectB properties lookes like this: > >label.first = First Initial >label.last = Last Initial > >My question is how do I do this? I believe it works similar to the >Struts Internationaliztion capablity where you can set a locale. >Is there some kind of variable I can set to distinguish what Project to >use? > >Can anyone point me in the right direction? > >Thanks in advance, > >Natalie > > > > > >- >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]
calling actions directly
Hi again everyone, yet another question. I read that one of the things about struts is the actions are only able to be called from the pages directly. Ie, you shouldn't be able to bookmark the actions themselves like: http://myhost/myaction.do However, I can do this no problem and it runs the action. Am I missing something? I'm using JBoss3.04_tomcat4.1.12 thanks, Brian
RE: Multiple Message Resource Files
why would you want to? the bundle is static - it's an absolute reference -Original Message- From: Natalie D Rassmann [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 9:04 AM To: Struts Users Mailing List Subject: Re: Multiple Message Resource Files I suppose I could but can I make that a variable that I can get out of the session? Mike Jasnowski wrote: Can't you just use the bundle att on the Struts message tag? -Original Message- From: David Chelimsky [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 8:55 AM To: Struts Users Mailing List Subject: Re: Multiple Message Resource Files I know that if you're using the jstl tags you can define the bundle in the tags. So instead of: bean:message key=some.label/ you'd write: fmt:message bundle=${currentBundle} key=some.label/ Then you can set the value of currentBundle in your Action based on the current project, or store it in the session when the user selects that project. In any case, I'm not sure if there's an equivalent in the struts bean tags. If not, I'd recommend using the JTSL tags. David Natalie D Rassmann wrote: Hi, My requirement is to have multiple message resource files not based on Locale but based on the user's project. For example, I need to create a message bundle for Project A and another one for Project B. MessageResources_ProjectA.properties looks like this: label.first = First Name label.last = Last Name MessageResources_ProjectB properties lookes like this: label.first = First Initial label.last = Last Initial My question is how do I do this? I believe it works similar to the Struts Internationaliztion capablity where you can set a locale. Is there some kind of variable I can set to distinguish what Project to use? Can anyone point me in the right direction? Thanks in advance, Natalie - 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: Submit issue for new form with struts
Ya, have a hard coded .do the documnt.forms['frm'].submit throws a object doesnt support method or property when used in conjunction with struts - it works fine with plain ol' html essentially this is what i wish to do script function fnOpenDetails(RecClicked,RecNum) { var msgCategory = 'IS41'; RecSelected.className=ResultRow; RecClicked.className=SelRow; RecSelected=RecClicked; RowClicked=RecNum; document.forms[0].intRecordCount.value=RecNum document.forms[0].strMessageCategory.value = msgCategory document.forms[0].submit(); window.open(MinEsnDetailsGeneral.do,'Detailswindow','width=700,height=600') } /script I am unable to push the values i am setting in the script - eg intRecordCount into my FormBean so i need a submit ?? Raghu essentially a table of values (list of records) retrieved from the db - on the action of the first jsp on dbl clicking the list, That still doesn't answer the question about text or text boxes, so for now I'll assume this is text. i have a javascript function that captures the record index and tries opening another window(a popup type) that queries the db for further data based on the record dbl clicked, ok. As of now, I am able to configure the submit by giving the action=/popupdetails.do instead of plain action=popupdetails (w/o the '.do') this somehow calls the execute method of the corresponding action class!! So you've hard-coded .do on your page? now, i have a different issue :( i want to pass the record index into the popupdetails jsp and i do not want to construct a url with a request parameter since that makes the url editable and all. i thought i will use a property of the originating jsp formbean to hold the record index (of the dblclicked record - hidden variable and all) my doubt is : how can one set a property in the bean on dblclick of the record? I posted some sample html yesterday that (almost) demonstrates how to do this: form name=frm action=?same-page method=GET input type=hidden name=action value=/ input type=checkbox name=users value=Test1Test1br input type=checkbox name=users value=Test2Test2br input type=checkbox name=users value=Test3Test3br input type=checkbox name=users value=Test4Test4br input type=checkbox name=users value=Test5Test5br br a href=JavaScript:doForm('users.actions.add')Add/a | a href=JavaScript:doForm('users.actions.delete')Remove/a /form script function doForm(action){ document.forms['frm'].elements['action'].value=action; document.forms['frm'].submit() } /script ...modify this to work for your situation: - add target=_new to the form or - open your new window (with params) from the doForm function Or is there an alternative? Thanx in Advance, Raghu HTH -- James Mitchell Software Developer/Struts Evangelist http://www.struts-atlanta.org 770-822-3359 AIM:jmitchtx - 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: Multiple Message Resource Files
Sure, it's just a string, but you would most likely have to use a jsp expression to reference it (i.e. bundle=%= currentBundle %. Either method (JSTL or Struts) can work, I just wanted to communicate you could achieve the same result with the Struts tag as well. -Original Message- From: Natalie D Rassmann [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 9:04 AM To: Struts Users Mailing List Subject: Re: Multiple Message Resource Files I suppose I could but can I make that a variable that I can get out of the session? Mike Jasnowski wrote: Can't you just use the bundle att on the Struts message tag? -Original Message- From: David Chelimsky [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 8:55 AM To: Struts Users Mailing List Subject: Re: Multiple Message Resource Files I know that if you're using the jstl tags you can define the bundle in the tags. So instead of: bean:message key=some.label/ you'd write: fmt:message bundle=${currentBundle} key=some.label/ Then you can set the value of currentBundle in your Action based on the current project, or store it in the session when the user selects that project. In any case, I'm not sure if there's an equivalent in the struts bean tags. If not, I'd recommend using the JTSL tags. David Natalie D Rassmann wrote: Hi, My requirement is to have multiple message resource files not based on Locale but based on the user's project. For example, I need to create a message bundle for Project A and another one for Project B. MessageResources_ProjectA.properties looks like this: label.first = First Name label.last = Last Name MessageResources_ProjectB properties lookes like this: label.first = First Initial label.last = Last Initial My question is how do I do this? I believe it works similar to the Struts Internationaliztion capablity where you can set a locale. Is there some kind of variable I can set to distinguish what Project to use? Can anyone point me in the right direction? Thanks in advance, Natalie - 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: calling actions directly
I've noticed that I can do that too. I'm not expert, but I'm guessing that it's not an issue, and this behavior is fine (as long as it is login protected if necessary). I'm also GUESSING that the rule that actions can only be called from JSP pages is made with the assumption that you're taking input from that page to use within the action. So, if there is no input necessary for the action, then this is fine. Maybe some of the struts gurus out there can tell me if I'm on the right track? Keith Kamholz Programming and Architecture Moog Inc. Phone: (716) 687-7001 www.buffalo.edu/~kkamholz -Original Message- From: Brian McSweeney [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 9:03 AM To: Struts Users Mailing List Subject: calling actions directly Hi again everyone, yet another question. I read that one of the things about struts is the actions are only able to be called from the pages directly. Ie, you shouldn't be able to bookmark the actions themselves like: http://myhost/myaction.do However, I can do this no problem and it runs the action. Am I missing something? I'm using JBoss3.04_tomcat4.1.12 thanks, Brian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: struts validator
Also, It looks like Struts run-time does not validate validation.xml against DTD, as a result any typo there are welcome without warnings. This is a problem with commons-validator not validating the xml files. I have been working to fix this but other problems have taken priority. David The problems in the java part of Struts might be solved with any Java IDE, but the problems with XML part becomes a really personal problem of Struts developers. Actually, it was a primary reason we start to develop Struts Studio. Regards, Sergey Smirnov - Exadel Struts Studio - IDE for Struts http://www.exadel.com/strutsStudio - - Original Message - From: David Graham [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, June 04, 2003 6:32 PM Subject: RE: struts validator Beats me, dude. I struggled with it for 3 days and said enough is enough, and wrote my own validations in my Action classes. If you look through the mail archive, you'll see right off that this is what happens to the majority of people trying to get Validator to work. That's one reason I decided to volunteer over on commons-validator. I've made a major effort to cleanup the validator code so that we can fix bugs faster and make it easier to use. I'm definitely interested in fixing problems you have using it but with a description like, it works sometimes but not others is not very helpful. David Good luck, Mark -Original Message- From: Frances Aleah Z. de Guzman [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 04, 2003 8:55 PM To: Struts Users Mailing List; Mark Galbreath Subject: Re: struts validator how can i fix it? On Friday 30 May 2003 08:20 pm, Mark Galbreath wrote: That's because the Validator works by magic and you obviously have a hex in your machine. (sometimes I kill myself) Mark -Original Message- From: Frances Aleah Z. de Guzman [mailto:[EMAIL PROTECTED] Sent: Friday, May 30, 2003 2:49 AM To: [EMAIL PROTECTED] Subject: struts validator struts validator (client side validation) example is not working in my pc, even the struts example. but it is working with the other pcs in our office. i noticed that when i view the page source there is no javascript generated unlike in the other pc. is there still i have to configure or what? im using struts rc1.1 and j2sdk 1.4.1_02 and tomcat 4.1.24 as the web server and sometimes JBOSS 3.0.6 -- Frances Aleah Z. De Guzman SA/Programmer Ingenium Technology, Inc. http://www.ingenium.com.ph Disclaimer : This message is intended only for the named recipient. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited. - 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] _ The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail - 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] _ STOP MORE SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: struts validator
This was caused by a bug in commons-validator that was fixed some time ago. David hi, Can you please let me know of how do you get rid of this issuse ( i mean setting up the validator so that i need not be connected to the net ) ... Thanks Guru -Original Message- From: Brian McSweeney [mailto:[EMAIL PROTECTED] Sent: 05 June 2003 10:50 To: Struts Users Mailing List Subject: Re: struts validator I had initial trouble setting up the validator, mainly to do with it not working when you try to validate the dtd with a machine not connected to the net. It didn't give a good error explaining this. However, once I realised this was the problem, and set up the validator properly, it works really well. Especially, if, like me, you are new to javascript! Brian - Original Message - From: Mark Galbreath [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Thursday, June 05, 2003 5:18 AM Subject: RE: struts validator You know, I just don't get it. I think Validator was a great idea that simply proved wrong in implementation. And I know I am not alone it this assessment. Mark -Original Message- From: Jeff Kyser [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 12:03 AM To: Struts Users Mailing List Subject: Re: struts validator Like I said, I dont use client-side, and its been pretty smooth sailing for me. Sorry your experience was different, but personally, I like it. Especially defining constants for validation masks and using them over and over on lots of different forms in different projects even. And the requiredif has been pretty handy for a number of cases to boot Of course, there are still cases where I need to go to validate() methods in the actions, but they are less and less, just as I use actual FormBeans less and less, now that i halfway grok DynaValidatorForms... cheers, -jeff On Wednesday, June 4, 2003, at 10:40 PM, Mark Galbreath wrote: yeah, well, DUH! When are you guys going to realize that Validator should never have come out here even in beta. It sucks. Mark -Original Message- From: Jeff Kyser [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 04, 2003 9:25 PM To: Struts Users Mailing List Subject: Re: struts validator I only did server-side validations, using v1.1b3, until I saw lots of people complaining that v1.1rc1 wasn;t working for client-side validations. I tried it (rc1) and it didn't work for me either. I haven't messed with the nightly builds - just went back to 1.1b3. Its probably been fixed in the latest, but since 1.1rc2 is coming out soon, figure I'll wait until then to check it out again. -jeff On Wednesday, June 4, 2003, at 08:18 PM, Mark Galbreath wrote: Beats me, dude. I struggled with it for 3 days and said enough is enough, and wrote my own validations in my Action classes. If you look through the mail archive, you'll see right off that this is what happens to the majority of people trying to get Validator to work. Good luck, Mark -Original Message- From: Frances Aleah Z. de Guzman [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 04, 2003 8:55 PM To: Struts Users Mailing List; Mark Galbreath Subject: Re: struts validator how can i fix it? On Friday 30 May 2003 08:20 pm, Mark Galbreath wrote: That's because the Validator works by magic and you obviously have a hex in your machine. (sometimes I kill myself) Mark -Original Message- From: Frances Aleah Z. de Guzman [mailto:[EMAIL PROTECTED] Sent: Friday, May 30, 2003 2:49 AM To: [EMAIL PROTECTED] Subject: struts validator struts validator (client side validation) example is not working in my pc, even the struts example. but it is working with the other pcs in our office. i noticed that when i view the page source there is no javascript generated unlike in the other pc. is there still i have to configure or what? im using struts rc1.1 and j2sdk 1.4.1_02 and tomcat 4.1.24 as the web server and sometimes JBOSS 3.0.6 -- Frances Aleah Z. De Guzman SA/Programmer Ingenium Technology, Inc. http://www.ingenium.com.ph Disclaimer : This message is intended only for the named recipient. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited. - 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,
Re: struts validator
Not sure all this talk of validator is that justifiable. I've had no issues generating both the client side and server side validation, and its saved me a lot of work. Like others i think it would be nice to define form beans and validation rules in the same place but I like it as it is, unless anybody has any alternatives? One thing to consider is that Struts validation is based on commons-validator which reads its own xml config file. Moving the validation configuration to struts-config.xml would require us to do all the validator setup in Struts rather than leveraging the commons-validator code. David Thats my 2 pence.. Mark On Thursday, Jun 5, 2003, at 05:24 Europe/London, Jeff Kyser wrote: So jump in and help David fix it. Otherwise, you're likely to wake up and find a large block of cheddar in your bed. :) On Wednesday, June 4, 2003, at 11:18 PM, Mark Galbreath wrote: You know, I just don't get it. I think Validator was a great idea that simply proved wrong in implementation. And I know I am not alone it this assessment. Mark -Original Message- From: Jeff Kyser [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 12:03 AM To: Struts Users Mailing List Subject: Re: struts validator Like I said, I dont use client-side, and its been pretty smooth sailing for me. Sorry your experience was different, but personally, I like it. Especially defining constants for validation masks and using them over and over on lots of different forms in different projects even. And the requiredif has been pretty handy for a number of cases to boot Of course, there are still cases where I need to go to validate() methods in the actions, but they are less and less, just as I use actual FormBeans less and less, now that i halfway grok DynaValidatorForms... cheers, -jeff On Wednesday, June 4, 2003, at 10:40 PM, Mark Galbreath wrote: yeah, well, DUH! When are you guys going to realize that Validator should never have come out here even in beta. It sucks. Mark -Original Message- From: Jeff Kyser [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 04, 2003 9:25 PM To: Struts Users Mailing List Subject: Re: struts validator I only did server-side validations, using v1.1b3, until I saw lots of people complaining that v1.1rc1 wasn;t working for client-side validations. I tried it (rc1) and it didn't work for me either. I haven't messed with the nightly builds - just went back to 1.1b3. Its probably been fixed in the latest, but since 1.1rc2 is coming out soon, figure I'll wait until then to check it out again. -jeff On Wednesday, June 4, 2003, at 08:18 PM, Mark Galbreath wrote: Beats me, dude. I struggled with it for 3 days and said enough is enough, and wrote my own validations in my Action classes. If you look through the mail archive, you'll see right off that this is what happens to the majority of people trying to get Validator to work. Good luck, Mark -Original Message- From: Frances Aleah Z. de Guzman [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 04, 2003 8:55 PM To: Struts Users Mailing List; Mark Galbreath Subject: Re: struts validator how can i fix it? On Friday 30 May 2003 08:20 pm, Mark Galbreath wrote: That's because the Validator works by magic and you obviously have a hex in your machine. (sometimes I kill myself) Mark -Original Message- From: Frances Aleah Z. de Guzman [mailto:[EMAIL PROTECTED] Sent: Friday, May 30, 2003 2:49 AM To: [EMAIL PROTECTED] Subject: struts validator struts validator (client side validation) example is not working in my pc, even the struts example. but it is working with the other pcs in our office. i noticed that when i view the page source there is no javascript generated unlike in the other pc. is there still i have to configure or what? im using struts rc1.1 and j2sdk 1.4.1_02 and tomcat 4.1.24 as the web server and sometimes JBOSS 3.0.6 -- Frances Aleah Z. De Guzman SA/Programmer Ingenium Technology, Inc. http://www.ingenium.com.ph Disclaimer : This message is intended only for the named recipient. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To
Re: Handling ServletException
The Struts exception handling mechanism only handles exceptions thrown from Action.execute() methods. Your JSP is probably throwing an exception so you need to setup error-page elements in web.xml to point to a friendlier error page. David Hi. I've followed everyones advice and written a custom Exception handler. The exceptionhandler is set up in struts-config to catch all exceptions : !-- Global Exceptions -- global-exceptions exception handler=mypackage.strutsextensions.CustomizedExceptionHandler key=global.error.message scope=request type=java.lang.Exception/ /global-exceptions This works great, but my problem is that sometimes there occures a SerlvetException which is just presented on screen and is not caught by my CustomizedExceptionHandler. I believe that this is because the ServletException is thrown by the container ?? Anyhow, I would like to catch these exceptions as well, and preferably route them to my custom Error handler. Does anyone have some advice on how to handle ServletExceptions to give the user better information ? Best Regards Eirik Kjølsrud, Norway - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
sslext
Dears, The tag sslext:link doesnt appear to work very well with html:rewrite... The link isnt render. I am using complete path to skip this problem... logic:iterate name=valueObjectproperty=addresses id=address tr td /td td sslext:link href=../addresses/main.do paramId=hash paramName=äddress paramProperty=hash bean:write name=address property=streetAddress/ /sslext:link /td /tr It is ugly... but, what can I do ? Rodrigo di Lorenzo Lopes - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
logic:iterate break
Is there a way to break out of an iterate after a certain amount of iterations. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: logic:iterate break
Got it. Length -Original Message- From: Steven Sajous [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 10:09 AM To: Struts Users Mailing List Subject: logic:iterate break Is there a way to break out of an iterate after a certain amount of iterations. - 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]
question about struts
hi all, i have been working with JSP model 2 for few years, and now i want to move to struts. i am starting to get acquainted with it, and i need help to face this situation. in my mvc, i am using 2 components, one to connect to R3 and the other for connecting to DB. the lifecycle of those components is the same as my servlet, since those components are not user/session/request specific. in reading docs about struts, i could not figure out where to put those components in the struts framework. of course, i can put them in ActionServlet, but this will require me to modify the code of the ActionServlet. is there any other way to do that other than modifying the code of ActionServlet? hope someone can help... thanx in advance and regards marco - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: sslext
are you sure you not looking for the page attribute? sslext:link page=/main.do. On Thursday, Jun 5, 2003, at 15:02 Europe/London, Rodrigo di Lorenzo Lopes wrote: Dears, The tag sslext:link doesnt appear to work very well with html:rewrite... The link isnt render. I am using complete path to skip this problem... logic:iterate name=valueObjectproperty=addresses id=address tr td /td td sslext:link href=../addresses/main.do paramId=hash paramName=äddress paramProperty=hash bean:write name=address property=streetAddress/ /sslext:link /td /tr It is ugly... but, what can I do ? Rodrigo di Lorenzo Lopes - 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: sslext
Oh ! I am sorry sirs (I feel so stupid)... yes! page attribute works with sslext. Thanx a lot. Mark Lowe writes: are you sure you not looking for the page attribute? sslext:link page=/main.do. On Thursday, Jun 5, 2003, at 15:02 Europe/London, Rodrigo di Lorenzo Lopes wrote: Dears, The tag sslext:link doesnt appear to work very well with html:rewrite... The link isnt render. I am using complete path to skip this problem... logic:iterate name=valueObjectproperty=addresses id=address tr td /td td sslext:link href=../addresses/main.do paramId=hash paramName=äddress paramProperty=hash bean:write name=address property=streetAddress/ /sslext:link /td /tr It is ugly... but, what can I do ? Rodrigo di Lorenzo Lopes - 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] -- Rodrigo di Lorenzo Lopes (Mineirinho) - ICQ 52982003 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: question about struts
You can use a Struts PlugIn to initialize your components and store them in the ServletContext. David hi all, i have been working with JSP model 2 for few years, and now i want to move to struts. i am starting to get acquainted with it, and i need help to face this situation. in my mvc, i am using 2 components, one to connect to R3 and the other for connecting to DB. the lifecycle of those components is the same as my servlet, since those components are not user/session/request specific. in reading docs about struts, i could not figure out where to put those components in the struts framework. of course, i can put them in ActionServlet, but this will require me to modify the code of the ActionServlet. is there any other way to do that other than modifying the code of ActionServlet? hope someone can help... thanx in advance and regards marco - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. http://join.msn.com/?page=features/virus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: calling actions directly
I read that one of the things about struts is the actions are only able to be called from the pages directly. Ie, you shouldn't be able to bookmark the actions themselves like: http://myhost/myaction.do Where did you hear this? That's totally not true - any action can be called directly as long as it has a mapping. It's just a URL. Otherwise, how would you enter the first action? :) Perhaps what you're thinking of is that JSP files should not be called directly or bookmarked. They should be hidden from the user completely, and only accessible through an action. Matt Kruse
RE: [OT] Reach out and touch someone?
Thank you. Some of the stuff is funny but lately I've been filtering all but Craig-- it's a good strategy in general for keeping up with struts, but I'm sure there are a lot of other posts that are interesting that I miss. He's right-- the reason most people subscribe has to do with struts not society. -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 04, 2003 10:03 PM To: Struts Users Mailing List Subject: RE: [OT] Reach out and touch someone? Mark (and others) OK guys ... I'm glad you've had your fun ... but an [OT] subject doesn't excuse the absolute and total garbage that has been going on the last few weeeks on this list. There is a line between having an open community that likes to have fun, and a mailing list where the amount of off-topic stuff (even if marked with [OT]) encourages people not to participate any longer. I believe that the struts-user list has gone over that line in the last month. And the trend line is that it's getting worse, not better. If people want to argue about what beer is good, or ribbing each other, or whining because you are still working late at night or on weekends, or ragging each other, or complaining about any other off-topic subject, that is fine ... but please do it elsewhere. I'm not interested. Neither are the vast majority of subscribers to this list. Please take the [OT] posts elsewhere. And, unless the [Friday] posts start to get at least semi-relavant to the Struts community, they are going to be reduced/restricted as well. Craig McClanahan On Wed, 4 Jun 2003, Mark Galbreath wrote: Date: Wed, 4 Jun 2003 23:46:40 -0400 From: Mark Galbreath [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: RE: [OT] Reach out and touch someone? reach out and touch somebody at irc.darkmyst.org 6667 and flame the hell out of me at #struts-user, you LISP fag. If you even know how to get around in a Unix environment on the Net. You are probably so full of Foster piss, you can't even type your way out of a virtual paper bag. Mark -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 04, 2003 11:35 PM To: Struts Users Mailing List Subject: RE: [OT] Reach out and touch someone? I dont drink fost.. oh! you mean Mark! ;- -Original Message- From: Chappell, Simon P [mailto:[EMAIL PROTECTED] Sent: Thursday, 5 June 2003 01:43 To: Struts Users Mailing List Subject: RE: [OT] Reach out and touch someone? Well, don't be telling everyone ... or he'll turn into a bitter and cynical foster's beer drinking grouch like someone we all know! ;-) -Original Message- From: Mark Galbreath [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 04, 2003 12:40 PM To: 'Struts Users Mailing List' Subject: [OT] Reach out and touch someone? heh heh...Brandon is flirting with Becky on irc.darkmyst.org 6667 right now -Original Message- From: James Mitchell [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 04, 2003 1:23 PM The quickest way to reach me is with AIM. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: calling actions directly
+ 1 It helps if people read one of the many books on Struts or one of the many tutorials on Struts or take one of the many instructor lead hands on training classes on Struts (I have many competitors now, just google for Struts training). (I think we need a bit of RTFM) .V ps/ot: Just hours before FRIDAY! Kruse, Matt wrote: I read that one of the things about struts is the actions are only able to be called from the pages directly. Ie, you shouldn't be able to bookmark the actions themselves like: http://myhost/myaction.do Where did you hear this? That's totally not true - any action can be called directly as long as it has a mapping. It's just a URL. Otherwise, how would you enter the first action? :) Perhaps what you're thinking of is that JSP files should not be called directly or bookmarked. They should be hidden from the user completely, and only accessible through an action. Matt Kruse -- Vic Cekvenich, Struts Instructor, 1-800-917-JAVA Advanced a href =baseBeans.comStruts Training/a and project recovery in North East. Open Source a href =baseBeans.comContent Management/a basicPortal sofware Best practicea href =baseBeans.comStruts Support/a v.1.1 helper ScafflodingXPress
Re: Submit issue for new form with struts
Ok, I think I've got what you were looking for. This script uses a link to set hidden fields which are submitted to your customized window (hidden toolbar, etc). You can copy and paste this as a simple jsp to test. I've added some debugging (snoop) stuff at the bottom just to verify that the params were passed correctly. Let me know if this helps or if you need more help tweaking it. -- form name=frm2 action=? method=GET table border=1 tr td a href=# onclick=fnOpenDetails(1, 'IS41')Sample Data 1/a /td td more stuff /td /tr tr td a href=# onclick=fnOpenDetails(2, 'IS41')Sample Data 2/a /td td more stuff /td /tr /table input type=submit name=sbmt value=Submit input type=hidden name=intRecordCount value=xxx input type=hidden name=strMessageCategory value=xxx /form script function fnOpenDetails(RecNum, msgCategory){ var newWindow; newWindow = window.open(, 'Detailswindow', 'width=700,height=600,toolbar=no,scrollbars=yes,resizable=no'); //window.open(MinEsnDetailsGeneral.do,'Detailswindow','width=700,height=60 0'); document.forms[0].target='Detailswindow'; document.forms[0].elements[intRecordCount].value = RecNum; document.forms[0].elements[strMessageCategory].value = msgCategory; document.forms[0].submit(); return false; } /script pre % java.util.Enumeration enum = null; ServletContext context = getServletContext(); try{ out.println(h3Servlet init parameters/h3); enum = getInitParameterNames(); while (enum.hasMoreElements()) { String key = (String)enum.nextElement(); String value = getInitParameter(key); out.println(+ key + = + value); } } catch(Exception e){ //continue } try{ out.println(h3Context init parameters/h3); enum = context.getInitParameterNames(); while (enum.hasMoreElements()) { String key = (String)enum.nextElement(); Object value = context.getInitParameter(key); out.println(+ key + = + value); } } catch(Exception e){ //continue } try{ out.println(h3Context attributes/h3); enum = context.getAttributeNames(); while (enum.hasMoreElements()) { String key = (String)enum.nextElement(); Object value = context.getAttribute(key); out.println(+ key + = + value); } } catch(Exception e){ //continue } try{ out.println(Request attributes:); enum = request.getAttributeNames(); while (enum.hasMoreElements()) { String key = (String)enum.nextElement(); Object value = request.getAttribute(key); out.println(+ key + = + value); } } catch(Exception e){ //continue } try{ //java.util.Enumeration enum = request.getHeaderNames(); while (enum.hasMoreElements()) { String key = (String)enum.nextElement(); String value = request.getHeader(key); out.println( b + key + /b: + value); } } catch(Exception e){ //continue } out.println(Servlet Name: + getServletName()); out.println(Protocol: + request.getProtocol().trim()); out.println(Scheme: + request.getScheme()); out.println(Server Name: + request.getServerName()); out.println(Server Port: + request.getServerPort()); out.println(Server Info: + getServletContext().getServerInfo()); out.println(Remote Addr: + request.getRemoteAddr()); out.println(Remote Host: + request.getRemoteHost()); out.println(Character Encoding: + request.getCharacterEncoding()); out.println(Content Length: + request.getContentLength()); out.println(Content Type: + request.getContentType()); out.println(Locale: + request.getLocale()); out.println(Default Response Buffer: + response.getBufferSize()); out.println(Request Is Secure: + request.isSecure()); out.println(Auth Type: + request.getAuthType()); out.println(HTTP Method: + request.getMethod()); out.println(Remote User: + request.getRemoteUser()); out.println(Request URI: + request.getRequestURI()); out.println(Context Path: + request.getContextPath()); out.println(Servlet Path: + request.getServletPath()); out.println(Path Info: + request.getPathInfo()); out.println(Path Trans: + request.getPathTranslated()); out.println(Query String: + request.getQueryString()); try{ out.println(Parameter names in this request:); //java.util.Enumeration enum = request.getParameterNames(); while (enum.hasMoreElements()) { String key = (String)enum.nextElement(); String[] values = request.getParameterValues(key); out.print(+ key + = ); for(int i = 0; i values.length; i++) { out.print(values[i] + ); } out.println(); } } catch(Exception e){ //continue } try{ out.println(h3Request Headers/h3); //java.util.Enumeration enum = request.getHeaderNames(); while (enum.hasMoreElements()) { String key = (String)enum.nextElement(); String value = request.getHeader(key); out.println(+ key + : + value); } } catch(Exception e){ //continue } try{ out.println(h3Cookies/h3); Cookie[] cookies = request.getCookies(); for (int i = 0; i cookies.length; i++) { Cookie cookie = cookies[i]; out.println(
dynamic paths to images
I have to generate dynamic paths to images (depending on the date). My jsp scriplet looks like this: bean:define id=imagePath name=imageProvider property=path/ img src='%=request.getContextPath()%bean:write name=imagePath/' where 'imageProvider' is an attribute in session scope with a property 'path'. It works, however it is not very elegant. Who knows a nicer solution? Thanks. Peter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: calling actions directly
Ah yes, Perhaps what you're thinking of is that JSP files should not be called directly or bookmarked. They should be hidden from the user completely, and only accessible through an action. that was it - sorry - stupid of me. Could you tell me how to secure the jsps so that they are only a result of the action? cheers, Brian - Original Message - From: Kruse, Matt [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, June 05, 2003 3:12 PM Subject: RE: calling actions directly I read that one of the things about struts is the actions are only able to be called from the pages directly. Ie, you shouldn't be able to bookmark the actions themselves like: http://myhost/myaction.do Where did you hear this? That's totally not true - any action can be called directly as long as it has a mapping. It's just a URL. Otherwise, how would you enter the first action? :) Perhaps what you're thinking of is that JSP files should not be called directly or bookmarked. They should be hidden from the user completely, and only accessible through an action. Matt Kruse - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How to repopulate Form which has html elements with same name
Hi I am a newbie to struts... I have a dynamic table which has a html:text and a html:select . The user cliks on a add button and enter values in each row of the table and submits the form. How can I repopulate the valuse if validation fails. Can some body give a working exapmle of the Action Form that is required for this kind of requirement. I found this in Ted Husted site but had no clue as what he is trying to do, What is RESULT etc -- TABLEhtml:form action=/item/StoreCategory logic:iterate name=RESULT property=iterator id=row TR THname/TH THcategory/TH /TR TR TDbean:write name=row property=name//TD TD%-- REMEMBER TO SPECIFY THE ITERATE ID AS THE NAME --% html:select name=row property=category html:option value=ARTArt/html:option html:option value=AUTAutomotive/html:option %-- ... --% /html:select %-- REMEMBER TO SPECIFY THE ITERATE ID AS THE NAME --% html:hidden name=row property=key/ /TD /TR /logic:iterate TR TD colspan=2 align=right html:submit/ /TD /TR /html:form /TABLE
Re: calling actions directly
Brian, If you put all your jsp's inside a the WEB-INF directory, they will not be accessible directly -- only through an action. I think this is part of the jsp specification that nothing can be directly served out of this special directory..Otherwise, a user could pull up configuration files that reside there -- web.xml for example.For example, I have a directory structure containing jsp's under WEB-INF/jsp in my current web applicationHope this helps! --nathan On Thursday, June 5, 2003, at 09:47 AM, Brian McSweeney wrote: Ah yes, Perhaps what you're thinking of is that JSP files should not be called directly or bookmarked. They should be hidden from the user completely, and only accessible through an action. that was it - sorry - stupid of me. Could you tell me how to secure the jsps so that they are only a result of the action? cheers, Brian - Original Message - From: Kruse, Matt [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, June 05, 2003 3:12 PM Subject: RE: calling actions directly I read that one of the things about struts is the actions are only able to be called from the pages directly. Ie, you shouldn't be able to bookmark the actions themselves like: http://myhost/myaction.do Where did you hear this? That's totally not true - any action can be called directly as long as it has a mapping. It's just a URL. Otherwise, how would you enter the first action? :) Perhaps what you're thinking of is that JSP files should not be called directly or bookmarked. They should be hidden from the user completely, and only accessible through an action. Matt Kruse - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] = Nathan Pitts Programmer Analyst Texas Animal Health Commission = - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: struts-el question
Look at the description of the c:forEach tag in the JSTL specification (or one of the books). You'll see the varStatus attribute. -Original Message- From: Matthew Van Horn [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 04, 2003 6:50 PM To: Struts Users Mailing List Subject: Re: struts-el question Is there a property in class MyForm named columns? It's in the base class that MyForm extends. Can you post the block using tags and the error? I got it working, although it is not what I would think of as elegant. here: c:set var=row value=0/ c:forEach var=foo items=${candidateSearchForm.candidateColumns} step=7 tr c:forEach var=cell begin=${7*row} end=${7*row+6} step=1 td align=left valign=top c:if test=${!empty candidateSearchForm.candidateColumns[cell]} html-el:multibox property=selectedColumns value=${candidateSearchForm.candidateColumns[cell]}/ /c:if /td td align=left valign=top c:if test=${!empty candidateSearchForm.candidateColumns[cell]} c:out value=${candidateSearchForm.candidateColumns[cell]}/ /c:if /td /c:forEach /tr c:set var=row value=${row + 1}/ /c:forEach I wish I had a solution that didn't need the !empty test, or the row = row + 1 bit. Matthew Van Horn wrote: How do I access the form bean properties from my jsp page? I have a property called columns which is a String[] array. I'd like to do the equivalent of the following using tags. % String[] myArray = myForm.getColumns(); for (int i=0; i myArray.length; i = i+7) { out.print(TR); for (int j=0; j 7; j++) { out.print(TD+ myArray[(i*7)+j] +/TD); } out.print(/TR); } % I tried this (saw it online) - but I get an error about accessing the columns property. c:forEach var=row begin=0 items=${myForm.columns} step=7 If it matters, columns is inherited from a BaseForm class. Thanks for helping, 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]
advice on reset method not being called 2nd time
I have 2 jsp page that has their appropriate actions and forms: 1. admin 2. creating a new survey both scopes are request 1. * @struts.action name=SurveyAdminForm * path=/SurveyAdmin * validate=true * scope=request * input=/survey/survey_admin.jsp * * @struts.action-forward name=New path=/survey/new_survey_question.jsp redirect=true * @struts.action-forward name=Edit path=/survey/edit_survey.jsp redirect=true * @struts.action-forward name=Reports path=/survey/survey_reports.jsp redirect=true 2. * @struts.action name=NewSurveyQuestionForm * path=/NewSurveyQuestion * validate=true * scope=request * input=/survey/new_survey_question.jsp * @struts.action-forward name=Cancel path=/survey/survey_admin.jsp redirect=true * @struts.action-forward name=Save path=/survey/survey_admin.jsp redirect=true When i call #1 first its reset is called. then i select the new button that calls #2 (create a new survey). The first time #2 is called its reset() method is executed. The problem i have is after i submit the data on #2 it goes back to #1. But when i select new again (to go to #2) the reset() method is never executed. But the reset() method for #1 is always called. Any ideas on this? Thanks -- Best regards, netizen1 mailto:[EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts Logic iterate vs JSTL Code forEach
It will stay in the contrib directory, or move out to a separate release. It will never go into the base Struts distribution, for good reason. Once JSP 2.0 is commonly available, the EL notation will be natively supported, and Struts-EL won't be needed. -Original Message- From: Derek Richardson [mailto:[EMAIL PROTECTED] Thanks. I submitted a patch to bugzilla. What does it mean that struts-el is still in the contrib directory? At what point will it migrate to struts-proper? I find it amazingly useful and forward-looking and so am puzzled that it is placed in an apparently peripheral position. Is this just on hold until after 1.1 final? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] Reach out and touch someone?
Yeah, as one of the bad boys of the Struts list, I understand. The Struts list is almost a victim of it's own success and has spawned a very active community of users that enjoy interacting and being varying amounts of OT. We are in the process of figuring out how to continue to enjoy our many and varied side conversations without upsetting, offending or scaring off the less outgoing members of the Struts community. This last friday, a number of the more vocal elements of the list had a multi-way Yahoo IM chat, it was great fun and almost totally OT, yet we were disturbing no one on the list. A win-win perhaps? I'll continue to work on solutions such as the group chats that work for the good of the majority. More news as I have it. (Allow a while, as the solution needs to work for windows, mac and linux users) Simon - Simon P. Chappell [EMAIL PROTECTED] Java Programming Specialist www.landsend.com Lands' End, Inc. (608) 935-4526 Never give in - never, never, never, never, in nothing great or small, large or petty, never give in except to convictions of honor and good sense. - Sir Winston Churchill -Original Message- From: Taylor, Jason [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 9:31 AM To: 'Struts Users Mailing List' Subject: RE: [OT] Reach out and touch someone? Thank you. Some of the stuff is funny but lately I've been filtering all but Craig-- it's a good strategy in general for keeping up with struts, but I'm sure there are a lot of other posts that are interesting that I miss. He's right-- the reason most people subscribe has to do with struts not society. snip Craig's comments - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
switch statement
Hey everyone, This is more of a Java question than a Struts question, I hope you all don't mind. I'm just wondering if there is any way to use a String for a switch statement, or if you are restricted to the true primitive types. I haven't found a way, but it seems like something that lots of people would want that wouldn't be hard for the Java developers to allow for. Wouldn't you agree? Keith Kamholz Programming and Architecture Moog Inc. Phone: (716) 687-7001 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: calling actions directly
Unfortunately, not all web containers will support this. There was apparent disagreement on the interpretation of the specification in this area. In particular, WebLogic does not support this. I believe, however, that in version 8.1 it's possible to do this, although I believe you have to set some non-standard configuration flag. I don't know the details. The alternative is to put all JSP pages into a security constraint on a role that no user is set to. -Original Message- From: Nathan Pitts [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 8:02 AM To: Struts Users Mailing List Subject: Re: calling actions directly Brian, If you put all your jsp's inside a the WEB-INF directory, they will not be accessible directly -- only through an action. I think this is part of the jsp specification that nothing can be directly served out of this special directory..Otherwise, a user could pull up configuration files that reside there -- web.xml for example.For example, I have a directory structure containing jsp's under WEB-INF/jsp in my current web applicationHope this helps! --nathan On Thursday, June 5, 2003, at 09:47 AM, Brian McSweeney wrote: Ah yes, Perhaps what you're thinking of is that JSP files should not be called directly or bookmarked. They should be hidden from the user completely, and only accessible through an action. that was it - sorry - stupid of me. Could you tell me how to secure the jsps so that they are only a result of the action? cheers, Brian - Original Message - From: Kruse, Matt [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, June 05, 2003 3:12 PM Subject: RE: calling actions directly I read that one of the things about struts is the actions are only able to be called from the pages directly. Ie, you shouldn't be able to bookmark the actions themselves like: http://myhost/myaction.do Where did you hear this? That's totally not true - any action can be called directly as long as it has a mapping. It's just a URL. Otherwise, how would you enter the first action? :) Perhaps what you're thinking of is that JSP files should not be called directly or bookmarked. They should be hidden from the user completely, and only accessible through an action. Matt Kruse - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] = Nathan Pitts Programmer Analyst Texas Animal Health Commission = - 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: calling actions directly
thanks Nathan! makes perfect sense :-) Brian - Original Message - From: Nathan Pitts [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, June 05, 2003 4:02 PM Subject: Re: calling actions directly Brian, If you put all your jsp's inside a the WEB-INF directory, they will not be accessible directly -- only through an action. I think this is part of the jsp specification that nothing can be directly served out of this special directory..Otherwise, a user could pull up configuration files that reside there -- web.xml for example.For example, I have a directory structure containing jsp's under WEB-INF/jsp in my current web applicationHope this helps! --nathan On Thursday, June 5, 2003, at 09:47 AM, Brian McSweeney wrote: Ah yes, Perhaps what you're thinking of is that JSP files should not be called directly or bookmarked. They should be hidden from the user completely, and only accessible through an action. that was it - sorry - stupid of me. Could you tell me how to secure the jsps so that they are only a result of the action? cheers, Brian - Original Message - From: Kruse, Matt [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, June 05, 2003 3:12 PM Subject: RE: calling actions directly I read that one of the things about struts is the actions are only able to be called from the pages directly. Ie, you shouldn't be able to bookmark the actions themselves like: http://myhost/myaction.do Where did you hear this? That's totally not true - any action can be called directly as long as it has a mapping. It's just a URL. Otherwise, how would you enter the first action? :) Perhaps what you're thinking of is that JSP files should not be called directly or bookmarked. They should be hidden from the user completely, and only accessible through an action. Matt Kruse - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] = Nathan Pitts Programmer Analyst Texas Animal Health Commission = - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Reach out and touch someone?
Yes, that was a lot of fun. Be forewarned though, as someone said, being on-topic will get you flamed ;) -- James Mitchell Software Developer/Struts Evangelist http://www.struts-atlanta.org 770-822-3359 AIM:jmitchtx - Original Message - From: Chappell, Simon P [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, June 05, 2003 11:02 AM Subject: RE: [OT] Reach out and touch someone? Yeah, as one of the bad boys of the Struts list, I understand. The Struts list is almost a victim of it's own success and has spawned a very active community of users that enjoy interacting and being varying amounts of OT. We are in the process of figuring out how to continue to enjoy our many and varied side conversations without upsetting, offending or scaring off the less outgoing members of the Struts community. This last friday, a number of the more vocal elements of the list had a multi-way Yahoo IM chat, it was great fun and almost totally OT, yet we were disturbing no one on the list. A win-win perhaps? I'll continue to work on solutions such as the group chats that work for the good of the majority. More news as I have it. (Allow a while, as the solution needs to work for windows, mac and linux users) Simon - Simon P. Chappell [EMAIL PROTECTED] Java Programming Specialist www.landsend.com Lands' End, Inc. (608) 935-4526 Never give in - never, never, never, never, in nothing great or small, large or petty, never give in except to convictions of honor and good sense. - Sir Winston Churchill -Original Message- From: Taylor, Jason [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 9:31 AM To: 'Struts Users Mailing List' Subject: RE: [OT] Reach out and touch someone? Thank you. Some of the stuff is funny but lately I've been filtering all but Craig-- it's a good strategy in general for keeping up with struts, but I'm sure there are a lot of other posts that are interesting that I miss. He's right-- the reason most people subscribe has to do with struts not society. snip Craig's comments - 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: How to repopulate Form which has html elements with same name
doesn't the form do this automatically? if validation fails, i think the standard behavior is to return the user to the page just as they left it -- preferably with the appropriate error messagei know there are multiple ways to do the validation (and i'm not using the best way), but one way is to have a method like the one below in you form bean. If any of the following conditions are met, the user is returned to the page with the form populated. Hope this helps. -nathan public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { ActionErrors errors = new ActionErrors(); if (this.isBlankString(oldpassword)) { errors.add(oldpassword,new ActionError(error.required.oldpassword)); } if (this.isBlankString(newpassword1)) { errors.add(newpassword1, new ActionError(error.required.newpassword1)); } if (this.isBlankString(newpassword2)) { errors.add(newpassword2, new ActionError(error.required.newpassword2)); } // Test to see if the new passwords are the same. if (!newpassword1.equals(newpassword2)) { errors.add(newpassword1, new ActionError(error.passwordmatch)); } return errors; } On Thursday, June 5, 2003, at 09:59 AM, Sashi Ravipati wrote: Hi I am a newbie to struts... I have a dynamic table which has a html:text and a html:select . The user cliks on a add button and enter values in each row of the table and submits the form. How can I repopulate the valuse if validation fails. Can some body give a working exapmle of the Action Form that is required for this kind of requirement. I found this in Ted Husted site but had no clue as what he is trying to do, What is RESULT etc --- --- TABLEhtml:form action=/item/StoreCategory logic:iterate name=RESULT property=iterator id=row TR THname/TH THcategory/TH /TR TR TDbean:write name=row property=name//TD TD%-- REMEMBER TO SPECIFY THE ITERATE ID AS THE NAME --% html:select name=row property=category html:option value=ARTArt/html:option html:option value=AUTAutomotive/html:option %-- ... --% /html:select %-- REMEMBER TO SPECIFY THE ITERATE ID AS THE NAME --% html:hidden name=row property=key/ /TD /TR /logic:iterate TR TD colspan=2 align=right html:submit/ /TD /TR /html:form /TABLE --- - = Nathan Pitts Programmer Analyst Texas Animal Health Commission = - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
struts blank.war and blank.jar
I am trying to get started withe the stuts blank project. I have modified the build.xml and compiled the blank example sucessfully. My questions is that on building the example my blank.war file is created along with a blank.jar. Extracting the blank.jar shows the projects resources/application.properties file. However this file is included in withe war file and the war file deploys to tomcat with no problems. Therfore what is the purpose of having my application.resources file built to a seperate jar file in this manner? cheers Andy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: calling actions directly
Right, I'm running Websphere and we couldn't get it to work. However, I just upgraded to version 5. Does anyone know if changes in v5 allow the web-inf trick to work? Keith Kamholz Programming and Architecture Moog Inc. Phone: (716) 687-7001 -Original Message- From: Karr, David [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 11:09 AM To: Struts Users Mailing List Subject: RE: calling actions directly Unfortunately, not all web containers will support this. There was apparent disagreement on the interpretation of the specification in this area. In particular, WebLogic does not support this. I believe, however, that in version 8.1 it's possible to do this, although I believe you have to set some non-standard configuration flag. I don't know the details. The alternative is to put all JSP pages into a security constraint on a role that no user is set to. -Original Message- From: Nathan Pitts [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 8:02 AM To: Struts Users Mailing List Subject: Re: calling actions directly Brian, If you put all your jsp's inside a the WEB-INF directory, they will not be accessible directly -- only through an action. I think this is part of the jsp specification that nothing can be directly served out of this special directory..Otherwise, a user could pull up configuration files that reside there -- web.xml for example.For example, I have a directory structure containing jsp's under WEB-INF/jsp in my current web applicationHope this helps! --nathan On Thursday, June 5, 2003, at 09:47 AM, Brian McSweeney wrote: Ah yes, Perhaps what you're thinking of is that JSP files should not be called directly or bookmarked. They should be hidden from the user completely, and only accessible through an action. that was it - sorry - stupid of me. Could you tell me how to secure the jsps so that they are only a result of the action? cheers, Brian - Original Message - From: Kruse, Matt [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, June 05, 2003 3:12 PM Subject: RE: calling actions directly I read that one of the things about struts is the actions are only able to be called from the pages directly. Ie, you shouldn't be able to bookmark the actions themselves like: http://myhost/myaction.do Where did you hear this? That's totally not true - any action can be called directly as long as it has a mapping. It's just a URL. Otherwise, how would you enter the first action? :) Perhaps what you're thinking of is that JSP files should not be called directly or bookmarked. They should be hidden from the user completely, and only accessible through an action. Matt Kruse - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] = Nathan Pitts Programmer Analyst Texas Animal Health Commission = - 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: calling actions directly
I don't have experience with WebLogic (it's all opensource sw and no $$ around here), but I'll take your word for it. -nathan On Thursday, June 5, 2003, at 10:08 AM, Karr, David wrote: Unfortunately, not all web containers will support this. There was apparent disagreement on the interpretation of the specification in this area. In particular, WebLogic does not support this. I believe, however, that in version 8.1 it's possible to do this, although I believe you have to set some non-standard configuration flag. I don't know the details. The alternative is to put all JSP pages into a security constraint on a role that no user is set to. -Original Message- From: Nathan Pitts [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 8:02 AM To: Struts Users Mailing List Subject: Re: calling actions directly Brian, If you put all your jsp's inside a the WEB-INF directory, they will not be accessible directly -- only through an action. I think this is part of the jsp specification that nothing can be directly served out of this special directory..Otherwise, a user could pull up configuration files that reside there -- web.xml for example.For example, I have a directory structure containing jsp's under WEB-INF/jsp in my current web applicationHope this helps! --nathan On Thursday, June 5, 2003, at 09:47 AM, Brian McSweeney wrote: Ah yes, Perhaps what you're thinking of is that JSP files should not be called directly or bookmarked. They should be hidden from the user completely, and only accessible through an action. that was it - sorry - stupid of me. Could you tell me how to secure the jsps so that they are only a result of the action? cheers, Brian - Original Message - From: Kruse, Matt [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, June 05, 2003 3:12 PM Subject: RE: calling actions directly I read that one of the things about struts is the actions are only able to be called from the pages directly. Ie, you shouldn't be able to bookmark the actions themselves like: http://myhost/myaction.do Where did you hear this? That's totally not true - any action can be called directly as long as it has a mapping. It's just a URL. Otherwise, how would you enter the first action? :) Perhaps what you're thinking of is that JSP files should not be called directly or bookmarked. They should be hidden from the user completely, and only accessible through an action. Matt Kruse - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] = Nathan Pitts Programmer Analyst Texas Animal Health Commission = - 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] = Nathan Pitts Programmer Analyst Texas Animal Health Commission = - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] Re: switch statement
You can't use Strings in switch statements. AFAIK, only ints and chars are allowed David Hey everyone, This is more of a Java question than a Struts question, I hope you all don't mind. I'm just wondering if there is any way to use a String for a switch statement, or if you are restricted to the true primitive types. I haven't found a way, but it seems like something that lots of people would want that wouldn't be hard for the Java developers to allow for. Wouldn't you agree? Keith Kamholz Programming and Architecture Moog Inc. Phone: (716) 687-7001 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: calling actions directly
Karr, David wrote: The alternative is to put all JSP pages into a security constraint on a role that no user is set to. Or you could put all JSP pages into a directory that is protected by a filter which both logs the access attempt (including all relevant data such as IP address, params, etc) and then redirects the user to an error page warning them that they have been logged. You can get quite sophisticated with this, for instance if you run behind apache, you can have repeat offenders (spiders, etc) written to a .htaccess list to reject their HTTP requests outright, etc. Erik - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to repopulate Form which has html elements with samename
Let me rephrase my question. I have a table which looks like this.. example table width=300 border=0 cellspacing=1 cellpadding=1 tr thName/th thSex/th /tr tr tdhtml:text property=name //td tdhtml:select property=sex html:option value=nbsp;/html:option html:option value=M Male/html:option html:option value=F Female/html:option /html:select /td /tr tr tdhtml:text property=name //td tdhtml:select property=sex html:option value=nbsp;/html:option html:option value=nbsp;/html:option html:option value=M Male/html:option html:option value=F Female/html:option /html:select /td /tr /table So when I add data like Sashi Male Sushma FEMALE now I submit the form, and say there are some validation errors how can I build the table with the above values retrieving from the Form Bean .My form bean has the following methods public String[] getName(){ return name; } public void setName(String[] newName){ name = newName; } public String[] getSex(){ return sex; } public void setSex(String[] newSex){ sex = newSex; } The values are getting stored in the array, but to get them back and build my table is what is not clear to me.. logic:iterate may do the job but how to use it?? Hope I am clear now [EMAIL PROTECTED] 06/05/03 11:15AM doesn't the form do this automatically? if validation fails, i think the standard behavior is to return the user to the page just as they left it -- preferably with the appropriate error messagei know there are multiple ways to do the validation (and i'm not using the best way), but one way is to have a method like the one below in you form bean. If any of the following conditions are met, the user is returned to the page with the form populated. Hope this helps. -nathan public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { ActionErrors errors = new ActionErrors(); if (this.isBlankString(oldpassword)) { errors.add(oldpassword,new ActionError(error.required.oldpassword)); } if (this.isBlankString(newpassword1)) { errors.add(newpassword1, new ActionError(error.required.newpassword1)); } if (this.isBlankString(newpassword2)) { errors.add(newpassword2, new ActionError(error.required.newpassword2)); } // Test to see if the new passwords are the same. if (!newpassword1.equals(newpassword2)) { errors.add(newpassword1, new ActionError(error.passwordmatch)); } return errors; } On Thursday, June 5, 2003, at 09:59 AM, Sashi Ravipati wrote: Hi I am a newbie to struts... I have a dynamic table which has a html:text and a html:select . The user cliks on a add button and enter values in each row of the table and submits the form. How can I repopulate the valuse if validation fails. Can some body give a working exapmle of the Action Form that is required for this kind of requirement. I found this in Ted Husted site but had no clue as what he is trying to do, What is RESULT etc --- --- TABLEhtml:form action=/item/StoreCategory logic:iterate name=RESULT property=iterator id=row TR THname/TH THcategory/TH /TR TR TDbean:write name=row property=name//TD TD%-- REMEMBER TO SPECIFY THE ITERATE ID AS THE NAME --% html:select name=row property=category html:option value=ARTArt/html:option html:option value=AUTAutomotive/html:option %-- ... --% /html:select %-- REMEMBER TO SPECIFY THE ITERATE ID AS THE NAME --% html:hidden name=row property=key/ /TD /TR /logic:iterate TR TD colspan=2 align=right html:submit/ /TD /TR /html:form /TABLE --- - = Nathan Pitts Programmer Analyst Texas Animal Health Commission = - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: switch statement
Kamholz, Keith (corp-staff) USX wrote: Hey everyone, This is more of a Java question than a Struts question, I hope you all don't mind. Not really, but for future reference I have found this resource to be more helpful for such questions: http://forum.java.sun.com/forum.jsp?forum=31 I'm just wondering if there is any way to use a String for a switch statement, or if you are restricted to the true primitive types. I haven't found a way, but it seems like something that lots of people would want that wouldn't be hard for the Java developers to allow for. Wouldn't you agree? The reason why it doesn't work is probably specific to the implementation of the language (maybe performance reasons), but a lot of people don't miss it -- nor would they agree, I suspect. The reason is that you can usually add behaviors to objects so that a single polymorphic method call can usually eliminate all of the infrastructural work of writing a switch statement, so doing a switch on an object doens't make much sense in that context. Of course, this is not applicable in all senses, such as your case with String which is final Erik - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Multiple Message Resource Files
Are you using modules? That might help. Then you specify a resource for each module and each module automagically gets messages from it's own properties file. -Original Message- From: Natalie D Rassmann [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 8:33 AM To: Struts Users Mailing List Subject: Multiple Message Resource Files Hi, My requirement is to have multiple message resource files not based on Locale but based on the user's project. For example, I need to create a message bundle for Project A and another one for Project B. MessageResources_ProjectA.properties looks like this: label.first = First Name label.last = Last Name MessageResources_ProjectB properties lookes like this: label.first = First Initial label.last = Last Initial My question is how do I do this? I believe it works similar to the Struts Internationaliztion capablity where you can set a locale. Is there some kind of variable I can set to distinguish what Project to use? Can anyone point me in the right direction? Thanks in advance, Natalie - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: switch statement
The reason I wanted to do this was to make my Action classes cleaner. I send a parameter to the Action to determine which item to pull from a database, then forward to a certain page. I didn't think I could get the switch to work, it was worth a try though. For a situation like mine, what do you all find to be the best way of doing this? I know I can use a series of if statements, it's just not very pretty... Keith Kamholz Programming and Architecture Moog Inc. Phone: (716) 687-7001 -Original Message- From: Erik Price [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 11:38 AM To: Struts Users Mailing List Subject: Re: switch statement Kamholz, Keith (corp-staff) USX wrote: Hey everyone, This is more of a Java question than a Struts question, I hope you all don't mind. Not really, but for future reference I have found this resource to be more helpful for such questions: http://forum.java.sun.com/forum.jsp?forum=31 I'm just wondering if there is any way to use a String for a switch statement, or if you are restricted to the true primitive types. I haven't found a way, but it seems like something that lots of people would want that wouldn't be hard for the Java developers to allow for. Wouldn't you agree? The reason why it doesn't work is probably specific to the implementation of the language (maybe performance reasons), but a lot of people don't miss it -- nor would they agree, I suspect. The reason is that you can usually add behaviors to objects so that a single polymorphic method call can usually eliminate all of the infrastructural work of writing a switch statement, so doing a switch on an object doens't make much sense in that context. Of course, this is not applicable in all senses, such as your case with String which is final Erik - 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: question about struts
I just posted (yesterday) a code example of how to extend the ActionServlet. It is a piece of cake: http://marc.theaimsgroup.com/?l=struts-userm=105476124906048w=2 And I found another post while looking for mine: http://marc.theaimsgroup.com/?l=struts-userm=100500141726722w=2 And here is a thread about whether to do it or not and other stuff: http://marc.theaimsgroup.com/?t=10050012153r=1w=2 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 10:14 AM To: [EMAIL PROTECTED] Subject: question about struts hi all, i have been working with JSP model 2 for few years, and now i want to move to struts. i am starting to get acquainted with it, and i need help to face this situation. in my mvc, i am using 2 components, one to connect to R3 and the other for connecting to DB. the lifecycle of those components is the same as my servlet, since those components are not user/session/request specific. in reading docs about struts, i could not figure out where to put those components in the struts framework. of course, i can put them in ActionServlet, but this will require me to modify the code of the ActionServlet. is there any other way to do that other than modifying the code of ActionServlet? hope someone can help... thanx in advance and regards marco - 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: switch statement
Keith, The switch statement doesn't work with all primitive types. It only works with ints. I don't know of any other language that has a switch statement that works with a string type. An if-else if-else block can easily implement the functionality of a switch statement. Regards, Richard -Original Message- From: Kamholz, Keith (corp-staff) USX [SMTP:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 8:06 AM To: Struts (E-mail) Subject: switch statement Hey everyone, This is more of a Java question than a Struts question, I hope you all don't mind. I'm just wondering if there is any way to use a String for a switch statement, or if you are restricted to the true primitive types. I haven't found a way, but it seems like something that lots of people would want that wouldn't be hard for the Java developers to allow for. Wouldn't you agree? Keith Kamholz Programming and Architecture Moog Inc. Phone: (716) 687-7001 - 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: switch statement
Why don't you send a parameter that can be converted into an int then? -Richard -Original Message- From: Kamholz, Keith (corp-staff) USX [SMTP:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 8:42 AM To: 'Struts Users Mailing List' Subject: RE: switch statement The reason I wanted to do this was to make my Action classes cleaner. I send a parameter to the Action to determine which item to pull from a database, then forward to a certain page. I didn't think I could get the switch to work, it was worth a try though. For a situation like mine, what do you all find to be the best way of doing this? I know I can use a series of if statements, it's just not very pretty... Keith Kamholz Programming and Architecture Moog Inc. Phone: (716) 687-7001 -Original Message- From: Erik Price [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 11:38 AM To: Struts Users Mailing List Subject: Re: switch statement Kamholz, Keith (corp-staff) USX wrote: Hey everyone, This is more of a Java question than a Struts question, I hope you all don't mind. Not really, but for future reference I have found this resource to be more helpful for such questions: http://forum.java.sun.com/forum.jsp?forum=31 I'm just wondering if there is any way to use a String for a switch statement, or if you are restricted to the true primitive types. I haven't found a way, but it seems like something that lots of people would want that wouldn't be hard for the Java developers to allow for. Wouldn't you agree? The reason why it doesn't work is probably specific to the implementation of the language (maybe performance reasons), but a lot of people don't miss it -- nor would they agree, I suspect. The reason is that you can usually add behaviors to objects so that a single polymorphic method call can usually eliminate all of the infrastructural work of writing a switch statement, so doing a switch on an object doens't make much sense in that context. Of course, this is not applicable in all senses, such as your case with String which is final Erik - 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: Re: struts validator
Obviously I can only speak for the multiple projects (both my own and those I've consulted on), various articles and presentations that I've written on the Validator and of course the work that I've done with it while writing the Struts books, but the fact is that the Validator does work. Like other framework components underneath Jakarta, there are versions that have this bug or that bug. In general however, I have found the Validator to do everything that it was designed to do. I can't explain why some have had more trouble than others; it might just be the version of the software they were using at the time. Like many other facets about Struts and its related technologies, it can become unyielding at times, but is manageable. So, for those of you who have yet to try it, dont be afraid. Get yourself a book that covers it, read the docs, search the lists. Whatever you do, dont reinvent the wheel. For lexical or syntactical validation (whether client or server side), the Validator gives you a development boost. You just have to take the time to learn how to use it. Chuck From: David Graham [EMAIL PROTECTED] Date: 2003/06/05 Thu AM 09:50:08 EDT To: [EMAIL PROTECTED] Subject: Re: struts validator Not sure all this talk of validator is that justifiable. I've had no issues generating both the client side and server side validation, and its saved me a lot of work. Like others i think it would be nice to define form beans and validation rules in the same place but I like it as it is, unless anybody has any alternatives? One thing to consider is that Struts validation is based on commons-validator which reads its own xml config file. Moving the validation configuration to struts-config.xml would require us to do all the validator setup in Struts rather than leveraging the commons-validator code. David Thats my 2 pence.. Mark On Thursday, Jun 5, 2003, at 05:24 Europe/London, Jeff Kyser wrote: So jump in and help David fix it. Otherwise, you're likely to wake up and find a large block of cheddar in your bed. :) On Wednesday, June 4, 2003, at 11:18 PM, Mark Galbreath wrote: You know, I just don't get it. I think Validator was a great idea that simply proved wrong in implementation. And I know I am not alone it this assessment. Mark -Original Message- From: Jeff Kyser [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 12:03 AM To: Struts Users Mailing List Subject: Re: struts validator Like I said, I dont use client-side, and its been pretty smooth sailing for me. Sorry your experience was different, but personally, I like it. Especially defining constants for validation masks and using them over and over on lots of different forms in different projects even. And the requiredif has been pretty handy for a number of cases to boot Of course, there are still cases where I need to go to validate() methods in the actions, but they are less and less, just as I use actual FormBeans less and less, now that i halfway grok DynaValidatorForms... cheers, -jeff On Wednesday, June 4, 2003, at 10:40 PM, Mark Galbreath wrote: yeah, well, DUH! When are you guys going to realize that Validator should never have come out here even in beta. It sucks. Mark -Original Message- From: Jeff Kyser [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 04, 2003 9:25 PM To: Struts Users Mailing List Subject: Re: struts validator I only did server-side validations, using v1.1b3, until I saw lots of people complaining that v1.1rc1 wasn;t working for client-side validations. I tried it (rc1) and it didn't work for me either. I haven't messed with the nightly builds - just went back to 1.1b3. Its probably been fixed in the latest, but since 1.1rc2 is coming out soon, figure I'll wait until then to check it out again. -jeff On Wednesday, June 4, 2003, at 08:18 PM, Mark Galbreath wrote: Beats me, dude. I struggled with it for 3 days and said enough is enough, and wrote my own validations in my Action classes. If you look through the mail archive, you'll see right off that this is what happens to the majority of people trying to get Validator to work. Good luck, Mark -Original Message- From: Frances Aleah Z. de Guzman [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 04, 2003 8:55 PM To: Struts Users Mailing List; Mark Galbreath Subject: Re: struts validator how can i fix it? On Friday 30 May 2003 08:20 pm, Mark Galbreath wrote: That's because the Validator works by magic and you obviously have a hex in your machine. (sometimes I kill myself) Mark -Original Message- From: Frances Aleah Z. de Guzman [mailto:[EMAIL PROTECTED] Sent: Friday, May 30, 2003 2:49 AM To: [EMAIL PROTECTED] Subject: struts validator struts validator (client side validation) example is not working in my pc, even the struts example. but it is
RE: switch statement
Because having descriptive values for parameters helps make your code more understandable, both for yourself and for others. It's not a big deal, I'll just use the if statements. Keith Kamholz Programming and Architecture Moog Inc. Phone: (716) 687-7001 -Original Message- From: Yee, Richard K,,DMDCWEST [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 11:49 AM To: 'Struts Users Mailing List' Subject: RE: switch statement Why don't you send a parameter that can be converted into an int then? -Richard -Original Message- From: Kamholz, Keith (corp-staff) USX [SMTP:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 8:42 AM To: 'Struts Users Mailing List' Subject: RE: switch statement The reason I wanted to do this was to make my Action classes cleaner. I send a parameter to the Action to determine which item to pull from a database, then forward to a certain page. I didn't think I could get the switch to work, it was worth a try though. For a situation like mine, what do you all find to be the best way of doing this? I know I can use a series of if statements, it's just not very pretty... Keith Kamholz Programming and Architecture Moog Inc. Phone: (716) 687-7001 -Original Message- From: Erik Price [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 11:38 AM To: Struts Users Mailing List Subject: Re: switch statement Kamholz, Keith (corp-staff) USX wrote: Hey everyone, This is more of a Java question than a Struts question, I hope you all don't mind. Not really, but for future reference I have found this resource to be more helpful for such questions: http://forum.java.sun.com/forum.jsp?forum=31 I'm just wondering if there is any way to use a String for a switch statement, or if you are restricted to the true primitive types. I haven't found a way, but it seems like something that lots of people would want that wouldn't be hard for the Java developers to allow for. Wouldn't you agree? The reason why it doesn't work is probably specific to the implementation of the language (maybe performance reasons), but a lot of people don't miss it -- nor would they agree, I suspect. The reason is that you can usually add behaviors to objects so that a single polymorphic method call can usually eliminate all of the infrastructural work of writing a switch statement, so doing a switch on an object doens't make much sense in that context. Of course, this is not applicable in all senses, such as your case with String which is final Erik - 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]
[OT] RE: switch statement
If the parameter values all have different first characters you could extract the first char and use that in your switch. David The reason I wanted to do this was to make my Action classes cleaner. I send a parameter to the Action to determine which item to pull from a database, then forward to a certain page. I didn't think I could get the switch to work, it was worth a try though. For a situation like mine, what do you all find to be the best way of doing this? I know I can use a series of if statements, it's just not very pretty... Keith Kamholz Programming and Architecture Moog Inc. Phone: (716) 687-7001 -Original Message- From: Erik Price [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 11:38 AM To: Struts Users Mailing List Subject: Re: switch statement Kamholz, Keith (corp-staff) USX wrote: Hey everyone, This is more of a Java question than a Struts question, I hope you all don't mind. Not really, but for future reference I have found this resource to be more helpful for such questions: http://forum.java.sun.com/forum.jsp?forum=31 I'm just wondering if there is any way to use a String for a switch statement, or if you are restricted to the true primitive types. I haven't found a way, but it seems like something that lots of people would want that wouldn't be hard for the Java developers to allow for. Wouldn't you agree? The reason why it doesn't work is probably specific to the implementation of the language (maybe performance reasons), but a lot of people don't miss it -- nor would they agree, I suspect. The reason is that you can usually add behaviors to objects so that a single polymorphic method call can usually eliminate all of the infrastructural work of writing a switch statement, so doing a switch on an object doens't make much sense in that context. Of course, this is not applicable in all senses, such as your case with String which is final Erik - 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] _ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to repopulate Form which has html elements with same name
Sounds like you might be missing input=theform.jsp in your action where theform.jsp is the name of your JSP you want to have come back with the errors. Also, have html:errors/ in the JSP to report the errors (just as important (more) than repopulating). If this doesn't help find a better (for you) online struts tutorial. What you are trying to do is a freebie in struts (if everything is setup right). -Original Message- From: Sashi Ravipati [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 10:59 AM To: [EMAIL PROTECTED] Subject: How to repopulate Form which has html elements with same name Hi I am a newbie to struts... I have a dynamic table which has a html:text and a html:select . The user cliks on a add button and enter values in each row of the table and submits the form. How can I repopulate the valuse if validation fails. Can some body give a working exapmle of the Action Form that is required for this kind of requirement. I found this in Ted Husted site but had no clue as what he is trying to do, What is RESULT etc --- TABLEhtml:form action=/item/StoreCategory logic:iterate name=RESULT property=iterator id=row TR THname/TH THcategory/TH /TR TR TDbean:write name=row property=name//TD TD%-- REMEMBER TO SPECIFY THE ITERATE ID AS THE NAME --% html:select name=row property=category html:option value=ARTArt/html:option html:option value=AUTAutomotive/html:option %-- ... --% /html:select %-- REMEMBER TO SPECIFY THE ITERATE ID AS THE NAME --% html:hidden name=row property=key/ /TD /TR /logic:iterate TR TD colspan=2 align=right html:submit/ /TD /TR /html:form /TABLE - - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: switch statement
Kamholz, Keith (corp-staff) USX wrote: I didn't think I could get the switch to work, it was worth a try though. For a situation like mine, what do you all find to be the best way of doing this? I know I can use a series of if statements, it's just not very pretty... It's one of the pains in the butts of web application development -- the advantage of HTTP is that it's super simple and so is very easy to get started and understand the fundamentals. But it's also very primitive, and you can't send true objects with behaviors over the wire, then invoke those behaviors on the other side. SOAP addresses this issue somewhat. Erik - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: switch statement
You can use a HashMap, keyed by the parameter, with the value being the appropriate forward Then you just do something like return (ActionForward)forwardMap.get( parameter ); This avoids the if..else blocks, and makes the code a lot cleaner to read. -Original Message- From: Kamholz, Keith (corp-staff) USX [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 11:42 AM To: 'Struts Users Mailing List' Subject: RE: switch statement The reason I wanted to do this was to make my Action classes cleaner. I send a parameter to the Action to determine which item to pull from a database, then forward to a certain page. I didn't think I could get the switch to work, it was worth a try though. For a situation like mine, what do you all find to be the best way of doing this? I know I can use a series of if statements, it's just not very pretty... Keith Kamholz Programming and Architecture Moog Inc. Phone: (716) 687-7001 -Original Message- From: Erik Price [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 11:38 AM To: Struts Users Mailing List Subject: Re: switch statement Kamholz, Keith (corp-staff) USX wrote: Hey everyone, This is more of a Java question than a Struts question, I hope you all don't mind. Not really, but for future reference I have found this resource to be more helpful for such questions: http://forum.java.sun.com/forum.jsp?forum=31 I'm just wondering if there is any way to use a String for a switch statement, or if you are restricted to the true primitive types. I haven't found a way, but it seems like something that lots of people would want that wouldn't be hard for the Java developers to allow for. Wouldn't you agree? The reason why it doesn't work is probably specific to the implementation of the language (maybe performance reasons), but a lot of people don't miss it -- nor would they agree, I suspect. The reason is that you can usually add behaviors to objects so that a single polymorphic method call can usually eliminate all of the infrastructural work of writing a switch statement, so doing a switch on an object doens't make much sense in that context. Of course, this is not applicable in all senses, such as your case with String which is final Erik - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] RE: switch statement
If the value you're looking up in the database is ultimately an int and you're just using String names to make the code maintainable, you could use a Map to map the names to the ints. That would get rid of all the switches and ifs. David Because having descriptive values for parameters helps make your code more understandable, both for yourself and for others. It's not a big deal, I'll just use the if statements. Keith Kamholz Programming and Architecture Moog Inc. Phone: (716) 687-7001 -Original Message- From: Yee, Richard K,,DMDCWEST [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 11:49 AM To: 'Struts Users Mailing List' Subject: RE: switch statement Why don't you send a parameter that can be converted into an int then? -Richard -Original Message- From: Kamholz, Keith (corp-staff) USX [SMTP:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 8:42 AM To: 'Struts Users Mailing List' Subject: RE: switch statement The reason I wanted to do this was to make my Action classes cleaner. I send a parameter to the Action to determine which item to pull from a database, then forward to a certain page. I didn't think I could get the switch to work, it was worth a try though. For a situation like mine, what do you all find to be the best way of doing this? I know I can use a series of if statements, it's just not very pretty... Keith Kamholz Programming and Architecture Moog Inc. Phone: (716) 687-7001 -Original Message- From: Erik Price [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 11:38 AM To: Struts Users Mailing List Subject: Re: switch statement Kamholz, Keith (corp-staff) USX wrote: Hey everyone, This is more of a Java question than a Struts question, I hope you all don't mind. Not really, but for future reference I have found this resource to be more helpful for such questions: http://forum.java.sun.com/forum.jsp?forum=31 I'm just wondering if there is any way to use a String for a switch statement, or if you are restricted to the true primitive types. I haven't found a way, but it seems like something that lots of people would want that wouldn't be hard for the Java developers to allow for. Wouldn't you agree? The reason why it doesn't work is probably specific to the implementation of the language (maybe performance reasons), but a lot of people don't miss it -- nor would they agree, I suspect. The reason is that you can usually add behaviors to objects so that a single polymorphic method call can usually eliminate all of the infrastructural work of writing a switch statement, so doing a switch on an object doens't make much sense in that context. Of course, this is not applicable in all senses, such as your case with String which is final Erik - 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] _ The new MSN 8: advanced junk mail protection and 2 months FREE* http://join.msn.com/?page=features/junkmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] RE: switch statement
Javascript does. Switch in java also works with chars. -Tim -Original Message- From: Yee, Richard K,,DMDCWEST [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 11:48 AM To: 'Struts Users Mailing List' Subject: RE: switch statement Keith, The switch statement doesn't work with all primitive types. It only works with ints. I don't know of any other language that has a switch statement that works with a string type. An if-else if-else block can easily implement the functionality of a switch statement. Regards, Richard -Original Message- From: Kamholz, Keith (corp-staff) USX [SMTP:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 8:06 AM To: Struts (E-mail) Subject: switch statement Hey everyone, This is more of a Java question than a Struts question, I hope you all don't mind. I'm just wondering if there is any way to use a String for a switch statement, or if you are restricted to the true primitive types. I haven't found a way, but it seems like something that lots of people would want that wouldn't be hard for the Java developers to allow for. Wouldn't you agree? Keith Kamholz Programming and Architecture Moog Inc. Phone: (716) 687-7001 - 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: switch statement
If your options are well known (if you were going to use a switch they are), create a Map with the strings as the key and the integer as the value, store in application scope; load them from a properties file or some other source; this will give you more flexibility. Would that work? A little bit more coding, but useful in the end. -Original Message- From: Kamholz, Keith (corp-staff) USX [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 11:52 AM To: 'Struts Users Mailing List' Subject: RE: switch statement Because having descriptive values for parameters helps make your code more understandable, both for yourself and for others. It's not a big deal, I'll just use the if statements. Keith Kamholz Programming and Architecture Moog Inc. Phone: (716) 687-7001 -Original Message- From: Yee, Richard K,,DMDCWEST [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 11:49 AM To: 'Struts Users Mailing List' Subject: RE: switch statement Why don't you send a parameter that can be converted into an int then? -Richard -Original Message- From: Kamholz, Keith (corp-staff) USX [SMTP:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 8:42 AM To: 'Struts Users Mailing List' Subject:RE: switch statement The reason I wanted to do this was to make my Action classes cleaner. I send a parameter to the Action to determine which item to pull from a database, then forward to a certain page. I didn't think I could get the switch to work, it was worth a try though. For a situation like mine, what do you all find to be the best way of doing this? I know I can use a series of if statements, it's just not very pretty... Keith Kamholz Programming and Architecture Moog Inc. Phone: (716) 687-7001 -Original Message- From: Erik Price [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 11:38 AM To: Struts Users Mailing List Subject: Re: switch statement Kamholz, Keith (corp-staff) USX wrote: Hey everyone, This is more of a Java question than a Struts question, I hope you all don't mind. Not really, but for future reference I have found this resource to be more helpful for such questions: http://forum.java.sun.com/forum.jsp?forum=31 I'm just wondering if there is any way to use a String for a switch statement, or if you are restricted to the true primitive types. I haven't found a way, but it seems like something that lots of people would want that wouldn't be hard for the Java developers to allow for. Wouldn't you agree? The reason why it doesn't work is probably specific to the implementation of the language (maybe performance reasons), but a lot of people don't miss it -- nor would they agree, I suspect. The reason is that you can usually add behaviors to objects so that a single polymorphic method call can usually eliminate all of the infrastructural work of writing a switch statement, so doing a switch on an object doens't make much sense in that context. Of course, this is not applicable in all senses, such as your case with String which is final Erik - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to repopulate Form which has html elements with same name
Sorry... But I think your solution is a some dirty. You can use a bean like mytable... public class MyTable { private Collection formBean; public Object getFormBean(){ return formBean; } void setFormBean(Collection c){ formBean = c; } } in a Servlet ... put this collection in the session. MyTable mytable = new MyTable(); session.setAttribute (mytable, mytable); I think you are using any thing like.. html:form action=/actions/foo.do In this action use... MyTable mytable = (MyTable) session.getrequest(mytable); mytable.add((FormBean) form); finally... to iterate... use: logic:iterate id=formbean name=mytable bean:write name=formbean property=name/ bean:write name=formbean property=sex/ /logic:iterate I have not tested this specific code. GOOD LUCK... Sashi Ravipati writes: Let me rephrase my question. I have a table which looks like this.. example table width=300 border=0 cellspacing=1 cellpadding=1 tr thName/th thSex/th /tr tr tdhtml:text property=name //td tdhtml:select property=sex html:option value=nbsp;/html:option html:option value=M Male/html:option html:option value=F Female/html:option /html:select /td /tr tr tdhtml:text property=name //td tdhtml:select property=sex html:option value=nbsp;/html:option html:option value=nbsp;/html:option html:option value=M Male/html:option html:option value=F Female/html:option /html:select /td /tr /table So when I add data like Sashi Male Sushma FEMALE now I submit the form, and say there are some validation errors how can I build the table with the above values retrieving from the Form Bean .My form bean has the following methods public String[] getName(){ return name; } public void setName(String[] newName){ name = newName; } public String[] getSex(){ return sex; } public void setSex(String[] newSex){ sex = newSex; } The values are getting stored in the array, but to get them back and build my table is what is not clear to me.. logic:iterate may do the job but how to use it?? Hope I am clear now [EMAIL PROTECTED] 06/05/03 11:15AM doesn't the form do this automatically? if validation fails, i think the standard behavior is to return the user to the page just as they left it -- preferably with the appropriate error messagei know there are multiple ways to do the validation (and i'm not using the best way), but one way is to have a method like the one below in you form bean. If any of the following conditions are met, the user is returned to the page with the form populated. Hope this helps. -nathan public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { ActionErrors errors = new ActionErrors(); if (this.isBlankString(oldpassword)) { errors.add(oldpassword,new ActionError(error.required.oldpassword)); } if (this.isBlankString(newpassword1)) { errors.add(newpassword1, new ActionError(error.required.newpassword1)); } if (this.isBlankString(newpassword2)) { errors.add(newpassword2, new ActionError(error.required.newpassword2)); } // Test to see if the new passwords are the same. if (!newpassword1.equals(newpassword2)) { errors.add(newpassword1, new ActionError(error.passwordmatch)); } return errors; } On Thursday, June 5, 2003, at 09:59 AM, Sashi Ravipati wrote: Hi I am a newbie to struts... I have a dynamic table which has a html:text and a html:select . The user cliks on a add button and enter values in each row of the table and submits the form. How can I repopulate the valuse if validation fails. Can some body give a working exapmle of the Action Form that is required for this kind of requirement. I found this in Ted Husted site but had no clue as what he is trying to do, What is RESULT etc --- --- TABLEhtml:form action=/item/StoreCategory logic:iterate name=RESULT property=iterator id=row TR THname/TH THcategory/TH /TR TR TDbean:write name=row property=name//TD TD%-- REMEMBER TO SPECIFY THE ITERATE ID AS THE NAME --% html:select name=row property=category html:option value=ARTArt/html:option html:option value=AUTAutomotive/html:option %-- ... --% /html:select %-- REMEMBER TO SPECIFY THE ITERATE ID AS THE NAME --% html:hidden name=row property=key/ /TD /TR /logic:iterate TR TD colspan=2 align=right html:submit/ /TD /TR /html:form /TABLE --- - =
RE: [OT] Reach out and touch someone?
So come to irc.darkmyst.org 6667 and join the rest of us Java Christians! Mark -Original Message- From: Chappell, Simon P [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 11:03 AM To: Struts Users Mailing List Subject: RE: [OT] Reach out and touch someone? Yeah, as one of the bad boys of the Struts list, I understand. The Struts list is almost a victim of it's own success and has spawned a very active community of users that enjoy interacting and being varying amounts of OT. We are in the process of figuring out how to continue to enjoy our many and varied side conversations without upsetting, offending or scaring off the less outgoing members of the Struts community. This last friday, a number of the more vocal elements of the list had a multi-way Yahoo IM chat, it was great fun and almost totally OT, yet we were disturbing no one on the list. A win-win perhaps? I'll continue to work on solutions such as the group chats that work for the good of the majority. More news as I have it. (Allow a while, as the solution needs to work for windows, mac and linux users) Simon - Simon P. Chappell [EMAIL PROTECTED] Java Programming Specialist www.landsend.com Lands' End, Inc. (608) 935-4526 Never give in - never, never, never, never, in nothing great or small, large or petty, never give in except to convictions of honor and good sense. - Sir Winston Churchill -Original Message- From: Taylor, Jason [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 9:31 AM To: 'Struts Users Mailing List' Subject: RE: [OT] Reach out and touch someone? Thank you. Some of the stuff is funny but lately I've been filtering all but Craig-- it's a good strategy in general for keeping up with struts, but I'm sure there are a lot of other posts that are interesting that I miss. He's right-- the reason most people subscribe has to do with struts not society. snip Craig's comments - 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]
ActionForm with non-simpleProperties
I received this message from jboss-server... argument type mismatch (...) at org.apache.commeons.beanutils.PropertyUtils.setSimpleProperty I would like to know if ActionForms can have complex properties, like Collections, and others objects. Please, if anyone knows, tell me. -- Rodrigo di Lorenzo Lopes - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: tiles and tiles controllers
Currently i have two page definitions - one for inheritence and one for the controller. The controller is a TilesAction - I suppose i could create a TilesAction that did nothing and have the inherited pages use that but it seems an unnecessary hack. It would be good if setting the controllerUrl to was OK or even a switch to disable it. Mike Jasnowski wrote: I suppose one possibility is to have a noop controller, noop.jsp, or use the controller attribute on each tile rather than the definition, which I think is less desireable than having it at the def level. -Original Message- From: teknokrat [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 8:14 AM To: [EMAIL PROTECTED] Subject: tiles and tiles controllers I have a page definition that uses a tiles controller. This works fine. However, i now want to defines several pages that extend the first page but i do not want them using the controller ( or any controller). can this be done? leaving urlController blank gives errors. 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: switch statement
I appreciate everybody's replies, even though some suggestions were really overkill for what I'm trying to do. I think I'll just use the if-else statements, it's not really a big deal. I still wish that switch statements would support Strings, but that's a different topic of discussion. Thanks again everyone. Keith Kamholz Programming and Architecture Moog Inc. Phone: (716) 687-7001 -Original Message- From: DelRio, Omar (CORP, DDEMESIS) [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 12:07 PM To: Struts Users Mailing List Subject: RE: switch statement If your options are well known (if you were going to use a switch they are), create a Map with the strings as the key and the integer as the value, store in application scope; load them from a properties file or some other source; this will give you more flexibility. Would that work? A little bit more coding, but useful in the end. -Original Message- From: Kamholz, Keith (corp-staff) USX [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 11:52 AM To: 'Struts Users Mailing List' Subject: RE: switch statement Because having descriptive values for parameters helps make your code more understandable, both for yourself and for others. It's not a big deal, I'll just use the if statements. Keith Kamholz Programming and Architecture Moog Inc. Phone: (716) 687-7001 -Original Message- From: Yee, Richard K,,DMDCWEST [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 11:49 AM To: 'Struts Users Mailing List' Subject: RE: switch statement Why don't you send a parameter that can be converted into an int then? -Richard -Original Message- From: Kamholz, Keith (corp-staff) USX [SMTP:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 8:42 AM To: 'Struts Users Mailing List' Subject:RE: switch statement The reason I wanted to do this was to make my Action classes cleaner. I send a parameter to the Action to determine which item to pull from a database, then forward to a certain page. I didn't think I could get the switch to work, it was worth a try though. For a situation like mine, what do you all find to be the best way of doing this? I know I can use a series of if statements, it's just not very pretty... Keith Kamholz Programming and Architecture Moog Inc. Phone: (716) 687-7001 -Original Message- From: Erik Price [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 11:38 AM To: Struts Users Mailing List Subject: Re: switch statement Kamholz, Keith (corp-staff) USX wrote: Hey everyone, This is more of a Java question than a Struts question, I hope you all don't mind. Not really, but for future reference I have found this resource to be more helpful for such questions: http://forum.java.sun.com/forum.jsp?forum=31 I'm just wondering if there is any way to use a String for a switch statement, or if you are restricted to the true primitive types. I haven't found a way, but it seems like something that lots of people would want that wouldn't be hard for the Java developers to allow for. Wouldn't you agree? The reason why it doesn't work is probably specific to the implementation of the language (maybe performance reasons), but a lot of people don't miss it -- nor would they agree, I suspect. The reason is that you can usually add behaviors to objects so that a single polymorphic method call can usually eliminate all of the infrastructural work of writing a switch statement, so doing a switch on an object doens't make much sense in that context. Of course, this is not applicable in all senses, such as your case with String which is final Erik - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: ActionForm with non-simpleProperties
Yes they can, but for things other than Java defined complex types you may have to write your own converter. I'm not sure what the ootb complex Java types are. See the commons beanutils package for more info. -Original Message- From: Rodrigo di Lorenzo Lopes [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 11:45 AM To: Struts Users Mailing List Subject: ActionForm with non-simpleProperties I received this message from jboss-server... argument type mismatch (...) at org.apache.commeons.beanutils.PropertyUtils.setSimpleProperty I would like to know if ActionForms can have complex properties, like Collections, and others objects. Please, if anyone knows, tell me. -- Rodrigo di Lorenzo Lopes - 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: ActionForm with non-simpleProperties
I'm not sure what the ootb complex Java types are I should have qualified that with, What types are supported by commons Converter -Original Message- From: Mike Jasnowski [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 12:48 PM To: Struts Users Mailing List Subject: RE: ActionForm with non-simpleProperties Yes they can, but for things other than Java defined complex types you may have to write your own converter. I'm not sure what the ootb complex Java types are. See the commons beanutils package for more info. -Original Message- From: Rodrigo di Lorenzo Lopes [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 11:45 AM To: Struts Users Mailing List Subject: ActionForm with non-simpleProperties I received this message from jboss-server... argument type mismatch (...) at org.apache.commeons.beanutils.PropertyUtils.setSimpleProperty I would like to know if ActionForms can have complex properties, like Collections, and others objects. Please, if anyone knows, tell me. -- Rodrigo di Lorenzo Lopes - 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: Multiple Message Resource Files
The bundle is not static I am going to change what bundle I use based on the users profile (depends on what project they are a member of). Mark Galbreath wrote: why would you want to? the bundle is static - it's an absolute reference -Original Message- From: Natalie D Rassmann [mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] ] Sent: Thursday, June 05, 2003 9:04 AM To: Struts Users Mailing List Subject: Re: Multiple Message Resource Files I suppose I could but can I make that a variable that I can get out of the session? Mike Jasnowski wrote: Can't you just use the bundle att on the Struts message tag? -Original Message- From: David Chelimsky [mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] ] Sent: Thursday, June 05, 2003 8:55 AM To: Struts Users Mailing List Subject: Re: Multiple Message Resource Files I know that if you're using the jstl tags you can define the bundle in the tags. So instead of: bean:message key=some.label/ you'd write: fmt:message bundle=${currentBundle} key=some.label/ Then you can set the value of currentBundle in your Action based on the current project, or store it in the session when the user selects that project. In any case, I'm not sure if there's an equivalent in the struts bean tags. If not, I'd recommend using the JTSL tags. David Natalie D Rassmann wrote: Hi, My requirement is to have multiple message resource files not based on Locale but based on the user's project. For example, I need to create a message bundle for Project A and another one for Project B. MessageResources_ProjectA.properties looks like this: label.first = First Name label.last = Last Name MessageResources_ProjectB properties lookes like this: label.first = First Initial label.last = Last Initial My question is how do I do this? I believe it works similar to the Struts Internationaliztion capablity where you can set a locale. Is there some kind of variable I can set to distinguish what Project to use? Can anyone point me in the right direction? Thanks in advance, Natalie - 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: Multiple Message Resource Files
Thank you, I appreciate it. Mike Jasnowski wrote: Sure, it's just a string, but you would most likely have to use a jsp expression to reference it (i.e. bundle=%= currentBundle %. Either method (JSTL or Struts) can work, I just wanted to communicate you could achieve the same result with the Struts tag as well. -Original Message- From: Natalie D Rassmann [mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] ] Sent: Thursday, June 05, 2003 9:04 AM To: Struts Users Mailing List Subject: Re: Multiple Message Resource Files I suppose I could but can I make that a variable that I can get out of the session? Mike Jasnowski wrote: Can't you just use the bundle att on the Struts message tag? -Original Message- From: David Chelimsky [mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] ] Sent: Thursday, June 05, 2003 8:55 AM To: Struts Users Mailing List Subject: Re: Multiple Message Resource Files I know that if you're using the jstl tags you can define the bundle in the tags. So instead of: bean:message key=some.label/ you'd write: fmt:message bundle=${currentBundle} key=some.label/ Then you can set the value of currentBundle in your Action based on the current project, or store it in the session when the user selects that project. In any case, I'm not sure if there's an equivalent in the struts bean tags. If not, I'd recommend using the JTSL tags. David Natalie D Rassmann wrote: Hi, My requirement is to have multiple message resource files not based on Locale but based on the user's project. For example, I need to create a message bundle for Project A and another one for Project B. MessageResources_ProjectA.properties looks like this: label.first = First Name label.last = Last Name MessageResources_ProjectB properties lookes like this: label.first = First Initial label.last = Last Initial My question is how do I do this? I believe it works similar to the Struts Internationaliztion capablity where you can set a locale. Is there some kind of variable I can set to distinguish what Project to use? Can anyone point me in the right direction? Thanks in advance, Natalie - 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: Multiple Message Resource Files
Yes you can make it a variable. But I'm curious, are the contents of each message catalog different? I assume so if you're trying to have each one per user profile. But what is unique about each profile that requires you to have a separate bundle for each? Thanks, Mike -Original Message- From: Rassmann, Natalie D [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 12:54 PM To: Struts Users Mailing List Subject: Re: Multiple Message Resource Files The bundle is not static I am going to change what bundle I use based on the users profile (depends on what project they are a member of). Mark Galbreath wrote: why would you want to? the bundle is static - it's an absolute reference -Original Message- From: Natalie D Rassmann [mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] ] Sent: Thursday, June 05, 2003 9:04 AM To: Struts Users Mailing List Subject: Re: Multiple Message Resource Files I suppose I could but can I make that a variable that I can get out of the session? Mike Jasnowski wrote: Can't you just use the bundle att on the Struts message tag? -Original Message- From: David Chelimsky [mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] ] Sent: Thursday, June 05, 2003 8:55 AM To: Struts Users Mailing List Subject: Re: Multiple Message Resource Files I know that if you're using the jstl tags you can define the bundle in the tags. So instead of: bean:message key=some.label/ you'd write: fmt:message bundle=${currentBundle} key=some.label/ Then you can set the value of currentBundle in your Action based on the current project, or store it in the session when the user selects that project. In any case, I'm not sure if there's an equivalent in the struts bean tags. If not, I'd recommend using the JTSL tags. David Natalie D Rassmann wrote: Hi, My requirement is to have multiple message resource files not based on Locale but based on the user's project. For example, I need to create a message bundle for Project A and another one for Project B. MessageResources_ProjectA.properties looks like this: label.first = First Name label.last = Last Name MessageResources_ProjectB properties lookes like this: label.first = First Initial label.last = Last Initial My question is how do I do this? I believe it works similar to the Struts Internationaliztion capablity where you can set a locale. Is there some kind of variable I can set to distinguish what Project to use? Can anyone point me in the right direction? Thanks in advance, Natalie - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Action Errors
Is there a way to save the ActionErrrors in Session Scope and still have it recognized by html:errors / in the jsp. I've got the Errors Object saved to session by: HttpSession session = request.getSession(false); session.setAttribute(org.apache.struts.Globals.ERROR_KEY,errors); ( where errors is my ActionErrrors Object ) However, the jsp page doesn't display the error values ( it does however display the key, all the time ). I need it in session scope b/c in the application the Action Class is redirecting NOT forwarding and so the request and response objects are lost... Thanks, Jimmy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to repopulate Form which has html elements with samename
Let me rephrase my question. I have a table which looks like this.. example table width=300 border=0 cellspacing=1 cellpadding=1 tr thName/th thSex/th /tr tr tdhtml:text property=name //td tdhtml:select property=sex html:option value=nbsp;/html:option html:option value=M Male/html:option html:option value=F Female/html:option /html:select /td /tr tr tdhtml:text property=name //td tdhtml:select property=sex html:option value=nbsp;/html:option html:option value=nbsp;/html:option html:option value=M Male/html:option html:option value=F Female/html:option /html:select /td /tr /table So when I add data like Sashi Male Sushma FEMALE now I submit the form, and say there are some validation errors how can I build the table with the above values retrieving from the Form Bean .My form bean has the following methods public String[] getName(){ return name; } public void setName(String[] newName){ name = newName; } public String[] getSex(){ return sex; } public void setSex(String[] newSex){ sex = newSex; } The values are getting stored in the array, but to get them back and build my table is what is not clear to me.. logic:iterate may do the job but how to use it?? Hope I am clear now [EMAIL PROTECTED] 06/05/03 11:30AM Sounds like you might be missing input=theform.jsp in your action where theform.jsp is the name of your JSP you want to have come back with the errors. Also, have html:errors/ in the JSP to report the errors (just as important (more) than repopulating). If this doesn't help find a better (for you) online struts tutorial. What you are trying to do is a freebie in struts (if everything is setup right). -Original Message- From: Sashi Ravipati [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 10:59 AM To: [EMAIL PROTECTED] Subject: How to repopulate Form which has html elements with same name Hi I am a newbie to struts... I have a dynamic table which has a html:text and a html:select . The user cliks on a add button and enter values in each row of the table and submits the form. How can I repopulate the valuse if validation fails. Can some body give a working exapmle of the Action Form that is required for this kind of requirement. I found this in Ted Husted site but had no clue as what he is trying to do, What is RESULT etc --- TABLEhtml:form action=/item/StoreCategory logic:iterate name=RESULT property=iterator id=row TR THname/TH THcategory/TH /TR TR TDbean:write name=row property=name//TD TD%-- REMEMBER TO SPECIFY THE ITERATE ID AS THE NAME --% html:select name=row property=category html:option value=ARTArt/html:option html:option value=AUTAutomotive/html:option %-- ... --% /html:select %-- REMEMBER TO SPECIFY THE ITERATE ID AS THE NAME --% html:hidden name=row property=key/ /TD /TR /logic:iterate TR TD colspan=2 align=right html:submit/ /TD /TR /html:form /TABLE - - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Singletons in Tomcat
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 If I have a class in my application which is a singleton, is there only one object per server (Tomcat in my case), or is it unique to the session (ie. each user gets a different instance)? Brian -BEGIN PGP SIGNATURE- Version: PGP 8.0 iQA/AwUBPt92MuLP0vXx30WgEQKtFQCfX4gkSYSwqx9+Zij4IfQU9DxA6L4An2gY hUqwLgvXo/4W5scinkxmIF7j =Osto -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Multiple Message Resource Files
No I am not using modules but thanks anyway. Bailey, Shane C. wrote: Are you using modules? That might help. Then you specify a resource for each module and each module automagically gets messages from it's own properties file. -Original Message- From: Natalie D Rassmann [mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] ] Sent: Thursday, June 05, 2003 8:33 AM To: Struts Users Mailing List Subject: Multiple Message Resource Files Hi, My requirement is to have multiple message resource files not based on Locale but based on the user's project. For example, I need to create a message bundle for Project A and another one for Project B. MessageResources_ProjectA.properties looks like this: label.first = First Name label.last = Last Name MessageResources_ProjectB properties lookes like this: label.first = First Initial label.last = Last Initial My question is how do I do this? I believe it works similar to the Struts Internationaliztion capablity where you can set a locale. Is there some kind of variable I can set to distinguish what Project to use? Can anyone point me in the right direction? Thanks in advance, Natalie - 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: Singletons in Tomcat
Brian Kidney wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 If I have a class in my application which is a singleton, is there only one object per server (Tomcat in my case), or is it unique to the session (ie. each user gets a different instance)? If your singleton class keeps its object in a static field, then there is only one instance per classloader. If you are not messing around with classloaders, then that means it should be one instance per JVM / server. Erik - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Singletons in Tomcat
It is not unique to the session. It is unique to the classloader which usually means that each web app will have its own singleton. Usually, you'll just end up with one per server. BAL From: Brian Kidney [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Singletons in Tomcat Date: Thu, 5 Jun 2003 14:26:19 -0230 -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 If I have a class in my application which is a singleton, is there only one object per server (Tomcat in my case), or is it unique to the session (ie. each user gets a different instance)? Brian -BEGIN PGP SIGNATURE- Version: PGP 8.0 iQA/AwUBPt92MuLP0vXx30WgEQKtFQCfX4gkSYSwqx9+Zij4IfQU9DxA6L4An2gY hUqwLgvXo/4W5scinkxmIF7j =Osto -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ STOP MORE SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re-populate Form Data
Hi I have array of text boxes with the same name eg: tr td html:text propertye=name/ html:text propertye=name/ html:text propertye=name/ /td /tr When I sbimit the page all the values are stored in an String Array in my Form bean. private String [] name=null; public String[] getName(){ return this.name; } public void setName(String[] name){ this.name = name; } I am not able to repopulate the textboxes with values I entered when the page is reloaded again?
Re: Multiple Message Resource Files
The labels of the fields on the form are dependent one the user's project in their profile. So, for example one project needs to enter size data on the form. Project A Size Data is measured in DLOCs Project B's Size Data is measured in SLOCs DLOCs and SLOCs are the labels for the text fields on the form. Mike Jasnowski wrote: Yes you can make it a variable. But I'm curious, are the contents of each message catalog different? I assume so if you're trying to have each one per user profile. But what is unique about each profile that requires you to have a separate bundle for each? Thanks, Mike -Original Message- From: Rassmann, Natalie D [mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] ] Sent: Thursday, June 05, 2003 12:54 PM To: Struts Users Mailing List Subject: Re: Multiple Message Resource Files The bundle is not static I am going to change what bundle I use based on the users profile (depends on what project they are a member of). Mark Galbreath wrote: why would you want to? the bundle is static - it's an absolute reference -Original Message- From: Natalie D Rassmann [mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] ] Sent: Thursday, June 05, 2003 9:04 AM To: Struts Users Mailing List Subject: Re: Multiple Message Resource Files I suppose I could but can I make that a variable that I can get out of the session? Mike Jasnowski wrote: Can't you just use the bundle att on the Struts message tag? -Original Message- From: David Chelimsky [mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] ] Sent: Thursday, June 05, 2003 8:55 AM To: Struts Users Mailing List Subject: Re: Multiple Message Resource Files I know that if you're using the jstl tags you can define the bundle in the tags. So instead of: bean:message key=some.label/ you'd write: fmt:message bundle=${currentBundle} key=some.label/ Then you can set the value of currentBundle in your Action based on the current project, or store it in the session when the user selects that project. In any case, I'm not sure if there's an equivalent in the struts bean tags. If not, I'd recommend using the JTSL tags. David Natalie D Rassmann wrote: Hi, My requirement is to have multiple message resource files not based on Locale but based on the user's project. For example, I need to create a message bundle for Project A and another one for Project B. MessageResources_ProjectA.properties looks like this: label.first = First Name label.last = Last Name MessageResources_ProjectB properties lookes like this: label.first = First Initial label.last = Last Initial My question is how do I do this? I believe it works similar to the Struts Internationaliztion capablity where you can set a locale. Is there some kind of variable I can set to distinguish what Project to use? Can anyone point me in the right direction? Thanks in advance, Natalie - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
multiple HTML form elements with the same name
How to use multiple HTML form elements with the same name. In the Help it is given as Yes. Define the element as an array and Struts will autopopulate it like any other. private String[] id= {}; public String[] getId() { return this.id; } public void setItem(String id[]) {this.id = id;} And so forth Can some body give an example as how to accomplish this.. Thanks Can I use multiple HTML form elements with the same name
RE: [OT] Reach out and touch someone?
I'm researching Mac OS X clients. -Original Message- From: Mark Galbreath [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 11:32 AM To: 'Struts Users Mailing List' Subject: RE: [OT] Reach out and touch someone? So come to irc.darkmyst.org 6667 and join the rest of us Java Christians! Mark -Original Message- From: Chappell, Simon P [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 11:03 AM To: Struts Users Mailing List Subject: RE: [OT] Reach out and touch someone? Yeah, as one of the bad boys of the Struts list, I understand. The Struts list is almost a victim of it's own success and has spawned a very active community of users that enjoy interacting and being varying amounts of OT. We are in the process of figuring out how to continue to enjoy our many and varied side conversations without upsetting, offending or scaring off the less outgoing members of the Struts community. This last friday, a number of the more vocal elements of the list had a multi-way Yahoo IM chat, it was great fun and almost totally OT, yet we were disturbing no one on the list. A win-win perhaps? I'll continue to work on solutions such as the group chats that work for the good of the majority. More news as I have it. (Allow a while, as the solution needs to work for windows, mac and linux users) Simon - Simon P. Chappell [EMAIL PROTECTED] Java Programming Specialist www.landsend.com Lands' End, Inc. (608) 935-4526 Never give in - never, never, never, never, in nothing great or small, large or petty, never give in except to convictions of honor and good sense. - Sir Winston Churchill -Original Message- From: Taylor, Jason [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 9:31 AM To: 'Struts Users Mailing List' Subject: RE: [OT] Reach out and touch someone? Thank you. Some of the stuff is funny but lately I've been filtering all but Craig-- it's a good strategy in general for keeping up with struts, but I'm sure there are a lot of other posts that are interesting that I miss. He's right-- the reason most people subscribe has to do with struts not society. snip Craig's comments - 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: ActionForm with non-simpleProperties
Thank you very much. Mike Jasnowski writes: Yes they can, but for things other than Java defined complex types you may have to write your own converter. I'm not sure what the ootb complex Java types are. See the commons beanutils package for more info. -Original Message- From: Rodrigo di Lorenzo Lopes [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 11:45 AM To: Struts Users Mailing List Subject: ActionForm with non-simpleProperties I received this message from jboss-server... argument type mismatch (...) at org.apache.commeons.beanutils.PropertyUtils.setSimpleProperty I would like to know if ActionForms can have complex properties, like Collections, and others objects. Please, if anyone knows, tell me. -- Rodrigo di Lorenzo Lopes - 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] -- Rodrigo di Lorenzo Lopes (Mineirinho) - ICQ 52982003 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to repopulate Form which has html elements with samename
Repopulating Fields. I keep hearing that this is a freebie in struts but i have note seen it work on my app yet. i just stuff what i want to repopulate with in the session (for now). It would be nice if someone could post what setup write IS. so we can check if we have something set up WRONG. After all, WSAD 5 came with struts preloaded so how can it be setup wrong? Sashi Ravipati [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Let me rephrase my question. I have a table which looks like this.. example table width=300 border=0 cellspacing=1 cellpadding=1 tr thName/th thSex/th /tr tr tdhtml:text property=name //td tdhtml:select property=sex html:option value=nbsp;/html:option html:option value=M Male/html:option html:option value=F Female/html:option /html:select /td /tr tr tdhtml:text property=name //td tdhtml:select property=sex html:option value=nbsp;/html:option html:option value=nbsp;/html:option html:option value=M Male/html:option html:option value=F Female/html:option /html:select /td /tr /table So when I add data like Sashi Male Sushma FEMALE now I submit the form, and say there are some validation errors how can I build the table with the above values retrieving from the Form Bean .My form bean has the following methods public String[] getName(){ return name; } public void setName(String[] newName){ name = newName; } public String[] getSex(){ return sex; } public void setSex(String[] newSex){ sex = newSex; } The values are getting stored in the array, but to get them back and build my table is what is not clear to me.. logic:iterate may do the job but how to use it?? Hope I am clear now [EMAIL PROTECTED] 06/05/03 11:30AM Sounds like you might be missing input=theform.jsp in your action where theform.jsp is the name of your JSP you want to have come back with the errors. Also, have html:errors/ in the JSP to report the errors (just as important (more) than repopulating). If this doesn't help find a better (for you) online struts tutorial. What you are trying to do is a freebie in struts (if everything is setup right). -Original Message- From: Sashi Ravipati [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 10:59 AM To: [EMAIL PROTECTED] Subject: How to repopulate Form which has html elements with same name Hi I am a newbie to struts... I have a dynamic table which has a html:text and a html:select . The user cliks on a add button and enter values in each row of the table and submits the form. How can I repopulate the valuse if validation fails. Can some body give a working exapmle of the Action Form that is required for this kind of requirement. I found this in Ted Husted site but had no clue as what he is trying to do, What is RESULT etc -- -- --- TABLEhtml:form action=/item/StoreCategory logic:iterate name=RESULT property=iterator id=row TR THname/TH THcategory/TH /TR TR TDbean:write name=row property=name//TD TD%-- REMEMBER TO SPECIFY THE ITERATE ID AS THE NAME --% html:select name=row property=category html:option value=ARTArt/html:option html:option value=AUTAutomotive/html:option %-- ... --% /html:select %-- REMEMBER TO SPECIFY THE ITERATE ID AS THE NAME --% html:hidden name=row property=key/ /TD /TR /logic:iterate TR TD colspan=2 align=right html:submit/ /TD /TR /html:form /TABLE -- -- - - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] web.xml error-page configuration problem
I'm using WebLogic 6.1 SP 2 and I can't get the web.xm. error-page configuration to work for exceptions occurring within a JSP. If the exception, occurs in Java code (i.e. non-JSP), the error page works fine. But if it occurs in the JSP, I see a stack trace on the screen instead of forwarding to the error JSP. Here's the setting I have in web.xml file: error-page exception-typejava.lang.Throwable/exception-type location/jsp/error.jsp/location /error-page This should handle every type of exception, right? In my JSP, I'm intentionally creating a null pointer exception. I also tried adding the following to my web.xml file and it still didn't work: error-page exception-typejava.lang.NullPointerException/exception-type location/jsp/error.jsp/location /error-page Any help is greatly appreciated, Thanks, JOHN HOHLEN - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Action Form: HashMap
I have a form that has elements that I do not know the names of ahead of time. I want to have struts scrape the form into a map so the key is the name of the element and the value is the value of the element when it was submitted. I looked for an action form that acted like this. Has anyone done it before, or is there a better way? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] web.xml error-page configuration problem
Is you /jsp/error.jsp page a error page? If not it as the Error Page via. %@ page isErrorPage=true % Jimmy -Original Message- From: Hohlen, John C [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 1:59 PM To: Struts-User (E-mail) Subject: [OT] web.xml error-page configuration problem I'm using WebLogic 6.1 SP 2 and I can't get the web.xm. error-page configuration to work for exceptions occurring within a JSP. If the exception, occurs in Java code (i.e. non-JSP), the error page works fine. But if it occurs in the JSP, I see a stack trace on the screen instead of forwarding to the error JSP. Here's the setting I have in web.xml file: error-page exception-typejava.lang.Throwable/exception-type location/jsp/error.jsp/location /error-page This should handle every type of exception, right? In my JSP, I'm intentionally creating a null pointer exception. I also tried adding the following to my web.xml file and it still didn't work: error-page exception-typejava.lang.NullPointerException/exception-type location/jsp/error.jsp/location /error-page Any help is greatly appreciated, Thanks, JOHN HOHLEN - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] web.xml error-page configuration problem
Is this at the top of your jsp? %@ page errorPage=/jsp/error.jsp % David From: Hohlen, John C [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts-User (E-mail) [EMAIL PROTECTED] Subject: [OT] web.xml error-page configuration problem Date: Thu, 5 Jun 2003 12:59:26 -0500 I'm using WebLogic 6.1 SP 2 and I can't get the web.xm. error-page configuration to work for exceptions occurring within a JSP. If the exception, occurs in Java code (i.e. non-JSP), the error page works fine. But if it occurs in the JSP, I see a stack trace on the screen instead of forwarding to the error JSP. Here's the setting I have in web.xml file: error-page exception-typejava.lang.Throwable/exception-type location/jsp/error.jsp/location /error-page This should handle every type of exception, right? In my JSP, I'm intentionally creating a null pointer exception. I also tried adding the following to my web.xml file and it still didn't work: error-page exception-typejava.lang.NullPointerException/exception-type location/jsp/error.jsp/location /error-page Any help is greatly appreciated, Thanks, JOHN HOHLEN - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ The new MSN 8: advanced junk mail protection and 2 months FREE* http://join.msn.com/?page=features/junkmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Singletons in Tomcat
I usually story Singletons in the ServletContext which is unique for an application. I often think that ServletContext should be better named ApplicationContext because that is actually what it represents. I don't feel comfortable to leave Singletons hanging around on static. variables. The benefit of ServletContext is, that you can easily participate on the lifecycle of the ServletContext (ServletContextListener::contextInitialized and ~::contextDestroyed) and take appropriate actions when your Singleton acquires any system resources. Markus Brian Kidney wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 If I have a class in my application which is a singleton, is there only one object per server (Tomcat in my case), or is it unique to the session (ie. each user gets a different instance)? Brian -BEGIN PGP SIGNATURE- Version: PGP 8.0 iQA/AwUBPt92MuLP0vXx30WgEQKtFQCfX4gkSYSwqx9+Zij4IfQU9DxA6L4An2gY hUqwLgvXo/4W5scinkxmIF7j =Osto -END PGP SIGNATURE- - 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: Action Form: HashMap
Ray Madigan wrote: I have a form that has elements that I do not know the names of ahead of time. I want to have struts scrape the form into a map so the key is the name of the element and the value is the value of the element when it was submitted. I looked for an action form that acted like this. Has anyone done it before, or is there a better way? Any reason why calling getParameterMap() on the request object doesn't do the trick? Erik - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Action Form: HashMap
Read the mapped properties section here: http://jakarta.apache.org/struts/faqs/indexedprops.html David From: Ray Madigan [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Action Form: HashMap Date: Thu, 5 Jun 2003 11:00:12 -0700 I have a form that has elements that I do not know the names of ahead of time. I want to have struts scrape the form into a map so the key is the name of the element and the value is the value of the element when it was submitted. I looked for an action form that acted like this. Has anyone done it before, or is there a better way? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] web.xml error-page configuration problem
Not sure I totally understood your response, but I looked up the directive you mentioned. Here's what I learned: Purpose --- - Indicates whether or not the current page can act as the error page for another JSP page Notes - 1. Use this for emergency backup only; explicitly handle as many exceptions as possible 2. The web.xml file can designate general error pages rather than page-specific ones like this According to item #2, I shouldn't have to do this. Furthermore, this means each JSP within my application needs the following: %@ page errorPage=error.jsp % This is what I'm trying to avoid. I would prefer to only specify this via a single configuration setting in the web.xml. JOHN -Original Message- From: Jimmy Emmanual [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 1:05 PM To: 'Struts Users Mailing List' Subject: RE: [OT] web.xml error-page configuration problem Is you /jsp/error.jsp page a error page? If not it as the Error Page via. %@ page isErrorPage=true % Jimmy -Original Message- From: Hohlen, John C [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 1:59 PM To: Struts-User (E-mail) Subject: [OT] web.xml error-page configuration problem I'm using WebLogic 6.1 SP 2 and I can't get the web.xm. error-page configuration to work for exceptions occurring within a JSP. If the exception, occurs in Java code (i.e. non-JSP), the error page works fine. But if it occurs in the JSP, I see a stack trace on the screen instead of forwarding to the error JSP. Here's the setting I have in web.xml file: error-page exception-typejava.lang.Throwable/exception-type location/jsp/error.jsp/location /error-page This should handle every type of exception, right? In my JSP, I'm intentionally creating a null pointer exception. I also tried adding the following to my web.xml file and it still didn't work: error-page exception-typejava.lang.NullPointerException/exception-type location/jsp/error.jsp/location /error-page Any help is greatly appreciated, Thanks, JOHN HOHLEN - 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: calling actions directly
Websphere 5 allows you to place JSPs under the WEB-INF directory. So did Websphere 4. It's not a trick but, as Nathan said, part of the specification. The reason some containers didn't support it for version 2.2 is that the spec was a little ambiguous. It has been clarified in 2.3 as being permitted. Steve -Original Message- From: Kamholz, Keith (corp-staff) USX [mailto:[EMAIL PROTECTED] Right, I'm running Websphere and we couldn't get it to work. However, I just upgraded to version 5. Does anyone know if changes in v5 allow the web-inf trick to work? From: Karr, David [mailto:[EMAIL PROTECTED] Unfortunately, not all web containers will support this. There was apparent disagreement on the interpretation of the specification in this area. From: Nathan Pitts [mailto:[EMAIL PROTECTED] If you put all your jsp's inside a the WEB-INF directory, they will not be accessible directly -- only through an action. I think this is part of the jsp specification that nothing can be directly served out of this special directory..Otherwise, a user could pull up configuration files that reside there -- web.xml for example.For example, I have a directory structure containing jsp's under WEB-INF/jsp in my current web applicationHope this helps! --nathan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] web.xml error-page configuration problem
David: When I add the errorPage directive to my JSP, my error page appeared in the screen b/c I'm using Struts Tiles. The page in which I'm creating a null pointer exception is actually an inner tile on my screen. The functionality that I'm looking for is the ability to forward to separate error screen which doesn't display the stack trace to the user. Thanks, JOHN -Original Message- From: David Graham [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 1:12 PM To: [EMAIL PROTECTED] Subject: Re: [OT] web.xml error-page configuration problem Is this at the top of your jsp? %@ page errorPage=/jsp/error.jsp % David From: Hohlen, John C [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts-User (E-mail) [EMAIL PROTECTED] Subject: [OT] web.xml error-page configuration problem Date: Thu, 5 Jun 2003 12:59:26 -0500 I'm using WebLogic 6.1 SP 2 and I can't get the web.xm. error-page configuration to work for exceptions occurring within a JSP. If the exception, occurs in Java code (i.e. non-JSP), the error page works fine. But if it occurs in the JSP, I see a stack trace on the screen instead of forwarding to the error JSP. Here's the setting I have in web.xml file: error-page exception-typejava.lang.Throwable/exception-type location/jsp/error.jsp/location /error-page This should handle every type of exception, right? In my JSP, I'm intentionally creating a null pointer exception. I also tried adding the following to my web.xml file and it still didn't work: error-page exception-typejava.lang.NullPointerException/exception-type location/jsp/error.jsp/location /error-page Any help is greatly appreciated, Thanks, JOHN HOHLEN - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ The new MSN 8: advanced junk mail protection and 2 months FREE* http://join.msn.com/?page=features/junkmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] web.xml error-page configuration problem
%@ page errorPage=error.jsp % This is what I'm trying to avoid. I would prefer to only specify this via a single configuration setting in the web.xml. I think that's required. I created a header.jsp file that has all my taglib declarations and the error page declaration and then I include header.jsp in all of my other jsps. David JOHN -Original Message- From: Jimmy Emmanual [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 1:05 PM To: 'Struts Users Mailing List' Subject: RE: [OT] web.xml error-page configuration problem Is you /jsp/error.jsp page a error page? If not it as the Error Page via. %@ page isErrorPage=true % Jimmy -Original Message- From: Hohlen, John C [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 1:59 PM To: Struts-User (E-mail) Subject: [OT] web.xml error-page configuration problem I'm using WebLogic 6.1 SP 2 and I can't get the web.xm. error-page configuration to work for exceptions occurring within a JSP. If the exception, occurs in Java code (i.e. non-JSP), the error page works fine. But if it occurs in the JSP, I see a stack trace on the screen instead of forwarding to the error JSP. Here's the setting I have in web.xml file: error-page exception-typejava.lang.Throwable/exception-type location/jsp/error.jsp/location /error-page This should handle every type of exception, right? In my JSP, I'm intentionally creating a null pointer exception. I also tried adding the following to my web.xml file and it still didn't work: error-page exception-typejava.lang.NullPointerException/exception-type location/jsp/error.jsp/location /error-page Any help is greatly appreciated, Thanks, JOHN HOHLEN - 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] _ Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] web.xml error-page configuration problem
You could point your error-page to a redirected Struts action so that it doesn't show up in a tile. David David: When I add the errorPage directive to my JSP, my error page appeared in the screen b/c I'm using Struts Tiles. The page in which I'm creating a null pointer exception is actually an inner tile on my screen. The functionality that I'm looking for is the ability to forward to separate error screen which doesn't display the stack trace to the user. Thanks, JOHN -Original Message- From: David Graham [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 1:12 PM To: [EMAIL PROTECTED] Subject: Re: [OT] web.xml error-page configuration problem Is this at the top of your jsp? %@ page errorPage=/jsp/error.jsp % David From: Hohlen, John C [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts-User (E-mail) [EMAIL PROTECTED] Subject: [OT] web.xml error-page configuration problem Date: Thu, 5 Jun 2003 12:59:26 -0500 I'm using WebLogic 6.1 SP 2 and I can't get the web.xm. error-page configuration to work for exceptions occurring within a JSP. If the exception, occurs in Java code (i.e. non-JSP), the error page works fine. But if it occurs in the JSP, I see a stack trace on the screen instead of forwarding to the error JSP. Here's the setting I have in web.xml file: error-page exception-typejava.lang.Throwable/exception-type location/jsp/error.jsp/location /error-page This should handle every type of exception, right? In my JSP, I'm intentionally creating a null pointer exception. I also tried adding the following to my web.xml file and it still didn't work: error-page exception-typejava.lang.NullPointerException/exception-type location/jsp/error.jsp/location /error-page Any help is greatly appreciated, Thanks, JOHN HOHLEN - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ The new MSN 8: advanced junk mail protection and 2 months FREE* http://join.msn.com/?page=features/junkmail - 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] _ Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] web.xml error-page configuration problem
Hi David, What container are you using and are you using Tiles? I'm using Jboss with Tomcat and I can't put all my taglibs in a common header (there was a discussion about this a while back on the Struts list). Thanks, -Tim -Original Message- From: David Graham [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 2:32 PM To: [EMAIL PROTECTED] Subject: RE: [OT] web.xml error-page configuration problem %@ page errorPage=error.jsp % This is what I'm trying to avoid. I would prefer to only specify this via a single configuration setting in the web.xml. I think that's required. I created a header.jsp file that has all my taglib declarations and the error page declaration and then I include header.jsp in all of my other jsps. David JOHN -Original Message- From: Jimmy Emmanual [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 1:05 PM To: 'Struts Users Mailing List' Subject: RE: [OT] web.xml error-page configuration problem Is you /jsp/error.jsp page a error page? If not it as the Error Page via. %@ page isErrorPage=true % Jimmy -Original Message- From: Hohlen, John C [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 1:59 PM To: Struts-User (E-mail) Subject: [OT] web.xml error-page configuration problem I'm using WebLogic 6.1 SP 2 and I can't get the web.xm. error-page configuration to work for exceptions occurring within a JSP. If the exception, occurs in Java code (i.e. non-JSP), the error page works fine. But if it occurs in the JSP, I see a stack trace on the screen instead of forwarding to the error JSP. Here's the setting I have in web.xml file: error-page exception-typejava.lang.Throwable/exception-type location/jsp/error.jsp/location /error-page This should handle every type of exception, right? In my JSP, I'm intentionally creating a null pointer exception. I also tried adding the following to my web.xml file and it still didn't work: error-page exception-typejava.lang.NullPointerException/exception-type location/jsp/error.jsp/location /error-page Any help is greatly appreciated, Thanks, JOHN HOHLEN - 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] _ Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] web.xml error-page configuration problem
sry 1. didn't mean to reply to the list and 2. the discussion was on the taglibs list. -Original Message- From: Chen, Gin [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 2:51 PM To: 'Struts Users Mailing List' Subject: RE: [OT] web.xml error-page configuration problem Hi David, What container are you using and are you using Tiles? I'm using Jboss with Tomcat and I can't put all my taglibs in a common header (there was a discussion about this a while back on the Struts list). Thanks, -Tim -Original Message- From: David Graham [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 2:32 PM To: [EMAIL PROTECTED] Subject: RE: [OT] web.xml error-page configuration problem %@ page errorPage=error.jsp % This is what I'm trying to avoid. I would prefer to only specify this via a single configuration setting in the web.xml. I think that's required. I created a header.jsp file that has all my taglib declarations and the error page declaration and then I include header.jsp in all of my other jsps. David JOHN -Original Message- From: Jimmy Emmanual [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 1:05 PM To: 'Struts Users Mailing List' Subject: RE: [OT] web.xml error-page configuration problem Is you /jsp/error.jsp page a error page? If not it as the Error Page via. %@ page isErrorPage=true % Jimmy -Original Message- From: Hohlen, John C [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 1:59 PM To: Struts-User (E-mail) Subject: [OT] web.xml error-page configuration problem I'm using WebLogic 6.1 SP 2 and I can't get the web.xm. error-page configuration to work for exceptions occurring within a JSP. If the exception, occurs in Java code (i.e. non-JSP), the error page works fine. But if it occurs in the JSP, I see a stack trace on the screen instead of forwarding to the error JSP. Here's the setting I have in web.xml file: error-page exception-typejava.lang.Throwable/exception-type location/jsp/error.jsp/location /error-page This should handle every type of exception, right? In my JSP, I'm intentionally creating a null pointer exception. I also tried adding the following to my web.xml file and it still didn't work: error-page exception-typejava.lang.NullPointerException/exception-type location/jsp/error.jsp/location /error-page Any help is greatly appreciated, Thanks, JOHN HOHLEN - 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] _ Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail - 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: [OT] web.xml error-page configuration problem
Okay, I'll try that. Do you mean the error-page in my web.xml, for example: error-page exception-typejava.lang.Throwable/exception-type location/displaySystemError.do/location /error-page Or the @page directive. For example: %@ page errorPage=/displaySystemError.do % Thanks, JOHN -Original Message- From: David Graham [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 1:33 PM To: [EMAIL PROTECTED] Subject: RE: [OT] web.xml error-page configuration problem You could point your error-page to a redirected Struts action so that it doesn't show up in a tile. David David: When I add the errorPage directive to my JSP, my error page appeared in the screen b/c I'm using Struts Tiles. The page in which I'm creating a null pointer exception is actually an inner tile on my screen. The functionality that I'm looking for is the ability to forward to separate error screen which doesn't display the stack trace to the user. Thanks, JOHN -Original Message- From: David Graham [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 1:12 PM To: [EMAIL PROTECTED] Subject: Re: [OT] web.xml error-page configuration problem Is this at the top of your jsp? %@ page errorPage=/jsp/error.jsp % David From: Hohlen, John C [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts-User (E-mail) [EMAIL PROTECTED] Subject: [OT] web.xml error-page configuration problem Date: Thu, 5 Jun 2003 12:59:26 -0500 I'm using WebLogic 6.1 SP 2 and I can't get the web.xm. error-page configuration to work for exceptions occurring within a JSP. If the exception, occurs in Java code (i.e. non-JSP), the error page works fine. But if it occurs in the JSP, I see a stack trace on the screen instead of forwarding to the error JSP. Here's the setting I have in web.xml file: error-page exception-typejava.lang.Throwable/exception-type location/jsp/error.jsp/location /error-page This should handle every type of exception, right? In my JSP, I'm intentionally creating a null pointer exception. I also tried adding the following to my web.xml file and it still didn't work: error-page exception-typejava.lang.NullPointerException/exception-type location/jsp/error.jsp/location /error-page Any help is greatly appreciated, Thanks, JOHN HOHLEN - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ The new MSN 8: advanced junk mail protection and 2 months FREE* http://join.msn.com/?page=features/junkmail - 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] _ Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] web.xml error-page configuration problem
Okay, I'll try that. Do you mean the error-page in my web.xml, for example: This is how I set it up. error-page exception-typejava.lang.Throwable/exception-type location/displaySystemError.do/location /error-page Or the @page directive. For example: %@ page errorPage=/displaySystemError.do % I don't see why that wouldn't work either. David Thanks, JOHN -Original Message- From: David Graham [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 1:33 PM To: [EMAIL PROTECTED] Subject: RE: [OT] web.xml error-page configuration problem You could point your error-page to a redirected Struts action so that it doesn't show up in a tile. David David: When I add the errorPage directive to my JSP, my error page appeared in the screen b/c I'm using Struts Tiles. The page in which I'm creating a null pointer exception is actually an inner tile on my screen. The functionality that I'm looking for is the ability to forward to separate error screen which doesn't display the stack trace to the user. Thanks, JOHN -Original Message- From: David Graham [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 1:12 PM To: [EMAIL PROTECTED] Subject: Re: [OT] web.xml error-page configuration problem Is this at the top of your jsp? %@ page errorPage=/jsp/error.jsp % David From: Hohlen, John C [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts-User (E-mail) [EMAIL PROTECTED] Subject: [OT] web.xml error-page configuration problem Date: Thu, 5 Jun 2003 12:59:26 -0500 I'm using WebLogic 6.1 SP 2 and I can't get the web.xm. error-page configuration to work for exceptions occurring within a JSP. If the exception, occurs in Java code (i.e. non-JSP), the error page works fine. But if it occurs in the JSP, I see a stack trace on the screen instead of forwarding to the error JSP. Here's the setting I have in web.xml file: error-page exception-typejava.lang.Throwable/exception-type location/jsp/error.jsp/location /error-page This should handle every type of exception, right? In my JSP, I'm intentionally creating a null pointer exception. I also tried adding the following to my web.xml file and it still didn't work: error-page exception-typejava.lang.NullPointerException/exception-type location/jsp/error.jsp/location /error-page Any help is greatly appreciated, Thanks, JOHN HOHLEN - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ The new MSN 8: advanced junk mail protection and 2 months FREE* http://join.msn.com/?page=features/junkmail - 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] _ Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 - 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] _ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] web.xml error-page configuration problem
Yes, I am using Tiles and Tomcat and the common header works great. David Hi David, What container are you using and are you using Tiles? I'm using Jboss with Tomcat and I can't put all my taglibs in a common header (there was a discussion about this a while back on the Struts list). Thanks, -Tim -Original Message- From: David Graham [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 2:32 PM To: [EMAIL PROTECTED] Subject: RE: [OT] web.xml error-page configuration problem %@ page errorPage=error.jsp % This is what I'm trying to avoid. I would prefer to only specify this via a single configuration setting in the web.xml. I think that's required. I created a header.jsp file that has all my taglib declarations and the error page declaration and then I include header.jsp in all of my other jsps. David JOHN -Original Message- From: Jimmy Emmanual [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 1:05 PM To: 'Struts Users Mailing List' Subject: RE: [OT] web.xml error-page configuration problem Is you /jsp/error.jsp page a error page? If not it as the Error Page via. %@ page isErrorPage=true % Jimmy -Original Message- From: Hohlen, John C [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 1:59 PM To: Struts-User (E-mail) Subject: [OT] web.xml error-page configuration problem I'm using WebLogic 6.1 SP 2 and I can't get the web.xm. error-page configuration to work for exceptions occurring within a JSP. If the exception, occurs in Java code (i.e. non-JSP), the error page works fine. But if it occurs in the JSP, I see a stack trace on the screen instead of forwarding to the error JSP. Here's the setting I have in web.xml file: error-page exception-typejava.lang.Throwable/exception-type location/jsp/error.jsp/location /error-page This should handle every type of exception, right? In my JSP, I'm intentionally creating a null pointer exception. I also tried adding the following to my web.xml file and it still didn't work: error-page exception-typejava.lang.NullPointerException/exception-type location/jsp/error.jsp/location /error-page Any help is greatly appreciated, Thanks, JOHN HOHLEN - 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] _ Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail - 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] _ MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. http://join.msn.com/?page=features/virus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]