Re: The field name in jsp
Hi riyaz, Thank you very much. I have try it. I think this method is mot suitable for me as I only want to get the fields in jsp not all the field in the form. As some field in the form is not used in jsp and some field is used by the other action. Anyway thank a lot. Do you still have any method let me try ?? Cliff this is your last method: HttpServletRequest request = (HttpServletRequest)pageContext.getRequest(); ModuleConfig moduleConfig = (ModuleConfig)request.getAttribute(Globals.MODULE_KEY); FormBeanConfig formBean = moduleConfig.findFormBeanConfig(formName); FormPropertyConfig[] formProps = formBean.findFormPropertyConfigs(); for (int i = 0; i formProps.length; i++) { // get property FormPropertyConfig prop = formProps[i]; System.out.println(prop.getName()); } - Original Message - From: rmanchu [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Tuesday, May 10, 2005 5:05 PM Subject: Re: The field name in jsp did u try with ur forms? i think it should work. also, if you're jsp is not backed by an action then, u'll need to create a form, which u can easily by using a RequestUtils.createActionForm method riyaz Cliff Lam wrote: Thx a lot. This is a good method but I'm not using DynaActionForms = ( . - 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: The field name in jsp
Thx a lot. This is a good method but I'm not using DynaActionForms = ( . Cliff - Original Message - From: rmanchu [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Monday, May 09, 2005 1:48 PM Subject: Re: The field name in jsp have used the following extensively with DynaActionForms. i would think that this would work with any extension of ActionForms. The form fields are represented by FormPropertyConfig objects contained within the FormBeanConfig objects. you could place the following code in you JSP and see what happens. HttpServletRequest request = (HttpServletRequest)pageContext.getRequest(); ModuleConfig moduleConfig = (ModuleConfig)request.getAttribute(Globals.MODULE_KEY); FormBeanConfig formBean = moduleConfig.findFormBeanConfig(formName); FormPropertyConfig[] formProps = formBean.findFormPropertyConfigs(); for (int i = 0; i formProps.length; i++) { // get property FormPropertyConfig prop = formProps[i]; System.out.println(prop.getName()); } Cliff Lam wrote: Should I hard code the field name in the collection ? I want to do it in each page in my web application =.= Cliff - 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] Help !! Too many select-box in one page
Hi, My page has too many select-box in one page. The .html has 17XXX lines. This make the page load for a long time to appear =( Anyone face this problem too?? Please give me some idea Thx a lot Cliff
Re: [OT] Help !! Too many select-box in one page
Thank you very much for your quick reply. Actually, all the select-box is in one table contain 89 lists and each list has several select-box in-side. but each select in each list has the same options. I'm trying to find a way to reuse it. So i can just generate one select-box for the other 88 select-box =( Cliff - Original Message - From: Allistair Crossley [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Tuesday, May 10, 2005 4:31 PM Subject: RE: [OT] Help !! Too many select-box in one page You need to decide also whether those too many select-boxes are there for a reason or not. If they are, then you can't very well get rid of them, if they are not, again, re-factor the form, re-gather requirements for the form data capture and work from that. Sounds like you could re-factor your HTML forms into perhaps a series of forms rather than one page. You might like to provide more information to the list with regard to how your page is built, what it's function is, the type of info it collects and the type of info it shows. Allistair. -Original Message- From: Cliff Lam [mailto:[EMAIL PROTECTED] Sent: 10 May 2005 09:25 To: Struts Users Mailing List Subject: [OT] Help !! Too many select-box in one page Hi, My page has too many select-box in one page. The .html has 17XXX lines. This make the page load for a long time to appear =( Anyone face this problem too?? Please give me some idea Thx a lot Cliff FONT SIZE=1 FACE=VERDANA,ARIAL COLOR=BLUE --- QAS Ltd. Developers of QuickAddress Software a href=http://www.qas.com;www.qas.com/a Registered in England: No 2582055 Registered in Australia: No 082 851 474 --- /FONT - 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] Help !! Too many select-box in one page
thank you for you reply I really want to solve the problem in the client side. It load for 1 min for the page = ( kill me please X.X Cliff - Original Message - From: Allistair Crossley [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Tuesday, May 10, 2005 4:40 PM Subject: RE: [OT] Help !! Too many select-box in one page You could define a JSP include file with one of these select lists, e.g select name=${selectName} ... /select And then in your main form, using JSTL before each select change the selectName page variable c:set var=selectName value=selectA / select name=${selectName} ... /select c:set var=selectName value=selectB / select name=${selectName} ... /select However, this will not reduce your HTML page size, because you are still using 88 select blocks. You should understand the difference between reducing page size (less code) and producing re-usable code (includes) Cheers, Allistair. -Original Message- From: Cliff Lam [mailto:[EMAIL PROTECTED] Sent: 10 May 2005 09:36 To: Struts Users Mailing List Subject: Re: [OT] Help !! Too many select-box in one page Thank you very much for your quick reply. Actually, all the select-box is in one table contain 89 lists and each list has several select-box in-side. but each select in each list has the same options. I'm trying to find a way to reuse it. So i can just generate one select-box for the other 88 select-box =( Cliff - Original Message - From: Allistair Crossley [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Tuesday, May 10, 2005 4:31 PM Subject: RE: [OT] Help !! Too many select-box in one page You need to decide also whether those too many select-boxes are there for a reason or not. If they are, then you can't very well get rid of them, if they are not, again, re-factor the form, re-gather requirements for the form data capture and work from that. Sounds like you could re-factor your HTML forms into perhaps a series of forms rather than one page. You might like to provide more information to the list with regard to how your page is built, what it's function is, the type of info it collects and the type of info it shows. Allistair. -Original Message- From: Cliff Lam [mailto:[EMAIL PROTECTED] Sent: 10 May 2005 09:25 To: Struts Users Mailing List Subject: [OT] Help !! Too many select-box in one page Hi, My page has too many select-box in one page. The .html has 17XXX lines. This make the page load for a long time to appear =( Anyone face this problem too?? Please give me some idea Thx a lot Cliff FONT SIZE=1 FACE=VERDANA,ARIAL COLOR=BLUE --- QAS Ltd. Developers of QuickAddress Software a href=http://www.qas.com;www.qas.com/a Registered in England: No 2582055 Registered in Australia: No 082 851 474 --- /FONT - 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: [OT] Help !! Too many select-box in one page
Thank you for your reply I get the options from the db But the main concern is in the client side ... It loaded about 1min for the 17XXX lines html ... Cliff - Original Message - From: rmanchu [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Tuesday, May 10, 2005 5:27 PM Subject: Re: [OT] Help !! Too many select-box in one page how r u rendering you select boxes? ie, database call for each render? riyaz Cliff Lam wrote: Hi, My page has too many select-box in one page. The .html has 17XXX lines. This make the page load for a long time to appear =( Anyone face this problem too?? Please give me some idea Thx a lot Cliff - 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] Help !! Too many select-box in one page
Thank you very much for your reply ^^ You are right !! I should not get the list from db so many times ^^ But I want to solve the loading time in the client side frist = (. It loaded 1 min even I copy the html source code loaded in the drameweaver = ( it is the html has 17XXX lines is too big ? Thanks a lot Cliff - Original Message - From: Allistair Crossley [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Tuesday, May 10, 2005 4:58 PM Subject: RE: [OT] Help !! Too many select-box in one page yes you won't be able to solve that problem if you are rendering 88 select boxes. why? because you are rending 88 select boxes that are populated from the database. no amount of client-sise javascript (yuck) is going to help you. you need to re-factor your design which is clearly not working for you. if you absolutely cannot re-factor the design, then you could consider using some caching strategy to prevent the huge database lookup more than once using something like OSCACHE perhaps. you could also consider hitting the database for 1 select list and building the html select list into a java String, i.e String select = select name=\PLACEHOLDER\; // loop database result set adding option to select // render JSP page in your JSP, replace the PLACEHOLDER with the select name you need % String select = request.getAttribute(select); % %= select.replaceAll(PLACEHOLDER, selectNameA) % %= select.replaceAll(PLACEHOLDER, selectNameB) % This method therefore hits the database ONCE (since you say you can reuse the select lists) and should be much faster. Allistair. -Original Message- From: Cliff Lam [mailto:[EMAIL PROTECTED] Sent: 10 May 2005 09:52 To: Struts Users Mailing List Subject: Re: [OT] Help !! Too many select-box in one page Thank you for your reply I get the options from the db But the main concern is in the client side ... It loaded about 1min for the 17XXX lines html ... Cliff - Original Message - From: rmanchu [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Tuesday, May 10, 2005 5:27 PM Subject: Re: [OT] Help !! Too many select-box in one page how r u rendering you select boxes? ie, database call for each render? riyaz Cliff Lam wrote: Hi, My page has too many select-box in one page. The .html has 17XXX lines. This make the page load for a long time to appear =( Anyone face this problem too?? Please give me some idea Thx a lot Cliff - 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] FONT SIZE=1 FACE=VERDANA,ARIAL COLOR=BLUE --- QAS Ltd. Developers of QuickAddress Software a href=http://www.qas.com;www.qas.com/a Registered in England: No 2582055 Registered in Australia: No 082 851 474 --- /FONT - 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] Help !! Too many select-box in one page
haha.. ='( really Thx a lot !!! Cliff - Original Message - From: Allistair Crossley [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Tuesday, May 10, 2005 5:16 PM Subject: RE: [OT] Help !! Too many select-box in one page the problem as I have said in both my previous replies is that you cannot possibly expect 17,000 lines of HTML to be fast not matter how you go about generating that 17,000 lines of code. so, as I have suggested, you need to look at your forms design and break it down into more pages I would say Form now: select1 select2 select3 select4 Re-factor 2-step process Page 1 select1 select2 Page 2 select3 select4 FOR EXAMPLE. Please note I am not in a position to tell you how to design your forms or application, but I am in a position to tell you that there is nothing you can do about making 17,000 lines of HTML quicker (unless you buy a new desktop PC for every user and increase network bandwidth ;) ). Re-factor Re-factor Re-factor -Original Message- From: Cliff Lam [mailto:[EMAIL PROTECTED] Sent: 10 May 2005 10:07 To: Struts Users Mailing List Subject: Re: [OT] Help !! Too many select-box in one page Thank you very much for your reply ^^ You are right !! I should not get the list from db so many times ^^ But I want to solve the loading time in the client side frist = (. It loaded 1 min even I copy the html source code loaded in the drameweaver = ( it is the html has 17XXX lines is too big ? Thanks a lot Cliff - Original Message - From: Allistair Crossley [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Tuesday, May 10, 2005 4:58 PM Subject: RE: [OT] Help !! Too many select-box in one page yes you won't be able to solve that problem if you are rendering 88 select boxes. why? because you are rending 88 select boxes that are populated from the database. no amount of client-sise javascript (yuck) is going to help you. you need to re-factor your design which is clearly not working for you. if you absolutely cannot re-factor the design, then you could consider using some caching strategy to prevent the huge database lookup more than once using something like OSCACHE perhaps. you could also consider hitting the database for 1 select list and building the html select list into a java String, i.e String select = select name=\PLACEHOLDER\; // loop database result set adding option to select // render JSP page in your JSP, replace the PLACEHOLDER with the select name you need % String select = request.getAttribute(select); % %= select.replaceAll(PLACEHOLDER, selectNameA) % %= select.replaceAll(PLACEHOLDER, selectNameB) % This method therefore hits the database ONCE (since you say you can reuse the select lists) and should be much faster. Allistair. -Original Message- From: Cliff Lam [mailto:[EMAIL PROTECTED] Sent: 10 May 2005 09:52 To: Struts Users Mailing List Subject: Re: [OT] Help !! Too many select-box in one page Thank you for your reply I get the options from the db But the main concern is in the client side ... It loaded about 1min for the 17XXX lines html ... Cliff - Original Message - From: rmanchu [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Tuesday, May 10, 2005 5:27 PM Subject: Re: [OT] Help !! Too many select-box in one page how r u rendering you select boxes? ie, database call for each render? riyaz Cliff Lam wrote: Hi, My page has too many select-box in one page. The .html has 17XXX lines. This make the page load for a long time to appear =( Anyone face this problem too?? Please give me some idea Thx a lot Cliff - 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] FONT SIZE=1 FACE=VERDANA,ARIAL COLOR=BLUE --- QAS Ltd. Developers of QuickAddress Software a href=http://www.qas.com;www.qas.com/a Registered in England: No 2582055 Registered in Australia: No 082 851 474 --- /FONT - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED
Re: [OT] Help !! Too many select-box in one page
Thx a lot !! Really thank you to everyone =) !!! Cliff - Original Message - From: Frank W. Zammetti [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Wednesday, May 11, 2005 12:05 AM Subject: Re: [OT] Help !! Too many select-box in one page I'd suggest doing some testing to determine where the delay is actually occurring... is it reading from the database that takes so long? Is it transit time from the server to the client? Is it rendering on the client? The firsr two you should be able to determine on the server-side, then just subtract that out from the total time to see how long the client is taking. If it's either of the first two then people have given you some options to explore already... if it's the later, you'll almost certainly have to refactor your design... the suggestion of populating the boxes via scripting is a good one, but I've done this extensively and so can tell you that it will become a bottleneck in a hurry, no to mention the fact that the perceived performance of your site can vary greatly depending on the clients' PC. Hence, my suggestion... once you determine where the greatest amount of time is actually spent, then folks can probably help in a hurry :) -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com John Fletcher wrote: Cliff, but each select in each list has the same options. If each select in each list has the same options, you can just download the options once to a javascript array and populate all of the select boxes on the client side. A quick example: script language=JavaScript var optionArray = {c:out value=${myValuesCSV} /}; function populateBoxes() { var mySelectBox; // You'll need to do this for each box on your form for (var i = 0; i optionArray.length; i++) { mySelectBox.options[i] = new Option(optionArray[i], optionArray[i]); } } /script Call that populateBoxes function on startup. Who knows how long that'll take to populate client-side, but it should reduce your page size considerably. If you need different values than text in the select boxes, you could either have a 2-dimensional array (which would require different formatting for the values, or a different method of printing them out in the javascript), or you could maintain 2 arrays, one for values and one for text. Note that you will need to know all of the names of the select boxes unless you want to just loop through all of the form elements and do the action for any of the select form elements that you find. Your CSV string that you drop into the optionArray will need to have strings quoted if necessary of course. John - 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: Way of reading this mailing list as a heirachy
This function is so useful But I cannot find it in my Outlook Express 6 =.= Cliff - Original Message - From: Rafael [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Monday, May 09, 2005 11:17 AM Subject: Re: Way of reading this mailing list as a heirachy I always thought outlook couldn't do message threads, but it can. I don't remember the option on whichever menu, but it's easy to find. Probably the View menu. yes, In Outlook Express 6 , View - Current View - Group Messages by Conversation. - Original Message - From: Adam Hardy [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Sunday, May 08, 2005 10:45 AM Subject: Re: Way of reading this mailing list as a heirachy On 08/05/05 04:27nbsp;Kwok Peng Tuck wrote: There's a pretty good e-mail client from mozilla.org, look for Thunderbird there. Does everything you ask for bellow. Mark Benussi wrote: I use Outlook and was wondering if there was a way of reading all these messages as a hierarchy. I sometimes miss messages on a thread I was interested in. I always thought outlook couldn't do message threads, but it can. I don't remember the option on whichever menu, but it's easy to find. Probably the View menu. It sets up the threads just like a newsgroup. If you really can't find it, perhaps your Outlook is an old version. Adam PS you should familiarise yourself with security issues in outlook as well, for instance, you should disable javascript and images in your incoming emails. -- struts 1.2 + tomcat 5.0.19 + java 1.4.2 Linux 2.4.20 Debian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
The field name in jsp
Hi, How can I know the fields in jsp dynamically. eg. I want to print the all the field name at the end of each page dynamically. Should I override the setProperty to do it? Thanks a lot =) Cliff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
The field name in jsp
Hi, How can I know the fields in jsp dynamically. eg. I want to print the all the field name at the end of each page dynamically. Should I override the setProperty to do it? Thanks a lot =) Cliff
Re: The field name in jsp
I'm talking the field is like html:text property=propertyName And I'm finding method to print all the field name (propertyName) at the end of the page. eg. At the end of the page This page's Field: propertyName1 propertyName2 propertyName3 Thanks a lot ^^ Cliff - Original Message - From: Jonathan Wright [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Monday, May 09, 2005 12:26 PM Subject: Re: The field name in jsp Define fields. Are you talking about form fields? Jonathan Wright - Original Message - From: Cliff Lam [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Monday, May 09, 2005 4:17 PM Subject: The field name in jsp Hi, How can I know the fields in jsp dynamically. eg. I want to print the all the field name at the end of each page dynamically. Should I override the setProperty to do it? Thanks a lot =) Cliff - 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: The field name in jsp
Should I hard code the field name in the collection ? I want to do it in each page in my web application =.= Cliff - Original Message - From: Jonathan Wright [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Monday, May 09, 2005 12:37 PM Subject: Re: The field name in jsp If the form is not dynamic, i.e. the form fields are not generated at runtime, why not just put a collection of Strings or an array or Strings into the scope of your choice and then iterate over it at the end of your page Jonathan Wright - Original Message - From: Cliff Lam [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Monday, May 09, 2005 4:33 PM Subject: Re: The field name in jsp I'm talking the field is like html:text property=propertyName And I'm finding method to print all the field name (propertyName) at the end of the page. eg. At the end of the page This page's Field: propertyName1 propertyName2 propertyName3 Thanks a lot ^^ Cliff - Original Message - From: Jonathan Wright [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Monday, May 09, 2005 12:26 PM Subject: Re: The field name in jsp Define fields. Are you talking about form fields? Jonathan Wright - Original Message - From: Cliff Lam [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Monday, May 09, 2005 4:17 PM Subject: The field name in jsp Hi, How can I know the fields in jsp dynamically. eg. I want to print the all the field name at the end of each page dynamically. Should I override the setProperty to do it? Thanks a lot =) Cliff - 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]
Validation of indexed property
Hi, Any one can send me some examples to do the validation of indexed property ?? As I find that JavascriptValidationTag just skip it . I'm using struts 1.1 Thanks a lot =) Cliff
Re: The field name in jsp
But if I do the reflection to check the field in my form how can I know which field is not used in the jsp /.\ if the form is extended to the other form, I think the case is more complex. Cliff - Original Message - From: Jonathan Wright [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Monday, May 09, 2005 12:51 PM Subject: Re: The field name in jsp You could do something clever and use reflection to look at the method names in you action form objects I guess Jonathan Wright - Original Message - From: Cliff Lam [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Monday, May 09, 2005 4:44 PM Subject: Re: The field name in jsp Should I hard code the field name in the collection ? I want to do it in each page in my web application =.= Cliff - Original Message - From: Jonathan Wright [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Monday, May 09, 2005 12:37 PM Subject: Re: The field name in jsp If the form is not dynamic, i.e. the form fields are not generated at runtime, why not just put a collection of Strings or an array or Strings into the scope of your choice and then iterate over it at the end of your page Jonathan Wright - Original Message - From: Cliff Lam [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Monday, May 09, 2005 4:33 PM Subject: Re: The field name in jsp I'm talking the field is like html:text property=propertyName And I'm finding method to print all the field name (propertyName) at the end of the page. eg. At the end of the page This page's Field: propertyName1 propertyName2 propertyName3 Thanks a lot ^^ Cliff - Original Message - From: Jonathan Wright [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Monday, May 09, 2005 12:26 PM Subject: Re: The field name in jsp Define fields. Are you talking about form fields? Jonathan Wright - Original Message - From: Cliff Lam [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Monday, May 09, 2005 4:17 PM Subject: The field name in jsp Hi, How can I know the fields in jsp dynamically. eg. I want to print the all the field name at the end of each page dynamically. Should I override the setProperty to do it? Thanks a lot =) Cliff - 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: The field name in jsp
I think I can do it like this 1. create my own textTag 2. override the setProperty function 2.1 save the property name 3. finally get it back using a tag But I don't know it is a good idea . Cliff - Original Message - From: Jonathan Wright [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Monday, May 09, 2005 12:51 PM Subject: Re: The field name in jsp You could do something clever and use reflection to look at the method names in you action form objects I guess Jonathan Wright - Original Message - From: Cliff Lam [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Monday, May 09, 2005 4:44 PM Subject: Re: The field name in jsp Should I hard code the field name in the collection ? I want to do it in each page in my web application =.= Cliff - Original Message - From: Jonathan Wright [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Monday, May 09, 2005 12:37 PM Subject: Re: The field name in jsp If the form is not dynamic, i.e. the form fields are not generated at runtime, why not just put a collection of Strings or an array or Strings into the scope of your choice and then iterate over it at the end of your page Jonathan Wright - Original Message - From: Cliff Lam [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Monday, May 09, 2005 4:33 PM Subject: Re: The field name in jsp I'm talking the field is like html:text property=propertyName And I'm finding method to print all the field name (propertyName) at the end of the page. eg. At the end of the page This page's Field: propertyName1 propertyName2 propertyName3 Thanks a lot ^^ Cliff - Original Message - From: Jonathan Wright [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Monday, May 09, 2005 12:26 PM Subject: Re: The field name in jsp Define fields. Are you talking about form fields? Jonathan Wright - Original Message - From: Cliff Lam [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Monday, May 09, 2005 4:17 PM Subject: The field name in jsp Hi, How can I know the fields in jsp dynamically. eg. I want to print the all the field name at the end of each page dynamically. Should I override the setProperty to do it? Thanks a lot =) Cliff - 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: problem with checkbox values and map backed properties
You can try to set a unlicked value in the reset function in the form. When the click-box is clicked the unlicked value will be covered. Hope this is useful for you. =) Cliff - Original Message - From: Günther Wieser [EMAIL PROTECTED] To: 'Struts Users Mailing List' user@struts.apache.org Sent: Saturday, April 30, 2005 1:28 AM Subject: problem with checkbox values and map backed properties hi, i have the following problem with map backed properties: i created a form bean with a map called inCampaignMap, and the getter and setters being boolean getInCampaign(String key) and setInCampaign(String key, boolean value). internally, of course, the map value entries are of type Boolean. in my JSP i have the following code: html:checkbox property=inCampaign(${campaign.id}) / where ${campaign.id} indicates the key for the map. this works fine if the checkbox is checked. in this case i can see that the setInCampaign() method is being called and that i get true for the value. if the checkbox is unchecked, the value is NOT set. strange enough, i also can see from the html code that's generate that value=on is always set, no matter if the checkbox is checked or not. any ideas? thanks in advance, kr, guenther - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: modules
http://struts.apache.org/userGuide/configuration.html#dd_config_modules =) Cliff - Original Message - From: Lucas Bern [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Saturday, April 30, 2005 5:39 AM Subject: modules Any resource that explains how to configure modules in struts??? thanks Lucas - 250MB gratis, Antivirus y Antispam Correo Yahoo!, el mejor correo web del mundo Abrí tu cuenta aquí - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Validate indexed property problem
Hi all, could any one send me some best practice about Validating indexed property? Thanks a lot =) Best wishes, Cliff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Validator with more than one module
If you not trying to use multi-module, you can try to include your all validation.xml into one config.xml. Lucky Cliff - Original Message - From: Diego Espada [EMAIL PROTECTED] To: user@struts.apache.org Sent: Saturday, March 12, 2005 2:22 AM Subject: Validator with more than one module Hi I'm trying to use the validator with one that more Struts module, but I've found that if you've more than one module, only one of them load the validation xmls correctly, the others don't. Having this in the web.xml /WEB-INF/struts-config-one.xml, /WEB-INF/struts-config-two.xml: Each one loading their own validation.xml (validation-one and validation-two), only struts-config-two loads the validator correctly. The other validation is ignored by Struts. If I switch the order of the files, it works the other way around. I've seen in the Internet sort of this problem happened in previous versions of Struts. I've tested this in 1.2.6 beta and 1.2.4 and the problem is present. Is there a patch or workaround for this ? 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: filter ?
Hi, I have encounter this problem before too. I have tried to get the destination jsp using a tag. 1. The tag can get the information of jsp and put it in the session. 2. Get the jsp information from the filter. Hope this help =) Cliff - Original Message - From: Eric Lemle [EMAIL PROTECTED] To: user@struts.apache.org Sent: Saturday, February 12, 2005 7:41 AM Subject: filter ? From inside a filter how do I get the name of the jsp that was requested? Eric D. Lemle Senior Programmer / Analyst Intermountain Health Care 36 South State Street, Suite 1100 Salt Lake City, Utah 84111 United States of America (USA) (801) 442-3688 -- 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]
JAAS implement RBAC in struts
Hi, could anyone get me some idea to implement a RBAC (role base access control) using JAAS in struts ?? I have no idea to implement it and try to find a lot of information about security of J2EE, JAAS login module . to read. Anyone can help me ?? Best wishes, Cliff Lam Reinfo Technology Limited ;,(13:10)
Re: Attributes Initialization
Hi, May be you can try to use the reset() in the Form. Good Luck Cliff - Original Message - From: elisegev1 [EMAIL PROTECTED] To: struts-user@jakarta.apache.org Sent: Thursday, January 06, 2005 3:12 AM Subject: Attributes Initialization I have a form that needs some initialization. The form is derived from DynaValidatorForm and its properties are defined in struts- config.xml. I initialize an attribute in the 'execute' method of my 'Action' class. For some reason when the servlet container creates the page for the first time, the Struts servlet does not call the 'execute' method and consequently there is no attribute initialization. When I hit the 'submit' button, the 'execute' method is called and the attribute is initialized correctly. I think that the problem is somewhere in re-direction, but I don't know where. Can anyone suggest why the 'execute' is never called before the initial display of the form? --- Eli Segev - 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 avoid validations for certain submit buttons on a single form?
Hi, You may get the reference from the Cancel Button in CancelTag. The Tag will set a parameter in the request to block the validation in the servlet. Good Luck Cliff - Original Message - From: Krishna Mohan Radhakrishnan [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Wednesday, January 05, 2005 12:27 AM Subject: HOw to avoid validations for certain submit buttons on a single form? Hi all, I have a jsp called Plan.jsp. The name of the ActionForm is PlanActionForm. There is a action class called PlanAction.java. From this PlanAction.java it is forwarding to Plan.jsp. In the Plan.jsp there are 2 buttons and one text field. Text field name is txtboxTitle and the 2 buttons are Add New Service Level and Inactivate Plan. Both are buttons of type submit. When I am clicking Add New Service Level, the PlanActionForm is being submitted to PlanAction.java. But when I am clicking the Inactivate button the same form is submitted to InactivatePlanAction.java. InactivatePlanAction.java is like this public class InactivatePlanAction extends ValidationAction { public InactivatePlanAction() { super(); super.setFormBean(new PlanActionForm()); super.setFormName(PlanActionForm); } protected void doCustomValidation(ActionForm form, SessionState state) { PlanActionForm planForm = (PlanActionForm) form; super.addError(Error happened); } protected ActionForward doExecute(ActionMapping mapping, ActionForm form, SessionState state) { PlanActionForm planForm = (PlanActionForm) form; String forwardTo = success; return mapping.findForward(forwardTo); } } The validator-rules.xml will look like this. form name=PlanActionForm field property=txtboxTitle depends=maxlength msg name=maxlength key=errors.offers.maxlength/ arg1 name=maxlength key=${var:maxlength} resource=false/ var var-namemaxlength/var-name var-value64/var-value /var /field /form Struts-config.xml will look like this form-bean name=PlanActionForm type=actionform.PlanActionForm/ action path= /InactivatePlanAction type= action.InactivatePlanAction scope=request name=PlanActionForm forward name=success path /Plan.jsp/ forward name=ValidationError path=/Plan.jsp / /action Here there is a text field validation for maximum length. What I want is that when I am clicking the Inactivate button, it should not do any form validations that is given in the validator-rules.xml. It should directly go to the InactivatePlanAction.java and display the error message Error happened. But when I am clicking the Add New Service Level button the form has to be validated according to that given in the validator-rules.xml. Now what is happening is when I am clicking the Inactivate button, it is doing the form validations too. Does any body have any idea how to do it? I think one solution is to put Inactivate in another ActionForm. But can I achieve the result in a single Actionform. Regards, Krishna Mohan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: HOw to avoid validations for certain submit buttons on a single form?
Hi, Could I ask where to set the bCancel ? as a parameter in the request ?? Thx a lot. Cliff - Original Message - From: Hubert Rabago [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Wednesday, January 05, 2005 2:27 AM Subject: Re: HOw to avoid validations for certain submit buttons on a single form? Like Jim said, take a look at the validate=false attribute for the /InactivatePlanAction. Also, the javascript validation will kick in by default. You can add an onClick handler to the Inactivate button to set bCancel=true; so the javascript validation is skipped. Hubert On Tue, 4 Jan 2005 10:19:06 -0700, Jim Barrows [EMAIL PROTECTED] wrote: -Original Message- From: Krishna Mohan Radhakrishnan [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 04, 2005 9:28 AM To: Struts Users Mailing List Subject: HOw to avoid validations for certain submit buttons on a single form? But can I achieve the result in a single Actionform. Yes. Read the validation and struts-config documentation and DTD's for further details. Something about validate being false. - 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: Security question
Hi, You may find some information in http://pow2acl.sourceforge.net/ Good Luck Cliff - Original Message - From: Barnett, Brian W. [EMAIL PROTECTED] To: 'Struts Users Mailing List' user@struts.apache.org Sent: Wednesday, January 05, 2005 4:50 AM Subject: RE: Security question Well, I guess I'll proceed with that. Thank you. -Original Message- From: Chaikin, Yaakov Y. [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 04, 2005 1:55 PM To: 'Struts Users Mailing List' Subject: RE: Security question I don't know of any other way than to programmatically check user's role inside your Action's method. There is no way to specify attributes in the url-pattern of the security-constraint. It just doesn't support such pattern matching. Yaakov. -Original Message- From: Jim Barrows [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 04, 2005 1:30 PM To: Struts Users Mailing List Subject: RE: Security question -Original Message- From: Barnett, Brian W. [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 04, 2005 11:04 AM To: 'Struts Users Mailing List' Subject: Security question I'm using LookupDispatchAction and role-based security. I want to allow certain roles to access certain dispatches of an action. I'm not sure what the best way to handle this is. Should I create separate Action classes? Is there a slick way to specify dispatch level security in web.xml? The container managed security is handled by URL. Which might include parameters. If not you'll have to use one of the dispatch that requires a seperate URL to do this. Alternatively you'll have to put the security checks inside each method. Can someone point me to a good article(s) on using role-based security in a struts app that might address these issues? Thanks, Brian - 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: validation issues when using multiple modules
Hi, I havn't use multi-module but multi-config.xml. My setting of Validator is centralised in one config.xml. You may try. plug-in className=org.apache.struts.validator.ValidatorPlugIn set-property property=pathnames value=/WEB-INF/validator-rules.xml, /WEB-INF/validation.xml, /WEB-INF/validation-lister.xml/ /plug-in Good Luck. Cliff - Original Message - From: Leigh Estes [EMAIL PROTECTED] To: user@struts.apache.org Sent: Tuesday, January 04, 2005 8:06 AM Subject: validation issues when using multiple modules No one ever responded to my follow up, so I'm trying again: It is version 1.2.4. 1) Both modules (root module and submodule) are configured as follows in web.xml: servlet servlet-nameaction/servlet-name servlet-classorg.apache.struts.action.ActionServlet/servlet-class init-param param-nameconfig/param-name param-value/WEB-INF/struts-config.xml/param-value /init-param init-param param-nameconfig/lister/param-name param-value/WEB-INF/struts-lister-config.xml/param-value /init-param init-param param-namedebug/param-name param-value2/param-value /init-param init-param param-namedetail/param-name param-value2/param-value /init-param init-param param-namevalidate/param-name param-valuetrue/param-value /init-param load-on-startup1/load-on-startup /servlet 2) Root module has its message resources and validation configured in its struts-config.xml as follows: message-resources parameter=com.dchoc.toblerone.web.Resources null=false/ plug-in className=org.apache.struts.validator.ValidatorPlugIn set-property property=pathnames value=/WEB-INF/validator-rules.xml, /WEB-INF/validation.xml/ /plug-in 3) Submodule has its messages resources and validation configured in its struts-lister-config.xml as follows: message-resources parameter=com.dchoc.toblerone.ext.lister.web.Resources key= null=false/ plug-in className=org.apache.struts.validator.ValidatorPlugIn set-property property=pathnames value=/WEB-INF/validator-rules.xml, /WEB-INF/validation-lister.xml/ /plug-in Note that null is set to false, and yet no error message appears for the key it doesn't seem to be able to find, just an empty string. 4) In the JSP where the action lives (an action in the submodule that is defined in its struts-lister-config.xml) that is configured to do the validation in question, html:errors is used as follows. html:errors bundle=/lister/ Note, in that same JSP, the submodule's bundle is used to print out all form labels and buttons with no problem as follows: table class=grid border=0 cellspacing=2 cellpadding=2 tr th bean:message bundle=/lister key=list.name/ /th td bean:write name=listView property=name/ /td /tr tr th bean:message bundle=/lister key=list.size/ /th td html:text property=size size=3 maxlength=3/ /td /tr tr height=20/tr tr td width=80/td td align=right html:cancel bean:message bundle=/lister key=cancel/ /html:cancel /td td html:submit bean:message bundle=/lister key=save/ /html:submit /td /tr /table Note that the list.size key referenced here is the same one referred to in the validation.xml that does not show up in the error messages, but it shows up just fine on this page when printed out as a form label. Any help would be most appreciated. Leigh On Mon, 2004-12-20 at 16:52, Leigh Estes wrote: From: Niall Pemberton [EMAIL PROTECTED] Subject: validation issues when using multiple modules Date: Fri, 17 Dec 2004 01:40:09 - Content-Type: text/plain; charset=iso-8859-1 When you say Struts 1.2 - is that version 1.2.4? Can you post the relevant bits of config/code: - show how you have the message resources configured in your struts-configs - show how your using html:errors Niall - Original Message - From: Leigh Estes [EMAIL PROTECTED] To: user@struts.apache.org Sent: Friday, December 17, 2004 12:29 AM Subject: validation issues when using multiple modules I have configured two modules in my web application using Struts 1.2. Each has its own struts config as defined in the web application's web.xml. Each has its own validation XML and resource bundles as defined in their respective struts config files. The problem I'm seeing is that if I violate a validation rule for the root
Re: Validation Failure
displaying the message in jsp != it can read in the Validator I also encountered this problem before. Cliff --- In [EMAIL PROTECTED], elisegev1 [EMAIL PROTECTED] wrote: I am learning how to use Struts and have encountered the following problem. I have a form bean defined as 'DynaActionForm' with properties defined in struts-config.xml. In validation.xml I specify the validation rules for some of the properties - not all. The source code for the generated page has the following generated Javascript function: function submitForm_required () { this.a0 = new Array(property1, , new Function (varName, return this[varName];)); this.a1 = new Array(property2, , new Function (varName, return this[varName];)); this.a2 = new Array(property3, , new Function (varName, return this[varName];)); } The error message should appear in the second argument of the 'new Array', but does not. Does anyone know what causes this error? If I put any of the error messages as a 'message' in the Jsp file, the message does appear correctly. Which means that my resource file is read by the system. Yet the error messages are missing. Any suggestions on how to debug this problem? BTW, the Javascript alert does pop up when it should, but it appears empty without the error messages. --- Eli --- -- 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: prevent reset of bean after submit
Hi, This is the other problem I have faced before. I have tried Combine the form from first.jsp and second.jsp: I try to save the form in the session beofore the end of the Execute () at the frist submition. Get it back when submit from second.jsp then combine the fields which you want. But you need to really consider the Validation and using the Same Form or the two form have a Extend Relationship. Hope that can help you. Happy New Year!! Good Luck Cliff --- In [EMAIL PROTECTED], sachin [EMAIL PROTECTED] wrote: hi Cliff , You may consider put all the fields which are populated from frist.jsp in the second.jsp using hidden field. This is one solution and it helps .. only problem is that if the first.jsp have a number of fields then the second.jsp will be overloaded with that much number of hidden fields. and making the bean a session bean is also a solution , but it brings with some other problems in my project. I think there are so many solutions can solve this problem. Please if u know any other solution to this problem , it will help me design the project in a better way . . Regards, Sachin Hegde -- Original Message --- From: Cliff [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thu, 23 Dec 2004 02:21:16 - Subject: Re: prevent reset of bean after submit You may consider put all the fields which are populated from frist.jsp in the second.jsp using hidden field. I think there are so many solutions can solve this problem. Good Luck Merry Christmas Cliff --- In [EMAIL PROTECTED], Hubert Rabago [EMAIL PROTECTED] wrote: It's possible that you have your bean in request scope. If so, a new bean is being used for each request. Try putting your bean in session scope. Hubert On Tue, 21 Dec 2004 12:49:55 +0530, sachin [EMAIL PROTECTED] wrote: hi all , On submit of a form , struts resets the bean before populating the form . For that perticular action can i stop the resetting of bean ? in my application i need to pupulate one bean from two forms . It has following structure :- JSP pages - First.jsp , Second.jsp Actions - FirstAction.java , SecondAction.java which refer to same CommonBean. the commonBean is first populated from First.jsp then it is forwarded to Second.jsp to populate the remaining fields .. But here the commonBean gets resetted ... I tried to override reset action in CommonBean with a blank method .. but it not doing .. any help is appreciated Thanks in advance Regards, Sachin Hegde Software Developer Paradyne Infotech Limited Mumbai 022-38546711 - 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] --- End of Original Message --- --- -- 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: Validation Post-Back help
I have faced this problem too. I tried to get back the previous form from the session and combine all the field that you need. This logic will happen when validator is finding an error and it do dynamically. So That is suitable for all the cases in the App. The logic I'm using is simple. It is just cover all the null fields from previous form which is saved in session. Cliff --- In [EMAIL PROTECTED], Daniel Kies [EMAIL PROTECTED] wrote: Greetings. I am using the Validation Framework and I am having problems when the validator is finding an error. When the post- back kicks back to the input page, it is not finding the data that was previously found in the request. In order for the data to be available when kicked back to the calling jsp, I have to put the data in the session instead of the request in the initial action. My question is this: What do I have to do to keep the data available in the request when the validator is called and errors are raised? I don't want to have to put everything in the session just for validation purposes. Thanks in advance. --- -- 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: prevent reset of bean after submit
You may consider put all the fields which are populated from frist.jsp in the second.jsp using hidden field. I think there are so many solutions can solve this problem. Good Luck Merry Christmas Cliff --- In [EMAIL PROTECTED], Hubert Rabago [EMAIL PROTECTED] wrote: It's possible that you have your bean in request scope. If so, a new bean is being used for each request. Try putting your bean in session scope. Hubert On Tue, 21 Dec 2004 12:49:55 +0530, sachin [EMAIL PROTECTED] wrote: hi all , On submit of a form , struts resets the bean before populating the form . For that perticular action can i stop the resetting of bean ? in my application i need to pupulate one bean from two forms . It has following structure :- JSP pages - First.jsp , Second.jsp Actions - FirstAction.java , SecondAction.java which refer to same CommonBean. the commonBean is first populated from First.jsp then it is forwarded to Second.jsp to populate the remaining fields .. But here the commonBean gets resetted ... I tried to override reset action in CommonBean with a blank method .. but it not doing .. any help is appreciated Thanks in advance Regards, Sachin Hegde Software Developer Paradyne Infotech Limited Mumbai 022-38546711 - 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: Page navigation links
Is the Action path include the parameter I pass in the request ? For an example: Form A to B, I will pass code='Bcode' in Action B Form B to C, I will pass code='Ccode' in Action C If I back Form C to B, I need to pass code='Bcode' The Question is Is the Action path will include this 'Bcode' If not I need to think the other way to get it back. Thanks a lot Cliff --- In [EMAIL PROTECTED], [EMAIL PROTECTED] wrote: Presumably you would want such a construct to work regardless of what path a user took to get to a specific page (assuming there ARE multiple paths in your app, maybe there aren't). So, if it was me, I'd be thinking a linked list stored in session. Each page that is presented would append itself to the list. Clicking a link would have to break the list at the point of the page that was clicked (i.e., if there are six pages in the nav trail and the user clicks the third, you basically want to discard the last three, which just means removing the link to the next element from the element of the page the user clicked). You would of course have to add enough information to each element in the list as to allow your app to go to that page when clicked. Might just be storing the Action path, might mean each element is really a HashMap with a bunch of information, you would have to decide. I'm not sure something like this exists yet, I'd certainly think it does though. If you have to roll your own, I suspect it wouldn't be too difficult using this approach (assuming I haven't glossed over something that makes it impossible or overly difficult of course!) -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com Donie Kelly wrote: Hi all Anybody got an example of how to implement a page navigation link for the top of a page like so... Home MainFgorm wizardpage1 wizard page 2 The last entry would be the name of the current page and would not be a link. I'm thinking of a session object where the page inserts it's name somehow so that if the page is re-used in different areas it puts it's link in the correct place. Just wondering how this can be achieved easily with struts and without hardcoding the paths on each page. Thanks Donie --- -- 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]
multi-properties in validator support in struts 1.2.1?
I have traced the code in the JavascriptValidatorTag.java and found that the defeat bundle is used to select the message resources. Anyone can tell me more?? Thanks a lot !! Cliff
Re: use multiple resource bundles in Validator
Thanks a lot. I can do it in jsp but not in validation.xml. I can find bundle is used in http://jakarta.apache.org/commons/dtds/validator_1_1.dtd but it seems cannot work. I'm now try to update the common-validator and try to check what bundle struts is using in JavascriptValidatorTag.java. If anyone have a better idea please tell me. Thanks a lot. --- In [EMAIL PROTECTED], Van [EMAIL PROTECTED] wrote: On Fri, 9 Jul 2004 14:44:08 -0700, Jim Barrows [EMAIL PROTECTED] wrote: -Original Message- From: cliff [mailto:[EMAIL PROTECTED] Sent: Thursday, July 08, 2004 9:34 PM To: [EMAIL PROTECTED] Subject: RE: use multiple resource bundles in Validator I have tried 1.2 but it cannot work. could anyone tell me how to do ? Well according to http://struts.apache.org/userGuide/struts- bean.html#message It should be something like: bean:message key=duhKey bundle=duhBundleWidDuhKey/ Thanks a lot From: Jim Barrows [EMAIL PROTECTED] Date: Fri Jul 9, 2004 4:37 am Subject: RE: use multiple resource bundles in Validator -Original Message- From: Van [mailto:[EMAIL PROTECTED] Sent: Thursday, July 08, 2004 1:12 PM To: Struts Users Mailing List Subject: Re: use multiple resource bundles in Validator On Thu, 8 Jul 2004 18:18:41 +0800, Hanna [EMAIL PROTECTED] wrote: How can i use mulitple message bundles in validator in struts 1.1? like the way of bean:message key=... bundle=.../ ? No. Not in 1.1... 1.2 you can. I was being a little flippant with my initial one word response of No. Partially, this was due to my own irritation when I learned that it was not possible to specify bundles for property lookups in my validator configuration files for 1.1. I have heard rumblings about this possibly being added to the commons validator though. You would want to check which version of the commons validator is included with the version of Struts you are using and then check to see whether that version of the commons validator supports the bundle attribute. If it is not easy to glean from the project docs, take a gander at the DTD for the validation configuration files in the version you are using to see whether the bundle attribute is allowed or not. The commons validator project home page is here: http://jakarta.apache.org/commons/validator/ Good luck and please report back to the list in the event that you find out the bundle support has been added in a recent version of commons validator. Thanks, Van Mike Van Riper mailto:[EMAIL PROTECTED] Silicon Valley Web Developer JUG https://sv-web-jug.dev.java.net/ (a.k.a. Sillicon Valley Struts User Group) http://www.baychi.org/bof/struts/ --- -- 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: use multiple resource bundles in Validator
I have tried 1.2 but it cannot work. could anyone tell me how to do ? Thanks a lot From: Jim Barrows [EMAIL PROTECTED] Date: Fri Jul 9, 2004 4:37 am Subject: RE: use multiple resource bundles in Validator -Original Message- From: Van [mailto:[EMAIL PROTECTED] Sent: Thursday, July 08, 2004 1:12 PM To: Struts Users Mailing List Subject: Re: use multiple resource bundles in Validator On Thu, 8 Jul 2004 18:18:41 +0800, Hanna [EMAIL PROTECTED] wrote: How can i use mulitple message bundles in validator in struts 1.1? like the way of bean:message key=... bundle=.../ ? No. Not in 1.1... 1.2 you can.
multi-porterties problem
Hi, I have encountered a problem in applying multi-properties. Multi-properties is used in my company's system. Bundle is set. I can use the message in xxx.jsp but not validation form thought I have set bundle. http://jakarta.apache.org/commons/dtds/validator_1_1.dtd is used in validation.xml Thanks. Best wishes, Cliff