Re: EJB Injection in Interceptor
Just to clear up my actual question from the thread below as feedback has run dry unfortunately. Is there anybody working daily with Struts 2 and EJB 3.0? If so, what is the best way to obtain local references to EJB 3 session beans from within Struts 2 action classes? Thanks for any thoughts on this subject. Robin Mannering wrote: Just wondering if the below thread has gone any further. After creating another thread on the same subject at an earlier date, we discussed using the EJB plugin here: http://cwiki.apache.org/S2PLUGINS/ejb3-plugin.html However, having started to use this plugin so that I can reference stateless session beans, it seems that all EJB Session bean classes must be defined as @Remote rather than @Local in order for the injection to obtain the references correctly. Failure to specify them as remote throws a javax.naming.NameNotFoundException. However, reading from a book entitled Pro EJB 3.0, the following performance issues are mentioned in relation to using @Remote when @Local is available. Hopefully this link will work for you. http://books.google.co.uk/books?id=fVCuB_Xq3pACpg=PA40lpg=PA40dq=Making+an+interface+remote+has+consequencessource=blots=Bg9DdpVAWWsig=vxrumZhYLhjmqbt6bdMJ96hrY7shl=enei=QIdtStuLC-WhjAf34KGeCwsa=Xoi=book_resultct=resultresnum= So, the problem is : How can we obtain references to EJB 3 session beans from within Struts 2 action classes? I'd be very interested to hear your thoughts. Thanks Robin Nathan Schulte wrote: Wes Wannemacher wesw at wantii.com writes: Seems to me that my idea to create an ObjectFactory based plugin ... needs to pick up some steam. I only have one question for the EJB users out there... Do you guys need Spring integration as well? To answer your question, _I_ personally don't need Spring integration. I've never used Spring, and for this project, it was too much overhead to learn (on top of Java EE, the JPA, Hibernate intricacies, Struts2...), and from what I understand, it seemed like using it and S2 together provided duplicate functionality (another topic altogether...). On another note, I find it awesome that the community (or whatever group you're part of) is so willing to provide support. I mean, in my eyes, this is something that I could see myself writing to make my coding easier, it's just that given my situation, it's easier to use the workaround. Admittedly, I'm not very familiar with JEE5. Some of this is still black magic, and I don't fully understand the issue, I just know enough to understand that the architecture permits it as an issue (and not everyone is just blowing smoke my way) and can leave all of the intricate details be, as they don't directly affect my project. -Nate - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.387 / Virus Database: 270.13.20/2248 - Release Date: 07/19/09 05:57:00 No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.392 / Virus Database: 270.13.31/2265 - Release Date: 07/26/09 17:59:00
Re: Struts 2 performance
Musachy Barroso wrote: Just to save you some time (because I just spend sometime myself on this), I would suggest you to use the profiler that comes with JRockit: http://www.oracle.com/technology/products/jrockit/index.html You will have to run your application with the JRockit jre to use it. It is free, and by far the best profiler I have ever used. I do all my development on a mac (not a platform for which this is available). I do have an old PC with *maybe* 1GB of memory that's dog slow already...do you think it's worth the hair I'll have to pull out in order to run my app in this and test it out? -Dale - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
How to pass id to any method by means of input type=checkbox and submit button?
Hello, I'm new on struts and want to handle following problem: I am listing all the invoice items via logic:iterate in my invoiceList.jsp. Beside each invoice line, there is a checkbox, which I want to use as following: User clicks on any checkbox to select the appropriate invoice item beside it, and after clicking on the submit button at the bottom, the id of the selected invoice shoould be transferred to InvoiceEditAction.editInvoice() method. But I get following error message unfortunately: javax.servlet.ServletException: java.lang.NumberFormatException: For input string: So I think the id can not be transferred at all. Below you can find my invoiceList.jsp. Any help is appreciated. html body html:form action=invoiceEdit table tbody tr td/td tdid/td tdInvoice No/td tdDate/td /tr logic:iterate name=invoiceListForm property=invoices id=invoice tr td input type=checkbox value=bean:write name=invoice property=id/ name=editInvoice /td tdbean:write name=invoice property=id //td tdbean:write name=invoice property=invoiceNo //td tdbean:write name=invoice property=date //td /tr /logic:iterate /tbody /table html:button property=add onclick=location.href='invoiceEdit.do?do=addInvoice'Add a new invoice /html:button html:button property=back onclick=location.href='default.do'Back to menu /html:button %-- set the parameter for the dispatch action --% html:hidden property=do value=editInvoice / html:submitUpdate/html:submit /html:form /body /html -- View this message in context: http://www.nabble.com/How-to-pass-%22id%22-to-any-method-by-means-of-%3Cinput-type%3D%22checkbox%22%3E-and-submit-button--tp24733742p24733742.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
One Struts2-project to rule them all
Hi folksI'm facing a nice problem and I would be glad to hear from you. I think it should be useful to all. Problem is easy: Gandalf and I need to build 15 websites one per domain, I really dont want to maintain 15 different and pretty small projects. I will be happy to use subdomains, but I couldnt. Alternatives: - A Struts2 project attending 15 websites. is it possible? Writing my own FilterDispatcher?? - Multiple Struts2 project on per domain bundled in a EAR. I think I will overhead the job. I dont want to duplicate struts configurations, javascript and css resources.
Re: New to Struts, a Question
Hi Thomas, yes it is picking it from there. Empty name is same as name=success. Best greetings, Paweł Wielgus. 2009/7/30 Thomas Sattler tomsatt...@gmail.com: In my struts.xml file, I have the UserDisplayAction class and a blank (no name=) result for userDisplay.jsp. Does it pick up from there? On Wed, Jul 29, 2009 at 8:40 PM, Dave Newton newton.d...@yahoo.com wrote: Dennis Atkinson wrote: Dave, OK, I can make it work. I just don't understand WHY it works. If I change to this: a href=/betaSystem/userDisplay.actionMy Acccount/a I get exactly what I expect; the screen loads with the data filled in properly. But what I don't understand is how Struts knows to load userDisplay.jsp. I assume it parses the userDisplay out of the url and appends the .jsp to the end, so as long as I have these names the same (other than the suffix), this will work? You don't have a user display action configured via XML or annotations? Dave - 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: How to pass id to any method by means of input type=checkbox and submit button?
Hi bilgerkan, have You check the generated source of that page, is it ok in the HTML sense? Do you have editInvoice long table defined in a Form that is aplied to invoiceEdit action? Best greetings, Paweł Wielgus. 2009/7/30 bilgerkan bilger...@yahoo.com: Hello, I'm new on struts and want to handle following problem: I am listing all the invoice items via logic:iterate in my invoiceList.jsp. Beside each invoice line, there is a checkbox, which I want to use as following: User clicks on any checkbox to select the appropriate invoice item beside it, and after clicking on the submit button at the bottom, the id of the selected invoice shoould be transferred to InvoiceEditAction.editInvoice() method. But I get following error message unfortunately: javax.servlet.ServletException: java.lang.NumberFormatException: For input string: So I think the id can not be transferred at all. Below you can find my invoiceList.jsp. Any help is appreciated. html body html:form action=invoiceEdit table tbody tr td/td tdid/td tdInvoice No/td tdDate/td /tr logic:iterate name=invoiceListForm property=invoices id=invoice tr td input type=checkbox value=bean:write name=invoice property=id/ name=editInvoice /td tdbean:write name=invoice property=id //td tdbean:write name=invoice property=invoiceNo //td tdbean:write name=invoice property=date //td /tr /logic:iterate /tbody /table html:button property=add onclick=location.href='invoiceEdit.do?do=addInvoice'Add a new invoice /html:button html:button property=back onclick=location.href='default.do'Back to menu /html:button %-- set the parameter for the dispatch action --% html:hidden property=do value=editInvoice / html:submitUpdate/html:submit /html:form /body /html -- View this message in context: http://www.nabble.com/How-to-pass-%22id%22-to-any-method-by-means-of-%3Cinput-type%3D%22checkbox%22%3E-and-submit-button--tp24733742p24733742.html Sent from the Struts - User mailing list archive at Nabble.com. - 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: One Struts2-project to rule them all
Hi David, i don't understand well what You would like to achieve but will aliases work for You? Just like regular alias www.myapp.com inside tomcat for myapp.com, you can add myapp2.com and so on for every domain You need. Best greetings, Paweł Wielgus. 2009/7/30 David Canos davidca...@gmail.com: Hi folksI'm facing a nice problem and I would be glad to hear from you. I think it should be useful to all. Problem is easy: Gandalf and I need to build 15 websites one per domain, I really dont want to maintain 15 different and pretty small projects. I will be happy to use subdomains, but I couldnt. Alternatives: - A Struts2 project attending 15 websites. is it possible? Writing my own FilterDispatcher?? - Multiple Struts2 project on per domain bundled in a EAR. I think I will overhead the job. I dont want to duplicate struts configurations, javascript and css resources. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: New to Struts, a Question
in your config files look for default result assignment with result tag as in result/userDisplay.jsp/result http://struts.apache.org/2.0.14/docs/result-configuration.html Martin Gainty __ Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité 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: Wed, 29 Jul 2009 21:14:24 -0400 Subject: Re: New to Struts, a Question From: tomsatt...@gmail.com To: user@struts.apache.org In my struts.xml file, I have the UserDisplayAction class and a blank (no name=) result for userDisplay.jsp. Does it pick up from there? On Wed, Jul 29, 2009 at 8:40 PM, Dave Newton newton.d...@yahoo.com wrote: Dennis Atkinson wrote: Dave, OK, I can make it work. I just don't understand WHY it works. If I change to this: a href=/betaSystem/userDisplay.actionMy Acccount/a I get exactly what I expect; the screen loads with the data filled in properly. But what I don't understand is how Struts knows to load userDisplay.jsp. I assume it parses the userDisplay out of the url and appends the .jsp to the end, so as long as I have these names the same (other than the suffix), this will work? You don't have a user display action configured via XML or annotations? Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org _ Bing™ brings you maps, menus, and reviews organized in one place. Try it now. http://www.bing.com/search?q=restaurantsform=MLOGENpubl=WLHMTAGcrea=TXT_MLOGEN_Local_Local_Restaurants_1x1
Re: EJB Injection in Interceptor
You can either use Spring or implement your own EJB3 interceptor. Though I use my own EJB3 interceptor, I believe the best option is to go with Spring. Google Juice can also be option on the table as well. --- On Thu, 7/30/09, Robin Mannering ro...@mtndesigns.co.uk wrote: From: Robin Mannering ro...@mtndesigns.co.uk Subject: Re: EJB Injection in Interceptor To: Struts Users Mailing List user@struts.apache.org Received: Thursday, July 30, 2009, 6:17 AM Just to clear up my actual question from the thread below as feedback has run dry unfortunately. Is there anybody working daily with Struts 2 and EJB 3.0? If so, what is the best way to obtain local references to EJB 3 session beans from within Struts 2 action classes? Thanks for any thoughts on this subject. Robin Mannering wrote: Just wondering if the below thread has gone any further. After creating another thread on the same subject at an earlier date, we discussed using the EJB plugin here: http://cwiki.apache.org/S2PLUGINS/ejb3-plugin.html However, having started to use this plugin so that I can reference stateless session beans, it seems that all EJB Session bean classes must be defined as @Remote rather than @Local in order for the injection to obtain the references correctly. Failure to specify them as remote throws a javax.naming.NameNotFoundException. However, reading from a book entitled Pro EJB 3.0, the following performance issues are mentioned in relation to using @Remote when @Local is available. Hopefully this link will work for you. http://books.google.co.uk/books?id=fVCuB_Xq3pACpg=PA40lpg=PA40dq=Making+an+interface+remote+has+consequencessource=blots=Bg9DdpVAWWsig=vxrumZhYLhjmqbt6bdMJ96hrY7shl=enei=QIdtStuLC-WhjAf34KGeCwsa=Xoi=book_resultct=resultresnum= So, the problem is : How can we obtain references to EJB 3 session beans from within Struts 2 action classes? I'd be very interested to hear your thoughts. Thanks Robin Nathan Schulte wrote: Wes Wannemacher wesw at wantii.com writes: Seems to me that my idea to create an ObjectFactory based plugin ... needs to pick up some steam. I only have one question for the EJB users out there... Do you guys need Spring integration as well? To answer your question, _I_ personally don't need Spring integration. I've never used Spring, and for this project, it was too much overhead to learn (on top of Java EE, the JPA, Hibernate intricacies, Struts2...), and from what I understand, it seemed like using it and S2 together provided duplicate functionality (another topic altogether...). On another note, I find it awesome that the community (or whatever group you're part of) is so willing to provide support. I mean, in my eyes, this is something that I could see myself writing to make my coding easier, it's just that given my situation, it's easier to use the workaround. Admittedly, I'm not very familiar with JEE5. Some of this is still black magic, and I don't fully understand the issue, I just know enough to understand that the architecture permits it as an issue (and not everyone is just blowing smoke my way) and can leave all of the intricate details be, as they don't directly affect my project. -Nate - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.387 / Virus Database: 270.13.20/2248 - Release Date: 07/19/09 05:57:00 No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.392 / Virus Database: 270.13.31/2265 - Release Date: 07/26/09 17:59:00 __ Looking for the perfect gift? Give the gift of Flickr! http://www.flickr.com/gift/ - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: One Struts2-project to rule them all
Hi David, I did a similar project as few months back where we supported 15 different URL with one Enterprise Implementation. The FilterDispatacher approach I guess is the right way to modularize the code. Your own FilterDispatacher (extending the Struts FilterDispatcher this class), which parses the URLs and redirected/forwarded the calls to the main application action classes. In this class you can also enforce other rules. Example : -- Mandating usage of https if the user types http -- Can handle application level controls Language and other stuff. Hope it helps. regards Kishore. From: David Canos davidca...@gmail.com To: Struts Users Mailing List user@struts.apache.org Sent: Thursday, July 30, 2009 4:39:11 PM Subject: One Struts2-project to rule them all Hi folksI'm facing a nice problem and I would be glad to hear from you. I think it should be useful to all. Problem is easy: Gandalf and I need to build 15 websites one per domain, I really dont want to maintain 15 different and pretty small projects. I will be happy to use subdomains, but I couldnt. Alternatives: - A Struts2 project attending 15 websites. is it possible? Writing my own FilterDispatcher?? - Multiple Struts2 project on per domain bundled in a EAR. I think I will overhead the job. I dont want to duplicate struts configurations, javascript and css resources.
Re: EJB Injection in Interceptor
Sorry Robin, this is on my to-do list, but it's not something I'm working on right this second. One thing that is holding me up is the lack of knowledge of JEE. Is there a standard mechanism for creating instances of EJB-hydrated objects? For instance, if you annotated a field on a servlet with @PersistenceContext, the entity manager will be populated on the servlet. Obviously this works because the app server instantiates the servlet and the app server knows to do things like this. Is it part of the spec(s) that there is a way to instantiate objects, complete with dependencies injected? I know you can get objects from the JNDI context, but would that mean that objects retrieved need to be defined in JNDI? In the example with the servlet and EM, the servlet is defined in the web.xml, not the JNDI context... So, is there a place where I can read up on standard instantiation with EE DI? If it's not part of the standard, then, I still wouldn't mind building something specific to the app server that you are using (provided it is something I can get my hands on for free i.e. JBoss, OpenEJB). I started looking into this when this came up a few weeks ago, but I wasn't finding what I wanted so it got put off. If there is a way for me to call into the app server's own instantiation w/ DI facilities, writing this plugin would be a snap... -Wes On Thu, Jul 30, 2009 at 2:17 AM, Robin Manneringro...@mtndesigns.co.uk wrote: Just to clear up my actual question from the thread below as feedback has run dry unfortunately. Is there anybody working daily with Struts 2 and EJB 3.0? If so, what is the best way to obtain local references to EJB 3 session beans from within Struts 2 action classes? Thanks for any thoughts on this subject. Robin Mannering wrote: Just wondering if the below thread has gone any further. After creating another thread on the same subject at an earlier date, we discussed using the EJB plugin here: http://cwiki.apache.org/S2PLUGINS/ejb3-plugin.html However, having started to use this plugin so that I can reference stateless session beans, it seems that all EJB Session bean classes must be defined as @Remote rather than @Local in order for the injection to obtain the references correctly. Failure to specify them as remote throws a javax.naming.NameNotFoundException. However, reading from a book entitled Pro EJB 3.0, the following performance issues are mentioned in relation to using @Remote when @Local is available. Hopefully this link will work for you. http://books.google.co.uk/books?id=fVCuB_Xq3pACpg=PA40lpg=PA40dq=Making+an+interface+remote+has+consequencessource=blots=Bg9DdpVAWWsig=vxrumZhYLhjmqbt6bdMJ96hrY7shl=enei=QIdtStuLC-WhjAf34KGeCwsa=Xoi=book_resultct=resultresnum= So, the problem is : How can we obtain references to EJB 3 session beans from within Struts 2 action classes? I'd be very interested to hear your thoughts. Thanks Robin Nathan Schulte wrote: Wes Wannemacher wesw at wantii.com writes: Seems to me that my idea to create an ObjectFactory based plugin ... needs to pick up some steam. I only have one question for the EJB users out there... Do you guys need Spring integration as well? To answer your question, _I_ personally don't need Spring integration. I've never used Spring, and for this project, it was too much overhead to learn (on top of Java EE, the JPA, Hibernate intricacies, Struts2...), and from what I understand, it seemed like using it and S2 together provided duplicate functionality (another topic altogether...). On another note, I find it awesome that the community (or whatever group you're part of) is so willing to provide support. I mean, in my eyes, this is something that I could see myself writing to make my coding easier, it's just that given my situation, it's easier to use the workaround. Admittedly, I'm not very familiar with JEE5. Some of this is still black magic, and I don't fully understand the issue, I just know enough to understand that the architecture permits it as an issue (and not everyone is just blowing smoke my way) and can leave all of the intricate details be, as they don't directly affect my project. -Nate - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.387 / Virus Database: 270.13.20/2248 - Release Date: 07/19/09 05:57:00 No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.392 / Virus Database: 270.13.31/2265 - Release Date: 07/26/09 17:59:00 -- Wes Wannemacher Head Engineer, WanTii, Inc. Need Training? Struts, Spring, Maven,
Re: EJB Injection in Interceptor
On Today at 9:16am, WW=Wes Wannemacher w...@wantii.com wrote: WW Sorry Robin, this is on my to-do list, but it's not something I'm WW working on right this second. One thing that is holding me up is the WW lack of knowledge of JEE. Is there a standard mechanism for creating WW instances of EJB-hydrated objects? WW WW [..snip..] WW Hi Wes, I don't know much of the details about the JEE spec, however, I can share my implementation with you. The code is not in production yet, so caveat emptor (it works for us, for now in development). I use glassfish as my app server. To expose local EJB interfaces within our entire application, I use an EJBInvokerServlet (uses the @EJB and @EJBs annotations). The listing is as follows (took out package and import statements and anonymized): @EJBs( value = { @EJB(beanInterface = Local1.class, name = ejb/local1), @EJB(beanInterface = Local2.class, name = ejb/local2), } ) /** * Used to make local interfaces of listed EJBs available within the whole * web application. */ public class EJBInvokerServlet extends HttpServlet { } The other way to inject beans is by specifying ejb-local-ref inside web.xml. ejb-local-ref ejb-ref-nameLocal1Bean/ejb-ref-name ejb-ref-typeSession/ejb-ref-type localLocal1/local /ejb-local-ref I prefer the Servlet approach as its simpler. Wherever we need the EJBs to be automagically injected (the container does its part because of EJBInvokerServlet), we then use the @Resource annotation, e.g., to inject the Local1 interface, I would use: @Resource(mappedName = ejb/local1) private Local1 local1; Hope that helps. -- Haroon Rafique haroon.rafi...@utoronto.ca - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: EJB Injection in Interceptor
On Thu, Jul 30, 2009 at 10:34 AM, Haroon Rafiqueharoon.rafi...@utoronto.ca wrote: Hi Wes, I don't know much of the details about the JEE spec, however, I can share my implementation with you. The code is not in production yet, so caveat emptor (it works for us, for now in development). I use glassfish as my app server. To expose local EJB interfaces within our entire application, I use an EJBInvokerServlet (uses the @EJB and @EJBs annotations). The listing is as follows (took out package and import statements and anonymized): �...@ejbs( value = { �...@ejb(beanInterface = Local1.class, name = ejb/local1), �...@ejb(beanInterface = Local2.class, name = ejb/local2), } ) /** * Used to make local interfaces of listed EJBs available within the whole * web application. */ public class EJBInvokerServlet extends HttpServlet { } The other way to inject beans is by specifying ejb-local-ref inside web.xml. ejb-local-ref ejb-ref-nameLocal1Bean/ejb-ref-name ejb-ref-typeSession/ejb-ref-type localLocal1/local /ejb-local-ref I prefer the Servlet approach as its simpler. Wherever we need the EJBs to be automagically injected (the container does its part because of EJBInvokerServlet), we then use the @Resource annotation, e.g., to inject the Local1 interface, I would use: �...@resource(mappedName = ejb/local1) private Local1 local1; Hope that helps. Haroon, it does and it doesn't. @EJB/@EJBs and @Resource aren't the only DI annotations that are part of the EE specs. This is the problem Robin has with the existing integration plugins. My understanding of what he wants is that he wants to be able to use other annotations (like @PersistenceContext) on fields in a struts action and have those fields injected. To turn it around and consider it compared to another similar plugin... In the spring plugin, we delegate the class instantiation to spring, then spring can decide what needs injected, etc. based on spring configuration. What I'd like to do is apply the same concept to EE. To do this in spring, there is an implementation of the ObjectFactory that first tries to instantiate objects using spring, and when that fails, it falls back on traditional xwork instantiation (reflection-based). Once the object is created, the spring object factory then checks to see if it can autowire the instance (based on plugin configuration). I'd like to try a similar approach with EE. The hard part is that I don't know what API, or where to look for an API that instantiates EE objects. Spring has 'applicationContext.getBean', is there something similar for EE? Even if it's not as easy as Spring, I'm still willing to wade through it for a bit since it seems like it would be useful to at least a few users. The advantage to an object factory based EE plugin is that I don't need to be aware of the annotations at all, I'd be delegating that sort of thing to the EE app server's own mechanisms. -Wes -- Wes Wannemacher Head Engineer, WanTii, Inc. Need Training? Struts, Spring, Maven, Tomcat... Ask me for a quote! - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Strut2 - s:optiontransferselect tag Issue
I am using Struts 2 tag s:optiontransferselect Now I have a ListCategory where Category have attributes as {int id, String name}. Now when I implement this tag, in left hand listbox I put 'categoryList' which create option as option value=1Value 1/option and so on. Now I transfer few values to right side listbox. In right side list again i have option as option value=1Value 1/option. Now I want to fetch these value as an List of Object i.e. ListCategory When I save it throws erros? Please help. I have tried using conversion.properties file but can't able to reach the solution. -- View this message in context: http://www.nabble.com/Strut2---%3Cs%3Aoptiontransferselect%3E-tag-Issue-tp24739637p24739637.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: [Struts 2] Date conversion general bug!
Hi, I solved my problem replacing the xwork library by xwork-2.0.8-SNAPSHOT.jar. I was necessary to download the source of this version and build it. Aloha, Rafael Sobral Sparecreative wrote: I agree that date conversion is a real problem for S2, especially in multi lingual applications. We¹ve had to implement our own converter which either looks for a format value with the date string or picks up a list of default prioritised date formats and tries each one successively until success or failure with all. Ideally it would be good if we could configure S2 out of the box (so to speak) to perform the same functionality. By that I mean that in struts.xml or by convention file you could specify locale or a comma separated list of date formats to try for both short (date only) and long (date and time) values. Z. -- View this message in context: http://www.nabble.com/-Struts-2--Date-conversion-general-bug%21-tp17369156p24740599.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Struts 2 performance
If you have a commercial profiler that works on Mac, it could be good enough. But after I have been using it for a few days I was like whoaa this thing has improved a lot. It has a feature for profiling lock contention which is very sweet. musachy On Wed, Jul 29, 2009 at 11:38 PM, Dale Newfieldd...@newfield.org wrote: Musachy Barroso wrote: Just to save you some time (because I just spend sometime myself on this), I would suggest you to use the profiler that comes with JRockit: http://www.oracle.com/technology/products/jrockit/index.html You will have to run your application with the JRockit jre to use it. It is free, and by far the best profiler I have ever used. I do all my development on a mac (not a platform for which this is available). I do have an old PC with *maybe* 1GB of memory that's dog slow already...do you think it's worth the hair I'll have to pull out in order to run my app in this and test it out? -Dale - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org -- Hey you! Would you help me to carry the stone? Pink Floyd - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: One Struts2-project to rule them all
thankx for your answers I did a similar project as few months back where we supported 15 different URL with one Enterprise Implementation. The FilterDispatacher approach I guess is the right way to modularize the code. What you mean with Enterprise Implementation? just an ear with a simple war? I really dont like to changing the Filter. I was looking at URLRewrite [1] this morning, it works just before the filter. Implementing my own filter should be great but if I resolve the issue one step before I think it would be better. [1] http://code.google.com/p/urlrewritefilter/ http://code.google.com/p/urlrewritefilter/ 2009/7/30 kishore chakraborty kishore1...@yahoo.com Hi David, I did a similar project as few months back where we supported 15 different URL with one Enterprise Implementation. The FilterDispatacher approach I guess is the right way to modularize the code. Your own FilterDispatacher (extending the Struts FilterDispatcher this class), which parses the URLs and redirected/forwarded the calls to the main application action classes. In this class you can also enforce other rules. Example : -- Mandating usage of https if the user types http -- Can handle application level controls Language and other stuff. Hope it helps. regards Kishore. From: David Canos davidca...@gmail.com To: Struts Users Mailing List user@struts.apache.org Sent: Thursday, July 30, 2009 4:39:11 PM Subject: One Struts2-project to rule them all Hi folksI'm facing a nice problem and I would be glad to hear from you. I think it should be useful to all. Problem is easy: Gandalf and I need to build 15 websites one per domain, I really dont want to maintain 15 different and pretty small projects. I will be happy to use subdomains, but I couldnt. Alternatives: - A Struts2 project attending 15 websites. is it possible? Writing my own FilterDispatcher?? - Multiple Struts2 project on per domain bundled in a EAR. I think I will overhead the job. I dont want to duplicate struts configurations, javascript and css resources.
Re: New to Struts, a Question
Thanks to all who helped with this - I understand it better now. Dennis From: Martin Gainty mgai...@hotmail.com To: Struts Users Mailing List user@struts.apache.org Sent: Thursday, July 30, 2009 8:32:01 AM Subject: RE: New to Struts, a Question in your config files look for default result assignment with result tag as in result/userDisplay.jsp/result http://struts.apache.org/2.0.14/docs/result-configuration.html Martin Gainty __ Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité 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: Wed, 29 Jul 2009 21:14:24 -0400 Subject: Re: New to Struts, a Question From: tomsatt...@gmail.com To: user@struts.apache.org In my struts.xml file, I have the UserDisplayAction class and a blank (no name=) result for userDisplay.jsp. Does it pick up from there? On Wed, Jul 29, 2009 at 8:40 PM, Dave Newton newton.d...@yahoo.com wrote: Dennis Atkinson wrote: Dave, OK, I can make it work. I just don't understand WHY it works. If I change to this: a href=/betaSystem/userDisplay.actionMy Acccount/a I get exactly what I expect; the screen loads with the data filled in properly. But what I don't understand is how Struts knows to load userDisplay.jsp. I assume it parses the userDisplay out of the url and appends the .jsp to the end, so as long as I have these names the same (other than the suffix), this will work? You don't have a user display action configured via XML or annotations? Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org _ Bing™ brings you maps, menus, and reviews organized in one place. Try it now. http://www.bing.com/search?q=restaurantsform=MLOGENpubl=WLHMTAGcrea=TXT_MLOGEN_Local_Local_Restaurants_1x1
common error page in struts2 application
Hi, What is the way to provide a common error page in a struts2 application? and automatically redirect to the error page when errors occur? Thanks
Re: common error page in struts2 application
Bhaarat Sharma wrote: What is the way to provide a common error page in a struts2 application? and automatically redirect to the error page when errors occur? Map exceptions to a global result. Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: common error page in struts2 application
On Thu, Jul 30, 2009 at 2:41 PM, Dave Newtonnewton.d...@yahoo.com wrote: Bhaarat Sharma wrote: What is the way to provide a common error page in a struts2 application? and automatically redirect to the error page when errors occur? Map exceptions to a global result. Dave Make sure you set error-page in your web.xml as well. Exceptions mapped to global results are good for errors that occur in app code, but you should also consider things like 404s. -Wes -- Wes Wannemacher Head Engineer, WanTii, Inc. Need Training? Struts, Spring, Maven, Tomcat... Ask me for a quote! - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: common error page in struts2 application
how do we map exceptions to a global result? On Thu, Jul 30, 2009 at 2:41 PM, Dave Newton newton.d...@yahoo.com wrote: Bhaarat Sharma wrote: What is the way to provide a common error page in a struts2 application? and automatically redirect to the error page when errors occur? Map exceptions to a global result. Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: common error page in struts2 application
global-exception-mappings exception-mapping exception=java.lang.Exception result=error / /global-exception-mappings On Thu, Jul 30, 2009 at 2:55 PM, Bhaarat Sharma bhaara...@gmail.com wrote: how do we map exceptions to a global result? On Thu, Jul 30, 2009 at 2:41 PM, Dave Newton newton.d...@yahoo.com wrote: Bhaarat Sharma wrote: What is the way to provide a common error page in a struts2 application? and automatically redirect to the error page when errors occur? Map exceptions to a global result. Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: EJB Injection in Interceptor
Just to note, there has been some work in OpenEJB to make it so Struts objects can use Java EE injection like Servlets or JSF components can. Karan did the work, he might be able to give more detail. -David On Jul 30, 2009, at 6:16 AM, Wes Wannemacher wrote: Sorry Robin, this is on my to-do list, but it's not something I'm working on right this second. One thing that is holding me up is the lack of knowledge of JEE. Is there a standard mechanism for creating instances of EJB-hydrated objects? For instance, if you annotated a field on a servlet with @PersistenceContext, the entity manager will be populated on the servlet. Obviously this works because the app server instantiates the servlet and the app server knows to do things like this. Is it part of the spec(s) that there is a way to instantiate objects, complete with dependencies injected? I know you can get objects from the JNDI context, but would that mean that objects retrieved need to be defined in JNDI? In the example with the servlet and EM, the servlet is defined in the web.xml, not the JNDI context... So, is there a place where I can read up on standard instantiation with EE DI? If it's not part of the standard, then, I still wouldn't mind building something specific to the app server that you are using (provided it is something I can get my hands on for free i.e. JBoss, OpenEJB). I started looking into this when this came up a few weeks ago, but I wasn't finding what I wanted so it got put off. If there is a way for me to call into the app server's own instantiation w/ DI facilities, writing this plugin would be a snap... -Wes On Thu, Jul 30, 2009 at 2:17 AM, Robin Manneringro...@mtndesigns.co.uk wrote: Just to clear up my actual question from the thread below as feedback has run dry unfortunately. Is there anybody working daily with Struts 2 and EJB 3.0? If so, what is the best way to obtain local references to EJB 3 session beans from within Struts 2 action classes? Thanks for any thoughts on this subject. Robin Mannering wrote: Just wondering if the below thread has gone any further. After creating another thread on the same subject at an earlier date, we discussed using the EJB plugin here: http://cwiki.apache.org/S2PLUGINS/ejb3-plugin.html However, having started to use this plugin so that I can reference stateless session beans, it seems that all EJB Session bean classes must be defined as @Remote rather than @Local in order for the injection to obtain the references correctly. Failure to specify them as remote throws a javax.naming.NameNotFoundException. However, reading from a book entitled Pro EJB 3.0, the following performance issues are mentioned in relation to using @Remote when @Local is available. Hopefully this link will work for you. http://books.google.co.uk/books?id=fVCuB_Xq3pACpg=PA40lpg=PA40dq=Making+an+interface+remote+has+consequencessource=blots=Bg9DdpVAWWsig=vxrumZhYLhjmqbt6bdMJ96hrY7shl=enei=QIdtStuLC-WhjAf34KGeCwsa=Xoi=book_resultct=resultresnum= So, the problem is : How can we obtain references to EJB 3 session beans from within Struts 2 action classes? I'd be very interested to hear your thoughts. Thanks Robin Nathan Schulte wrote: Wes Wannemacher wesw at wantii.com writes: Seems to me that my idea to create an ObjectFactory based plugin ... needs to pick up some steam. I only have one question for the EJB users out there... Do you guys need Spring integration as well? To answer your question, _I_ personally don't need Spring integration. I've never used Spring, and for this project, it was too much overhead to learn (on top of Java EE, the JPA, Hibernate intricacies, Struts2...), and from what I understand, it seemed like using it and S2 together provided duplicate functionality (another topic altogether...). On another note, I find it awesome that the community (or whatever group you're part of) is so willing to provide support. I mean, in my eyes, this is something that I could see myself writing to make my coding easier, it's just that given my situation, it's easier to use the workaround. Admittedly, I'm not very familiar with JEE5. Some of this is still black magic, and I don't fully understand the issue, I just know enough to understand that the architecture permits it as an issue (and not everyone is just blowing smoke my way) and can leave all of the intricate details be, as they don't directly affect my project. -Nate - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.387 / Virus Database: 270.13.20/2248 - Release Date: 07/19/09 05:57:00
Re: common error page in struts2 application
Bhaarat Sharma wrote: how do we map exceptions to a global result? You may not know about the Struts 2 documentation wiki that has a page covering exception configuration: http://struts.apache.org/2.1.6/docs/exception-configuration.html Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: common error page in struts2 application
thanks On Thu, Jul 30, 2009 at 3:21 PM, Dave Newton newton.d...@yahoo.com wrote: Bhaarat Sharma wrote: how do we map exceptions to a global result? You may not know about the Struts 2 documentation wiki that has a page covering exception configuration: http://struts.apache.org/2.1.6/docs/exception-configuration.html Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Struts2 + JPA + JSON - Help with error
Hey all, I've got an issue I can't seem to solve. I'm using Struts2 with the JSON Plugin. The error I am receiving is below. This occurs when trying to access the Action. I am not sure why this error is being thrown, but I believe it has something to do with the way I implemented the Open Session in View pattern. The Action consists of querying via JPA for a List of entities, and returning ActionSupport.SUCCESS. The Action has a single result, result name=success type=json/. The entities that the list consists of have lazily fetched associations. My solution to the Open Session in View pattern is described here, http://article.gmane.org/gmane.comp.jakarta.struts.user/170543, and works for other result types (specifically the dispatcher type). Here is a link to the error, http://pastebin.com/m5d0d22c8. Thanks! - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: common error page in struts2 application
one last question: lets say my mapping comes out to be this global-results result name=error/chapterFour/Error.jsp/result /global-results global-exception-mappings exception-mapping exception=java.lang.Exception result=error / /global-exception-mappings so will i add that in each package in my struts.xml. I have over 20 right now. Is there a way to just add it somewhere so that all 20 package mappings see it? most of the packing are using struts-default On Thu, Jul 30, 2009 at 3:26 PM, Bhaarat Sharma bhaara...@gmail.com wrote: thanks On Thu, Jul 30, 2009 at 3:21 PM, Dave Newton newton.d...@yahoo.comwrote: Bhaarat Sharma wrote: how do we map exceptions to a global result? You may not know about the Struts 2 documentation wiki that has a page covering exception configuration: http://struts.apache.org/2.1.6/docs/exception-configuration.html Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: EJB Injection in Interceptor
Robin Mannering robin at mtndesigns.co.uk writes: http://cwiki.apache.org/S2PLUGINS/ejb3-plugin.html Are you using that plugin, or the following? http://cwiki.apache.org/S2PLUGINS/ejb3-jboss-plugin.html With the JBoss plugin, I am able to use Local interfaces rather than remote. I can show an example of this as well if you think it might help. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Struts 2.1.6 TLD file
Hi, Our J2EE server (Sybase EAServer 6.1) has been complaining about my struts 2 application when I deploy it. After some digging, it turns out that the tlibversion in the Struts2 tld file is invalid. This seemed to happen when I changed my project to Servlet 2.5. The Struts 2 tlibversion is 2.2.3, and I know that the 'tlibversion' can be a dewey-decimal type, but from my memories of libraries, I don't remember it being allowed to have 2 decimal points. Does anybody know if this is a failing of my server, or is this something that is a failing of Struts2? In the mean time, I actually, at runtime, open up the Struts 2 Jar, and modify the tld to fix it when deploying to that server. Thanks Dan Slack
RE: Struts 2 performance
detect lock contention on threads or connections? lock on something else? ? Martin Gainty __ Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité 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: Thu, 30 Jul 2009 08:40:30 -0700 Subject: Re: Struts 2 performance From: musa...@gmail.com To: user@struts.apache.org If you have a commercial profiler that works on Mac, it could be good enough. But after I have been using it for a few days I was like whoaa this thing has improved a lot. It has a feature for profiling lock contention which is very sweet. musachy On Wed, Jul 29, 2009 at 11:38 PM, Dale Newfieldd...@newfield.org wrote: Musachy Barroso wrote: Just to save you some time (because I just spend sometime myself on this), I would suggest you to use the profiler that comes with JRockit: http://www.oracle.com/technology/products/jrockit/index.html You will have to run your application with the JRockit jre to use it. It is free, and by far the best profiler I have ever used. I do all my development on a mac (not a platform for which this is available). I do have an old PC with *maybe* 1GB of memory that's dog slow already...do you think it's worth the hair I'll have to pull out in order to run my app in this and test it out? -Dale - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org -- Hey you! Would you help me to carry the stone? Pink Floyd - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org _ NEW mobile Hotmail. Optimized for YOUR phone. Click here. http://windowslive.com/Mobile?ocid=TXT_TAGLM_WL_CS_MB_new_hotmail_072009
RE: Struts 2.1.6 TLD file
webapp server's container supports a servlet spec here is an example from TC http://tomcat.apache.org/ 2.5 Servlet spec support on TC as the example illustrates Servlet/JSP Spec Apache Tomcat version 2.5/2.1 6.0.20 2.4/2.0 5.5.27 2.3/1.2 4.1.40 2.2/1.1 3.3.2 (archived) much easier to upgrade the one aberrant taglib.. you can always re-implement an older container ..but i would suspect alot Servlet Spec 2.5 webapps would break Martin Gainty __ Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité 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. From: dsl...@langui.com To: user@struts.apache.org Subject: Struts 2.1.6 TLD file Date: Thu, 30 Jul 2009 14:50:09 -0500 Hi, Our J2EE server (Sybase EAServer 6.1) has been complaining about my struts 2 application when I deploy it. After some digging, it turns out that the tlibversion in the Struts2 tld file is invalid. This seemed to happen when I changed my project to Servlet 2.5. The Struts 2 tlibversion is 2.2.3, and I know that the 'tlibversion' can be a dewey-decimal type, but from my memories of libraries, I don't remember it being allowed to have 2 decimal points. Does anybody know if this is a failing of my server, or is this something that is a failing of Struts2? In the mean time, I actually, at runtime, open up the Struts 2 Jar, and modify the tld to fix it when deploying to that server. Thanks Dan Slack _ Windows Live™ Hotmail®: Search, add, and share the web’s latest sports videos. Check it out. http://www.windowslive.com/Online/Hotmail/Campaign/QuickAdd?ocid=TXT_TAGLM_WL_QA_HM_sports_videos_072009cat=sports
Re: common error page in struts2 application
Bhaarat Sharma wrote: Is there a way to just add [exception mapping] somewhere so that all 20 package mappings see it? most of the packing are using struts-default You could create your own base package and extend from that. Package extension is also documented on the Struts 2 wiki (briefly): http://struts.apache.org/2.1.6/docs/package-configuration.html Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Struts 2.1.6 TLD file
Yes, the version is wrong in struts, according to the JSP Spec: !ELEMENT tlibversion (#PCDATA) Describes the JSP version (number) this taglibrary requires in order to function (dewey decimal) The default is 1.1 #PCDATA ::= [0-9]*{ “.”[0-9] }0..3 //I will fix it in trunk musachy On Thu, Jul 30, 2009 at 12:50 PM, Dan Slackdsl...@langui.com wrote: Hi, Our J2EE server (Sybase EAServer 6.1) has been complaining about my struts 2 application when I deploy it. After some digging, it turns out that the tlibversion in the Struts2 tld file is invalid. This seemed to happen when I changed my project to Servlet 2.5. The Struts 2 tlibversion is 2.2.3, and I know that the 'tlibversion' can be a dewey-decimal type, but from my memories of libraries, I don't remember it being allowed to have 2 decimal points. Does anybody know if this is a failing of my server, or is this something that is a failing of Struts2? In the mean time, I actually, at runtime, open up the Struts 2 Jar, and modify the tld to fix it when deploying to that server. Thanks Dan Slack -- Hey you! Would you help me to carry the stone? Pink Floyd - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Struts 2.1.6 TLD file
Dan Slack wrote: Our J2EE server (Sybase EAServer 6.1) has been complaining about my struts 2 application when I deploy it. After some digging, it turns out that the tlibversion in the Struts2 tld file is invalid. This seemed to happen when I changed my project to Servlet 2.5. The Struts 2 tlibversion is 2.2.3, and I know that the 'tlibversion' can be a dewey-decimal type, but from my memories of libraries, I don't remember it being allowed to have 2 decimal points. Does anybody know if this is a failing of my server, or is this something that is a failing of Struts2? I don't know what it's supposed to be, but at least some taglib DTD's ([1] for example) contain the following: !ELEMENT tlib-version (#PCDATA) !-- Describes the JSP version (number) this taglibrary requires in order to function (dewey decimal) The default is 1.2 #PCDATA ::= [0-9]*{ .[0-9] }0..3 -- Dave [1] Note also that Sun's 1.2 DTD contained the same: http://svn.apache.org/repos/asf/tomcat/servletapi/branches/other/servlet2.4-jsp2.0-tc5.x/js5/src/share/dtd/web-jsptaglibrary_2_0.dtd - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Struts 2.1.6 TLD file
agr, actually I missread the regex, I read 0..3 as applied to [0..9]. So the version in the tld is ok. musachy On Thu, Jul 30, 2009 at 1:09 PM, Musachy Barrosomusa...@gmail.com wrote: Yes, the version is wrong in struts, according to the JSP Spec: !ELEMENT tlibversion (#PCDATA) Describes the JSP version (number) this taglibrary requires in order to function (dewey decimal) The default is 1.1 #PCDATA ::= [0-9]*{ “.”[0-9] }0..3 //I will fix it in trunk musachy On Thu, Jul 30, 2009 at 12:50 PM, Dan Slackdsl...@langui.com wrote: Hi, Our J2EE server (Sybase EAServer 6.1) has been complaining about my struts 2 application when I deploy it. After some digging, it turns out that the tlibversion in the Struts2 tld file is invalid. This seemed to happen when I changed my project to Servlet 2.5. The Struts 2 tlibversion is 2.2.3, and I know that the 'tlibversion' can be a dewey-decimal type, but from my memories of libraries, I don't remember it being allowed to have 2 decimal points. Does anybody know if this is a failing of my server, or is this something that is a failing of Struts2? In the mean time, I actually, at runtime, open up the Struts 2 Jar, and modify the tld to fix it when deploying to that server. Thanks Dan Slack -- Hey you! Would you help me to carry the stone? Pink Floyd -- Hey you! Would you help me to carry the stone? Pink Floyd - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: Struts 2.1.6 TLD file
Ok, so, it's obviously an issue with my servers validation of tlibversion. I'll guess I'll have to stick with my hack until a new version of the server is tested. Thanks, Dan -Original Message- From: Musachy Barroso [mailto:musa...@gmail.com] Sent: Thursday, July 30, 2009 3:12 PM To: Struts Users Mailing List Subject: Re: Struts 2.1.6 TLD file agr, actually I missread the regex, I read 0..3 as applied to [0..9]. So the version in the tld is ok. musachy On Thu, Jul 30, 2009 at 1:09 PM, Musachy Barrosomusa...@gmail.com wrote: Yes, the version is wrong in struts, according to the JSP Spec: !ELEMENT tlibversion (#PCDATA) Describes the JSP version (number) this taglibrary requires in order to function (dewey decimal) The default is 1.1 #PCDATA ::= [0-9]*{ .[0-9] }0..3 //I will fix it in trunk musachy On Thu, Jul 30, 2009 at 12:50 PM, Dan Slackdsl...@langui.com wrote: Hi, Our J2EE server (Sybase EAServer 6.1) has been complaining about my struts 2 application when I deploy it. After some digging, it turns out that the tlibversion in the Struts2 tld file is invalid. This seemed to happen when I changed my project to Servlet 2.5. The Struts 2 tlibversion is 2.2.3, and I know that the 'tlibversion' can be a dewey-decimal type, but from my memories of libraries, I don't remember it being allowed to have 2 decimal points. Does anybody know if this is a failing of my server, or is this something that is a failing of Struts2? In the mean time, I actually, at runtime, open up the Struts 2 Jar, and modify the tld to fix it when deploying to that server. Thanks Dan Slack -- Hey you! Would you help me to carry the stone? Pink Floyd -- Hey you! Would you help me to carry the stone? Pink Floyd - 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 + JPA + JSON - Help with error
Nathan Schulte nathan.schulte at ngc.com writes: here, http://article.gmane.org/gmane.comp.jakarta.struts.user/170543, http://article.gmane.org/gmane.comp.jakarta.struts.user/170543 Here is a link to the error, http://pastebin.com/m5d0d22c8. http://pastebin.com/m5d0d22c8 Also, here is the exception report (of a similar action) given as the HTTP response: http://pastebin.com/m21348ec5 - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
splitting one struts app into two
I have an existing struts/tiles app that works great. I just got a new requirement to add another product that will share some of the infrastructure already created/used in the existing app. I thought I would do this by having three struts.xml files -- one for the new app, one for the existing app, and one for the shared stuff. I'm having a really hard time doing this. I tried putting include file=... into the base struts.xml file. This works in the sense that I can access the actions, but the interceptors stack that I have in the main struts isn't working for the original app. I think it's because I'm forced to have different package names? Help would be greatly appreciated, Kate - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: One Struts2-project to rule them all
We¹ve implemented a similar solution where we have a custom interceptor which sets a domainId value based on the url used to access the site. It¹s then a simple matter of applying the appropriate processing for each of the domains based on the domainId value. I can tell you from our perspective its great as our app manages about 120 domains on a single app and the client loves it because they a a single interface for all domains. Z. Hi folksI'm facing a nice problem and I would be glad to hear from you. I think it should be useful to all. Problem is easy: Gandalf and I need to build 15 websites one per domain, I really dont want to maintain 15 different and pretty small projects. I will be happy to use subdomains, but I couldnt. Alternatives: - A Struts2 project attending 15 websites. is it possible? Writing my own FilterDispatcher?? - Multiple Struts2 project on per domain bundled in a EAR. I think I will overhead the job. I dont want to duplicate struts configurations, javascript and css resources.
[s2] Multiple file upload using arrays
I have a question about multiple file uploads using arrays[1]. Say I have 4 text fields with a file input field related to each one on a JSP like this: input type=text name=attrVal/ s:file label=File (1) name=attrImg / input type=text name=attrVal/ s:file label=File (2) name=attrImg / input type=text name=attrVal/ s:file label=FIle (3) name=attrImg / input type=text name=attrVal/ s:file label=FIle (4) name=attrImg / The user must enter a value in the text field, but uploading a file isn't required. If the user picks a file for File(1) and File(4), in my Action class the attrImg File[] only has two values in it. This makes sense, but I'm wondering, is there a way I can get Struts to include null values in the File[] for the file upload fields (in this case 2 and 3) the user didn't choose a file for? I need to keep the files associated with the textfield data in my action, as it works now, I can't do that, because I won't know which textfield the files are related to. I can't give each upload field a unique name, as the user is able to add a new textfield/file input pair dynamically. Any ideas would be greatly appreciated. Thanks! Nate [1] http://struts.apache.org/2.1.6/docs/file-upload.html#FileUpload-UploadingMultipleFilesusingArrays -- View this message in context: http://www.nabble.com/-s2--Multiple-file-upload-using-arrays-tp24750296p24750296.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: common error page in struts2 application
will the global exception not recognize the exception if I am catching it?? I need to catch it because I want to put it in the logs. However, in my example, if i am catching the exception then I am seeing that the error page defined with global-results is not coming up. do the global exception mappings only work for 'non caught' exceptions? On Thu, Jul 30, 2009 at 4:07 PM, Dave Newton newton.d...@yahoo.com wrote: Bhaarat Sharma wrote: Is there a way to just add [exception mapping] somewhere so that all 20 package mappings see it? most of the packing are using struts-default You could create your own base package and extend from that. Package extension is also documented on the Struts 2 wiki (briefly): http://struts.apache.org/2.1.6/docs/package-configuration.html Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: common error page in struts2 application
Sorry I am a little confused. Basically I need to be able to log the message by doing log.error(e.getMessage(), e); However, if i catch the error and put it in the catch block then the global error page does not come up (I am assuming because the exception is caught?) If I do not catch the exception, then the error page shows up, however, I have no way to do log.error(e.getMessage(), e); After reading, http://struts.apache.org/2.0.6/docs/exception-configuration.html I though I can have a chainAction so something like. package... global-results result name=Exception type=chain param name=actionNameErrorPage/param param name=namespace/error/param /result /global-results global-exception-mappings exception-mapping exception=java.lang.Exception result=Exception/ /global-exception-mappings action name=selectionPage class=reports.ReportSelection result/reports/SelectionPage.jsp/result /action /package package name=secure namespace=/error action name=ErrorPage class=com.myErrorClass resulterrorpage.jsp/result /action /package So finally, if i do not catch the error, the control will go to com.myErrorClass. Will I be able to do log.error(e.getMessage(), e); in that class?? I dont think it will be available as originally the error was thrown in reports.ReportSelection class. I'd appreciate any help to guide me in right direction. Thanks On Thu, Jul 30, 2009 at 11:40 PM, Bhaarat Sharma bhaara...@gmail.comwrote: will the global exception not recognize the exception if I am catching it?? I need to catch it because I want to put it in the logs. However, in my example, if i am catching the exception then I am seeing that the error page defined with global-results is not coming up. do the global exception mappings only work for 'non caught' exceptions? On Thu, Jul 30, 2009 at 4:07 PM, Dave Newton newton.d...@yahoo.comwrote: Bhaarat Sharma wrote: Is there a way to just add [exception mapping] somewhere so that all 20 package mappings see it? most of the packing are using struts-default You could create your own base package and extend from that. Package extension is also documented on the Struts 2 wiki (briefly): http://struts.apache.org/2.1.6/docs/package-configuration.html Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org