Re: How to use grid in struts 1.x
Hi, Do you want to use Dynamic table on browser side (javascript) or on server side / jsp? On JSP side you can use indexed or mapped properties and create table of input boxes. For more information http://mail-archives.apache.org/mod_mbox/struts-user/200710.mbox/[EMAIL PROTECTED] Thanks, Nikhil On Sun, Sep 21, 2008 at 11:02 AM, greatshalu.6 [EMAIL PROTECTED]wrote: Hi all, I want to use grid ( dynamic table) in struts 1.x and according to my knowledge there is no concept of grid in struts 1.x , please do tell me how can i form a grid in struts 1.x. Please provide me the solution. Thanks in advance. -- View this message in context: http://www.nabble.com/How-to-use-grid-in-struts-1.x-tp19591793p19591793.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Nikhil
Re: Query
You could use jQgrid, it has lots of options. http://www.trirand.com/jqgrid/jqgrid.html To use jqgrid you need to pass it the data via xml or json, so I recomend use the xslt or the json result of struts. You should not build the xml or the json using a jsp. It's not somewhat easy, but you will need to do your homework. Si quieres ser más positivo, pierde un electrón Miguel Ruiz Velasco S. On Sun, Sep 21, 2008 at 20:32, Jim Kiley [EMAIL PROTECTED] wrote: You're going to need to provide a lot more detail if you want a useful answer of any kind. On Sun, Sep 21, 2008 at 1:27 AM, greatshalu.6 [EMAIL PROTECTED]wrote: how we use grids in struts -- View this message in context: http://www.nabble.com/Query-tp19591765p19591765.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Jim Kiley Technical Consultant | Summa [p] 412.258.3346 [m] 412.445.1729 http://www.summa-tech.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
about ajax
Hallo I recently subscribe to the list, and I start working with ajax tags. Im using in a form some tabs, by inside a tab I need to use a form that will make a ajax post. I was trying a combination between htmlContent inside the ajax tabs, but in my java class I didn't receive any value in the form, everything is null. Any idea? Thank you in advance
Re: session based pojo as form variables
Ok I figured out what is happening with my s:submit method=pageForward attempt: If you specify a form action function (example, s:form action=sample!submit) it will supersede your submit's method parameter and the submit method will not get called. If I remove the !submit and make it action=sample then the submit method is getting called. Thanks for help on this one. 928572663 wrote: But I havent' seen anything in the framework yet on how to have a single form call different functions in the same action class based on which button was pushed. That's what s:submit...'s method attribute does. I removed the JavaScript and hidden var stuff and replaced it with this: s:submit type=image src=%{#next_button_url} label= cssClass=formButton method=pageForward / but when I click on the image button the form is submitted (my Action's submit() function is called) but my Action's pageForward() function didn't get called. The Tag Reference doc: http://struts.apache.org/2.0.11.1/docs/submit.html doesn't have much detail about what to expect: Set method attribute. Is my pageForward() method supposed to conform to a certain signature? Maybe this page can be updated to include this use case? http://struts.apache.org/2.x/docs/html-form-buttons-howto.html or http://struts.apache.org/2.x/docs/multiple-submit-buttons.html Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Query
If you are using jQuery try this also http://www.webplicity.net/flexigrid/ I felt its better polished and finished. Regards, Jishnu Viswanath Software Engineer *(+9180)41190300 - 222(Ext) ll * ( + 91 ) 9731209330ll Tavant Technologies Inc., www.tavant.com PEOPLE :: PASSION :: EXCELLENCE -Original Message- From: Miguel [mailto:[EMAIL PROTECTED] Sent: Monday, September 22, 2008 9:06 PM To: Struts Users Mailing List Subject: Re: Query You could use jQgrid, it has lots of options. http://www.trirand.com/jqgrid/jqgrid.html To use jqgrid you need to pass it the data via xml or json, so I recomend use the xslt or the json result of struts. You should not build the xml or the json using a jsp. It's not somewhat easy, but you will need to do your homework. Si quieres ser más positivo, pierde un electrón Miguel Ruiz Velasco S. On Sun, Sep 21, 2008 at 20:32, Jim Kiley [EMAIL PROTECTED] wrote: You're going to need to provide a lot more detail if you want a useful answer of any kind. On Sun, Sep 21, 2008 at 1:27 AM, greatshalu.6 [EMAIL PROTECTED]wrote: how we use grids in struts -- View this message in context: http://www.nabble.com/Query-tp19591765p19591765.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Jim Kiley Technical Consultant | Summa [p] 412.258.3346 [m] 412.445.1729 http://www.summa-tech.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Any comments or statements made in this email are not necessarily those of Tavant Technologies. The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. If you have received this in error, please contact the sender and delete the material from any computer. All e-mails sent from or to Tavant Technologies may be subject to our monitoring procedures. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Global result of type redirect
Ho all. I'm il train! It is possible in struts.xml to have global result of type redirect? My struts.xml doesn't give validation errors, but results or type redirect aren't visible ho the controller. Please help Gianluca Inviato da iPhone - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
two forms, two submits
Hello I have two non-nested forms, each with their own submit button and separate action destinations. The problem is when I click the second form the first form always fires. Should this, primitive, design work as intuitive with each only submitting to the action on the specific form that the submit button is clicked? tia.
RE: Query
great if we were programming php on Apache! I recommend the Dojo Grid control http://dojotoolkit.org/book/dijit-functional-spec/other-widgets/table anyone else? Martin __ Disclaimer and confidentiality note Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. Subject: RE: Query Date: Mon, 22 Sep 2008 21:29:17 +0530 From: [EMAIL PROTECTED] To: user@struts.apache.org If you are using jQuery try this also http://www.webplicity.net/flexigrid/ I felt its better polished and finished. Regards, Jishnu Viswanath Software Engineer *(+9180)41190300 - 222(Ext) ll * ( + 91 ) 9731209330ll Tavant Technologies Inc., www.tavant.com PEOPLE :: PASSION :: EXCELLENCE -Original Message- From: Miguel [mailto:[EMAIL PROTECTED] Sent: Monday, September 22, 2008 9:06 PM To: Struts Users Mailing List Subject: Re: Query You could use jQgrid, it has lots of options. http://www.trirand.com/jqgrid/jqgrid.html To use jqgrid you need to pass it the data via xml or json, so I recomend use the xslt or the json result of struts. You should not build the xml or the json using a jsp. It's not somewhat easy, but you will need to do your homework. Si quieres ser más positivo, pierde un electrón Miguel Ruiz Velasco S. On Sun, Sep 21, 2008 at 20:32, Jim Kiley [EMAIL PROTECTED] wrote: You're going to need to provide a lot more detail if you want a useful answer of any kind. On Sun, Sep 21, 2008 at 1:27 AM, greatshalu.6 [EMAIL PROTECTED]wrote: how we use grids in struts -- View this message in context: http://www.nabble.com/Query-tp19591765p19591765.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Jim Kiley Technical Consultant | Summa [p] 412.258.3346 [m] 412.445.1729 http://www.summa-tech.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Any comments or statements made in this email are not necessarily those of Tavant Technologies. The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. If you have received this in error, please contact the sender and delete the material from any computer. All e-mails sent from or to Tavant Technologies may be subject to our monitoring procedures. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Stay up to date on your PC, the Web, and your mobile phone with Windows Live. http://clk.atdmt.com/MRT/go/msnnkwxp1020093185mrt/direct/01/
Struts 2 Prepare Interceptor, CRUD Pattern and Optimistic Locking
Also posted to Struts 2 forum on Nabble - apologies if this causes a duplicate posting. Planning to use Struts 2 and JPA (OpenJPA) in a new application development and am spending some time to review options of how it should be done. There will be a large CRUD component within the application so I am working on the patterns to use in those scenarios. Following the CRUD examples in the Struts 2 In Action (and other sources), I have been experimenting with the ParamsPrepareParams stack. Using the pattern shown in the Struts 2 in Action book, the following is my understanding of the relevant points in the execution path. - when an edit (save) action is called the prepare() method retrieves the model object from the database (because there is an ID in the HTTP Request parameters). - the Params interceptor is invoked then loads the values from the HTTP Request parameters. None of the documentation describes why this is done, I assume the reason is to ensure that the Model object is fully populated (not all of the attributes may be on the UI and thus in the HTTP Request parameters). - the action is then invoked - and persists the updated Model object (delegated to a service) From what I can see, this causes a conflicts with the use of a version attribute for Optimistic Locking on the database. When the updates from the HTTP Request parameters are merged in with a newly retrieved model object the version number/timestamp is the value retrieved from the database. Even if that row had been updated by another user/thread since being retrieved the first time, the version checking would not catch the conflicting updates becuase it has been refreshed to the latest value in the DB. It seems a fairly fundamental and obvious problem so I am worried that I am mis-understanding the pattern described in the book (and repeated in other samples). I know that the examples in the book are simplified, but I would expect something like this to be commented on in the text. Am I missing something ??? Can anybody confirm or contradict my reasoning? -- View this message in context: http://www.nabble.com/Struts-2-Prepare-Interceptor%2C-CRUD-Pattern-and-Optimistic-Locking-tp19612252p19612252.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: two forms, two submits
I guess you should be more specific about the problem, what is the theme you are using ? The answer to your question is yes, it is working intuitively, as I use it in my own projects. - Pascal http://www.cameleon-sporting.com cpanon wrote: Hello I have two non-nested forms, each with their own submit button and separate action destinations. The problem is when I click the second form the first form always fires. Should this, primitive, design work as intuitive with each only submitting to the action on the specific form that the submit button is clicked? tia. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: context value
Thanks for your answer. I don't know what's happening with my thread but I can't see your answer on nabble. Not a problem, I can see it in an other way. But your answer doesn't explain me why the attribute is lost between two struts actions, or I don't understand. The real problem is that an attribute, contained in the context, exists in a first stuts action, and not in a second one. And the two actions are the one after the other, like in my example: http://www.nabble.com/context-value-to19593451.html I hope I am clear. Thanks in advance. mgainty wrote: access it with straight web.xml context-param context-param param-namequalifying_requirements/param-name param-valuepoor_english/param-value /context-param //you can then access it via getServletContext().getInitParameter(qualifying_requirements);Is there something specific you needed? Martin __ Disclaimer and confidentiality note Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. Date: Sun, 21 Sep 2008 04:07:53 -0700 From: [EMAIL PROTECTED] To: user@struts.apache.org Subject: context value Hello, sorry for my bad english. Does someone knows why a context value could be lost between two struts actions? For an example, In SecondAction: req.getSession(true).getServletContext().getAttribute(key)) returns value, In ThirdAction: req.getSession(true).getServletContext().getAttribute(key)) returns null with the following struts actions: action path=/secondAction name=secondAction type=appli.struts.actions.SecondAction forward name=valid path=/thirdAction.do/ forward name=invalid path=/error.jsp / /action action path=/thirdAction name=thirdAction type=appli.struts.actions.ThirdAction forward name=valid path=/result2.jsp / forward name=invalid path=/error.jsp / /action I haven't this problem when I do this at home, with a simple configuration. But is there something that could explain that I have this problem at work in your advice? Configuration parameters, the scope of the context, etc... ? Thank you in advance. -- View this message in context: http://www.nabble.com/context-value-tp19593451p19593451.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Stay up to date on your PC, the Web, and your mobile phone with Windows Live. http://clk.atdmt.com/MRT/go/msnnkwxp1020093185mrt/direct/01/ -- View this message in context: http://www.nabble.com/context-value-tp19593451p19613111.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Query
That's really weird, I can not find any thing so php specific with grid, its plain simple grid. Bye the way, dojo 1.1 has grid, or was it 1.0 Well I personally did not like the grid implementation, mainly one reason, sluggish, heavy. I do remember some other contributed and they migrated it to dojo, I read it some where but I am not sure about it. Well who cares about it. I would recommend still to use jQuery, personally I am a big fan of dojo(Only second to extjs) but Grid is something really heavy and jQuery is simple CSS based rules work much faster on grid. PS: jQuery, dojo, ext every thing is js no relation with PHP/ASP/JSP correct me if I am wrong. PS2: If you are using dojo grid with original ajax frame work with struts2 which uses .4 and the grid is 1.1(1.2) where the API's are entirely diffrenet? Well rewrite every ajax widget you want, as we did, or put grid in a different frame if you still use dojo. Regards, Jishnu Viswanath Software Engineer *(+9180)41190300 - 222(Ext) ll * ( + 91 ) 9731209330ll Tavant Technologies Inc., www.tavant.com PEOPLE :: PASSION :: EXCELLENCE -Original Message- From: Martin Gainty [mailto:[EMAIL PROTECTED] Sent: Monday, September 22, 2008 10:35 PM To: Struts Users Mailing List Subject: RE: Query great if we were programming php on Apache! I recommend the Dojo Grid control http://dojotoolkit.org/book/dijit-functional-spec/other-widgets/table anyone else? Martin __ Disclaimer and confidentiality note Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. Subject: RE: Query Date: Mon, 22 Sep 2008 21:29:17 +0530 From: [EMAIL PROTECTED] To: user@struts.apache.org If you are using jQuery try this also http://www.webplicity.net/flexigrid/ I felt its better polished and finished. Regards, Jishnu Viswanath Software Engineer *(+9180)41190300 - 222(Ext) ll * ( + 91 ) 9731209330ll Tavant Technologies Inc., www.tavant.com PEOPLE :: PASSION :: EXCELLENCE -Original Message- From: Miguel [mailto:[EMAIL PROTECTED] Sent: Monday, September 22, 2008 9:06 PM To: Struts Users Mailing List Subject: Re: Query You could use jQgrid, it has lots of options. http://www.trirand.com/jqgrid/jqgrid.html To use jqgrid you need to pass it the data via xml or json, so I recomend use the xslt or the json result of struts. You should not build the xml or the json using a jsp. It's not somewhat easy, but you will need to do your homework. Si quieres ser más positivo, pierde un electrón Miguel Ruiz Velasco S. On Sun, Sep 21, 2008 at 20:32, Jim Kiley [EMAIL PROTECTED] wrote: You're going to need to provide a lot more detail if you want a useful answer of any kind. On Sun, Sep 21, 2008 at 1:27 AM, greatshalu.6 [EMAIL PROTECTED]wrote: how we use grids in struts -- View this message in context: http://www.nabble.com/Query-tp19591765p19591765.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Jim Kiley Technical Consultant | Summa [p] 412.258.3346 [m] 412.445.1729 http://www.summa-tech.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Any comments or statements made in this email are not necessarily those of Tavant Technologies. The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. If you have received this in error, please contact the sender and delete the material from any computer. All e-mails sent from or to Tavant Technologies may be subject to our monitoring procedures. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Stay up to date on your PC, the Web, and your mobile phone with Windows Live. http://clk.atdmt.com/MRT/go/msnnkwxp1020093185mrt/direct/01/ Any comments or statements made in this email are not necessarily those of Tavant Technologies. The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. If you have received this in error, please contact the sender and delete the material from any computer. All e-mails sent from or to Tavant
Re: Global result of type redirect
Are you saying you want to set the default result type to redirect globally or that you just want a global result type of redirect to be available to your actions? If the former, just redefine the redirect result type in your package and set it to default=true, like: result-types result-type name=redirect class=org.apache.struts2.dispatcher.ServletRedirectResult default=true/ /result-types If the latter, make sure your package extends struts-default that's where all the standard result types get defined. (*Chris*) On Mon, Sep 22, 2008 at 9:25 AM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Ho all. I'm il train! It is possible in struts.xml to have global result of type redirect? My struts.xml doesn't give validation errors, but results or type redirect aren't visible ho the controller. Please help Gianluca Inviato da iPhone - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 2 Prepare Interceptor, CRUD Pattern and Optimistic Locking
I agree that using the paramsPrepareParams is not the ideal stack to handle optimistic locking. However, assuming that you are not losing the original version number (for example if you are submitting it as a hidden field of your edit form), and you can reassign it to the appropriate POJO field through the parameters interceptor, at the end, if there is a conflict in version numbers between the original and the just loaded object, still you have all the necessary information to detect the conflict. 2008/9/22 Frank D. [EMAIL PROTECTED]: Also posted to Struts 2 forum on Nabble - apologies if this causes a duplicate posting. Planning to use Struts 2 and JPA (OpenJPA) in a new application development and am spending some time to review options of how it should be done. There will be a large CRUD component within the application so I am working on the patterns to use in those scenarios. Following the CRUD examples in the Struts 2 In Action (and other sources), I have been experimenting with the ParamsPrepareParams stack. Using the pattern shown in the Struts 2 in Action book, the following is my understanding of the relevant points in the execution path. - when an edit (save) action is called the prepare() method retrieves the model object from the database (because there is an ID in the HTTP Request parameters). - the Params interceptor is invoked then loads the values from the HTTP Request parameters. None of the documentation describes why this is done, I assume the reason is to ensure that the Model object is fully populated (not all of the attributes may be on the UI and thus in the HTTP Request parameters). - the action is then invoked - and persists the updated Model object (delegated to a service) From what I can see, this causes a conflicts with the use of a version attribute for Optimistic Locking on the database. When the updates from the HTTP Request parameters are merged in with a newly retrieved model object the version number/timestamp is the value retrieved from the database. Even if that row had been updated by another user/thread since being retrieved the first time, the version checking would not catch the conflicting updates becuase it has been refreshed to the latest value in the DB. It seems a fairly fundamental and obvious problem so I am worried that I am mis-understanding the pattern described in the book (and repeated in other samples). I know that the examples in the book are simplified, but I would expect something like this to be commented on in the text. Am I missing something ??? Can anybody confirm or contradict my reasoning? -- View this message in context: http://www.nabble.com/Struts-2-Prepare-Interceptor%2C-CRUD-Pattern-and-Optimistic-Locking-tp19612252p19612252.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Query
dojo and struts-tags and sitemesh and tiles are already supported in struts http://struts.apache.org/2.0.11.2/docs/dojo-head.html BTW: you're loading one heck of alot of functionality into JS with these external JS libraries http://struts.apache.org/2.0.11.2/docs/ajax.html (i'm not picking on JQuery per se but why not GWT or Scriptaculous which have equal amount of functionality?) are you enlisting yourself to write a JQuery plugin for struts http://cwiki.apache.org/WW/plugins.html ? Martin __ Disclaimer and confidentiality note Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. Subject: RE: Query Date: Mon, 22 Sep 2008 23:22:22 +0530 From: [EMAIL PROTECTED] To: user@struts.apache.org That's really weird, I can not find any thing so php specific with grid, its plain simple grid. Bye the way, dojo 1.1 has grid, or was it 1.0 Well I personally did not like the grid implementation, mainly one reason, sluggish, heavy. I do remember some other contributed and they migrated it to dojo, I read it some where but I am not sure about it. Well who cares about it. I would recommend still to use jQuery, personally I am a big fan of dojo(Only second to extjs) but Grid is something really heavy and jQuery is simple CSS based rules work much faster on grid. PS: jQuery, dojo, ext every thing is js no relation with PHP/ASP/JSP correct me if I am wrong. PS2: If you are using dojo grid with original ajax frame work with struts2 which uses .4 and the grid is 1.1(1.2) where the API's are entirely diffrenet? Well rewrite every ajax widget you want, as we did, or put grid in a different frame if you still use dojo. Regards, Jishnu Viswanath Software Engineer *(+9180)41190300 - 222(Ext) ll * ( + 91 ) 9731209330ll Tavant Technologies Inc., www.tavant.com PEOPLE :: PASSION :: EXCELLENCE -Original Message- From: Martin Gainty [mailto:[EMAIL PROTECTED] Sent: Monday, September 22, 2008 10:35 PM To: Struts Users Mailing List Subject: RE: Query great if we were programming php on Apache! I recommend the Dojo Grid control http://dojotoolkit.org/book/dijit-functional-spec/other-widgets/table anyone else? Martin __ Disclaimer and confidentiality note Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. Subject: RE: Query Date: Mon, 22 Sep 2008 21:29:17 +0530 From: [EMAIL PROTECTED] To: user@struts.apache.org If you are using jQuery try this also http://www.webplicity.net/flexigrid/ I felt its better polished and finished. Regards, Jishnu Viswanath Software Engineer *(+9180)41190300 - 222(Ext) ll * ( + 91 ) 9731209330ll Tavant Technologies Inc., www.tavant.com PEOPLE :: PASSION :: EXCELLENCE -Original Message- From: Miguel [mailto:[EMAIL PROTECTED] Sent: Monday, September 22, 2008 9:06 PM To: Struts Users Mailing List Subject: Re: Query You could use jQgrid, it has lots of options. http://www.trirand.com/jqgrid/jqgrid.html To use jqgrid you need to pass it the data via xml or json, so I recomend use the xslt or the json result of struts. You should not build the xml or the json using a jsp. It's not somewhat easy, but you will need to do your homework. Si quieres ser más positivo, pierde un electrón Miguel Ruiz Velasco S. On Sun, Sep 21, 2008 at 20:32, Jim Kiley [EMAIL PROTECTED] wrote: You're going to need to provide a lot more detail if you want a useful answer of any kind. On Sun, Sep 21, 2008 at 1:27 AM, greatshalu.6 [EMAIL PROTECTED]wrote: how we use grids in struts -- View this message in context: http://www.nabble.com/Query-tp19591765p19591765.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Jim Kiley Technical Consultant | Summa [p] 412.258.3346 [m] 412.445.1729 http://www.summa-tech.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Any comments or statements made in this email are not necessarily those of Tavant
Date validation allows 09/22/2dff
Hi, i have a date validation allows year if it starts with number. If i try to put the year as dff2: or no number like ddff it throws validation error. But when I enter 2dff it doesnt throw any validation error. Here is the validation block field property=datefield depends=date arg0 key=datefieldText/ var var-namedatePattern/var-name var-valueMM/dd//var-value /var /field Any help is much appreciated. Thanks Kishore -- View this message in context: http://www.nabble.com/Date-validation-allows-09-22-2dff-tp19613725p19613725.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Custom tag and map-backed action
I encountered a very strange situation today. I had the following in a web page: s:iterator value=employees s:textfield name=employees[%{key}].id .../ where the get method in my action was: public MapString,Employee getEmployees() The employee id 7932F was being interpreted as 7932! The trailing F was apparently being considered a literal for FLOAT and was being trimmed off the String. When I wrapped the variable in quotes is worked s:textfield name=employees[ '%{key' }].id .../ Does this appear to be a bug? -- View this message in context: http://www.nabble.com/Custom-tag-and-map-backed-action-tp19614086p19614086.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Query
1. Dojo and struts-tags and sitemesh and tiles are already supported in struts Hmmm, I think these are the valid 2.0.11.2 strut-tags http://struts.apache.org/2.0.11.2/docs/ajax-tags.html Well there is no where specified that struts moved to dojo 1.0, well if they don't we will have problem if u use .4 and 1.x together. In simple it can't work. 2. Well I did not get what you meant, But these libraries are designed to work like that, If you say that jQuery is simple not much features, a full fledged app will be equally complex when you use jQuery or dojo. Well this chart will bring some light in what we are looking at http://javascriptant.com/articles/24/javascript-libraries-by-comparison for perf http://jst.pbwiki.com/ I don't think you can find any performance comparison of extjs as its in GPL or Commercial License. I can not, cos I am more or less dojo developer, not jQuery :D But I have to accept Grid is ++jQuery;--dojo/dijit. Regards, Jishnu Viswanath Software Engineer *(+9180)41190300 - 222(Ext) ll * ( + 91 ) 9731209330ll Tavant Technologies Inc., www.tavant.com PEOPLE :: PASSION :: EXCELLENCE -Original Message- From: Martin Gainty [mailto:[EMAIL PROTECTED] Sent: Monday, September 22, 2008 11:41 PM To: Struts Users Mailing List Subject: RE: Query dojo and struts-tags and sitemesh and tiles are already supported in struts http://struts.apache.org/2.0.11.2/docs/dojo-head.html BTW: you're loading one heck of alot of functionality into JS with these external JS libraries http://struts.apache.org/2.0.11.2/docs/ajax.html (i'm not picking on JQuery per se but why not GWT or Scriptaculous which have equal amount of functionality?) are you enlisting yourself to write a JQuery plugin for struts http://cwiki.apache.org/WW/plugins.html ? Martin __ Disclaimer and confidentiality note Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. Subject: RE: Query Date: Mon, 22 Sep 2008 23:22:22 +0530 From: [EMAIL PROTECTED] To: user@struts.apache.org That's really weird, I can not find any thing so php specific with grid, its plain simple grid. Bye the way, dojo 1.1 has grid, or was it 1.0 Well I personally did not like the grid implementation, mainly one reason, sluggish, heavy. I do remember some other contributed and they migrated it to dojo, I read it some where but I am not sure about it. Well who cares about it. I would recommend still to use jQuery, personally I am a big fan of dojo(Only second to extjs) but Grid is something really heavy and jQuery is simple CSS based rules work much faster on grid. PS: jQuery, dojo, ext every thing is js no relation with PHP/ASP/JSP correct me if I am wrong. PS2: If you are using dojo grid with original ajax frame work with struts2 which uses .4 and the grid is 1.1(1.2) where the API's are entirely diffrenet? Well rewrite every ajax widget you want, as we did, or put grid in a different frame if you still use dojo. Regards, Jishnu Viswanath Software Engineer *(+9180)41190300 - 222(Ext) ll * ( + 91 ) 9731209330ll Tavant Technologies Inc., www.tavant.com PEOPLE :: PASSION :: EXCELLENCE -Original Message- From: Martin Gainty [mailto:[EMAIL PROTECTED] Sent: Monday, September 22, 2008 10:35 PM To: Struts Users Mailing List Subject: RE: Query great if we were programming php on Apache! I recommend the Dojo Grid control http://dojotoolkit.org/book/dijit-functional-spec/other-widgets/table anyone else? Martin __ Disclaimer and confidentiality note Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. Subject: RE: Query Date: Mon, 22 Sep 2008 21:29:17 +0530 From: [EMAIL PROTECTED] To: user@struts.apache.org If you are using jQuery try this also http://www.webplicity.net/flexigrid/ I felt its better polished and finished. Regards, Jishnu Viswanath Software Engineer *(+9180)41190300 - 222(Ext) ll * ( + 91 ) 9731209330ll Tavant Technologies Inc., www.tavant.com PEOPLE :: PASSION :: EXCELLENCE -Original Message- From: Miguel [mailto:[EMAIL PROTECTED] Sent: Monday, September 22, 2008 9:06 PM To: Struts Users Mailing List Subject: Re: Query You could use jQgrid, it has lots of options. http://www.trirand.com/jqgrid/jqgrid.html To use jqgrid you need to pass it the data
RE: Query
--- On Mon, 9/22/08, Martin Gainty wrote: great if we were programming php on Apache! Or S2 on an app server; I use jQuery regularly. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Query
--- On Mon, 9/22/08, Jishnu Viswanath wrote: Hmmm, I think these are the valid 2.0.11.2 strut-tags http://struts.apache.org/2.0.11.2/docs/ajax-tags.html They're supported under S2.0 as well, but not as a plugin, and cotnain somewhat less functionality. well if they don't we will have problem if u use .4 and 1.x together. In simple it can't work. I actually think some people here have reported that they're doing so successfully, although I haven't done it myself. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Query
I actually think some people here have reported that they're doing so successfully, although I haven't done it myself. Well that would be one amazing work cos both dojo object is entirely different, ya u can use it in 2 iframes, but in same iframe both dojo .4 and 1.x, well until I see it I wont believe it :D Regards, Jishnu Viswanath Software Engineer *(+9180)41190300 - 222(Ext) ll * ( + 91 ) 9731209330ll Tavant Technologies Inc., www.tavant.com PEOPLE :: PASSION :: EXCELLENCE -Original Message- From: Dave Newton [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 23, 2008 12:36 AM To: Struts Users Mailing List Subject: RE: Query --- On Mon, 9/22/08, Jishnu Viswanath wrote: Hmmm, I think these are the valid 2.0.11.2 strut-tags http://struts.apache.org/2.0.11.2/docs/ajax-tags.html They're supported under S2.0 as well, but not as a plugin, and cotnain somewhat less functionality. well if they don't we will have problem if u use .4 and 1.x together. In simple it can't work. I actually think some people here have reported that they're doing so successfully, although I haven't done it myself. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Any comments or statements made in this email are not necessarily those of Tavant Technologies. The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. If you have received this in error, please contact the sender and delete the material from any computer. All e-mails sent from or to Tavant Technologies may be subject to our monitoring procedures. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: two forms, two submits
FYI, a theme can be specified in a s:form tag or any of its s: form elements via theme=simple|xhtml|ajax attribute. If you didn't specify one it's using the xhtml theme. Do your forms submit to the same event handler? It would be helpful if we could see the struts.xml and the web pages that house the forms. -Original Message- From: cpanon [mailto:[EMAIL PROTECTED] Sent: Monday, September 22, 2008 3:57 PM To: Struts Users Mailing List Subject: Re: two forms, two submits Hi Pascal I dont understand the use of the word theme. This is a very simplistic jsp that has two forms, each with a different action and a html:submit button that does not work for one of the two forms. I hope I am clearer. It is almost too simple to further describe. tia. 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 (which may be known outside the United States as Merck Frosst, Merck Sharp Dohme or MSD and in Japan, as Banyu - 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: two forms, two submits
He mentioned html:submit - I guess we are talking about Struts 1, so there are no themes involved. Piero On Monday 22 September 2008 22:14:50 Kawczynski, David wrote: FYI, a theme can be specified in a s:form tag or any of its s: form elements via theme=simple|xhtml|ajax attribute. If you didn't specify one it's using the xhtml theme. Do your forms submit to the same event handler? It would be helpful if we could see the struts.xml and the web pages that house the forms. -Original Message- From: cpanon [mailto:[EMAIL PROTECTED] Sent: Monday, September 22, 2008 3:57 PM To: Struts Users Mailing List Subject: Re: two forms, two submits Hi Pascal I dont understand the use of the word theme. This is a very simplistic jsp that has two forms, each with a different action and a html:submit button that does not work for one of the two forms. I hope I am clearer. It is almost too simple to further describe. tia. 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 (which may be known outside the United States as Merck Frosst, Merck Sharp Dohme or MSD and in Japan, as Banyu - 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Custom tag and map-backed action
Interesting. Seems it is a feature, as documented in [1]. Tested it myself: s:property value=1234h.class.name / s:property value=1234b.class.name / s:property value=1234F.class.name / s:property value=1234L.class.name / s:property value=1234d.class.name / s:property value=(1234).class.name / The last one (Integer) didn't work without the ( ), which I don't know if this is a necessity or a bug. What about Short and Byte data type? it doesn't say... However, I think is NOT a bug that employees[1234F].id returns nothing, since the map key is a string and you need to quote it accordingly. [1] http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/basicExpressions.html#constants 2008/9/22 stanlick [EMAIL PROTECTED]: I encountered a very strange situation today. I had the following in a web page: s:iterator value=employees s:textfield name=employees[%{key}].id .../ where the get method in my action was: public MapString,Employee getEmployees() The employee id 7932F was being interpreted as 7932! The trailing F was apparently being considered a literal for FLOAT and was being trimmed off the String. When I wrapped the variable in quotes is worked s:textfield name=employees[ '%{key' }].id .../ Does this appear to be a bug? -- View this message in context: http://www.nabble.com/Custom-tag-and-map-backed-action-tp19614086p19614086.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Is my struts.xml never read?
I'm having a problem with Struts2 in Eclipse. I've set all the JARs up and the FilterDispatcher launches properly. The problem is that it seems my struts.xml is never read, because I keep getting a message saying There is no Action mapped for namespace / and action name home. - [unknown location] when trying to access http://localhost/home.action (yes, Tomcat is configured to port 80). I've searched all over for a week or so but I still haven't found a solution. I think the problem is where I put struts.xml or some configuration somewhere. I've tried placing struts.xml in project root/build/classes/, project root/classpath/, and project root/content/WEB-INF/classes/, but none of them works. Does anyone have an idea? Thanks in advance. Emil ---struts.xml--- ?xml version=1.0 encoding=UTF-8? !DOCTYPE struts PUBLIC -//Apache Software Foundation//DTD Struts Configuration 2.0//EN http://struts.apache.org/dtds/struts-2.0.dtd; struts package name=default namespace=/ extends=struts-default action name=home class=my.package.web.struts.action.HomeAction result/WEB-INF/jsp/page/home.jsp/result /action /package /struts ---/struts.xml-- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 2 Prepare Interceptor, CRUD Pattern and Optimistic Locking
Thanks for the response. I agree that there are a number of ways around the problem - I was just worried that I mis-understanding the sample. Gabriel Belingueres-2 wrote: I agree that using the paramsPrepareParams is not the ideal stack to handle optimistic locking. However, assuming that you are not losing the original version number (for example if you are submitting it as a hidden field of your edit form), and you can reassign it to the appropriate POJO field through the parameters interceptor, at the end, if there is a conflict in version numbers between the original and the just loaded object, still you have all the necessary information to detect the conflict. 2008/9/22 Frank D. [EMAIL PROTECTED]: Also posted to Struts 2 forum on Nabble - apologies if this causes a duplicate posting. Planning to use Struts 2 and JPA (OpenJPA) in a new application development and am spending some time to review options of how it should be done. There will be a large CRUD component within the application so I am working on the patterns to use in those scenarios. Following the CRUD examples in the Struts 2 In Action (and other sources), I have been experimenting with the ParamsPrepareParams stack. Using the pattern shown in the Struts 2 in Action book, the following is my understanding of the relevant points in the execution path. - when an edit (save) action is called the prepare() method retrieves the model object from the database (because there is an ID in the HTTP Request parameters). - the Params interceptor is invoked then loads the values from the HTTP Request parameters. None of the documentation describes why this is done, I assume the reason is to ensure that the Model object is fully populated (not all of the attributes may be on the UI and thus in the HTTP Request parameters). - the action is then invoked - and persists the updated Model object (delegated to a service) From what I can see, this causes a conflicts with the use of a version attribute for Optimistic Locking on the database. When the updates from the HTTP Request parameters are merged in with a newly retrieved model object the version number/timestamp is the value retrieved from the database. Even if that row had been updated by another user/thread since being retrieved the first time, the version checking would not catch the conflicting updates becuase it has been refreshed to the latest value in the DB. It seems a fairly fundamental and obvious problem so I am worried that I am mis-understanding the pattern described in the book (and repeated in other samples). I know that the examples in the book are simplified, but I would expect something like this to be commented on in the text. Am I missing something ??? Can anybody confirm or contradict my reasoning? -- View this message in context: http://www.nabble.com/Struts-2-Prepare-Interceptor%2C-CRUD-Pattern-and-Optimistic-Locking-tp19612252p19612252.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Struts-2-Prepare-Interceptor%2C-CRUD-Pattern-and-Optimistic-Locking-tp19612252p19616065.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Is my struts.xml never read?
--- On Mon, 9/22/08, Emil Lundberg [EMAIL PROTECTED] wrote: I'm having a problem with Struts2 in Eclipse. I've set all the JARs up and the FilterDispatcher launches properly. The problem is that it seems my struts.xml is never read, because I keep getting a message saying There is no Action mapped for namespace / and action name home. - [unknown location] when trying to access http://localhost/home.action (yes, Tomcat is configured to port 80). I've searched all over for a week or so but I still haven't found a solution. I think the problem is where I put struts.xml or some configuration somewhere. Are you deploying it to the root application context? If you put struts.xml at the root of your source directory it should be deployed properly. If you haven't already, turn on devMode. You can also set the XWork and S2 logging to DEBUG to get more of an idea what's happening with the configuration. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Is my struts.xml never read?
That's strange... When i set constant name=struts.devMode value=true / in struts.xml, struts goes into devMode, but still doesn't find my action mappings. Did I do something wrong? I've worked with struts before but I just can't seem to get this right for some reason... Could it have something to do with that I'm not using Spring yet in this project? /Emil Dave Newton wrote: --- On Mon, 9/22/08, Emil Lundberg [EMAIL PROTECTED] wrote: I'm having a problem with Struts2 in Eclipse. I've set all the JARs up and the FilterDispatcher launches properly. The problem is that it seems my struts.xml is never read, because I keep getting a message saying There is no Action mapped for namespace / and action name home. - [unknown location] when trying to access http://localhost/home.action (yes, Tomcat is configured to port 80). I've searched all over for a week or so but I still haven't found a solution. I think the problem is where I put struts.xml or some configuration somewhere. Are you deploying it to the root application context? If you put struts.xml at the root of your source directory it should be deployed properly. If you haven't already, turn on devMode. You can also set the XWork and S2 logging to DEBUG to get more of an idea what's happening with the configuration. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problems with Indexed Properties, Hidden Values and Logic Iterate Tag
Anyone can help me, please? Thanks. cacodemon79 wrote: Hi to all. I'm using Struts 1.3, Tomcat 6.0 and Eclipse. I have a problem with Indexed Properties. I have a jsp that should save hidden values and pass it to the linked Action. I show you my code. JSP PAGE logic:notEmpty name=creazioneProfiloUtenteForm property=listaSport html:select property=sport styleId=sport o_n_c_h_a_n_g_e=javascript:submitForm('creazioneProfiloUtenteForm','caricamentoRuoliAttributiSport.do') html:optionsCollection property=listaSport / /html:select logic:iterate id=hSportBean name=creazioneProfiloUtenteForm property=listaSport html:hidden name=hSportBean property=label indexed=true / html:hidden name=hSportBean property=value indexed=true / /logic:iterate /logic:notEmpty where - 'listaSport' is a list containing a list of sports. This list is correctly populated by the previous Action through 'select' and 'optionsCollection' tags. - 'hSportBean' is a LabelValueBean list where I have to save the select options. *** ACTION FORM *** public class CreazioneProfiloUtenteForm extends ActionForm { private String sport; private ArrayList listaSport; private ArrayList listaRuoli; private Object[] ruoliSelezionati; public ActionErrors validate(ActionMapping mapping,HttpServletRequest request) { return null; } public void reset(ActionMapping mapping, HttpServletRequest request) { } public LabelValueBean getHSportBean(int index) { if(this.listaSport == null) { this.listaSport = new ArrayList(); } while(index = this.listaSport.size()) { this.listaSport.add(new LabelValueBean()); } return (LabelValueBean) listaSport.get(index); } public String getSport() { return sport; } public void setSport(String sport) { this.sport = sport; } public ArrayList getListaSport() { return listaSport; } public void setListaSport(ArrayList listaSport) { this.listaSport = listaSport; } public ArrayList getListaRuoli() { return listaRuoli; } public void setListaRuoli(ArrayList listaRuoli) { this.listaRuoli = listaRuoli; } public Object[] getRuoliSelezionati() { return ruoliSelezionati; } public void setRuoliSelezionati(Object[] ruoliSelezionati) { this.ruoliSelezionati = ruoliSelezionati; } } ** ACTION ** public class CaricamentoRuoliAttributiSportAction extends Action { public ActionForward execute(ActionMapping mapping, ActionForm form,HttpServletRequest request, HttpServletResponse response) { CreazioneProfiloUtenteForm creazioneProfiloUtenteForm = (CreazioneProfiloUtenteForm) form;// TODO Auto-generated method stub sportSelezionato = creazioneProfiloUtenteForm.getSport(); //HERE I HAVE TO LOAD HIDDEN VALUES SAVED IN JSP PAGE ... ... } } The problem is that I can't load in Action the hidden values saved in the jsp page. I tried to print the values received System.out.println((creazioneProfiloUtenteForm.getHSportBean(0)).getLabel()) System.out.println((creazioneProfiloUtenteForm.getHSportBean(0)).getValue()); but I always obtain null values (for all indexes). So, I don't know how to solve my problem. I also followed guidelines in: http://faq.javaranch.com/java/IndexedProperties http://faq.javaranch.com/java/IndexedProperties http://struts.apache.org/1.x/struts-taglib/indexedprops.html http://struts.apache.org/1.x/struts-taglib/indexedprops.html http://mail-archives.apache.org/mod_mbox/struts-user/200604.mbox/[EMAIL PROTECTED] http://mail-archives.apache.org/mod_mbox/struts-user/200604.mbox/[EMAIL PROTECTED] Can you help me? Thanks a lot in advance. -- View this message in context: http://www.nabble.com/Problems-with-Indexed-Properties%2C-Hidden-Values-and-Logic-Iterate-Tag-tp19593011p19616277.html Sent from the Struts - User mailing list archive at Nabble.com.
Re: Is my struts.xml never read?
Is the Struts Dispatcher configured in your web.xml to intercept all requests? Carlos Luis Zúñiga Sibaja __ [EMAIL PROTECTED] divide et impera... On Mon, Sep 22, 2008 at 3:43 PM, Emil Lundberg [EMAIL PROTECTED]wrote: That's strange... When i set constant name=struts.devMode value=true / in struts.xml, struts goes into devMode, but still doesn't find my action mappings. Did I do something wrong? I've worked with struts before but I just can't seem to get this right for some reason... Could it have something to do with that I'm not using Spring yet in this project? /Emil Dave Newton wrote: --- On Mon, 9/22/08, Emil Lundberg [EMAIL PROTECTED] wrote: I'm having a problem with Struts2 in Eclipse. I've set all the JARs up and the FilterDispatcher launches properly. The problem is that it seems my struts.xml is never read, because I keep getting a message saying There is no Action mapped for namespace / and action name home. - [unknown location] when trying to access http://localhost/home.action (yes, Tomcat is configured to port 80). I've searched all over for a week or so but I still haven't found a solution. I think the problem is where I put struts.xml or some configuration somewhere. Are you deploying it to the root application context? If you put struts.xml at the root of your source directory it should be deployed properly. If you haven't already, turn on devMode. You can also set the XWork and S2 logging to DEBUG to get more of an idea what's happening with the configuration. Dave - 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]
Accessing a bean on the value stack from within an action
Hi, i want to save some special settings inside a bean and use them to change things on my jsp pages. for that i created a singleton usersettingsbean. I know i can create the bean with the help of a struts-tag. but how can i access/create the bean from within the execute method of an action? i can access the value stack with the help of the actioncontext, but it seems as if i cant add a name to the object i push on the stack (like #page). Is anybody able to help me? Greetings, Alexander - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Global result of type redirect
Hello Chris. Thank you. Are you saying you want to set the default result type to redirect globally or that you just want a global result type of redirect to be available to your actions? The second. I wrote this: package name=almayer namespace=/ extends=struts-default global-results result name=login/component/login.jsp/result result type=redirect name=homeSecure/homeSecure.action/result result type=redirect name=homeUnsecure/homeUnsecure.action/result /global-results Te problem is that the struts.xml is validated in the startup phase, but if some action returns homeSecure, I receive an error because the forward isn't defined. That's all. Where is my fault? Gianluca 2008/9/22 Chris Pratt [EMAIL PROTECTED]: Are you saying you want to set the default result type to redirect globally or that you just want a global result type of redirect to be available to your actions? If the former, just redefine the redirect result type in your package and set it to default=true, like: result-types result-type name=redirect class=org.apache.struts2.dispatcher.ServletRedirectResult default=true/ /result-types If the latter, make sure your package extends struts-default that's where all the standard result types get defined. (*Chris*) On Mon, Sep 22, 2008 at 9:25 AM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Ho all. I'm il train! It is possible in struts.xml to have global result of type redirect? My struts.xml doesn't give validation errors, but results or type redirect aren't visible ho the controller. Please help Gianluca Inviato da iPhone - 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]
quest on dynamic redirect
This is my requirement: - the user asks for a resource, say A.action - the controller fires a custom interceptor I to authenticate the user - user isn't authenticated, so I redirect to L, the login page - user enters valid credentials - the controller redirect to the original requested A.action The problem is that the results of the login action are statically cablated in struts.xml: result type=tiles name=successhome/result result type=tiles name=failurelogin/result But I need a new case to redirect dynamically to A.action (I can't provide statically all cases in my struts.xml). How can I have this behaviour? thanks Gianluca - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Accessing a bean on the value stack from within an action
Stupid me... it seems i was looking at the wrong api docs. Next time i avoid google... There is a difference between the webworks documentation on opensymphony.com and struts.apache.org. set(string,object) is hopefully the solution of my problem. i'll try it tomorrow. on the pro side, i solve my own problems. why can't i do that before i send a mail to the list? Greetings, Alexander Alexander Baetz schrieb: Hi, i want to save some special settings inside a bean and use them to change things on my jsp pages. for that i created a singleton usersettingsbean. I know i can create the bean with the help of a struts-tag. but how can i access/create the bean from within the execute method of an action? i can access the value stack with the help of the actioncontext, but it seems as if i cant add a name to the object i push on the stack (like #page). Is anybody able to help me? Greetings, Alexander - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: quest on dynamic redirect
I thought of the same problem some time ago. - during the execution of I all information for the correct redirect is stored (session, bean... whatsoever) - during the login action, after the login is confirmed the action realizes that a redirect is requestet (to a.action) now the login action can get a result like this result name=redirect type=..${redirectTo}/result now the action is asced for the correct action name/tiles view... it shall return. Greetings, Alexander Gianluca Musella schrieb: This is my requirement: - the user asks for a resource, say A.action - the controller fires a custom interceptor I to authenticate the user - user isn't authenticated, so I redirect to L, the login page - user enters valid credentials - the controller redirect to the original requested A.action The problem is that the results of the login action are statically cablated in struts.xml: result type=tiles name=successhome/result result type=tiles name=failurelogin/result But I need a new case to redirect dynamically to A.action (I can't provide statically all cases in my struts.xml). How can I have this behaviour? thanks Gianluca - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Global result of type redirect
What is the message you're receiving? From what you've provided I can't tell if it's that it can't find the redirect result type, or the /homeSecure.action to redirect to. (*Chris*) On Mon, Sep 22, 2008 at 4:03 PM, Gianluca Musella [EMAIL PROTECTED] wrote: Hello Chris. Thank you. Are you saying you want to set the default result type to redirect globally or that you just want a global result type of redirect to be available to your actions? The second. I wrote this: package name=almayer namespace=/ extends=struts-default global-results result name=login/component/login.jsp/result result type=redirect name=homeSecure/homeSecure.action/result result type=redirect name=homeUnsecure/homeUnsecure.action/result /global-results Te problem is that the struts.xml is validated in the startup phase, but if some action returns homeSecure, I receive an error because the forward isn't defined. That's all. Where is my fault? Gianluca 2008/9/22 Chris Pratt [EMAIL PROTECTED]: Are you saying you want to set the default result type to redirect globally or that you just want a global result type of redirect to be available to your actions? If the former, just redefine the redirect result type in your package and set it to default=true, like: result-types result-type name=redirect class=org.apache.struts2.dispatcher.ServletRedirectResult default=true/ /result-types If the latter, make sure your package extends struts-default that's where all the standard result types get defined. (*Chris*) On Mon, Sep 22, 2008 at 9:25 AM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Ho all. I'm il train! It is possible in struts.xml to have global result of type redirect? My struts.xml doesn't give validation errors, but results or type redirect aren't visible ho the controller. Please help Gianluca Inviato da iPhone - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Custom tag and map-backed action
I don't know but I hope not, since I don't want my expressions to reduce to different data types depending if there is a number or not in them! Even if abc would reduce to the string 'abc', the expression 0xabc reduce to an Integer (have tested it), since it is an hexadecimal number. 2008/9/22 [EMAIL PROTECTED]: I expected the conversion facility or iterator key to be smart enough to recognize my MapString, Employee and setup the internal key variable accordingly. Do you suppose it would have worked if my Map had contained 'abc':emp1, 'def':emp2, 'ghi':emp3? Peace, Scott On Mon, Sep 22, 2008 at 3:47 PM, Gabriel Belingueres [EMAIL PROTECTED]wrote: Interesting. Seems it is a feature, as documented in [1]. Tested it myself: s:property value=1234h.class.name / s:property value=1234b.class.name / s:property value=1234F.class.name / s:property value=1234L.class.name / s:property value=1234d.class.name / s:property value=(1234).class.name / The last one (Integer) didn't work without the ( ), which I don't know if this is a necessity or a bug. What about Short and Byte data type? it doesn't say... However, I think is NOT a bug that employees[1234F].id returns nothing, since the map key is a string and you need to quote it accordingly. [1] http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/basicExpressions.html#constants 2008/9/22 stanlick [EMAIL PROTECTED]: I encountered a very strange situation today. I had the following in a web page: s:iterator value=employees s:textfield name=employees[%{key}].id .../ where the get method in my action was: public MapString,Employee getEmployees() The employee id 7932F was being interpreted as 7932! The trailing F was apparently being considered a literal for FLOAT and was being trimmed off the String. When I wrapped the variable in quotes is worked s:textfield name=employees[ '%{key' }].id .../ Does this appear to be a bug? -- View this message in context: http://www.nabble.com/Custom-tag-and-map-backed-action-tp19614086p19614086.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Is my struts.xml never read?
please post your struts.xml and the url you are trying to hit. Your web.xml relevant part will also behelpful ... On Mon, Sep 22, 2008 at 5:43 PM, Emil Lundberg [EMAIL PROTECTED]wrote: That's strange... When i set constant name=struts.devMode value=true / in struts.xml, struts goes into devMode, but still doesn't find my action mappings. Did I do something wrong? I've worked with struts before but I just can't seem to get this right for some reason... Could it have something to do with that I'm not using Spring yet in this project? /Emil Dave Newton wrote: --- On Mon, 9/22/08, Emil Lundberg [EMAIL PROTECTED] wrote: I'm having a problem with Struts2 in Eclipse. I've set all the JARs up and the FilterDispatcher launches properly. The problem is that it seems my struts.xml is never read, because I keep getting a message saying There is no Action mapped for namespace / and action name home. - [unknown location] when trying to access http://localhost/home.action (yes, Tomcat is configured to port 80). I've searched all over for a week or so but I still haven't found a solution. I think the problem is where I put struts.xml or some configuration somewhere. Are you deploying it to the root application context? If you put struts.xml at the root of your source directory it should be deployed properly. If you haven't already, turn on devMode. You can also set the XWork and S2 logging to DEBUG to get more of an idea what's happening with the configuration. Dave - 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] -- Alberto http://www.linkedin.com/in/aflores
RE: quest on dynamic redirect
if you want to create action (actually action names) on the fly 2 options http://struts.apache.org/2.0.11.2/docs/rest-plugin.html provided disableControllerScanning = false e.g. struts.configuration.rest.disableControllerScanning=false the other option is to go with Spring MVC dynamic MultiActionController http://static.springframework.org/spring/docs/1.2.x/reference/mvc.html#mvc-controller far more capable to dyanmically craft your method but then again far more complex the method name which is yielded is defined to have the following signature: // actionName can be replaced by any methodname ModelAndView actionName(HttpServletRequest, HttpServletResponse);HTH Martin __ Disclaimer and confidentiality note Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. Date: Tue, 23 Sep 2008 01:23:50 +0200 From: [EMAIL PROTECTED] To: user@struts.apache.org Subject: Re: quest on dynamic redirect I thought of the same problem some time ago. - during the execution of I all information for the correct redirect is stored (session, bean... whatsoever) - during the login action, after the login is confirmed the action realizes that a redirect is requestet (to a.action) now the login action can get a result like this result name=redirect type=..${redirectTo}/result now the action is asced for the correct action name/tiles view... it shall return. Greetings, Alexander Gianluca Musella schrieb: This is my requirement: - the user asks for a resource, say A.action - the controller fires a custom interceptor I to authenticate the user - user isn't authenticated, so I redirect to L, the login page - user enters valid credentials - the controller redirect to the original requested A.action The problem is that the results of the login action are statically cablated in struts.xml: result type=tiles name=successhome/result result type=tiles name=failurelogin/result But I need a new case to redirect dynamically to A.action (I can't provide statically all cases in my struts.xml). How can I have this behaviour? thanks Gianluca - 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] _ Get more out of the Web. Learn 10 hidden secrets of Windows Live. http://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-cns!550F681DAD532637!5295.entry?ocid=TXT_TAGLM_WL_domore_092008