Re: struts2 interceptor session timeout with ajax
Thanks, it worked but now trying this and not sure how to fix this. Have a on a page. After session timeout trying to click on another tab of tabbed panel should redirect the user to login page. panel not firing the onErrorTopics. The javascript function is not getting called. The server is sending result 403. Please see below and guide me on how to fix this issue. I am seeing in fire bug that the 403 error is thrown but I am unable to catch it in jsp. Need help with the same. struts.xml /jsp/secondPanel.jsp 403 User session expired jsp $(document).ready(function() { $.subscribe('loadError', function(event, status, data) { alert('in error'); var status1 = event.status; if(status1 == 403 ) { window.location.href = "/Sample/login.action"; } }); From: Lukasz Lenart <lukaszlen...@apache.org> Sent: Friday, March 11, 2016 2:21 PM To: Struts Users Mailing List Subject: Re: struts2 interceptor session timeout with ajax It won't work that way, when using Ajax you must use Ajax to redirect to a login page. You can use something like this http://cypressnorth.com/programming/global-ajax-error-handling-with-jquery/ so your interceptor must return 403 status code (it can return also an url to login page to redirect to) and you must handle redirect on client side Regards -- Łukasz + 48 606 323 122 http://www.lenart.org.pl/ 2016-03-11 15:31 GMT+01:00 fea jabi <zy...@hotmail.com>: > Need help with this please. > > ________ > From: fea jabi <zy...@hotmail.com> > Sent: Wednesday, March 9, 2016 10:51 AM > To: user@struts.apache.org > Subject: struts2 interceptor session timeout with ajax > > Have jquery tabbed panel in a jsp page which has a button to Save the form in > the tabbed panel which is making an ajax call and is working fine. > > Now trying to implement the session management for all requests in the > application and imlemented the new interceptor to perform the same. Having > issue with session management with the ajax calls. Have the below package for > ajax requests in which configured the new interceptor created and the default > interceptor. But, the below is not redirecting to the login page instead > opening the popup with login page html in it. what am I missing here? > > > > > > > > > > > > > > > > > > > > > > > > > > true > > true > > jsonResult > > > > > > appLogin > > / > > > > > > > > > > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: struts2 interceptor session timeout with ajax
Need help with this please. From: fea jabi <zy...@hotmail.com> Sent: Wednesday, March 9, 2016 10:51 AM To: user@struts.apache.org Subject: struts2 interceptor session timeout with ajax Have jquery tabbed panel in a jsp page which has a button to Save the form in the tabbed panel which is making an ajax call and is working fine. Now trying to implement the session management for all requests in the application and imlemented the new interceptor to perform the same. Having issue with session management with the ajax calls. Have the below package for ajax requests in which configured the new interceptor created and the default interceptor. But, the below is not redirecting to the login page instead opening the popup with login page html in it. what am I missing here? true true jsonResult appLogin / - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
struts2 interceptor session timeout with ajax
Have jquery tabbed panel in a jsp page which has a button to Save the form in the tabbed panel which is making an ajax call and is working fine. Now trying to implement the session management for all requests in the application and imlemented the new interceptor to perform the same. Having issue with session management with the ajax calls. Have the below package for ajax requests in which configured the new interceptor created and the default interceptor. But, the below is not redirecting to the login page instead opening the popup with login page html in it. what am I missing here? true true jsonResult appLogin /
RE: sj:grid --- action errors and highlight the row/row cell that failed validation
Thank you, for your response. I really appreciate it. I got it working. > From: mgai...@hotmail.com > To: user@struts.apache.org > Subject: RE: sj:grid --- action errors and highlight the row/row cell that > failed validation > Date: Fri, 9 Oct 2015 17:31:15 -0400 > > > > > > > From: zy...@hotmail.com > > To: user@struts.apache.org > > Subject: RE: sj:grid --- action errors and highlight the row/row cell that > > failed validation > > Date: Fri, 9 Oct 2015 15:50:39 -0400 > > > > Still looking for help on this please... > > > > > From: zy...@hotmail.com > > > To: user@struts.apache.org > > > Subject: sj:grid --- action errors and highlight the row/row cell that > > > failed validation > > > Date: Fri, 18 Sep 2015 16:17:33 -0400 > > > > > > Trying to display action errors when trying to save a row in a > > > Is there an example I can follow? > > > > > > > > > Followed > > > > > > https://code.google.com/p/struts2-jquery/wiki/EditGrid Simple Edit > > > and wrote validate method which is returning the action errors. > > > > > > > > > 1. How should be the struts.xml configured? > MG>one is provided in each sample application > > as success return type is json, what should it be for input? > > > > > >> > class="xxx.EditAddEmpGridEntryAction"> > > > > > > > > > > > > > > > > > > /jsp/createFidAddCas.jsp > MG>you didnt specify default type for package so if type attribute is not > specified, the framework will MG>use the default dispatcher type, which > forwards to another web resource > https://struts.apache.org/docs/result-configuration.html > > > > > > > > > > > > > > > 2. how to display these action errors > class="com.jgeppert.struts2.jquery.richtext.actions.CkeditorUpload"> > name="error">/ckeditor/ckeditorError.ftl > > https://struts.apache.org/docs/result-types.html > > and how to highlight the column cell in the grid that's not valid. > MG>you have to add stylesheet class which contains, font,size and color of > the css stylesheet class to the control in question.. > MG>here is an example of cranking up the font size for tag id="errorElement" > MG>$("#errorElement").style.fontSize="20px"; > > > > > > > > > Need help with this please. > MG>you should have enough information > MG>consider paying for further help in answering your questions > > > > > >
RE: sj:grid --- action errors and highlight the row/row cell that failed validation
Still looking for help on this please... > From: zy...@hotmail.com > To: user@struts.apache.org > Subject: sj:grid --- action errors and highlight the row/row cell that failed > validation > Date: Fri, 18 Sep 2015 16:17:33 -0400 > > Trying to display action errors when trying to save a row in a > Is there an example I can follow? > > > Followed > > https://code.google.com/p/struts2-jquery/wiki/EditGrid Simple Edit > and wrote validate method which is returning the action errors. > > > 1. How should be the struts.xml configured? as success return type is json, > what should it be for input? > >class="xxx.EditAddEmpGridEntryAction"> > > > > > > /jsp/createFidAddCas.jsp > > > > > 2. how to display these action errors and how to highlight the column cell in > the grid that's not valid. > > > > Need help with this please. >
edit inline control navigator buttons to display
Using the below sjg:grid with edit inline. This displays the edit navigator buttons Add New Row, Edit selected row, Save, Cancel row editing. I don't want to show the Add new row button in the navigator. How to do this?
sj:grid --- action errors and highlight the row/row cell that failed validation
Trying to display action errors when trying to save a row in a Is there an example I can follow? Followed https://code.google.com/p/struts2-jquery/wiki/EditGrid Simple Edit and wrote validate method which is returning the action errors. 1. How should be the struts.xml configured? as success return type is json, what should it be for input? /jsp/createFidAddCas.jsp 2. how to display these action errors and how to highlight the column cell in the grid that's not valid. Need help with this please.
sjg:gridcolumn validation and error display
The above has to be a 8,4 decimal number basically with 3 digit max number and 4 decimal places. how to set this rule in the grid column? Also, how is the recently edited row cell value is highlighted if any validation error when saving a row.
sjg:grid in modal window not getting displayed atall
I am trying to use sjg:grid in a modal window which is opened from a tabbed panel. Have the below code. Everything seams right to me. The modal window opens and displays other stuff but the grid is not getting displayed atall. The getJSON() in the action class is never getting called. I did similar code in another page and it worked fine. Only difference being now I am trying it on the modal window. Please need help with this. Not sure what am I missing here. jspCode . struts.xml .. Action class public class CreateDepartmentAction extends ActionSupport implements SessionAware { . private List searchResults = new ArrayList(); public String execute() { retrieveSearchDepartmentsResults(); return SUCCESS; } public String retrieveSearchDepartmentsResults() { try { setSearchResults(getSearchResultsBasedOnCriteria()); int to = (rows * page); int from = to - rows; records = getSearchResults().size(); searchResults = getSearchResults(); total =(int) Math.ceil((double)records / (double)rows); } catch (Exception e) { return ERROR; } return SUCCESS; } } ... getters and setters public String getJSON() { return retrieveSearchDepartmentsResults(); } }
RE: sjg:grid in modal window not getting displayed atall
Adding one more action configuration to this of struts.xml > From: zy...@hotmail.com > To: user@struts.apache.org > Subject: sjg:grid in modal window not getting displayed atall > Date: Fri, 4 Sep 2015 09:53:36 -0400 > > I am trying to use sjg:grid in a modal window which is opened from a tabbed > panel. > > > Have the below code. Everything seams right to me. The modal window opens and > displays other stuff but the grid is not getting displayed atall. The > getJSON() in the action class is never getting called. > > > I did similar code in another page and it worked fine. Only difference being > now I am trying it on the modal window. > > > > Please need help with this. Not sure what am I missing here. > > > > >searchDepartment.jspCode > > . > > > > > id="id" > > caption="Testing" > > dataType="json" > > href="%{searchResultsUrl}" > > pager="true" > > gridModel="searchResults" > > rowList="10,15,20" > > rowNum="15" > > rownumbers="true" > > viewrecords="true" > > autowidth="true" > > navigator="true" > > navigatorAdd="false" > > navigatorViewOptions="{height:280, width:500}" > > navigatorDelete="true" > > navigatorDeleteOptions="{height:280, > width:500,reloadAfterSubmit:true}" > > navigatorEdit="false" > > navigatorRefresh="true" > > navigatorSearch="false" > > multiselect="true" > > onSelectRowTopics="rowselect" > > loadonce="true" > > > > > title="Department Number" key="true" sortable="true"/> > > title="Department Description" sortable="false"/> > > > > > > > struts.xml /jsp/searchDepartment.jsp searchDepartment > > namespace="/grid"> > > .. > > > > > > > > > > > > > > > > > > > Action class > > public class CreateDepartmentAction extends ActionSupport implements > SessionAware { > > . > > > > private List searchResults = new ArrayList(); > > public String execute() { > > retrieveSearchDepartmentsResults(); > > > > return SUCCESS; > > } > > > public String retrieveSearchDepartmentsResults() { > > > > try { > > setSearchResults(getSearchResultsBasedOnCriteria()); > > int to = (rows * page); > > int from = to - rows; > > records = getSearchResults().size(); > > searchResults = getSearchResults(); > > total =(int) Math.ceil((double)records / (double)rows); > > } catch (Exception e) { > > return ERROR; > > } > > return SUCCESS; > > } > > > > } > > ... > > getters and setters > > > > public String getJSON() > > { > > return retrieveSearchDepartmentsResults(); > > } > > > } >
RE: sjg:grid in modal window not getting displayed atall
I got this working. Thanks. > From: zy...@hotmail.com > To: user@struts.apache.org > Subject: RE: sjg:grid in modal window not getting displayed atall > Date: Fri, 4 Sep 2015 10:25:32 -0400 > > Adding one more action configuration to this of struts.xml > > > From: zy...@hotmail.com > > To: user@struts.apache.org > > Subject: sjg:grid in modal window not getting displayed atall > > Date: Fri, 4 Sep 2015 09:53:36 -0400 > > > > I am trying to use sjg:grid in a modal window which is opened from a tabbed > > panel. > > > > > > Have the below code. Everything seams right to me. The modal window opens > > and displays other stuff but the grid is not getting displayed atall. The > > getJSON() in the action class is never getting called. > > > > > > I did similar code in another page and it worked fine. Only difference > > being now I am trying it on the modal window. > > > > > > > > Please need help with this. Not sure what am I missing here. > > > > > > > > > >searchDepartment.jspCode > > > > . > > > > > > > > > > > id="id" > > > > caption="Testing" > > > > dataType="json" > > > > href="%{searchResultsUrl}" > > > > pager="true" > > > > gridModel="searchResults" > > > > rowList="10,15,20" > > > > rowNum="15" > > > > rownumbers="true" > > > > viewrecords="true" > > > > autowidth="true" > > > > navigator="true" > > > > navigatorAdd="false" > > > > navigatorViewOptions="{height:280, width:500}" > > > > navigatorDelete="true" > > > > navigatorDeleteOptions="{height:280, > > width:500,reloadAfterSubmit:true}" > > > > navigatorEdit="false" > > > > navigatorRefresh="true" > > > > navigatorSearch="false" > > > > multiselect="true" > > > > onSelectRowTopics="rowselect" > > > > loadonce="true" > > > > > > > > > > title="Department Number" key="true" sortable="true"/> > > > > > title="Department Description" sortable="false"/> > > > > > > > > > > > > > > struts.xml > namespace="/"> > > > > /jsp/searchDepartment.jsp > >searchDepartment > > > > > > > > > > namespace="/grid"> > > > > .. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Action class > > > > public class CreateDepartmentAction extends ActionSupport implements > > SessionAware { > > > > . > > > > > > > > private List searchResults = new ArrayList(); > > > > public String execute() { > > > > retrieveSearchDepartmentsResults(); > > > > > > > > return SUCCESS; > > > > } > > > > > > public String retrieveSearchDepartmentsResults() { > > > > > > > > try { > > > > setSearchResults(getSearchResultsBasedOnCriteria()); > > > > int to = (rows * page); > > > > int from = to - rows; > > > > records = getSearchResults().size(); > > > > searchResults = getSearchResults(); > > > > total =(int) Math.ceil((double)records / (double)rows); > > > > } catch (Exception e) { > > > > return ERROR; > > > > } > > > > return SUCCESS; > > > > } > > > > > > > > } > > > > ... > > > > getters and setters > > > > > > > > public String getJSON() > > > > { > > > > return retrieveSearchDepartmentsResults(); > > > > } > > > > > > } > > >
sjg:grid ----- Reload grid after form submit
Need to reload the sjg:grid on a click of submit button. How to do this? I tried the below JSP Has this .. $(document).ready(function() { $.subscribe('onSearchSucessTopics', function(event) { ?Not sure how to trigger reload grid? }); });
Sjg:grid refresh of parent window from modal window
1. I have a web page which is having a 2. From this webpage I open a modal window which has a link to update the parent window grid information. 3. Once the modal window is done with it's work and closes. how to trigger the refresh the parent window grid ? Need help with this please.
RE: Textfield onchange --> handling ajax error response to show action errors
Can you point me to a link that has the sample which does this please? I tried but couldn't get the result. Thanks, for trying to help me on this. > From: lukaszlen...@apache.org > Date: Sun, 30 Aug 2015 15:22:52 +0200 > Subject: Re: Textfield onchange --> handling ajax error response to show > action errors > To: user@struts.apache.org > > works on server side but JavaScript works on client > side - it isn't possible to join them. You can only mimic its > behaviour by adding the same html structure as does. > > 2015-08-28 17:14 GMT+02:00 fea jabi <zy...@hotmail.com>: > > text-field onchange ---> making ajax call. > > > > > > onsucess ---> everything works fine as needed > > > > > > on failure - > like user entered wrong data ---> How to show the error > > messages in jsp. I added fieldError but not sure how to show it in jsp with > > the ajax stuff. > > > > In jsp > > > > > > > >
RE: form submit on one tab should move to next tab
Still need help with this please. > From: zy...@hotmail.com > To: user@struts.apache.org > Subject: form submit on one tab should move to next tab > Date: Sat, 29 Aug 2015 12:54:38 -0400 > > Have a tabbed panel and in one of the tab have a form. > On submit of this form should move to next tab. > How to implement this. It is just forwarding to a jsp without a tabbed panels. > >
sj:tabbedpanel form submit on one tab should move to next tab
Have a tabbed panel and in one of the tab have a form. On submit of this form should move to next tab. How to implement this. It is just forwarding to a jsp without a tabbed panels. sj:tabbedpanel
Textfield onchange -- handling ajax error response to show action errors
text-field onchange --- making ajax call. onsucess --- everything works fine as needed on failure - like user entered wrong data --- How to show the error messages in jsp. I added fieldError but not sure how to show it in jsp with the ajax stuff. In jsp s:actionerror/ script$.ajax({ url: ajax/retrivexxxAJAXAction.action+?jsonRequestdata=+JSON.stringify(json), type: 'POST', dataType: 'json', success:function(response){ ... }error:function(jqXhr, textStatus, errorThrown){ alert(textStatus);} });
RE: sj:autocompleter dependable
I tried doing this onSelectTopics of first autocompleter to select value of the second autocompleter but didn't work. Any suggessions? First autocompleter sj:autocompleter onChangeTopics=publisherDescChange onSelectTopics=publisherDescSelect . / Second autocompleter sj:autocompleter id=publisherCodeId . listenTopics=publisherDescChange / $.subscribe('publisherDescSelect', function(event, data) { var ui = event.originalEvent.ui;var message = ui.item.value; if(ui.item.key) { message = '( '+ ui.item.key +' ) '+message; } $('#topics').html('i'+message+'/i'); $(#publisherCodeId option[value=' + ui.item.text + ']); $(#publisherCodeId option[text=' + ui.item.message + ']); $(#publisherCodeId option[val=' + ui.item.text + ']).attr(selected,selected); }); From: zy...@hotmail.com To: user@struts.apache.org Subject: RE: sj:autocompleter dependable Date: Wed, 26 Aug 2015 09:55:53 -0400 As mentioned earlier have 2 autocompleters with same list of Managers. Only difference being the Manger.description is shown as drop down in one and Manager.code is shown in the drop down in another. In the first autocompleter when Manager.description is selected it should automatically select the second autocompleter with corresponding Manager.code value and vise versa. How to do this? I am new to both struts2 and jquery. Please need help with this. I tried adding the subscribe mentioned below that didn't auto select the option in the second autocompleter. From: mgai...@hotmail.com To: user@struts.apache.org Subject: RE: sj:autocompleter dependable Date: Tue, 25 Aug 2015 07:09:12 -0400 you will notice in the autocompleter tutorial posted at http://struts.jgeppert.com/struts2-jquery-showcase/autocompleter-json.action;jsessionid=CE13A626C1A38AC66A47344D139993DE there exists a sj:autocompleter with onChangeTopics=autocompleteChangebut there is no (jquery) function subscribed to listen to autocompleteChange topic .. if you look at bottom of tutorial you will see: $.subscribe('autocompleteChange', function(event, data) { var ui = event.originalEvent.ui; var message = ui.item.value; if(ui.item.key) { message = '( '+ ui.item.key +' ) '+message; } $('#topics').html('b'+message+'/b'); }); when you publish an event topic you will also need to subscribe listener for the same event topic HTH Martin From: zy...@hotmail.com To: user@struts.apache.org Subject: sj:autocompleter dependable Date: Mon, 24 Aug 2015 15:59:49 -0400 I am new to struts2 and need help with the struts2 jquery autocompleter tag Have an object Publisher code description In Action getPublishers() I am trying to use 2 dependable sj:autocompleter tags. In both it should display the Publishers list but in one it should display the description of publisher and in another it should display the code If the user changes discription in one of the autocompleter then it should change the code and vise versa on the second autocompleter. I am not not sure how the selected value goes to the action class. I'll want the selected publisher to be set to corresponding Publisher object selected to the selectedPublisherOfPublisherDescription attribute. How will it change the second autocompleter code on change of the first one. But, it's not working. Your help is appreciated. I tried the below sj:autocompleter id=publisherDescriptionId name=publisherDescription value=%{selectedPublisherOfPublisherDescription} list=%{publishers} listValue=description listKey=code selectBox=true selectBoxIcon=true label=Publisher Description onChangeTopics=publisherChange / sj:autocompleter id=publisherCodeId name=publisherCode value=%{selectedPublisherOfMPublisherCode} list=%{publishers} listValue=code listKey=description selectBox=true selectBoxIcon=true label=Publisher Code listenTopics=publisherChange
RE: sj:autocompleter dependable
As mentioned earlier have 2 autocompleters with same list of Managers. Only difference being the Manger.description is shown as drop down in one and Manager.code is shown in the drop down in another. In the first autocompleter when Manager.description is selected it should automatically select the second autocompleter with corresponding Manager.code value and vise versa. How to do this? I am new to both struts2 and jquery. Please need help with this. I tried adding the subscribe mentioned below that didn't auto select the option in the second autocompleter. From: mgai...@hotmail.com To: user@struts.apache.org Subject: RE: sj:autocompleter dependable Date: Tue, 25 Aug 2015 07:09:12 -0400 you will notice in the autocompleter tutorial posted at http://struts.jgeppert.com/struts2-jquery-showcase/autocompleter-json.action;jsessionid=CE13A626C1A38AC66A47344D139993DE there exists a sj:autocompleter with onChangeTopics=autocompleteChangebut there is no (jquery) function subscribed to listen to autocompleteChange topic .. if you look at bottom of tutorial you will see: $.subscribe('autocompleteChange', function(event, data) { var ui = event.originalEvent.ui; var message = ui.item.value; if(ui.item.key) { message = '( '+ ui.item.key +' ) '+message; } $('#topics').html('b'+message+'/b'); }); when you publish an event topic you will also need to subscribe listener for the same event topic HTH Martin From: zy...@hotmail.com To: user@struts.apache.org Subject: sj:autocompleter dependable Date: Mon, 24 Aug 2015 15:59:49 -0400 I am new to struts2 and need help with the struts2 jquery autocompleter tag Have an object Publisher code description In Action getPublishers() I am trying to use 2 dependable sj:autocompleter tags. In both it should display the Publishers list but in one it should display the description of publisher and in another it should display the code If the user changes discription in one of the autocompleter then it should change the code and vise versa on the second autocompleter. I am not not sure how the selected value goes to the action class. I'll want the selected publisher to be set to corresponding Publisher object selected to the selectedPublisherOfPublisherDescription attribute. How will it change the second autocompleter code on change of the first one. But, it's not working. Your help is appreciated. I tried the below sj:autocompleter id=publisherDescriptionId name=publisherDescription value=%{selectedPublisherOfPublisherDescription} list=%{publishers} listValue=description listKey=code selectBox=true selectBoxIcon=true label=Publisher Description onChangeTopics=publisherChange / sj:autocompleter id=publisherCodeId name=publisherCode value=%{selectedPublisherOfMPublisherCode} list=%{publishers} listValue=code listKey=description selectBox=true selectBoxIcon=true label=Publisher Code listenTopics=publisherChange
RE: OGNL error --- Unexpected Exception caught setting ... on 'class.........
private String[] publisherName; //why is this an Array of String instead of String publisherName; I had it as String but after seeing the error I modified it to String[] and tried that. MGwhere are you setting the publisherName?.. in constructor of Action class? I did not set the default value. Tried to submit without any value and was getting error. MGwhere is your subscribe javascript function? do have the subscribe javascript functions. But it's still not working I do have the subscribe javascript functions as below. Tried similar to the one in example and later modified too. I tried doing this onSelectTopics of first autocompleter to select value of the second autocompleter but didn't work. Any suggessions? First autocompleter sj:autocompleter onChangeTopics=publisherDescChange onSelectTopics=publisherDescSelect . / Second autocompleter sj:autocompleter id=publisherCodeId . listenTopics=publisherDescChange / $.subscribe('publisherDescChange', function(event, data) { var ui = event.originalEvent.ui;var message = ui.item.value; if(ui.item.key) { message = '( '+ ui.item.key +' ) '+message; } $('#topics').html('i'+message+'/i'); }); $.subscribe('publisherDescFocus', function(event, data) { var ui = event.originalEvent.ui;var message = ui.item.value; if(ui.item.key) { message = '( '+ ui.item.key +' ) '+message; } $('#topics').html('i'+message+'/i'); }); $.subscribe('publisherDescSelect', function(event, data) { var ui = event.originalEvent.ui;var message = ui.item.value; if(ui.item.key) { message = '( '+ ui.item.key +' ) '+message; } $('#topics').html('i'+message+'/i'); }); From: mgai...@hotmail.com To: user@struts.apache.org Subject: RE: OGNL error --- Unexpected Exception caught setting ... on 'class. Date: Wed, 26 Aug 2015 21:10:52 -0400 From: zy...@hotmail.com To: user@struts.apache.org Subject: OGNL error --- Unexpected Exception caught setting ... on 'class. Date: Wed, 26 Aug 2015 19:42:36 -0400 Have a Publisher class with attributes Publisher ---class name code Action class private String[] publisherName; //why is this an Array of String instead of String publisherName; MGwhere are you setting the publisherName?.. in constructor of Action class? ListPublisher publishers= new ArrayListPublisher(); getters and setters for the same too in it. JSP sj:autocompleter id=publisherNameId name=publisherName list=%{publishers} listValue=name listKey=code listLabel=code selectBox=true selectBoxIcon=true key=label.publisherName onChangeTopics=publisherNameChange onFocusTopics=publisherNameFocus onSelectTopics=publisherNameSelect size=34 maxlength=34 / MGwhere is your subscribe javascript function? When I don't select anything in autocompleter and submit the form seeing this in console Unexpected Exception caught setting 'publisherName' on 'class com.xxx.createAction: Error setting expression 'publisherName' with value ['', ] when I select something in autocompleter and submit the form seeing this in console Unexpected Exception caught setting 'publisherName' on 'class com.xxx.createAction: Error setting expression 'publisherName' with value ['macode2', ] Unexpected Exception caught setting 'publisherName_widget' on 'class com.xxx.createAction: Error setting expression 'publisherName_widget' with value ['macode2', ] MGLooks like corruption of values for variables publisherName and publisherName_widget MGcan you get a senior guy from your team to oversee what you're doing? Is this the right way to declare in the Action class for autocompleter? MGif none of your action variables are populated then the answer would be no Please need help on this.
OGNL error --- Unexpected Exception caught setting ... on 'class.........
Have a Publisher class with attributes Publisher ---class name code Action class private String[] publisherName; ListPublisher publishers= new ArrayListPublisher(); getters and setters for the same too in it. JSP sj:autocompleter id=publisherNameId name=publisherName list=%{publishers} listValue=name listKey=code listLabel=code selectBox=true selectBoxIcon=true key=label.publisherName onChangeTopics=publisherNameChange onFocusTopics=publisherNameFocus onSelectTopics=publisherNameSelect size=34 maxlength=34 / When I don't select anything in autocompleter and submit the form seeing this in console Unexpected Exception caught setting 'publisherName' on 'class com.xxx.createAction: Error setting expression 'publisherName' with value ['', ] when I select something in autocompleter and submit the form seeing this in console Unexpected Exception caught setting 'publisherName' on 'class com.xxx.createAction: Error setting expression 'publisherName' with value ['macode2', ] Unexpected Exception caught setting 'publisherName_widget' on 'class com.xxx.createAction: Error setting expression 'publisherName_widget' with value ['macode2', ] Is this the right way to declare in the Action class for autocompleter? Please need help on this.
RE: sj:autocompleter dependable
Thanks, for trying to help me on this. I did add the subscribe java script functions as you've suggested. Still not working. Please need help. sj:autocompleter id=publisherNameId name=publisherName list=%{publishers} listValue=name listKey=code listLabel=code selectBox=true selectBoxIcon=true key=label.publisherName onChangeTopics=autocompleteChange onFocusTopics=autocompleteFocus onSelectTopics=autocompleteSelect size=34 maxlength=34 / sj:autocompleter id=publisherCodeId name=publisherCode list=%{publishers} listValue=code listKey=name selectBox=true selectBoxIcon=true key=label.publisherCode size=20 maxlength=20 onChangeTopics=autocompleteChange onFocusTopics=autocompleteFocus onSelectTopics=autocompleteSelect / script type=text/javascript $(document).ready(function() { $.subscribe('autocompleteChange', function(event, data) { var ui = event.originalEvent.ui; var message = ui.item.value; if(ui.item.key) { message = '( '+ ui.item.key +' ) '+message; } $('#topics').html('b'+message+'/b'); }); $.subscribe('autocompleteFocus', function(event, data) { var ui = event.originalEvent.ui; var message = ui.item.value; if(ui.item.key) { message = '( '+ ui.item.key +' ) '+message; } $('#topics').html('u'+message+'/u'); }); $.subscribe('autocompleteSelect', function(event, data) { var ui = event.originalEvent.ui; var message = ui.item.value; if(ui.item.key) { message = '( '+ ui.item.key +' ) '+message; } $('#topics').html('i'+message+'/i'); }); }); /script From: mgai...@hotmail.com To: user@struts.apache.org Subject: RE: sj:autocompleter dependable Date: Wed, 26 Aug 2015 20:36:27 -0400 MGfollow the example to the letter From: zy...@hotmail.com To: user@struts.apache.org Subject: RE: sj:autocompleter dependable Date: Wed, 26 Aug 2015 13:21:13 -0400 I tried doing this onSelectTopics of first autocompleter to select value of the second autocompleter but didn't work. Any suggessions? First autocompleter sj:autocompleter onChangeTopics=publisherDescChange onSelectTopics=publisherDescSelect . / MG !-- handle publisherDescChange first with subscribe statement below -- $.subscribe('publisherDescChange', function(event, data) { var ui = event.originalEvent.ui; var message = ui.item.value; if(ui.item.key) { message = '( '+ ui.item.key +' ) '+message; } $('#topics').html('b'+message+'/b'); }); MG MG!-- handle publisherDescSelect with subscribe statement below -- $.subscribe('publisherDescSelect', function(event, data) { var ui = event.originalEvent.ui; var message = ui.item.value; if(ui.item.key) { message = '( '+ ui.item.key +' ) '+message; } $('#topics').html('i'+message+'/i'); }); MG http://struts.jgeppert.com/struts2-jquery-showcase/autocompleter-json.action;jsessionid=CE13A626C1A38AC66A47344D139993DE MGNow when you select the list is the javascript function for second subscribe('publisherDescSelect' ... called ? MGNow when you change the list is the javascript function for first subscribe('publisherDescChange' ... called ? MGits important you implement everything you see in the autocompleter example MGif you do not your results will be 'undefined' From: zy...@hotmail.com To: user@struts.apache.org Subject: RE: sj:autocompleter dependable Date: Wed, 26 Aug 2015 09:55:53 -0400 As mentioned earlier have 2 autocompleters with same list of Managers. Only difference being the Manger.description is shown as drop down in one and Manager.code is shown in the drop down in another. In the first autocompleter when Manager.description is selected it should automatically select the second autocompleter with corresponding Manager.code value and vise versa. How to do this? I am new to both struts2 and jquery. Please need help with this. I tried adding the subscribe mentioned below that didn't auto select the option in the second autocompleter. From: mgai...@hotmail.com To: user@struts.apache.org Subject: RE: sj:autocompleter dependable Date: Tue, 25 Aug 2015 07:09:12 -0400 you will notice in the autocompleter tutorial posted at http://struts.jgeppert.com/struts2-jquery-showcase/autocompleter-json.action;jsessionid=CE13A626C1A38AC66A47344D139993DE there exists a sj:autocompleter with onChangeTopics=autocompleteChangebut there is no (jquery) function subscribed to listen to autocompleteChange topic .. if you look at bottom of tutorial you will see: $.subscribe('autocompleteChange', function(event, data) { var ui = event.originalEvent.ui; var message = ui.item.value; if(ui.item.key) {
RE: Struts2 resource bundle labels not showing up
I really appreciate you helping me. But, still having issues. Under resources folder - which is a source folder(getting copied to \WEB-INF\classes) I added the below files struts.properties test.properties In struts.properties struts.custom.i18n.resources=test Also, tried adding this in struts.xml struts constant name=struts.devMode value=true / constant name=struts.custom.i18n.resources value=test.properties / Both didn't work. Am I missing something? From: lukaszlen...@apache.org Date: Tue, 25 Aug 2015 15:45:48 +0200 Subject: Re: Struts2 resource bundle labels not showing up To: user@struts.apache.org 2015-08-25 15:34 GMT+02:00 fea jabi zy...@hotmail.com: I tried setting the default-action-ref in struts.xml as below. That didn't work. Also, I tried placing the properties in the package.properties that didn't work either. Do I need to do any setting for package.properties to work. Tried placing it within the com.xxx.actions and outside as well. package name=test_default extends=struts-default namespace=/result-types result-type name=tiles class=org.apache.struts2.views.tiles.TilesResult / /result-types default-action-ref name=login/ action name=testPortal result type=tileslogin/result /action action name=login class=com.xxx.actions.LoginAction Sorry, I meant default-class-ref not default-action-ref. And defining action like this action name=testPortal result type=tileslogin/result /action will use class from default-class-ref to create an instance of the action. And by default it's com.opensymphony.xwork2.ActionSupport so you must put properties in com/opensymphony/xwork2/ActionSupport.properties or define global properties package.properties won't work as well as LoginAction and ActionSupport are in different packages - com/xxx/actions vs com/opensymphony/xwork2 Regards -- Łukasz + 48 606 323 122 http://www.lenart.org.pl/ - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: Struts2 resource bundle labels not showing up
Thanks, for all the help. I got this working. All I had to do was redeploy and re-launch the application. Then global properties worked fine. From: zy...@hotmail.com To: user@struts.apache.org Subject: RE: Struts2 resource bundle labels not showing up Date: Tue, 25 Aug 2015 10:19:07 -0400 I really appreciate you helping me. But, still having issues. Under resources folder - which is a source folder(getting copied to \WEB-INF\classes) I added the below files struts.properties test.properties In struts.properties struts.custom.i18n.resources=test Also, tried adding this in struts.xml struts constant name=struts.devMode value=true / constant name=struts.custom.i18n.resources value=test.properties / Both didn't work. Am I missing something? From: lukaszlen...@apache.org Date: Tue, 25 Aug 2015 15:45:48 +0200 Subject: Re: Struts2 resource bundle labels not showing up To: user@struts.apache.org 2015-08-25 15:34 GMT+02:00 fea jabi zy...@hotmail.com: I tried setting the default-action-ref in struts.xml as below. That didn't work. Also, I tried placing the properties in the package.properties that didn't work either. Do I need to do any setting for package.properties to work. Tried placing it within the com.xxx.actions and outside as well. package name=test_default extends=struts-default namespace=/result-types result-type name=tiles class=org.apache.struts2.views.tiles.TilesResult / /result-types default-action-ref name=login/ action name=testPortal result type=tileslogin/result /action action name=login class=com.xxx.actions.LoginAction Sorry, I meant default-class-ref not default-action-ref. And defining action like this action name=testPortal result type=tileslogin/result /action will use class from default-class-ref to create an instance of the action. And by default it's com.opensymphony.xwork2.ActionSupport so you must put properties in com/opensymphony/xwork2/ActionSupport.properties or define global properties package.properties won't work as well as LoginAction and ActionSupport are in different packages - com/xxx/actions vs com/opensymphony/xwork2 Regards -- Łukasz + 48 606 323 122 http://www.lenart.org.pl/ - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: Struts2 resource bundle labels not showing up
Need help with this please. From: zy...@hotmail.com To: user@struts.apache.org Subject: RE: Struts2 resource bundle labels not showing up Date: Mon, 24 Aug 2015 10:20:41 -0400 Thanks,, for trying to help me on this. yes, in the properties file I do have the line breaks as label.user=User label.password=Password After submitting the login form with wrong user/pass I am seeing the labels. you are right on this. Didn't realize that until now. How to get the labels when I load the page then? I am calling the same action(login) to launch the page too. From: lukaszlen...@apache.org Date: Mon, 24 Aug 2015 15:24:47 +0200 Subject: Re: Struts2 resource bundle labels not showing up To: user@struts.apache.org 2015-08-21 8:17 GMT+02:00 fea jabi zy...@hotmail.com: Using struts2 in iRad 1. In src folder have package com.xyx.actions in this have LoginAction.java 2. Created resources -- of type Source Folder in it I added a package com.xyx.actions in this added LoginAction.properties I added couple of label and error properties in it. 3. In LoginAction - validate method is handling errors and adding the key from LoginAction.properties file and on field error in jsp the value from properties file is read and displaying in jsp correctly. i.e error messages are showing correct from th properties file. 4. In the same properties file, I added label properties like label.user=Userlabel.password=Passwordbtn.login=Login errors.user.required=Please enter usererrors.password.required=Please enter password The jsp is not getting the label properties and displaying the key itself as label.user s:label key=label.loginInfo/ s:textfield name=user key=label.user/s:textfield s:submit key=btn.login align=center cssClass=button/s:submit what is that I am missing? How to fix this? Any help on this appreciated. Thanks. What action do you use to display the login form? And after submitting the login form with wrong user/pass do you see the labels? Regards -- Łukasz + 48 606 323 122 http://www.lenart.org.pl/ - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: Struts2 resource bundle labels not showing up
Sorry, here is my Struts.xml. Thanks, for trying to help me. Struts.xml action name=testPortal result type=tileslogin/result /action action name=login class=com.xxx.actions.LoginAction result name=success type=tileshome/result result name=notAuthorized type=tilesnotAuthorized/result result name=input type=tileslogin/result /action URL I am using to lauch is http://localhost:9080/Test/testPortal.action Do I need to create and have the properties set in the TestPortalAction.properties too?? Do I need to have same properties in both TestPortalAction.properties and LoginAction.properties as well?? From: lukaszlen...@apache.org Date: Tue, 25 Aug 2015 14:46:24 +0200 Subject: Re: Struts2 resource bundle labels not showing up To: user@struts.apache.org 2015-08-25 14:41 GMT+02:00 fea jabi zy...@hotmail.com: Need help with this please. Sure but can you answer my question I have sent you 6 hours ago? Regards -- Łukasz + 48 606 323 122 http://www.lenart.org.pl/ - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: Struts2 resource bundle labels not showing up
I tried setting the default-action-ref in struts.xml as below. That didn't work. Also, I tried placing the properties in the package.properties that didn't work either. Do I need to do any setting for package.properties to work. Tried placing it within the com.xxx.actions and outside as well. package name=test_default extends=struts-default namespace=/result-types result-type name=tiles class=org.apache.struts2.views.tiles.TilesResult / /result-types default-action-ref name=login/ action name=testPortal result type=tileslogin/result /action action name=login class=com.xxx.actions.LoginAction From: lukaszlen...@apache.org Date: Tue, 25 Aug 2015 15:00:34 +0200 Subject: Re: Struts2 resource bundle labels not showing up To: user@struts.apache.org 2015-08-25 14:50 GMT+02:00 fea jabi zy...@hotmail.com: Sorry, here is my Struts.xml. Thanks, for trying to help me. Struts.xml action name=testPortal result type=tileslogin/result /action So I assume that's your login form input action from where you start. If so this doesn't use LoginAction but ActionSupport - it's a default action defined with default-action-ref [1] in struts-default.xml. You can override that in struts.xml or define other more common global properties [2] [1] https://struts.apache.org/docs/action-configuration.html#ActionConfiguration-ActionDefault [2] http://struts.apache.org/docs/localization.html Regards -- Łukasz + 48 606 323 122 http://www.lenart.org.pl/ - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Struts2 resource bundle labels not showing up
Still need help with this please. From: zy...@hotmail.com To: user@struts.apache.org Subject: Struts2 resource bundle labels not showing up Date: Fri, 21 Aug 2015 02:17:08 -0400 Using struts2 in iRad 1. In src folder have package com.xyx.actions in this have LoginAction.java 2. Created resources -- of type Source Folder in it I added a package com.xyx.actions in this added LoginAction.properties I added couple of label and error properties in it. 3. In LoginAction - validate method is handling errors and adding the key from LoginAction.properties file and on field error in jsp the value from properties file is read and displaying in jsp correctly. i.e error messages are showing correct from th properties file. 4. In the same properties file, I added label properties like label.user=Userlabel.password=Passwordbtn.login=Login errors.user.required=Please enter usererrors.password.required=Please enter password The jsp is not getting the label properties and displaying the key itself as label.user s:label key=label.loginInfo/ s:textfield name=user key=label.user/s:textfield s:submit key=btn.login align=center cssClass=button/s:submit what is that I am missing? How to fix this? Any help on this appreciated. Thanks.
struts2 s:autocompleter
Using struts-core 2.3.24.jar I am trying to do 2 dependable autocomplete drop downs and found an example here http://struts.fromdev.com/2009/10/struts-2-ajax-autocomplete-dropdown.html But getting error that as JSPG0046E: Unable to locate tagfile for tag autocompleter I did check the jar and I don't see autocompleter tag in it. Which struts2 jar has this tag???
RE: Struts2 resource bundle labels not showing up
Thanks,, for trying to help me on this. yes, in the properties file I do have the line breaks as label.user=User label.password=Password After submitting the login form with wrong user/pass I am seeing the labels. you are right on this. Didn't realize that until now. How to get the labels when I load the page then? I am calling the same action(login) to launch the page too. From: lukaszlen...@apache.org Date: Mon, 24 Aug 2015 15:24:47 +0200 Subject: Re: Struts2 resource bundle labels not showing up To: user@struts.apache.org 2015-08-21 8:17 GMT+02:00 fea jabi zy...@hotmail.com: Using struts2 in iRad 1. In src folder have package com.xyx.actions in this have LoginAction.java 2. Created resources -- of type Source Folder in it I added a package com.xyx.actions in this added LoginAction.properties I added couple of label and error properties in it. 3. In LoginAction - validate method is handling errors and adding the key from LoginAction.properties file and on field error in jsp the value from properties file is read and displaying in jsp correctly. i.e error messages are showing correct from th properties file. 4. In the same properties file, I added label properties like label.user=Userlabel.password=Passwordbtn.login=Login errors.user.required=Please enter usererrors.password.required=Please enter password The jsp is not getting the label properties and displaying the key itself as label.user s:label key=label.loginInfo/ s:textfield name=user key=label.user/s:textfield s:submit key=btn.login align=center cssClass=button/s:submit what is that I am missing? How to fix this? Any help on this appreciated. Thanks. What action do you use to display the login form? And after submitting the login form with wrong user/pass do you see the labels? Regards -- Łukasz + 48 606 323 122 http://www.lenart.org.pl/ - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: struts2 s:autocompleter
Thanks, for the reply. Can you forward a link which has the 2 autocompleter tags which are dependent on each other using struts2 jquery plugin? Date: Mon, 24 Aug 2015 11:08:52 -0400 Subject: Re: struts2 s:autocompleter From: davelnew...@gmail.com To: user@struts.apache.org The deprecated Dojo-based tags (which I would recommend against using in fairly strong terms) or the S2 jQuery plugin? On Mon, Aug 24, 2015 at 10:33 AM, fea jabi zy...@hotmail.com wrote: Using struts-core 2.3.24.jar I am trying to do 2 dependable autocomplete drop downs and found an example here http://struts.fromdev.com/2009/10/struts-2-ajax-autocomplete-dropdown.html But getting error that as JSPG0046E: Unable to locate tagfile for tag autocompleter I did check the jar and I don't see autocompleter tag in it. Which struts2 jar has this tag??? -- e: davelnew...@gmail.com m: 908-380-8699 s: davelnewton_skype t: @dave_newton https://twitter.com/dave_newton b: Bucky Bits http://buckybits.blogspot.com/ g: davelnewton https://github.com/davelnewton so: Dave Newton http://stackoverflow.com/users/438992/dave-newton
sj:autocompleter dependable
I am new to struts2 and need help with the struts2 jquery autocompleter tag Have an object Publisher code description In Action getPublishers() I am trying to use 2 dependable sj:autocompleter tags. In both it should display the Publishers list but in one it should display the description of publisher and in another it should display the code If the user changes discription in one of the autocompleter then it should change the code and vise versa on the second autocompleter. I am not not sure how the selected value goes to the action class. I'll want the selected publisher to be set to corresponding Publisher object selected to the selectedPublisherOfPublisherDescription attribute. How will it change the second autocompleter code on change of the first one. But, it's not working. Your help is appreciated. I tried the below sj:autocompleter id=publisherDescriptionId name=publisherDescription value=%{selectedPublisherOfPublisherDescription} list=%{publishers} listValue=description listKey=code selectBox=true selectBoxIcon=true label=Publisher Description onChangeTopics=publisherChange / sj:autocompleter id=publisherCodeId name=publisherCode value=%{selectedPublisherOfMPublisherCode} list=%{publishers} listValue=code listKey=description selectBox=true selectBoxIcon=true label=Publisher Code listenTopics=publisherChange
Struts2 tabbed panel not working
Using Struts2.3 . Using the below code to display the tabbed panel but it's not working. What am I missing in this? All I see is some text of Tab1 Tab2 on screen. no css is applied. Have struts2-dojo-plugin in build path. What else do I need? Using struts2 tiles too. Any help is appreciated. %@ taglib prefix=s uri=/struts-tags % %@ taglib prefix=sx uri=/struts-dojo-tags% html head meta http-equiv=Content-Type content=text/html; charset=UTF-8 META HTTP-EQUIV=Expires CONTENT=0 META HTTP-EQUIV=Pragma CONTENT=no-cache META HTTP-EQUIV=Cache-Control CONTENT=no-cacheMETA HTTP-EQUIV=Cache-Control CONTENT=no-store s:head/ sx:head/ link rel=stylesheet type=text/css href=theme/test.css script src=scripts/test.js //script /head body s:form sx:tabbedpanel id=tabContainer sx:div label=Tab 1Tab 1/sx:div sx:div label=Tab 2Tab 2/sx:div /sx:tabbedpanel /s:form /body /html
RE: Struts2 tabbed panel not working
Thanks, for your reply. sorry, I saw an example on web and tried that. What do I use then? Any example link you can provide please? Date: Fri, 21 Aug 2015 02:13:01 -0400 Subject: Re: Struts2 tabbed panel not working From: davelnew...@gmail.com To: user@struts.apache.org Why are you using the long-deprecated Dojo tags? On Aug 21, 2015 2:06 AM, fea jabi zy...@hotmail.com wrote: Using Struts2.3 . Using the below code to display the tabbed panel but it's not working. What am I missing in this? All I see is some text of Tab1 Tab2 on screen. no css is applied. Have struts2-dojo-plugin in build path. What else do I need? Using struts2 tiles too. Any help is appreciated. %@ taglib prefix=s uri=/struts-tags % %@ taglib prefix=sx uri=/struts-dojo-tags% html head meta http-equiv=Content-Type content=text/html; charset=UTF-8 META HTTP-EQUIV=Expires CONTENT=0 META HTTP-EQUIV=Pragma CONTENT=no-cache META HTTP-EQUIV=Cache-Control CONTENT=no-cacheMETA HTTP-EQUIV=Cache-Control CONTENT=no-store s:head/ sx:head/ link rel=stylesheet type=text/css href=theme/test.css script src=scripts/test.js //script /head body s:form sx:tabbedpanel id=tabContainer sx:div label=Tab 1Tab 1/sx:div sx:div label=Tab 2Tab 2/sx:div /sx:tabbedpanel /s:form /body /html
RE: Struts2 tabbed panel not working
Thanks, got this after using the struts2-jquery-plugin. From: zy...@hotmail.com To: user@struts.apache.org Subject: RE: Struts2 tabbed panel not working Date: Fri, 21 Aug 2015 02:20:26 -0400 Thanks, for your reply. sorry, I saw an example on web and tried that. What do I use then? Any example link you can provide please? Date: Fri, 21 Aug 2015 02:13:01 -0400 Subject: Re: Struts2 tabbed panel not working From: davelnew...@gmail.com To: user@struts.apache.org Why are you using the long-deprecated Dojo tags? On Aug 21, 2015 2:06 AM, fea jabi zy...@hotmail.com wrote: Using Struts2.3 . Using the below code to display the tabbed panel but it's not working. What am I missing in this? All I see is some text of Tab1 Tab2 on screen. no css is applied. Have struts2-dojo-plugin in build path. What else do I need? Using struts2 tiles too. Any help is appreciated. %@ taglib prefix=s uri=/struts-tags % %@ taglib prefix=sx uri=/struts-dojo-tags% html head meta http-equiv=Content-Type content=text/html; charset=UTF-8 META HTTP-EQUIV=Expires CONTENT=0 META HTTP-EQUIV=Pragma CONTENT=no-cache META HTTP-EQUIV=Cache-Control CONTENT=no-cacheMETA HTTP-EQUIV=Cache-Control CONTENT=no-store s:head/ sx:head/ link rel=stylesheet type=text/css href=theme/test.css script src=scripts/test.js //script /head body s:form sx:tabbedpanel id=tabContainer sx:div label=Tab 1Tab 1/sx:div sx:div label=Tab 2Tab 2/sx:div /sx:tabbedpanel /s:form /body /html
Struts2 resource bundle labels not showing up
Using struts2 in iRad 1. In src folder have package com.xyx.actions in this have LoginAction.java 2. Created resources -- of type Source Folder in it I added a package com.xyx.actions in this added LoginAction.properties I added couple of label and error properties in it. 3. In LoginAction - validate method is handling errors and adding the key from LoginAction.properties file and on field error in jsp the value from properties file is read and displaying in jsp correctly. i.e error messages are showing correct from th properties file. 4. In the same properties file, I added label properties like label.user=Userlabel.password=Passwordbtn.login=Login errors.user.required=Please enter usererrors.password.required=Please enter password The jsp is not getting the label properties and displaying the key itself as label.user s:label key=label.loginInfo/ s:textfield name=user key=label.user/s:textfield s:submit key=btn.login align=center cssClass=button/s:submit what is that I am missing? How to fix this? Any help on this appreciated. Thanks.
s:textfield label text align
I want to align the s:textfield label to 'right'. How can I do this? Thanks.
struts PDF
On click of a button I open a window and generating PDF in it as inline within that browser window. It works fine. I did set the http response header for the response with the file name. So, I am seeing the right PDF name in the open/save dialog of PDF. But when I click on the save button in PDF within the browser or File|Save of the browser the file name in the save dialog is the struts action name.pdf instead of the http response header file name that I set. How to get the file name set to the header of http response in the save dialog instead of the struts action name.pdf? Thanks. _ The New Busy is not the old busy. Search, chat and e-mail from your inbox. http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_3
RE: html:link submit with request parameters
thank you for your responce. I tried the below to pass parameters and also to submit the form. jsp:useBean id=mapParams class=java.util.HashMap/ c:set target=${mapParams} property=theKey value=${theValue}/ c:set target=${mapParams} property=theKey1 value=${theValue1}/ html:link href=javascript:document.myform.submit() name=mapParams c:out value=${custItr.empName}/ /html:link When i click on the link getting javascript error which says syntax error. when I remove the name attribute in html:link there is no error but I need to have the name attribute to pass the parameters. How to do both the submit and passing of parameters using html:link? Your help is appreciated. Thanks. Subject: RE: html:link submit with request parameters Date: Fri, 13 Nov 2009 14:44:55 -0500 From: david_kawczyn...@merck.com To: user@struts.apache.org Use javascript to get a reference to the form, and call its submit method. EG form name=form id=form action=/setup.do input name=blah / input type=submit/ /form script function submit() { document.getElementById(form).submit() return false; } /script a href=javascript:submit(); onclick=return submit();click me/a -Original Message- From: fea jabi [mailto:zy...@hotmail.com] Sent: Thursday, November 12, 2009 8:43 PM To: user@struts.apache.org Subject: html:link submit with request parameters I need to submit the form when the html:link . is clicked/pressed and also need to pass parameters. c:url value=/setup.do var=setupUrl c:param name=empId value=${custItr.empId}/ /c:url html:link href=%= (String)pageContext.getAttribute(\setupUrl\) % transaction=true c:out value=${custItr.empName}/ /html:link but this is not submitting the form. How can I submit the form and also pass the request params? Basically I want other values entered in the html form are set to the form bean so i can acess those in action class when the link is pressed. How can this be done? Thanks. _ Hotmail: Trusted email with Microsoft's powerful SPAM protection. http://clk.atdmt.com/GBL/go/177141664/direct/01/ http://clk.atdmt.com/GBL/go/177141664/direct/01/ Notice: This e-mail message, together with any attachments, contains information of Merck Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates Direct contact information for affiliates is available at http://www.merck.com/contact/contacts.html) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org _ Windows 7: It works the way you want. Learn more. http://www.microsoft.com/Windows/windows-7/default.aspx?ocid=PID24727::T:WLMTAGL:ON:WL:en-US:WWL_WIN_evergreen:112009v2
html:link submit with request parameters
I need to submit the form when the html:link . is clicked/pressed and also need to pass parameters. c:url value=/setup.do var=setupUrl c:param name=empId value=${custItr.empId}/ /c:url html:link href=%= (String)pageContext.getAttribute(\setupUrl\) % transaction=true c:out value=${custItr.empName}/ /html:link but this is not submitting the form. How can I submit the form and also pass the request params? Basically I want other values entered in the html form are set to the form bean so i can acess those in action class when the link is pressed. How can this be done? Thanks. _ Hotmail: Trusted email with Microsoft's powerful SPAM protection. http://clk.atdmt.com/GBL/go/177141664/direct/01/ http://clk.atdmt.com/GBL/go/177141664/direct/01/
checkbox in table struts 1.2
I am trying to add checkboxes in table column and unable to do so. need to send a boolean value when the checkbox is checked otherwise false. * Created a bean for each row in the table Have a bean Employee firstName lastname . Boolean isHandicap; == Have a Formbean ... ListEmployee emps = new ArrayListEmployee(); === JSP loop thru the list table . c:foreach var=empItr items=${formbean.emps} td../td td../td td html:checkbox name=formbean property=empitr.isHandicap/td /c:foreach /table Getting error in the page near the html:checkbox. How to do this? your help is appreciated. Thanks. _ Windows 7: It works the way you want. Learn more. http://www.microsoft.com/Windows/windows-7/default.aspx?ocid=PID24727::T:WLMTAGL:ON:WL:en-US:WWL_WIN_evergreen2:102009
Get struts action class
In my method signature have ActionMapping mapping, ActionForm form, HttpServletRequest request I want to get the associated Action. How to get the action class? I would appreciate your help. Thanks. _ Hotmail® has ever-growing storage! Don’t worry about storage limits. http://windowslive.com/Tutorial/Hotmail/Storage?ocid=TXT_TAGLM_WL_HM_Tutorial_Storage_062009
set submit button focus
Have couple of submit buttons in my JSP html:submit property=method /html:submit All of them have the property as method. When I try to set the focus for the html:form. how do I set to the focus to a certain submit button. html:form .. focus=method I tried the above. we;ll it did not work. How to do this? your help is appreciated. Thanks. _ Hotmail® has ever-growing storage! Don’t worry about storage limits. http://windowslive.com/Tutorial/Hotmail/Storage?ocid=TXT_TAGLM_WL_HM_Tutorial_Storage_062009
submit button
have a submit button which has the value of Add Employee html:submit property=actionAdd Employee/html:submit but when submitted I want the property to be set to another value add in the request action=add How can this be done? Thanks. _ Bing brings you health info from trusted sources. http://www.bing.com/search?q=pet+allergyform=MHEINApubl=WLHMTAGcrea=TXT_MHEINA_Health_Health_PetAllergy_1x1
RE: submit button
may I know what the javascript will be? Date: Tue, 15 Sep 2009 11:59:20 -0400 From: d...@newfield.org To: user@struts.apache.org Subject: Re: submit button fea jabi wrote: have a submit button which has the value of Add Employee html:submit property=actionAdd Employee/html:submit but when submitted I want the property to be set to another value add in the request action=add How can this be done? Without javascript it cannot. -Dale - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org _ Ready for Fall shows? Use Bing to find helpful ratings and reviews on digital tv's. http://www.bing.com/shopping/search?q=digital+tv'sform=MSHNCBpubl=WLHMTAGcrea=TEXT_MSHNCB_Vertical_Shopping_DigitalTVs_1x1
action mapping parameter issue
We are getting the below error in production server for some of the users not all. Everything works fine on our local machines. What can we check to avoid the below issue. Any suggessions? javax.servlet.ServletException: Request[/DispatchOrdersAction] does not contain handler parameter named 'method'. This may be caused by whitespace in the label text. Thanks. _ Change the world with e-mail. Join the i’m Initiative from Microsoft. http://im.live.com/Messenger/IM/Join/Default.aspx?source=EML_WL_ChangeWorld
RE: Progress Bar
code snipet would be helpfull. Thanks. From: [EMAIL PROTECTED] To: user@struts.apache.org Subject: Progress Bar Date: Fri, 11 Jan 2008 16:14:00 -0500 Working a process which would take couple of mins to complete. Would like to use progress bar for this process. How to use a progress bar? using 1.2. struts. Thanks. _ Share life as it happens with the new Windows Live. http://www.windowslive.com/share.html?ocid=TXT_TAGHM_Wave2_sharelife_012008 _ Get the power of Windows + Web with the new Windows Live. http://www.windowslive.com?ocid=TXT_TAGHM_Wave2_powerofwindows_012008
Progress Bar
Working a process which would take couple of mins to complete. Would like to use progress bar for this process. How to use a progress bar? using 1.2. struts. Thanks. _ Share life as it happens with the new Windows Live. http://www.windowslive.com/share.html?ocid=TXT_TAGHM_Wave2_sharelife_012008
usage of constant in validation-rules in custom validator
Created a custom validator. I have created a constant in validation-rules.xml constant constant-namealpha_num/constant-name constant-value^[a-zA-Z0-9]*$/constant-value /constant Is it possible to use the this constant in my custom validator I created. If so, how to use it? Also, Is it possible to get message from the MessageResource.properties. If so, How to get the message too from the customer validator? Thanks. _ From predictions to trailers, check out the MSN Entertainment Guide to the Academy Awards® http://movies.msn.com/movies/oscars2007/?icid=ncoscartagline1 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: validation help
can someone help me with this please. thanks. From: fea jabi [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org To: user@struts.apache.org Subject: validation help Date: Thu, 08 Feb 2007 10:01:01 -0500 Have 2 radio buttons of ID and Name and an input field to enter criteria. When the ID is selected the criteria the user entered should be numeric. Should display the user with the appropriate message that only int value is allowed. When the Name is selected the criteria the user entered should be alphanumeric. Should display appropriate message that only alphanumeric values are allowed. Tried the below it works great for the second option. Not sure how can I join the two conditions. formset form name=search field property=criteria depends=mask msg name=mask key=error.alphanumeric/ arg0 name=mask key=lbl.criteria / var var-namemask/var-name var-value${alpha_numeric}/var-value /var /field /form /formset You help is appreciated. Thanks. _ Laugh, share and connect with Windows Live Messenger http://clk.atdmt.com/MSN/go/msnnkwme002001msn/direct/01/?href=http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-ussource=hmtagline - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Turn searches into helpful donations. Make your search count. http://click4thecause.live.com/search/charity/default.aspx?source=hmemtagline_donationFORM=WLMTAG - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
validation help
Have 2 radio buttons of ID and Name and an input field to enter criteria. When the ID is selected the criteria the user entered should be numeric. Should display the user with the appropriate message that only int value is allowed. When the Name is selected the criteria the user entered should be alphanumeric. Should display appropriate message that only alphanumeric values are allowed. Tried the below it works great for the second option. Not sure how can I join the two conditions. formset form name=search field property=criteria depends=mask msg name=mask key=error.alphanumeric/ arg0 name=mask key=lbl.criteria / var var-namemask/var-name var-value${alpha_numeric}/var-value /var /field /form /formset You help is appreciated. Thanks. _ Laugh, share and connect with Windows Live Messenger http://clk.atdmt.com/MSN/go/msnnkwme002001msn/direct/01/?href=http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-ussource=hmtagline - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
session time out
When the session times out want to redirect to a session time out page. Is there an easier way to do this in struts? How can this be done? Thanks. _ Find sales, coupons, and free shipping, all in one place! MSN Shopping Sales Deals http://shopping.msn.com/content/shp/?ctid=198,ptnrid=176,ptnrdata=200639 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
request values between actions
Have a Customer.jsp For this jsp, have a prepare action and dispatch action. In prepare action doing some process and creating an obj called Customer object. In this Customer JSP, have a table which displays some rows. One of the columns data i.e orderID is a link. On clicking it navigates to another page, orders.jsp Want to set the customer obj created in prepare action to request which is needed in orders.jsp how to do this? using tiles hence request attributes are getting lost. How to set the request parameter as customer obj. using JSTL. Any help is appreciated. Thanks. _ Find sales, coupons, and free shipping, all in one place! MSN Shopping Sales Deals http://shopping.msn.com/content/shp/?ctid=198,ptnrid=176,ptnrdata=200639 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
initial values and reset method relation
Have the below in the form bean. public void reset(ActionMapping mapping, javax.servlet.http.HttpServletRequest request) { super.reset(mapping, request); set(empCost, Boolean.FALSE); set(orders, Boolean.FALSE); } Is it required to call the super.reset()? How is it related to the initialize values? What happens if we don't call the super.reset() in the above reset method and have initial values? Thanks. _ MSN Shopping has everything on your holiday list. Get expert picks by style, age, and price. Try it! http://shopping.msn.com/content/shp/?ctId=8000,ptnrid=176,ptnrdata=200601tcode=wlmtagline - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: initial values and reset method relation
Thanks for your response. yes, I am using reset method only for resetting the checkboxes. With all your help now I understand the reset method. What I want to know is, in reset method in my formbean do I have to call the super.reset() ??? When initialize is used on a form property and if super.reset() method is not used, in the reset method, will there be any problems/issues. Would like to know about this. I wrote the reset method without calling super.reset() statement. But I was told that I need to call super.reset() from the reset method of formbean. I was not clear on why I need to do this. Trying to get answers for this. Thanks. From: Hubert Rabago [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org To: Struts Users Mailing List user@struts.apache.org Subject: Re: initial values and reset method relation Date: Mon, 27 Nov 2006 11:09:50 -0600 If you consult the documentation for the reset() method [1], you'll see it's mainly for resetting checkbox values: This method is not the appropriate place to initialize form value for an update type page (this should be done in a setup Action). You mainly need to worry about setting checkbox values to false; most of the time you can leave this method unimplemented. Hubert [1] http://struts.apache.org/1.x/struts-core/apidocs/org/apache/struts/action/ActionForm.html On 11/27/06, fea jabi [EMAIL PROTECTED] wrote: Have the below in the form bean. public void reset(ActionMapping mapping, javax.servlet.http.HttpServletRequest request) { super.reset(mapping, request); set(empCost, Boolean.FALSE); set(orders, Boolean.FALSE); } Is it required to call the super.reset()? How is it related to the initialize values? What happens if we don't call the super.reset() in the above reset method and have initial values? Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Stay up-to-date with your friends through the Windows Live Spaces friends list. http://clk.atdmt.com/MSN/go/msnnkwsp007001msn/direct/01/?href=http://spaces.live.com/spacesapi.aspx?wx_action=createwx_url=/friends.aspxmk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
why/when to use redirect
I am not really clear when to use redirect=true. I am chaining actions. As I was doing this I had to use redirect=true to get the values that were set in one action to another. But the request attributes set in that action were lost when redirect is set to true. why is that? is there any way, I can use redirect=true and also get the request attributes??? also, not really sure when to use the contextRelative=true/false/yes/no?? Thanks. _ Share your latest news with your friends with the Windows Live Spaces friends module. http://clk.atdmt.com/MSN/go/msnnkwsp007001msn/direct/01/?href=http://spaces.live.com/spacesapi.aspx?wx_action=createwx_url=/friends.aspxmk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
jsp page/actions design question
Using struts. Have a JSP cust.jsp In it half of it is very specific to that page only. other half is shown in this cust.jsp and another report.jsp too. want to implement this so that code can be re-used in the other one too. The way I have designed is for a jsp have a prepare action and dispatch action. But not sure how to design this page so that I can re-use the code in another too. any suggesions are appreciated. Thanks. _ Get today's hot entertainment gossip http://movies.msn.com/movies/hotgossip?icid=T002MSN03A07001 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: checkbox issue
can someone help me with this please. Thanks. From: fea jabi [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org To: user@struts.apache.org Subject: checkbox issue Date: Fri, 03 Nov 2006 17:30:09 -0500 struts-config The below form-bean is session scoped and hence using reset. form-bean name=CustForm type=com.formbeans.CustForm dynamic=true ... form-property name=split type=java.lang.Boolean/ /form-bean public class CustForm extends DynaValidatorForm { public CustForm() { } public void reset(ActionMapping mapping, javax.servlet.http.HttpServletRequest request) { set(split, Boolean.FALSE); } } DispatchCustAction public ActionForward save(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { DynaValidatorForm frm = (DynaValidatorForm)form; .. ... return mapping.findForward(successSave); } JSP: html:form . html:checkbox name=CustForm property=split/ ... /html:form When this jsp is first loaded the checkbox above is unchecked. When user checked the checkbox, and clicked a submit save button, in the save method of dispatch action I was expecting to see the split value as true. But it was false when I debug. why is this? What am I missing here? _ Add a Yahoo! contact to Windows Live Messenger for a chance to win a free trip! http://www.imagine-windowslive.com/minisites/yahoo/default.aspx?locale=en-ushmtagline - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Use your PC to make calls at very low rates https://voiceoam.pcs.v2s.live.com/partnerredirect.aspx - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: checkbox issue
well the class name and the form-bean name are same. I tried removing the name attribute in html:checkbox too but, have same issue. Is there anything else I can try? Thanks. From: Chris Pratt [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org To: Struts Users Mailing List user@struts.apache.org Subject: Re: checkbox issue Date: Wed, 8 Nov 2006 14:06:44 -0800 The name parameter of the html:checkbox is the name of a bean, not the name of a class. If you remove the name attribute, it will default to the form bean associated with the html:form surrounding the html:checkbox, which is probably what you want. (*Chris*) On 11/8/06, fea jabi [EMAIL PROTECTED] wrote: can someone help me with this please. Thanks. From: fea jabi [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org To: user@struts.apache.org Subject: checkbox issue Date: Fri, 03 Nov 2006 17:30:09 -0500 struts-config The below form-bean is session scoped and hence using reset. form-bean name=CustForm type=com.formbeans.CustForm dynamic=true ... form-property name=split type=java.lang.Boolean/ /form-bean public class CustForm extends DynaValidatorForm { public CustForm() { } public void reset(ActionMapping mapping, javax.servlet.http.HttpServletRequest request) { set(split, Boolean.FALSE); } } DispatchCustAction public ActionForward save(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { DynaValidatorForm frm = (DynaValidatorForm)form; .. ... return mapping.findForward(successSave); } JSP: html:form . html:checkbox name=CustForm property=split/ ... /html:form When this jsp is first loaded the checkbox above is unchecked. When user checked the checkbox, and clicked a submit save button, in the save method of dispatch action I was expecting to see the split value as true. But it was false when I debug. why is this? What am I missing here? _ Add a Yahoo! contact to Windows Live Messenger for a chance to win a free trip! http://www.imagine-windowslive.com/minisites/yahoo/default.aspx?locale=en-ushmtagline - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Use your PC to make calls at very low rates https://voiceoam.pcs.v2s.live.com/partnerredirect.aspx - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Get FREE company branded e-mail accounts and business Web site from Microsoft Office Live http://clk.atdmt.com/MRT/go/mcrssaub0050001411mrt/direct/01/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: checkbox issue
con someone help me with this please? thanks. From: fea jabi [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org To: user@struts.apache.org Subject: checkbox issue Date: Fri, 03 Nov 2006 17:30:09 -0500 struts-config The below form-bean is session scoped and hence using reset. form-bean name=CustForm type=com.formbeans.CustForm dynamic=true ... form-property name=split type=java.lang.Boolean/ /form-bean public class CustForm extends DynaValidatorForm { public CustForm() { } public void reset(ActionMapping mapping, javax.servlet.http.HttpServletRequest request) { set(split, Boolean.FALSE); } } DispatchCustAction public ActionForward save(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { DynaValidatorForm frm = (DynaValidatorForm)form; .. ... return mapping.findForward(successSave); } JSP: html:form . html:checkbox name=CustForm property=split/ ... /html:form When this jsp is first loaded the checkbox above is unchecked. When user checked the checkbox, and clicked a submit save button, in the save method of dispatch action I was expecting to see the split value as true. But it was false when I debug. why is this? What am I missing here? _ Add a Yahoo! contact to Windows Live Messenger for a chance to win a free trip! http://www.imagine-windowslive.com/minisites/yahoo/default.aspx?locale=en-ushmtagline - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Add a Yahoo! contact to Windows Live Messenger for a chance to win a free trip! http://www.imagine-windowslive.com/minisites/yahoo/default.aspx?locale=en-ushmtagline - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
checkbox issue
struts-config The below form-bean is session scoped and hence using reset. form-bean name=CustForm type=com.formbeans.CustForm dynamic=true ... form-property name=split type=java.lang.Boolean/ /form-bean public class CustForm extends DynaValidatorForm { public CustForm() { } public void reset(ActionMapping mapping, javax.servlet.http.HttpServletRequest request) { set(split, Boolean.FALSE); } } DispatchCustAction public ActionForward save(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { DynaValidatorForm frm = (DynaValidatorForm)form; .. ... return mapping.findForward(successSave); } JSP: html:form . html:checkbox name=CustForm property=split/ ... /html:form When this jsp is first loaded the checkbox above is unchecked. When user checked the checkbox, and clicked a submit save button, in the save method of dispatch action I was expecting to see the split value as true. But it was false when I debug. why is this? What am I missing here? _ Add a Yahoo! contact to Windows Live Messenger for a chance to win a free trip! http://www.imagine-windowslive.com/minisites/yahoo/default.aspx?locale=en-ushmtagline - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: reset method with DyanValidatorForm
Great. thanks a lot for your help. From: Wendy Smoak [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org To: Struts Users Mailing List user@struts.apache.org Subject: Re: reset method with DyanValidatorForm Date: Wed, 1 Nov 2006 08:21:41 -0700 On 11/1/06, fea jabi [EMAIL PROTECTED] wrote: may I know the reason why do we have to use Serializable in the below. package com.example.myapp; public final class AccountForm extends DynaValidatorActionForm implements Serializable {...} You don't. DynaValidatorActionForm is already Serializable. http://struts.apache.org/1.2.9/api/org/apache/struts/validator/DynaValidatorActionForm.html http://java.sun.com/docs/books/jls/second_edition/html/interfaces.doc.html -- Wendy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ All-in-one security and maintenance for your PC. Get a free 90-day trial! http://clk.atdmt.com/MSN/go/msnnkwlo005002msn/direct/01/?href=http://www.windowsonecare.com/?sc_cid=msn_hotmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: reset method with DyanValidatorForm
Thanks. This forum has been great help to me. we are using 1.2.7 so, can't use this nice feature yet. But where can I get the new features added after 1.2.7 version from? From: Niall Pemberton [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org To: Struts Users Mailing List user@struts.apache.org Subject: Re: reset method with DyanValidatorForm Date: Wed, 1 Nov 2006 15:35:44 + On 1/6/06, Wendy Smoak [EMAIL PROTECTED] wrote: On 1/6/06, fea jabi [EMAIL PROTECTED] wrote: So, I might have to reset the checkboxes now. Do, I have no other choice but to create a formbean Class with all the setter's and getter's and then add reset method too for it. or is there an easier way to do this using DynaValidatorForm? You don't have to add the get/set methods. Just extend DynaValidatorForm and add the reset method -- then be sure to change the type of the form in struts-config.xml to your new form type. package com.example.myapp; public final class AccountForm extends DynaValidatorActionForm implements Serializable {...} form-bean name=accountForm type=com.example.myapp.AccountForm Hubert added a new feature in Struts 1.3.x that allows you to configure reset behaviour on a property-by-property basis in the struts-config.xml - I believe you just add reset=true attributes to your form-property elements and it will reset the values to whatever is (or isn't) specified by the initial attribute. Something like the following: form-beans form-bean name=fooForm type=org.apache.struts.action.DynaActionForm form-property name=state type=java.lang.String initial=INITIAL reset=true/ form-property name=unsubscribe type=java.lang.String initial=true reset=true/ /form-bean /form-beans Niall -- Wendy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Get FREE company branded e-mail accounts and business Web site from Microsoft Office Live http://clk.atdmt.com/MRT/go/mcrssaub0050001411mrt/direct/01/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
On enter from input field getting: does not contain handler parameter error
form-bean name=Form1 type=org.apache.struts.validator.DynaValidatorForm form-property name=searchCriteria type=java.lang.String/ form-property name=method type=java.lang.String/ /form-bean action path=/PrepareSearchAction type=com.PrepareSearchAction name=Form1 scope=session validate=false input=/pages/Search.jsp forward name=success path=/pages/Search.jsp redirect=false/ /action action path=/DispatchSearchAction type=com.DispatchSearchAction name=Form1 scope=session validate=true input=/pages/Search.jsp parameter=method forward name=successSearch path=/PrepareSearchAction.do redirect=true/ /action IN JSP: html HEAD meta http-equiv=Content-Type content=text/html; charset=UTF-8 /HEAD BODY onLoad=document.getElementById('searchCriteriaID').focus(); html:form action=DispatchSearchAction.do method=post fmt:setBundle var=appbundle basename=MessageResources/ html:text name=Form1 property=searchCriteria styleId=searchCriteriaID/ html:submit onclick= property=methodfmt:message key=btn.search bundle=${appbundle}//html:submit /html:form /BODY /html When the user enters value in the input field and presses enter, getting exception [10/27/06 9:22:19:739 EDT] 2668498 RequestProces W org.apache.struts.action.RequestProcessor Unhandled Exception thrown: class javax.servlet.ServletException [10/27/06 9:22:19:799 EDT] 2668498 WebGroup E SRVE0026E: [Servlet Error]-[Request[/DispatchSearchAction] does not contain handler parameter named #39;method#39;. This may be caused by whitespace in the label text.]: javax.servlet.ServletException: Request[/DispatchSearchAction] does not contain handler parameter named 'method'. This may be caused by whitespace in the label text. Everything works fine when user clicks on the search button. But when pressed enter from input field the method is not getting the value I guess and getting this exception. Not sure why this is happenning. In other jsp's it executes the first submit button on enter from input field. But in this jsp getting error. I am not sure what's going wrong here. I appreciate your help. Thanks. _ All-in-one security and maintenance for your PC. Get a free 90-day trial! http://clk.atdmt.com/MSN/go/msnnkwlo005002msn/direct/01/?href=http://www.windowsonecare.com/?sc_cid=msn_hotmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: On enter from input field getting: does not contain handler parameter error
Here is the solution for this. http://frustratedprogrammer.blogspot.com/2004/07/ie-bug-and-struts-forms-with-one-input.html Thanks. From: fea jabi [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org To: user@struts.apache.org Subject: On enter from input field getting: does not contain handler parameter error Date: Fri, 27 Oct 2006 09:34:13 -0400 form-bean name=Form1 type=org.apache.struts.validator.DynaValidatorForm form-property name=searchCriteria type=java.lang.String/ form-property name=method type=java.lang.String/ /form-bean action path=/PrepareSearchAction type=com.PrepareSearchAction name=Form1 scope=session validate=false input=/pages/Search.jsp forward name=success path=/pages/Search.jsp redirect=false/ /action action path=/DispatchSearchAction type=com.DispatchSearchAction name=Form1 scope=session validate=true input=/pages/Search.jsp parameter=method forward name=successSearch path=/PrepareSearchAction.do redirect=true/ /action IN JSP: html HEAD meta http-equiv=Content-Type content=text/html; charset=UTF-8 /HEAD BODY onLoad=document.getElementById('searchCriteriaID').focus(); html:form action=DispatchSearchAction.do method=post fmt:setBundle var=appbundle basename=MessageResources/ html:text name=Form1 property=searchCriteria styleId=searchCriteriaID/ html:submit onclick= property=methodfmt:message key=btn.search bundle=${appbundle}//html:submit /html:form /BODY /html When the user enters value in the input field and presses enter, getting exception [10/27/06 9:22:19:739 EDT] 2668498 RequestProces W org.apache.struts.action.RequestProcessor Unhandled Exception thrown: class javax.servlet.ServletException [10/27/06 9:22:19:799 EDT] 2668498 WebGroup E SRVE0026E: [Servlet Error]-[Request[/DispatchSearchAction] does not contain handler parameter named 'method'. This may be caused by whitespace in the label text.]: javax.servlet.ServletException: Request[/DispatchSearchAction] does not contain handler parameter named 'method'. This may be caused by whitespace in the label text. Everything works fine when user clicks on the search button. But when pressed enter from input field the method is not getting the value I guess and getting this exception. Not sure why this is happenning. In other jsp's it executes the first submit button on enter from input field. But in this jsp getting error. I am not sure what's going wrong here. I appreciate your help. Thanks. _ All-in-one security and maintenance for your PC. Get a free 90-day trial! http://clk.atdmt.com/MSN/go/msnnkwlo005002msn/direct/01/?href=http://www.windowsonecare.com/?sc_cid=msn_hotmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Try the next generation of search with Windows Live Search today! http://imagine-windowslive.com/minisites/searchlaunch/?locale=en-ussource=hmtagline - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
disable enter key functionality
Is it possible in struts to disable the functionality of the enter key which would usually execute the first submit button in the page. Can we do this at form level? If so how to do this? Thanks. _ Add a Yahoo! contact to Windows Live Messenger for a chance to win a free trip! http://www.imagine-windowslive.com/minisites/yahoo/default.aspx?locale=en-ushmtagline - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
display only mode using struts tags
Developed jsp using struts html tags. (html:text etc.) Now we have the requirement which should display the values only is display mode on a condition. user should not be able to edit any in some condition. Is there something in struts that can be used to get this functionality. I have seen that layout tag does have this. But use it we have to re-write the jsp's. is there any other option I can use to minimize the re-writting of code. Thanks. _ Get today's hot entertainment gossip http://movies.msn.com/movies/hotgossip?icid=T002MSN03A07001 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
validwhen for double value comparision
Need to check if the value entered is greater than zero. Tried the below using the validwhen field property=payment depends=required,validwhen msg name=required key=error.required/ msg name=validwhen key=error.gtzero/ var var-nametest/var-name var-value(*this* 0.00)/var-value /var /field validation seams to be working right when entered 0,0.00,any string, any negative number all give validation error. which is exactly what I wanted. Is this really doing the validation right i.e checking if the value entered is greater than zero? Is this the right way to do? or do I have to create the custom validator to do double value comparision? Thanks. _ Use your PC to make calls at very low rates https://voiceoam.pcs.v2s.live.com/partnerredirect.aspx - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
date comparision using validwhen
can we use validwhen to do date comparision? we are using date pattern MM-dd-. the data type in form bean property is String. Thanks. _ Share your special moments by uploading 500 photos per month to Windows Live Spaces http://clk.atdmt.com/MSN/go/msnnkwsp007001msn/direct/01/?href=http://www.get.live.com/spaces/features - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
format/unformat of input values
using fmt:Number as below and putting the value in the input field. fmt:formatNumber value=${Form1.map.revenue} type=currency currencySymbol= var=rev/ html:text name=Form1 property=totRev value='%= pageContext.getAttribute(rev).toString() %'/ But, when form is submitted the value in the input field is comma separated. How to make this value unformatted when form is submitted? Is there something in JSTL that does this? Ofcourse can do this using javascript. But wondering how others implemented this kind of values? Thanks. _ Try the new Live Search today! http://imagine-windowslive.com/minisites/searchlaunch/?locale=en-usFORM=WLMTAG - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
clear form bean properties
Which method is the better/preffered way to clear the form-bean properties. have form properties as ArrayList, String and Boolean in a DynaValidatorForm. when we have to clear the form bean we are trying to remove all the form properties i.e making form-bean with no properties in it. Other way is to make all the form-properties to blank. which is better or usual way of doing? Thanks. _ Share your special moments by uploading 500 photos per month to Windows Live Spaces http://clk.atdmt.com/MSN/go/msnnkwsp007001msn/direct/01/?href=http://www.get.live.com/spaces/features - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
mapping forwards
In struts config have a Dynavalidator form-bean form-bean name=Form1 type= DynaValidatorForm form-property name=typeName type=java.lang.String/ .. /form-bean have prepare(Action) and dispath(LookupDispatchAction) actions for the jsp in the config which are session scoped. action path=/PrepareAction type=com.PrepareAction name=Form1 scope=session forward name=success path=/pages/Accounts.jsp redirect=false/ /action action path=/DispatchAction type=com.DispatchAction name=Form1 scope=session validate=true parameter=method forward name=successCalc path=/pages/Accounts.jsp redirect=false/ /action In the jsp have a submit button which dispatches to the dispatch action to one of the methods in it. I am setting one of the form property value in that method. public class DispatchAction extends LookupDispatchAction { protected Map getKeyMethodMap() { Map map = new HashMap(); map.put(btn.calc, calc); } public ActionForward calc(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { DynaValidatorForm frm = (DynaValidatorForm)form; frm.set(typeName, x); return mapping.findForward(successCalc); } } Have couple of buttons on the jsp. calc button which has to return to the same jsp, and load the jsp with calculated values. Using struts validator for validating the user inputs. Observed that the mapping forwards when forwarded to the jsp instead of action, had to save the token before returning the sucessCalc. Is this the right way of doing? Have other buttons which forward to the different jsp after performing some actions so, forwarding them to the appropriate prepare actions. But when this page is loaded initially it should have all form bean properties to blank/null. I know we can use reset method to do this. But how does it effect when calc button is pressed? which comes back to the same jsp. What I would like to know is, how mapping forwards are handled in such situations. Are the forwards forwarded to jsp or prepare actions? when is it forwarded to jsp, and when to prepare actions? Also, I need to set the form-bean values to null/blank initially and also, when the user clicks on any other buttons except the calculate also they have to be set to null/blank. how to do this? Your help is appreciated. Thanks. _ Find a local pizza place, music store, museum and more then map the best route! http://local.live.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: form-property value set in dispatch action is lost
thanks a lot that worked. I never understood what the redirect does until now. I know now when to make it true. Thanks a lot again. From: Michael Jouravlev [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org To: Struts Users Mailing List user@struts.apache.org Subject: Re: form-property value set in dispatch action is lost Date: Wed, 20 Sep 2006 15:34:46 -0700 You use the same form in both actions, and you chain them without a redirect, so the request parameters are applied to your form again when you forward to PrepareAction. Struts repopulates your form with request parameters, so if the parameter is mentioned in the request and it is emply, Struts will clear the value you've set. Also check your reset() method, Struts will call it before populating the form. This method is called from both of your actions, and you should not clear your form if PrepareAction is called. On 9/19/06, fea jabi [EMAIL PROTECTED] wrote: In struts config have a Dynavalidator form-bean form-bean name=Form1 type= DynaValidatorForm form-property name=typeName type=java.lang.String/ .. /form-bean have prepare(Action) and dispath(LookupDispatchAction) actions for the jsp in the config which are session scoped. action path=/PrepareAction type=com.PrepareAction name=Form1 scope=session forward name=success path=/pages/Accounts.jsp redirect=false/ /action action path=/DispatchAction type=com.DispatchAction name=Form1 scope=session parameter=method forward name=successCalc path=/PrepareAction.do redirect=false/ /action In the jsp have a submit button which dispatches to the dispatch action to one of the methods in it. I am setting one of the form property value in that method. public class DispatchAction extends LookupDispatchAction { protected Map getKeyMethodMap() { Map map = new HashMap(); map.put(btn.calc, calc); } public ActionForward calculate(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { DynaValidatorForm frm = (DynaValidatorForm)form; frm.set(typeName, x); return mapping.findForward(successCalc); } } setting the form-property value in the dispatch action i.e the typeName to x When it is sucess it is going back to the prepare action and the form property value is instead of x. checked at the first statement in the execute method in prepare action the form-property value is different. not sure why the form-property value is different in prepare action as before. When in dispatch action the form-bean had the right value i.e the form-property in form-bean to x. but when came to prepare it's value is lost. why is this happenning? how can this be fixed? Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Add fun gadgets and colorful themes to express yourself on Windows Live Spaces http://clk.atdmt.com/MSN/go/msnnkwsp007001msn/direct/01/?href=http://www.get.live.com/spaces/features - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: form-property value set in dispatch action is lost
Thanks for your responses. can someone help me with this please. Thanks. From: fea jabi [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org To: user@struts.apache.org Subject: Re: form-property value set in dispatch action is lost Date: Tue, 19 Sep 2006 16:53:57 -0400 sorry, it was a typo. I have a rigt method 'calc' itself. From: Wendy Smoak [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org To: Struts Users Mailing List user@struts.apache.org Subject: Re: form-property value set in dispatch action is lost Date: Tue, 19 Sep 2006 13:23:36 -0700 On 9/19/06, fea jabi [EMAIL PROTECTED] wrote: public class DispatchAction extends LookupDispatchAction { That's confusing... Struts already has a DispatchAction. protected Map getKeyMethodMap() { Map map = new HashMap(); map.put(btn.calc, calc); } public ActionForward calculate(ActionMapping mapping, This doesn't match. getKeyMethodMap should map property keys to method names. http://struts.apache.org/1.x/struts-extras/apidocs/org/apache/struts/actions/LookupDispatchAction.html Do you have another method called 'calc'? It's not clear that the 'calculate' method is even executing. -- Wendy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Get today's hot entertainment gossip http://movies.msn.com/movies/hotgossip - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Share your special moments by uploading 500 photos per month to Windows Live Spaces http://clk.atdmt.com/MSN/go/msnnkwsp007001msn/direct/01/?href=http://www.get.live.com/spaces/features - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
form-bean is not getting updated with the values entered
Have an ArrayList in the form-bean form-property name=payments type=java.util.ArrayList/ This contains the list of row objects required for the below table. using displaytag to display the the list of elements. display:table name=sessionScope.Form1.payments id=row requestURI=PrepareAction.do class=table1 .. display:column titleKey=lbl.payment c:set var=paymentPropertyName value=payments[${row_rowNum -1}].paymentAnn/ html:text name=Form1 property='%= pageContext.getAttribute (paymentPropertyName).toString() %' / /display:column ... /display:table I tried using the above code but, when the form is submitted the values entered in the input fields are not updated to the form-bean arraylist. Using validator for validation. that seams to be working fine but the form-beans ArrayList is not updated. what am I missing here? how to fix this? Thanks. _ Get today's hot entertainment gossip http://movies.msn.com/movies/hotgossip - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
form-property value set in dispatch action is lost
In struts config have a Dynavalidator form-bean form-bean name=Form1 type= DynaValidatorForm form-property name=typeName type=java.lang.String/ .. /form-bean have prepare(Action) and dispath(LookupDispatchAction) actions for the jsp in the config which are session scoped. action path=/PrepareAction type=com.PrepareAction name=Form1 scope=session forward name=success path=/pages/Accounts.jsp redirect=false/ /action action path=/DispatchAction type=com.DispatchAction name=Form1 scope=session parameter=method forward name=successCalc path=/PrepareAction.do redirect=false/ /action In the jsp have a submit button which dispatches to the dispatch action to one of the methods in it. I am setting one of the form property value in that method. public class DispatchAction extends LookupDispatchAction { protected Map getKeyMethodMap() { Map map = new HashMap(); map.put(btn.calc, calc); } public ActionForward calculate(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { DynaValidatorForm frm = (DynaValidatorForm)form; frm.set(typeName, x); return mapping.findForward(successCalc); } } setting the form-property value in the dispatch action i.e the typeName to x When it is sucess it is going back to the prepare action and the form property value is instead of x. checked at the first statement in the execute method in prepare action the form-property value is different. not sure why the form-property value is different in prepare action as before. When in dispatch action the form-bean had the right value i.e the form-property in form-bean to x. but when came to prepare it's value is lost. why is this happenning? how can this be fixed? Thanks. _ Express yourself - download free Windows Live Messenger themes! http://clk.atdmt.com/MSN/go/msnnkwme002001msn/direct/01/?href=http://imagine-msn.com/themes/vibe/default.aspx?locale=en-ussource=hmtagline - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: form-property value set in dispatch action is lost
I do have the dynamic=true set too. form-bean name=Form1 type= DynaValidatorForm dynamic=true form-property name=typeName type=java.lang.String/ .. /form-bean From: fea jabi [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org To: user@struts.apache.org Subject: form-property value set in dispatch action is lost Date: Tue, 19 Sep 2006 15:43:37 -0400 In struts config have a Dynavalidator form-bean form-bean name=Form1 type= DynaValidatorForm form-property name=typeName type=java.lang.String/ .. /form-bean have prepare(Action) and dispath(LookupDispatchAction) actions for the jsp in the config which are session scoped. action path=/PrepareAction type=com.PrepareAction name=Form1 scope=session forward name=success path=/pages/Accounts.jsp redirect=false/ /action action path=/DispatchAction type=com.DispatchAction name=Form1 scope=session parameter=method forward name=successCalc path=/PrepareAction.do redirect=false/ /action In the jsp have a submit button which dispatches to the dispatch action to one of the methods in it. I am setting one of the form property value in that method. public class DispatchAction extends LookupDispatchAction { protected Map getKeyMethodMap() { Map map = new HashMap(); map.put(btn.calc, calc); } public ActionForward calculate(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { DynaValidatorForm frm = (DynaValidatorForm)form; frm.set(typeName, x); return mapping.findForward(successCalc); } } setting the form-property value in the dispatch action i.e the typeName to x When it is sucess it is going back to the prepare action and the form property value is instead of x. checked at the first statement in the execute method in prepare action the form-property value is different. not sure why the form-property value is different in prepare action as before. When in dispatch action the form-bean had the right value i.e the form-property in form-bean to x. but when came to prepare it's value is lost. why is this happenning? how can this be fixed? Thanks. _ Express yourself - download free Windows Live Messenger themes! http://clk.atdmt.com/MSN/go/msnnkwme002001msn/direct/01/?href=http://imagine-msn.com/themes/vibe/default.aspx?locale=en-ussource=hmtagline - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ SearchYour way, your world, right now! http://imagine-windowslive.com/minisites/searchlaunch/?locale=en-usFORM=WLMTAG - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: form-property value set in dispatch action is lost
thanks for you reply. may I know why this has to be done. The form-bean is in session. I thought it can be set from any action. is it not so? From: Givler, Eric [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org To: Struts Users Mailing List user@struts.apache.org Subject: RE: form-property value set in dispatch action is lost Date: Tue, 19 Sep 2006 16:05:32 -0400 Do you have to issue code after the call here: frm.set(typeName, x); like: placeFormBackInScope( mapping, frm, request ); which would place the updated form back in scope: public void placeFormInScope(ActionMapping mapping, ActionForm form, HttpServletRequest request) { if (mapping.getScope().equalsIgnoreCase(REQUEST) ) { request.setAttribute( mapping.getName(), frm ); } else if ( mapping.getScope().equalsIgnoreCase(SESSION)) { HttpSession session = request.getSession(); session.setAttribute( mapping.getName(), frm ); } } -Original Message- From: fea jabi [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 19, 2006 3:44 PM To: user@struts.apache.org Subject: form-property value set in dispatch action is lost In struts config have a Dynavalidator form-bean form-bean name=Form1 type= DynaValidatorForm form-property name=typeName type=java.lang.String/ .. /form-bean have prepare(Action) and dispath(LookupDispatchAction) actions for the jsp in the config which are session scoped. action path=/PrepareAction type=com.PrepareAction name=Form1 scope=session forward name=success path=/pages/Accounts.jsp redirect=false/ /action action path=/DispatchAction type=com.DispatchAction name=Form1 scope=session parameter=method forward name=successCalc path=/PrepareAction.do redirect=false/ /action In the jsp have a submit button which dispatches to the dispatch action to one of the methods in it. I am setting one of the form property value in that method. public class DispatchAction extends LookupDispatchAction { protected Map getKeyMethodMap() { Map map = new HashMap(); map.put(btn.calc, calc); } public ActionForward calculate(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { DynaValidatorForm frm = (DynaValidatorForm)form; frm.set(typeName, x); return mapping.findForward(successCalc); } } setting the form-property value in the dispatch action i.e the typeName to x When it is sucess it is going back to the prepare action and the form property value is instead of x. checked at the first statement in the execute method in prepare action the form-property value is different. not sure why the form-property value is different in prepare action as before. When in dispatch action the form-bean had the right value i.e the form-property in form-bean to x. but when came to prepare it's value is lost. why is this happenning? how can this be fixed? Thanks. _ Express yourself - download free Windows Live Messenger themes! http://clk.atdmt.com/MSN/go/msnnkwme002001msn/direct/01/?href=http://imagine-msn.com/themes/vibe/default.aspx?locale=en-ussource=hmtagline - 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] _ Try the new Live Search today! http://imagine-windowslive.com/minisites/searchlaunch/?locale=en-usFORM=WLMTAG - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: form-property value set in dispatch action is lost
sorry, it was a typo. I have a rigt method 'calc' itself. From: Wendy Smoak [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org To: Struts Users Mailing List user@struts.apache.org Subject: Re: form-property value set in dispatch action is lost Date: Tue, 19 Sep 2006 13:23:36 -0700 On 9/19/06, fea jabi [EMAIL PROTECTED] wrote: public class DispatchAction extends LookupDispatchAction { That's confusing... Struts already has a DispatchAction. protected Map getKeyMethodMap() { Map map = new HashMap(); map.put(btn.calc, calc); } public ActionForward calculate(ActionMapping mapping, This doesn't match. getKeyMethodMap should map property keys to method names. http://struts.apache.org/1.x/struts-extras/apidocs/org/apache/struts/actions/LookupDispatchAction.html Do you have another method called 'calc'? It's not clear that the 'calculate' method is even executing. -- Wendy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Add fun gadgets and colorful themes to express yourself on Windows Live Spaces http://clk.atdmt.com/MSN/go/msnnkwsp007001msn/direct/01/?href=http://www.get.live.com/spaces/features - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: form-property value set in dispatch action is lost
sorry, it was a typo. I have a rigt method 'calc' itself. From: Wendy Smoak [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org To: Struts Users Mailing List user@struts.apache.org Subject: Re: form-property value set in dispatch action is lost Date: Tue, 19 Sep 2006 13:23:36 -0700 On 9/19/06, fea jabi [EMAIL PROTECTED] wrote: public class DispatchAction extends LookupDispatchAction { That's confusing... Struts already has a DispatchAction. protected Map getKeyMethodMap() { Map map = new HashMap(); map.put(btn.calc, calc); } public ActionForward calculate(ActionMapping mapping, This doesn't match. getKeyMethodMap should map property keys to method names. http://struts.apache.org/1.x/struts-extras/apidocs/org/apache/struts/actions/LookupDispatchAction.html Do you have another method called 'calc'? It's not clear that the 'calculate' method is even executing. -- Wendy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Get today's hot entertainment gossip http://movies.msn.com/movies/hotgossip - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
LookupDispatchAction call - onchange of an input field
Have a html:text . onchange of the value entered in this field, have to submit the form. Using LookupDispatchAction. script function onNumChange(numObj) document.forms[0].method.value=numPay; document.forms[0].submit(); } script html:hidden property=method/ // used for LookupDispatchAction html:text name=Form1 styleId=numID property=numPay onchange=onNumChange(this);/ IS it possible to submit a form onchange of a input field? the above is not working. How can this be done? Thanks. _ Get real-time traffic reports with Windows Live Local Search http://local.live.com/default.aspx?v=2cp=42.336065~-109.392273style=rlvl=4scene=3712634trfc=1 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
conditional required in struts validator
Have a Drop down and an input field. When user selects Type 1 from drop down only then the input field is required. otherwise it's not a required field. Looking at the validator guide in struts maybe I have to create a new validator rule which should check if drop down value Type 1. But not sure how to code to say that the input field is required here. How to do this? Thanks. _ Got something to buy, sell or swap? Try Windows Live Expo ttp://clk.atdmt.com/MSN/go/msnnkwex001001msn/direct/01/?href=http://expo.live.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
displaytag/ struts layout tag?
which one is preferable? When I posted here for pagination/sorting an year ago, I was pointed towards displaytag. I see that struts layout tag does these too. which one is preffered to use? Thanks. _ Get the new Windows Live Messenger! http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-ussource=wlmailtagline - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: validation of two form properties
can someone help me wih this please? Thanks. From: fea jabi [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org To: user@struts.apache.org Subject: validation of two form properties Date: Tue, 08 Aug 2006 15:50:58 -0400 have form properties a and b have to validate that property b is an integer, greater than 0 and also greater than form property a. field property=b depends=integer,validwhen msg name=integer key=errors.notvalid/ msg name=validwhen key=errors.notvalid/ var var-nametest/var-name var-value( (*this* = 0) and (*this* = a) )/var-value /var /field tried using the above. but not working. getting error message even when the form property is greater than zero and greater than a. what is missing here? Thanks. _ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
validation of two form properties
have form properties a and b have to validate that property b is an integer, greater than 0 and also greater than form property a. field property=b depends=integer,validwhen msg name=integer key=errors.notvalid/ msg name=validwhen key=errors.notvalid/ var var-nametest/var-name var-value( (*this* = 0) and (*this* = a) )/var-value /var /field tried using the above. but not working. getting error message even when the form property is greater than zero and greater than a. what is missing here? Thanks. _ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: validate integer with a comma thousands seperator using Validator
Thanks, Eric. From: Givler, Eric [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org To: Struts Users Mailing List user@struts.apache.org Subject: RE: validate integer with a comma thousands seperator using Validator Date: Thu, 3 Aug 2006 11:45:28 -0400 You could create another validator, and inside that perform a stripping of non-numeric characters (stripCommas), then execute code similar to the existing long range validator like this: /** * Determines if a formatted numeric value is between a range as defined by * the user-supplied variables: min and max * p * Note: The only formattting performed is stripping off any commas. If the * resulting number does not convert to a Long, then validation will fail as * well. * /p * p * Validation succeeds if: * ol *liThe value in question is null./li *liThe parsed field value is within the user-supplied range./li * /ol * /p * @return * @param application * @param request * @param errors * @param field * @param va * @param bean */ public static boolean validateFormattedLongRange( Object bean, ValidatorAction va, Field field, ActionMessages errors, HttpServletRequest request, ServletContext application) { System.out.println(*** validateFormattedLongRange ( + field.getProperty() + ) - START); boolean isValid = true; String value = null; value = ValidationUtils.evaluateBean(bean, field); if (!GenericValidator.isBlankOrNull(value)) { try { long minVal = Long.parseLong(field.getVarValue(min)); long maxVal = Long.parseLong(field.getVarValue(max)); // We don't want to do this unless we use map.put to show tampered value // value = value.replaceAll([^-0123456789.], ); value = value.replaceAll([,], ); long lngValue = Long.parseLong(value); if ((lngValue maxVal) || (lngValue minVal)) { errors.add(field.getKey(), Resources.getActionMessage(request, va, field)); isValid = false; } } catch (NumberFormatException nfex) { errors.add(field.getKey(), Resources.getActionMessage(request, va, field)); isValid = false; } } System.out.println(*** validateFormattedLongRange ( + field.getProperty() + ) - END, returning + isValid); return isValid; } Define this validator in validator-rules.xml: validator name=fmtLongRange classname=view.struts.validator.StrutsValidationExtensions method=validateFormattedLongRange methodParams=java.lang.Object, org.apache.commons.validator.ValidatorAction, org.apache.commons.validator.Field, org.apache.struts.action.ActionMessages, javax.servlet.http.HttpServletRequest, javax.servlet.ServletContext msg=errors.fmtLongRange /validator Add a rule for a field: field property=water_usage page=2 depends=fmtLongRange arg0 name=required key=Page_2.water_usage/ arg0 name=fmtLongRange key=Page_2.water_usage / arg1 name=fmtLongRange key=${var:min} resource=false/ arg2 name=fmtLongRange key=999,999,999 resource=false/ varvar-namemin/var-namevar-value0/var-value/var varvar-namemax/var-namevar-value9/var-value/var /field Define the message in the resource file (errors.fmtLongRange): errors.fmtLongRange={0} must be a valid whole number between {1} and {2}. -Original Message- From: fea jabi [mailto:[EMAIL PROTECTED] Sent: Thursday, August 03, 2006 10:01 AM To: user@struts.apache.org Subject: RE: validate integer with a comma thousands seperator using Validator can someone help me with this please? From: fea jabi [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org To: user@struts.apache.org Subject: validate integer with a comma thousands seperator using Validator Date: Wed, 02 Aug 2006 10:09:19 -0400 Using struts validator. have to validate the user entered value. The value entered should be a positive integer with a comma thousands seperator. the number need not be in thousands. I have as below to check for positive integer without comma seperator. but not sure how to validate if the user entered value with a comma seperator? i.e value like 25,349 // how to validate this? field property=hrs depends=integer,validwhen msg name=integer key=errors.notvalid/ msg name=validwhen key=errors.notvalid/ var
RE: validate integer with a comma thousands seperator using Validator
can someone help me with this please? From: fea jabi [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org To: user@struts.apache.org Subject: validate integer with a comma thousands seperator using Validator Date: Wed, 02 Aug 2006 10:09:19 -0400 Using struts validator. have to validate the user entered value. The value entered should be a positive integer with a comma thousands seperator. the number need not be in thousands. I have as below to check for positive integer without comma seperator. but not sure how to validate if the user entered value with a comma seperator? i.e value like 25,349 // how to validate this? field property=hrs depends=integer,validwhen msg name=integer key=errors.notvalid/ msg name=validwhen key=errors.notvalid/ var var-nametest/var-name var-value(*this* = 0)/var-value /var /field how to validate the user entered value with a comma seperator? Thanks. _ Dont just search. Find. Check out the new MSN Search! http://search.msn.click-url.com/go/onm00200636ave/direct/01/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Dont just search. Find. Check out the new MSN Search! http://search.msn.click-url.com/go/onm00200636ave/direct/01/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
validate integer with a comma thousands seperator using Validator
Using struts validator. have to validate the user entered value. The value entered should be a positive integer with a comma thousands seperator. the number need not be in thousands. I have as below to check for positive integer without comma seperator. but not sure how to validate if the user entered value with a comma seperator? i.e value like 25,349 // how to validate this? field property=hrs depends=integer,validwhen msg name=integer key=errors.notvalid/ msg name=validwhen key=errors.notvalid/ var var-nametest/var-name var-value(*this* = 0)/var-value /var /field how to validate the user entered value with a comma seperator? Thanks. _ Dont just search. Find. Check out the new MSN Search! http://search.msn.click-url.com/go/onm00200636ave/direct/01/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT]design help
can someone help me with this please? Thanks. From: fea jabi [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org To: user@struts.apache.org Subject: [OT]design help Date: Fri, 28 Jul 2006 13:09:46 -0400 have String array's which have values in them. dbValues[] newValues[] Have an object Customer which has row obj in a table in jsp page. This row obj basically has dbValues[0] , newValues[0] .. etc. In Prepare Action. Creating the list of Customer obj's that is put in the form-bean. struts-config. form-bean name=Form type=org.apache.struts.validator.DynaValidatorForm dynamic=true form-property name=custs type=java.util.ArrayList/ . /form-bean jsp: the customers are shown in the jsp in a table. I have to check if it's new customer then have to ask user if they want to put dbValues in the newValues. If the user presses 'yes' then have to put the dbValues in newValues and then create the rowObjects(i.e Customer Objects) and display them in jsp. Not sure how to do this. Before asking the user if they want to replace newValues, the rowsObjects are created. somehow have to create new rowObjects again. Using LookupDispatchAction. when the user presses 'yes' how is the user values 'yes' will be passed as i am using LookupDispatchAction which method gets executed? How to do this? Thanks. _ On the road to retirement? Check out MSN Life Events for advice on how to get there! http://lifeevents.msn.com/category.aspx?cid=Retirement - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT]design help
have String array's which have values in them. dbValues[] newValues[] Have an object Customer which has row obj in a table in jsp page. This row obj basically has dbValues[0] , newValues[0] .. etc. In Prepare Action. Creating the list of Customer obj's that is put in the form-bean. struts-config. form-bean name=Form type=org.apache.struts.validator.DynaValidatorForm dynamic=true form-property name=custs type=java.util.ArrayList/ . /form-bean jsp: the customers are shown in the jsp in a table. I have to check if it's new customer then have to ask user if they want to put dbValues in the newValues. If the user presses 'yes' then have to put the dbValues in newValues and then create the rowObjects(i.e Customer Objects) and display them in jsp. Not sure how to do this. Before asking the user if they want to replace newValues, the rowsObjects are created. somehow have to create new rowObjects again. Using LookupDispatchAction. when the user presses 'yes' how is the user values 'yes' will be passed as i am using LookupDispatchAction which method gets executed? How to do this? Thanks. _ On the road to retirement? Check out MSN Life Events for advice on how to get there! http://lifeevents.msn.com/category.aspx?cid=Retirement - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: errorStyleClass not working
Thanks, Niall. Got it working by installing as mentioned in the site you suggested to look. And, by giving the below in the validation.xml Have just a single question though. Want to display just a single error message and highlight all the errors. Highlighting is working fine. But it's displaying the messages for all the error fields. Is it possible to display just a single message instead of all the error messages? how can this be achieved? have the below in the JSP. logic:messagesPresent UL html:messages id=error span class=errorsLIc:out value=${error}//LI/span /html:messages /UL /logic:messagesPresent form name=Form field property=hrs depends=extends var var-nameextends/var-name var-valueAdHrs/var-value /var /field /form form name=AdHrs field property=adHrs depends=integer,validwhen msg name=integer key=lbl.notvalidnumber/ msg name=validwhen key=lbl.notvalidnumber/ var var-nametest/var-name var-value(*this* = 0)/var-value /var /field /form Thanks. From: Niall Pemberton [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org To: Struts Users Mailing List user@struts.apache.org Subject: Re: errorStyleClass not working Date: Fri, 21 Jul 2006 23:29:47 +0100 On 7/21/06, David Friedman [EMAIL PROTECTED] wrote: You should find out what version of the commons validator you are using. Notes from the Jakarts Commons Validator site shows that older versions may stop on the first error for INDEXED properties. It sounds like your form uses and indexed property. See notes like this: http://mail-archives.apache.org/mod_mbox/struts-user/200508.mbox/%3CE4CD19A7 [EMAIL PROTECTED] It seems that even the latest greatest stable version of Struts hasn't upgraded the jakarta commons validator to that high a level so you are probably best off trying to swap commons-validator.jar files and see if everything works right with your indexed properties. Yes Struts 1.2.9 is distributed with Validator 1.1.4 - but you can upgrade to the latest Validator 1.3.0 (upcoming Struts 1.3.5 has that dependency) with Struts 1.2.9 which is what I have deployed. Having said that Validator 1.3.0 won't resolve this issue for you anyway - the only thing I know of is a small extension I wrote quite a while ago that can do this: http://www.niallp.pwp.blueyonder.co.uk/strutsvalidatorextends.html Niall I'm out of ideas at this point so good luck (Unles Niall has any ideas). Regards, David -Original Message- From: fea jabi [mailto:[EMAIL PROTECTED] Sent: Friday, July 21, 2006 9:13 AM To: user@struts.apache.org Subject: RE: errorStyleClass not working I think the problem is on server side. As in the dispatch aciton, the below statement org.apache.struts.action.ActionErrors errors = frm.validate( mapping, request ); is returning just one error even when the 2 entries entered by user are invalid. only after fixing the first the second error is getting highlighted. validation.xml formset form name=Form field property=adHrs indexedListProperty=hrs depends=integer,validwhen msg name=integer key=lbl.notvalid/ msg name=validwhen key=lbl.notvalid/ var var-nametest/var-name var-value(*this* = 0)/var-value /var /field /form /formset I tried giving the below plug-in too. But it's the same. only one error gets highlighted. What else can I try to make all the errors get highlighted. Not sure why the validate is returning one one error when there are 2 entries that are invalid? Thanks. From: David Friedman [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org To: Struts Users Mailing List user@struts.apache.org Subject: RE: errorStyleClass not working Date: Thu, 20 Jul 2006 17:23:48 -0400 Is your problem server side or client side? If you problem is client side then you should read the struts javadocs: http://struts.apache.org/1.2.7/api/org/apache/struts/validator/ValidatorPlu g In.html Or the User Guides: http://struts.apache.org/1.x/faqs/validator.html Both of them mention a plugin property stopOnFirstError: plug-in className=org.apache.struts.validator.ValidatorPlugIn set-property property=pathnames value=/WEB-INF/validator-rules.xml,/WEB-INF/validations.xml/ set-property property=stopOnFirstError value=false/ /plug-in * Also, if you want to use the errorStyleClass with your validation I think I understand your problem now. At the very bottom of this letter I left in a copy of the code you described using in your dispatch action. You save errors with 'saveMessages(request, messages
Re: errorStyleClass not working
got this working too. logic:messagesPresent fmt:message var=errrorMsg key=lbl.notvalidNumber bundle=${appbundle}/ span class=errorsc:out value=${errrorMsg}//span /logic:messagesPresent Thanks a lot David and Niall. From: fea jabi [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org To: user@struts.apache.org Subject: Re: errorStyleClass not working Date: Mon, 24 Jul 2006 13:51:43 -0400 Thanks, Niall. Got it working by installing as mentioned in the site you suggested to look. And, by giving the below in the validation.xml Have just a single question though. Want to display just a single error message and highlight all the errors. Highlighting is working fine. But it's displaying the messages for all the error fields. Is it possible to display just a single message instead of all the error messages? how can this be achieved? have the below in the JSP. logic:messagesPresent UL html:messages id=error span class=errorsLIc:out value=${error}//LI/span /html:messages /UL /logic:messagesPresent form name=Form field property=hrs depends=extends var var-nameextends/var-name var-valueAdHrs/var-value /var /field /form form name=AdHrs field property=adHrs depends=integer,validwhen msg name=integer key=lbl.notvalidnumber/ msg name=validwhen key=lbl.notvalidnumber/ var var-nametest/var-name var-value(*this* = 0)/var-value /var /field /form Thanks. From: Niall Pemberton [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org To: Struts Users Mailing List user@struts.apache.org Subject: Re: errorStyleClass not working Date: Fri, 21 Jul 2006 23:29:47 +0100 On 7/21/06, David Friedman [EMAIL PROTECTED] wrote: You should find out what version of the commons validator you are using. Notes from the Jakarts Commons Validator site shows that older versions may stop on the first error for INDEXED properties. It sounds like your form uses and indexed property. See notes like this: http://mail-archives.apache.org/mod_mbox/struts-user/200508.mbox/%3CE4CD19A7 [EMAIL PROTECTED] It seems that even the latest greatest stable version of Struts hasn't upgraded the jakarta commons validator to that high a level so you are probably best off trying to swap commons-validator.jar files and see if everything works right with your indexed properties. Yes Struts 1.2.9 is distributed with Validator 1.1.4 - but you can upgrade to the latest Validator 1.3.0 (upcoming Struts 1.3.5 has that dependency) with Struts 1.2.9 which is what I have deployed. Having said that Validator 1.3.0 won't resolve this issue for you anyway - the only thing I know of is a small extension I wrote quite a while ago that can do this: http://www.niallp.pwp.blueyonder.co.uk/strutsvalidatorextends.html Niall I'm out of ideas at this point so good luck (Unles Niall has any ideas). Regards, David -Original Message- From: fea jabi [mailto:[EMAIL PROTECTED] Sent: Friday, July 21, 2006 9:13 AM To: user@struts.apache.org Subject: RE: errorStyleClass not working I think the problem is on server side. As in the dispatch aciton, the below statement org.apache.struts.action.ActionErrors errors = frm.validate( mapping, request ); is returning just one error even when the 2 entries entered by user are invalid. only after fixing the first the second error is getting highlighted. validation.xml formset form name=Form field property=adHrs indexedListProperty=hrs depends=integer,validwhen msg name=integer key=lbl.notvalid/ msg name=validwhen key=lbl.notvalid/ var var-nametest/var-name var-value(*this* = 0)/var-value /var /field /form /formset I tried giving the below plug-in too. But it's the same. only one error gets highlighted. What else can I try to make all the errors get highlighted. Not sure why the validate is returning one one error when there are 2 entries that are invalid? Thanks. From: David Friedman [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org To: Struts Users Mailing List user@struts.apache.org Subject: RE: errorStyleClass not working Date: Thu, 20 Jul 2006 17:23:48 -0400 Is your problem server side or client side? If you problem is client side then you should read the struts javadocs: http://struts.apache.org/1.2.7/api/org/apache/struts/validator/ValidatorPlu g In.html Or the User Guides: http://struts.apache.org/1.x/faqs/validator.html Both of them mention a plugin property stopOnFirstError: plug-in className
RE: errorStyleClass not working
Thanks a lot, David for your help. From: David Friedman [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org To: Struts Users Mailing List user@struts.apache.org Subject: RE: errorStyleClass not working Date: Fri, 21 Jul 2006 13:16:21 -0400 You should find out what version of the commons validator you are using. Notes from the Jakarts Commons Validator site shows that older versions may stop on the first error for INDEXED properties. It sounds like your form uses and indexed property. See notes like this: http://mail-archives.apache.org/mod_mbox/struts-user/200508.mbox/%3CE4CD19A7 [EMAIL PROTECTED] It seems that even the latest greatest stable version of Struts hasn't upgraded the jakarta commons validator to that high a level so you are probably best off trying to swap commons-validator.jar files and see if everything works right with your indexed properties. I'm out of ideas at this point so good luck (Unles Niall has any ideas). Regards, David -Original Message- From: fea jabi [mailto:[EMAIL PROTECTED] Sent: Friday, July 21, 2006 9:13 AM To: user@struts.apache.org Subject: RE: errorStyleClass not working I think the problem is on server side. As in the dispatch aciton, the below statement org.apache.struts.action.ActionErrors errors = frm.validate( mapping, request ); is returning just one error even when the 2 entries entered by user are invalid. only after fixing the first the second error is getting highlighted. validation.xml formset form name=Form field property=adHrs indexedListProperty=hrs depends=integer,validwhen msg name=integer key=lbl.notvalid/ msg name=validwhen key=lbl.notvalid/ var var-nametest/var-name var-value(*this* = 0)/var-value /var /field /form /formset I tried giving the below plug-in too. But it's the same. only one error gets highlighted. What else can I try to make all the errors get highlighted. Not sure why the validate is returning one one error when there are 2 entries that are invalid? Thanks. From: David Friedman [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org To: Struts Users Mailing List user@struts.apache.org Subject: RE: errorStyleClass not working Date: Thu, 20 Jul 2006 17:23:48 -0400 Is your problem server side or client side? If you problem is client side then you should read the struts javadocs: http://struts.apache.org/1.2.7/api/org/apache/struts/validator/ValidatorPlu g In.html Or the User Guides: http://struts.apache.org/1.x/faqs/validator.html Both of them mention a plugin property stopOnFirstError: plug-in className=org.apache.struts.validator.ValidatorPlugIn set-property property=pathnames value=/WEB-INF/validator-rules.xml,/WEB-INF/validations.xml/ set-property property=stopOnFirstError value=false/ /plug-in * Also, if you want to use the errorStyleClass with your validation I think I understand your problem now. At the very bottom of this letter I left in a copy of the code you described using in your dispatch action. You save errors with 'saveMessages(request, messages);' which presumably saves messages in the Globals.MESSAGE_KEY. If you switch to 'saveErrors(request, messages);' then it will save them in the Globals.ERROR_KEY which is used by the errorStyleClass so it should be able to detect you have an ERROR and automatically insert the html for class='errorMsg' whenever an error is found. For more information see this link where they talk about ERRORS and MESSAGES being saved under different keys, as I've mentioned in my previous posts: http://struts.apache.org/1.x/struts-core/apidocs/org/apache/struts/action/A c tion.html Regards, David On 7/19/06, fea jabi [EMAIL PROTECTED] wrote: Yah, in the JSP where the errorStyleClass is working I am using html:errors property=name/ So, do I have to use html:errors? not html:messages? yes, I am using DynaValidatorForm but calling validate from action class. The validation is done in validator.xml In dispath action class I have ActionMessages messages = (ActionMessages)frm.validate( mapping, request ); if ( messages != null !messages.isEmpty() ) { saveMessages(request, messages); return (mapping.findForward(validationFailed)); } Should I be saving action errors instead of ActionMessages? Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Dont just search. Find. Check out the new MSN Search! http://search.msn.click-url.com/go/onm00200636ave/direct/01/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail
Re: errorStyleClass not working
Thankyou all for helping me working on this. I have one morequestion on this. have couple of input field in a column of a table. Using indexed properties for the input fields and validating using the same. When the user entered wrong values in more than one input field, the Validator is returning only one error the first one and displays the same and highlights the first error input field. Only after correcting the first and press a button which validates the form again and then the second error is shown/highlighted. Is it possible to highlight all the error input fields using index properties? how can this be done? Thanks. From: Niall Pemberton [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org To: Struts Users Mailing List user@struts.apache.org Subject: Re: errorStyleClass not working Date: Thu, 20 Jul 2006 00:45:41 +0100 See 1. Why have two JSP tags that do the same job?: http://www.niallp.pwp.blueyonder.co.uk/HelpTagsErrorsAndMessages.html ..and follow the link to the Wiki regarding ActionErrors/ActionMessages: http://wiki.apache.org/struts/ActionErrorsAndActionMessages Niall On 7/19/06, fea jabi [EMAIL PROTECTED] wrote: Yah, in the JSP where the errorStyleClass is working I am using html:errors property=name/ So, do I have to use html:errors? not html:messages? yes, I am using DynaValidatorForm but calling validate from action class. The validation is done in validator.xml In dispath action class I have ActionMessages messages = (ActionMessages)frm.validate( mapping, request ); if ( messages != null !messages.isEmpty() ) { saveMessages(request, messages); return (mapping.findForward(validationFailed)); } Should I be saving action errors instead of ActionMessages? Thanks. From: David Friedman [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org To: Struts Users Mailing List user@struts.apache.org Subject: RE: errorStyleClass not working Date: Wed, 19 Jul 2006 14:51:48 -0400 There is something odd going on here. In the JSP's where the html:messages and errorStyleClass are working, do you have html:messages setting 'message=true'? This is odd because that changes the key from Globals.MESSAGE_KEY to Global.ERROR_KEY. Action1 Html tags perform error lookups (I just checked the SVN repos) using in the Globals.ERROR_KEY, not the Globals.MESSAGE_KEY. That makes me wonder: Are the error messages you are seeing on this page (the page where errorStyleClass is not working) the ones you saved INSIDE your action or are you 100% sure these are validation errors from the DynaValidatorForm? What do you see when you remove the 'message=true' from your html:messages tag and then run your action? See this page for what I'm talking about: http://husted.com/struts/tips/017.html Take a look at your logic:messagesPresent tag doing the same thing. This is the current SVN java code ( just a snippet ) that is important: public class MessagesPresentTag extends ConditionalTagBase { /** * If this is set to 'true', then the codeGlobals.MESSAGE_KEY/code * will be used to retrieve the messages from scope. */ protected String message = null; public MessagesPresentTag() { name = Globals.ERROR_KEY; } // ... End of snippet, lots cut but you get the idea that // you are changing the keys to NOT use the Globals.ERROR_KEY // that I believe errorStyleClass is using. } Regards, David -Original Message- From: fea jabi [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 19, 2006 1:57 PM To: user@struts.apache.org Subject: RE: errorStyleClass not working yes, using 1.2.7 version of struts. This(errorStyleClass) does work in another page though whose property is in Form-bean. But here in this page, I have the arraylist in the form-bean, and the arraylist contains the list of objects whose one of the attribute is shown in the input field. probably something is missing here. actually showing the messages. I can see the message entered value is not valid. logic:messagesPresent message=true UL html:messages id=error message=true span class=errorsLIc:out value=${error}//LI/span /html:messages /UL /logic:messagesPresent From: David Friedman [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org To: Struts Users Mailing List user@struts.apache.org Subject: RE: errorStyleClass not working Date: Wed, 19 Jul 2006 13:36:10 -0400 I see your final output does not list the class=... attribute. What version of struts are you using? Accoring to the release notes, only versions 1.2.7 and above have the errorStyleClass attributes in them. Are you sure your version supports errorStyleClass? And we ARE talking the output of your html:text tag on a page which also shows the actual errors, via
Re: logic:messagesPresent not working for nestedProperty
Thanks for your response. I am doing the below in Dispatch Action ActionMessages messages = (ActionMessages)frm.validate( mapping, request ); if ( messages != null !messages.isEmpty() ) { saveMessages(request, messages); return (mapping.findForward(validationFailed)); } Because it's Messages that I saved, probabaly have to give message=true in the tags logic:messagesPresent and html:messages tags. Is that right?? Thanks. From: Laurie Harper [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org To: user@struts.apache.org Subject: Re: logic:messagesPresent not working for nestedProperty Date: Tue, 18 Jul 2006 16:41:51 -0400 It depends how the messages were generated. Struts keeps two sets of messages: errors and general messages. The 'messages' attribute allows you to select which set to examine. How are you generating the messages? L. fea jabi wrote: Thanks, that worked giving messages=true on the logic:messagesPresent and html:messages tags But not sure when this has to be given? ActionMessages are saved have to give this??? Thanks. From: Laurie Harper [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org To: user@struts.apache.org Subject: Re: logic:messagesPresent not working for nestedProperty Date: Thu, 13 Jul 2006 15:39:03 -0400 Are you sure the messsges are stored as error messages? What happens if you include messages=true on the logic:messagesPresent and html:messages tags? L. fea jabi wrote: Validator messages are not getting displayed in JSP. When debugged the code i.e JSP, I see the RequestAttributes does contain the ActionErrors object and the also the messages in it. the message has Key is ___ hrs[1].adHrs value is _ lbl.notvalidnumber have the below in the JSP logic:messagesPresent UL html:messages id=error LIbean:write name=error//LI /html:messages /UL /logic:messagesPresent What's missing here? Thanks. _ Dont just search. Find. Check out the new MSN Search! http://search.msn.click-url.com/go/onm00200636ave/direct/01/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ FREE pop-up blocking with the new MSN Toolbar get it now! http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ FREE pop-up blocking with the new MSN Toolbar get it now! http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: errorStyleClass not working
can someone help me with this please. Thanks. From: fea jabi [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org To: user@struts.apache.org Subject: errorStyleClass not working Date: Mon, 17 Jul 2006 11:44:49 -0400 struts-config form-bean name=Form type=org.apache.struts.validator.DynaValidatorForm dynamic=true form-property name=hrs type=java.util.ArrayList/ . /form-bean JSP: html:form action=DispatchAction.do method=post fmt:setBundle var=appbundle basename=MessageResources/ logic:messagesPresent message=true UL html:messages id=error message=true LIc:out value=${error}//LI /html:messages /UL /logic:messagesPresent display:table name=sessionScope.Form.hrs id=rows requestURI=PrepareAction.do ... display:column titleKey=lbl.hrs c:set var=g value=hrs[${rows_rowNum -1}].adHrs/ c:if test=${rows.adHrs != null} html:text property=%= pageContext.getAttribute(g).toString() % errorStyleClass=errormsg/ /c:if /display:column /display:table /html:form validation.xml formset form name=Form field property=adHrs indexedListProperty=hrs depends=integer,validwhen msg name=integer key=lbl.notvalid/ msg name=validwhen key=lbl.notvalid/ var var-nametest/var-name var-value(*this* = 0)/var-value /var /field /form /formset the error messages does display at the top. But the input field is not highlighted. Need help with highlighting. Thanks. _ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: errorStyleClass not working
Thanks for your response. a) Have you checked your output to make sure the class is set in the html when an error occurs? what class are you talking about here? yes, the css is embeded and the errormsg is also in there. It works fine in other pages. except for this nested page. .errormsg{ color: red; background: inherit; font-size: 11px; border: 1px solid red; padding: 3px; } Hoping to get an answer for this. Thanks. From: David Friedman [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org To: Struts Users Mailing List user@struts.apache.org Subject: RE: errorStyleClass not working Date: Wed, 19 Jul 2006 12:18:24 -0400 a) Have you checked your output to make sure the class is set in the html when an error occurs? b) What is the CSS you specify for that errormsg style definition? c) Have you embedded your style definition in the web page to ensure it is loaded properly? FireFox has a good plugin called web developer that includes a live CSS editor so you can make sure your css is loaded and adjust it to see how different changes alter your page appearance. Regards, David From: fea jabi [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org To: user@struts.apache.org Subject: errorStyleClass not working Date: Mon, 17 Jul 2006 11:44:49 -0400 ... display:column titleKey=lbl.hrs c:set var=g value=hrs[${rows_rowNum -1}].adHrs/ c:if test=${rows.adHrs != null} html:text property=%= pageContext.getAttribute(g).toString() % errorStyleClass=errormsg/ /c:if /display:column /display:table /html:form - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ FREE pop-up blocking with the new MSN Toolbar get it now! http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: errorStyleClass not working
Thanks for helping me. The web page has input type=text name=hrs[0].adHrs value=12 input type=text name=hrs[1].adHrs value=dgsadg You said nested page. Are you including one page inside another or do you simply mean nested inside a displaytag library tag? I mean nested inside a displaytag library tag. trying to validate the user entered values, here the 2nd one i.e name=hrs[1].adHrs checking if user entered numeric value. I am getting the error msg back too. But only the errorStyleClass is not working. Thanks. From: David Friedman [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org To: Struts Users Mailing List user@struts.apache.org Subject: RE: errorStyleClass not working Date: Wed, 19 Jul 2006 13:12:17 -0400 I was asking what your html:text tag outputs. Can you post what it puts into your web page (when you view the source of the generated page?) You know, the generated html code: (example below) input type=text name=something value=some value class=errormsg / For what it is worth, your css class definition worked fine in a test page / form of mine. You said nested page. Are you including one page inside another or do you simply mean nested inside a displaytag library tag? Regards, David -Original Message- From: fea jabi [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 19, 2006 12:53 PM To: user@struts.apache.org Subject: RE: errorStyleClass not working Thanks for your response. a) Have you checked your output to make sure the class is set in the html when an error occurs? what class are you talking about here? yes, the css is embeded and the errormsg is also in there. It works fine in other pages. except for this nested page. .errormsg{ color: red; background: inherit; font-size: 11px; border: 1px solid red; padding: 3px; } Hoping to get an answer for this. Thanks. From: David Friedman [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org To: Struts Users Mailing List user@struts.apache.org Subject: RE: errorStyleClass not working Date: Wed, 19 Jul 2006 12:18:24 -0400 a) Have you checked your output to make sure the class is set in the html when an error occurs? b) What is the CSS you specify for that errormsg style definition? c) Have you embedded your style definition in the web page to ensure it is loaded properly? FireFox has a good plugin called web developer that includes a live CSS editor so you can make sure your css is loaded and adjust it to see how different changes alter your page appearance. Regards, David From: fea jabi [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org To: user@struts.apache.org Subject: errorStyleClass not working Date: Mon, 17 Jul 2006 11:44:49 -0400 ... display:column titleKey=lbl.hrs c:set var=g value=hrs[${rows_rowNum -1}].adHrs/ c:if test=${rows.adHrs != null} html:text property=%= pageContext.getAttribute(g).toString() % errorStyleClass=errormsg/ /c:if /display:column /display:table /html:form - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ FREE pop-up blocking with the new MSN Toolbar get it now! http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/ - 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] _ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: errorStyleClass not working
yes, using 1.2.7 version of struts. This(errorStyleClass) does work in another page though whose property is in Form-bean. But here in this page, I have the arraylist in the form-bean, and the arraylist contains the list of objects whose one of the attribute is shown in the input field. probably something is missing here. actually showing the messages. I can see the message entered value is not valid. logic:messagesPresent message=true UL html:messages id=error message=true span class=errorsLIc:out value=${error}//LI/span /html:messages /UL /logic:messagesPresent From: David Friedman [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org To: Struts Users Mailing List user@struts.apache.org Subject: RE: errorStyleClass not working Date: Wed, 19 Jul 2006 13:36:10 -0400 I see your final output does not list the class=... attribute. What version of struts are you using? Accoring to the release notes, only versions 1.2.7 and above have the errorStyleClass attributes in them. Are you sure your version supports errorStyleClass? And we ARE talking the output of your html:text tag on a page which also shows the actual errors, via the html:errors tag, right? Regards, David -Original Message- From: fea jabi [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 19, 2006 1:28 PM To: user@struts.apache.org Subject: RE: errorStyleClass not working Thanks for helping me. The web page has input type=text name=hrs[0].adHrs value=12 input type=text name=hrs[1].adHrs value=dgsadg You said nested page. Are you including one page inside another or do you simply mean nested inside a displaytag library tag? I mean nested inside a displaytag library tag. trying to validate the user entered values, here the 2nd one i.e name=hrs[1].adHrs checking if user entered numeric value. I am getting the error msg back too. But only the errorStyleClass is not working. Thanks. From: David Friedman [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org To: Struts Users Mailing List user@struts.apache.org Subject: RE: errorStyleClass not working Date: Wed, 19 Jul 2006 13:12:17 -0400 I was asking what your html:text tag outputs. Can you post what it puts into your web page (when you view the source of the generated page?) You know, the generated html code: (example below) input type=text name=something value=some value class=errormsg / For what it is worth, your css class definition worked fine in a test page / form of mine. You said nested page. Are you including one page inside another or do you simply mean nested inside a displaytag library tag? Regards, David -Original Message- From: fea jabi [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 19, 2006 12:53 PM To: user@struts.apache.org Subject: RE: errorStyleClass not working Thanks for your response. a) Have you checked your output to make sure the class is set in the html when an error occurs? what class are you talking about here? yes, the css is embeded and the errormsg is also in there. It works fine in other pages. except for this nested page. .errormsg{ color: red; background: inherit; font-size: 11px; border: 1px solid red; padding: 3px; } Hoping to get an answer for this. Thanks. From: David Friedman [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org To: Struts Users Mailing List user@struts.apache.org Subject: RE: errorStyleClass not working Date: Wed, 19 Jul 2006 12:18:24 -0400 a) Have you checked your output to make sure the class is set in the html when an error occurs? b) What is the CSS you specify for that errormsg style definition? c) Have you embedded your style definition in the web page to ensure it is loaded properly? FireFox has a good plugin called web developer that includes a live CSS editor so you can make sure your css is loaded and adjust it to see how different changes alter your page appearance. Regards, David From: fea jabi [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org To: user@struts.apache.org Subject: errorStyleClass not working Date: Mon, 17 Jul 2006 11:44:49 -0400 ... display:column titleKey=lbl.hrs c:set var=g value=hrs[${rows_rowNum -1}].adHrs/ c:if test=${rows.adHrs != null} html:text property=%= pageContext.getAttribute(g).toString() % errorStyleClass=errormsg/ /c:if /display:column /display:table /html:form - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ FREE pop-up blocking with the new MSN Toolbar get it now! http
RE: errorStyleClass not working
Yah, in the JSP where the errorStyleClass is working I am using html:errors property=name/ So, do I have to use html:errors? not html:messages? yes, I am using DynaValidatorForm but calling validate from action class. The validation is done in validator.xml In dispath action class I have ActionMessages messages = (ActionMessages)frm.validate( mapping, request ); if ( messages != null !messages.isEmpty() ) { saveMessages(request, messages); return (mapping.findForward(validationFailed)); } Should I be saving action errors instead of ActionMessages? Thanks. From: David Friedman [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org To: Struts Users Mailing List user@struts.apache.org Subject: RE: errorStyleClass not working Date: Wed, 19 Jul 2006 14:51:48 -0400 There is something odd going on here. In the JSP's where the html:messages and errorStyleClass are working, do you have html:messages setting 'message=true'? This is odd because that changes the key from Globals.MESSAGE_KEY to Global.ERROR_KEY. Action1 Html tags perform error lookups (I just checked the SVN repos) using in the Globals.ERROR_KEY, not the Globals.MESSAGE_KEY. That makes me wonder: Are the error messages you are seeing on this page (the page where errorStyleClass is not working) the ones you saved INSIDE your action or are you 100% sure these are validation errors from the DynaValidatorForm? What do you see when you remove the 'message=true' from your html:messages tag and then run your action? See this page for what I'm talking about: http://husted.com/struts/tips/017.html Take a look at your logic:messagesPresent tag doing the same thing. This is the current SVN java code ( just a snippet ) that is important: public class MessagesPresentTag extends ConditionalTagBase { /** * If this is set to 'true', then the codeGlobals.MESSAGE_KEY/code * will be used to retrieve the messages from scope. */ protected String message = null; public MessagesPresentTag() { name = Globals.ERROR_KEY; } // ... End of snippet, lots cut but you get the idea that // you are changing the keys to NOT use the Globals.ERROR_KEY // that I believe errorStyleClass is using. } Regards, David -Original Message- From: fea jabi [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 19, 2006 1:57 PM To: user@struts.apache.org Subject: RE: errorStyleClass not working yes, using 1.2.7 version of struts. This(errorStyleClass) does work in another page though whose property is in Form-bean. But here in this page, I have the arraylist in the form-bean, and the arraylist contains the list of objects whose one of the attribute is shown in the input field. probably something is missing here. actually showing the messages. I can see the message entered value is not valid. logic:messagesPresent message=true UL html:messages id=error message=true span class=errorsLIc:out value=${error}//LI/span /html:messages /UL /logic:messagesPresent From: David Friedman [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org To: Struts Users Mailing List user@struts.apache.org Subject: RE: errorStyleClass not working Date: Wed, 19 Jul 2006 13:36:10 -0400 I see your final output does not list the class=... attribute. What version of struts are you using? Accoring to the release notes, only versions 1.2.7 and above have the errorStyleClass attributes in them. Are you sure your version supports errorStyleClass? And we ARE talking the output of your html:text tag on a page which also shows the actual errors, via the html:errors tag, right? Regards, David -Original Message- From: fea jabi [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 19, 2006 1:28 PM To: user@struts.apache.org Subject: RE: errorStyleClass not working Thanks for helping me. The web page has input type=text name=hrs[0].adHrs value=12 input type=text name=hrs[1].adHrs value=dgsadg You said nested page. Are you including one page inside another or do you simply mean nested inside a displaytag library tag? I mean nested inside a displaytag library tag. trying to validate the user entered values, here the 2nd one i.e name=hrs[1].adHrs checking if user entered numeric value. I am getting the error msg back too. But only the errorStyleClass is not working. Thanks. From: David Friedman [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org To: Struts Users Mailing List user@struts.apache.org Subject: RE: errorStyleClass not working Date: Wed, 19 Jul 2006 13:12:17 -0400 I was asking what your html:text tag outputs. Can you post what it puts into your web page (when you view the source of the generated page?) You know, the generated html code: (example below) input type=text