Issue: Action redirect do not include parameter as complex objects?
Hello, I have tried an example in which i have inserted a user using insert method of UserAction class. On insert I have redirected the success to loadAdd method of UserAction. During redirect I have passed the parameter as param name=user${user}/param In struts 2.0.14 this gives an ognl exception. whereas when I pass param name=user.id${user.id}/param it works. My observation says this is a bug in struts or ognl that it does parse composite objects while it parses simple data types. Any work-around please suggest. Or Is there any way by which I can forward the complete action context or value stack in the redirected action With Best Regards, Amol Ghotankar Technical Lead Cursive Technologies Pvt. Ltd. 104, A1 Wing, W Sector, Masulkar Colony, Ajmera, Pimpri, Pune-18 INDIA O: +91 2020 270 570 M: +91 9960 980 419 www.cursivetech.com CURSIVE TECHNOLOGIES EMAIL NOTICE The information contained in this email and any attachments is confidential and may be subject to copyright or other intellectual property protection. If you are not the intended recipient, you are not authorized to use or disclose this information, and we request that you notify us by reply mail or telephone and delete the original message from your mail system.
Re: Issue: Action redirect do not include parameter as complex objects?
Aside from you're using an old version of S2, I don't think your approach is the best one. Why should you pass every parameters? You could simply pass just the id and then load the user object inside your loadAdd method. On 24 May 2011 18:08, Amol Ghotankar ghotankaru...@gmail.com wrote: Hello, I have tried an example in which i have inserted a user using insert method of UserAction class. On insert I have redirected the success to loadAdd method of UserAction. During redirect I have passed the parameter as param name=user${user}/param In struts 2.0.14 this gives an ognl exception. whereas when I pass param name=user.id${user.id}/param it works. My observation says this is a bug in struts or ognl that it does parse composite objects while it parses simple data types. Any work-around please suggest. Or Is there any way by which I can forward the complete action context or value stack in the redirected action With Best Regards, Amol Ghotankar Technical Lead Cursive Technologies Pvt. Ltd. 104, A1 Wing, W Sector, Masulkar Colony, Ajmera, Pimpri, Pune-18 INDIA O: +91 2020 270 570 M: +91 9960 980 419 www.cursivetech.com CURSIVE TECHNOLOGIES EMAIL NOTICE The information contained in this email and any attachments is confidential and may be subject to copyright or other intellectual property protection. If you are not the intended recipient, you are not authorized to use or disclose this information, and we request that you notify us by reply mail or telephone and delete the original message from your mail system. -- Maurizio Cucchiara
Re: Issue: Action redirect do not include parameter as complex objects?
Not to mention that's not how URL parameters work--all you can send is strings. Dave On Tue, May 24, 2011 at 12:40 PM, Maurizio Cucchiara maurizio.cucchi...@gmail.com wrote: Aside from you're using an old version of S2, I don't think your approach is the best one. Why should you pass every parameters? You could simply pass just the id and then load the user object inside your loadAdd method. On 24 May 2011 18:08, Amol Ghotankar ghotankaru...@gmail.com wrote: Hello, I have tried an example in which i have inserted a user using insert method of UserAction class. On insert I have redirected the success to loadAdd method of UserAction. During redirect I have passed the parameter as param name=user${user}/param In struts 2.0.14 this gives an ognl exception. whereas when I pass param name=user.id${user.id}/param it works. My observation says this is a bug in struts or ognl that it does parse composite objects while it parses simple data types. Any work-around please suggest. Or Is there any way by which I can forward the complete action context or value stack in the redirected action With Best Regards, Amol Ghotankar Technical Lead Cursive Technologies Pvt. Ltd. 104, A1 Wing, W Sector, Masulkar Colony, Ajmera, Pimpri, Pune-18 INDIA O: +91 2020 270 570 M: +91 9960 980 419 www.cursivetech.com CURSIVE TECHNOLOGIES EMAIL NOTICE The information contained in this email and any attachments is confidential and may be subject to copyright or other intellectual property protection. If you are not the intended recipient, you are not authorized to use or disclose this information, and we request that you notify us by reply mail or telephone and delete the original message from your mail system. -- Maurizio Cucchiara - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Issue: Action redirect do not include parameter as complex objects?
I can't resist to imagine a connection pool that pass over a get request :) -- Maurizio Cucchiara
Re: Issue: Action redirect do not include parameter as complex objects?
Ok. 1, Why I need to pass the object and not the id. -- I have just inserted it and do not want additional reads from database. 2. Can't image url get request. -- Exactly. Why do we have just GET here, can't we have post also. 3. Old version. -- Applications can't be upgraded for every version released so best stable release of struts2 is used. i.e 2.0.14 4. Important. Can't we have a work around to forward the value stack to the redirected action without using action chaining, but having somewhat similar effect. ? 5. Why can't we post values through redirect action, any work around to do that? ?
Re: Issue: Action redirect do not include parameter as complex objects?
On Tue, May 24, 2011 at 1:35 PM, Amol Ghotankar wrote: 1, Why I need to pass the object and not the id. -- I have just inserted it and do not want additional reads from database. Doesn't matter (and if your caching is configured properly, shouldn't do a round-trip anyway). Look at a browser request--the only thing you can send is strings. Period. 4. Important. Can't we have a work around to forward the value stack to the redirected action without using action chaining, but having somewhat similar effect. It's called session scope. You can keep things in it. Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: Issue: Action redirect do not include parameter as complex objects?
-Original Message- From: Amol Ghotankar [mailto:ghotankaru...@gmail.com] Sent: Tuesday, May 24, 2011 12:09 To: Struts Users Mailing List Subject: Issue: Action redirect do not include parameter as complex objects? Hello, I have tried an example in which i have inserted a user using insert method of UserAction class. On insert I have redirected the success to loadAdd method of UserAction. During redirect I have passed the parameter as param name=user${user}/param In struts 2.0.14 this gives an ognl exception. whereas when I pass param name=user.id${user.id}/param it works. My observation says this is a bug in struts or ognl that it does parse composite objects while it parses simple data types. Any work-around please suggest. Don't do it that way. The design is flawed. Or Is there any way by which I can forward the complete action context or value stack in the redirected action Disclaimer: there are reasons why this is not common. That being said: Use the session or application scope to store the object and pass a token/key to the item stored in the url. -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- - - - Jason Pyeron PD Inc. http://www.pdinc.us - - Principal Consultant 10 West 24th Street #100- - +1 (443) 269-1555 x333Baltimore, Maryland 21218 - - - -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- This message is copyright PD Inc, subject to license 20080407P00. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Upgrading Struts 1.1 to Struts 2 with tiles
Hi, I might not understand what null definition means. Also i don't want to loose the current flow of struts 1.1 (using TilesPlugin) and also Struts2 to work using old tiles definition. I am using tile 2.2.2 and followed the instructions given on http://tiles.apache.org/framework/migration/configuration.html#Reusing_old_Tiles_configuration_files got NullPointerException org.apache.tiles.definition.dao.CachingLocaleUrlDefinitionDAO.loadDefinitionsFromURLs. So i rename my my tiles-defs.xml fiel to tiles.xml and got the same exception as given below. org.apache.tiles.impl.InvalidTemplateException: Cannot render a null template Thanks for help. Best regards, Sachin On 24-05-2011 00:12, Martin Gainty wrote: it seems you are supplying a null template definition e.g. %@ taglib uri=http://struts.apache.org/tags-tiles; prefix=tiles % definition name=templateDefinition path=/layout.jsp put name=title value=This is the title. / put name=header value=header.jsp / put name=body value=body.jsp / /definition WEB-INF/struts-config.xml !-- To use tiles-plugin, download and add the Tiles jar to your WEB-INF/lib directory then uncomment the plugin definition below. -- plug-in className=org.apache.struts.tiles.TilesPlugin set-property property=definitions-config value=/WEB-INF/tiles-defs.xml /s set-property property=moduleAware value=true / /plug-in to implement tiles in struts2.x use org.apache.struts2.tiles.listener.StrutsTilesListener web.xml would contain listener listener-class org.apache.struts2.tiles.StrutsTilesListener /listener-class /listener Martin Gainty __ Jogi és Bizalmassági kinyilatkoztatás/Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité Ez az üzenet bizalmas. Ha nem ön az akinek szánva volt, akkor kérjük, hogy jelentse azt nekünk vissza. Semmiféle továbbítása vagy másolatának készítése nem megengedett. Ez az üzenet csak ismeret cserét szolgál és semmiféle jogi alkalmazhatósága sincs. Mivel az electronikus üzenetek könnyen megváltoztathatóak, ezért minket semmi felelöség nem terhelhet ezen üzenet tartalma miatt. Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni. Date: Mon, 23 May 2011 22:48:01 +0530 From: sachin.l...@krishagni.com To: user@struts.apache.org Subject: Upgrading Struts 1.1 to Struts 2 with tiles Hi, I want to upgrade my application to Struts 2.2.3 from struts 1.1. I want to migrate this on shared resource basis i.e. running both Struts1 and struts2 in parallel each handling different action extension (*.action and *.do). Though i could successfully created the Struts2 action class and request is getting routed correctly but i am facing problems with re-using struts-tiles. I added below lines in web.xml filter filter-namestruts2/filter-name filter-classorg.apache.struts2.dispatcher.FilterDispatcher/filter-class /filter filter-mapping filter-namestruts2/filter-name url-pattern*.action/url-pattern /filter-mapping context-param param-nameorg.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG/param-name param-value/WEB-INF/tiles-defs.xml/param-value /context-param listener listener-classorg.apache.tiles.extras.complete.CompleteAutoloadTilesListener/listener-class /listener But it is throwing below action while forwarding request from struts2 action to tile. org.apache.tiles.impl.InvalidTemplateException: Cannot render a null template org.apache.tiles.renderer.impl.TemplateAttributeRenderer.write(TemplateAttributeRenderer.java:51) org.apache.tiles.renderer.impl.AbstractBaseAttributeRenderer.render(AbstractBaseAttributeRenderer.java:106) org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:670) org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:690) org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:644) org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:627) org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:321)