Re: Invoking Javascript function from Struts 1.3
Thanks to the repliers! Tom, your solution is perfect. Thank you! Dave, I might have been unclear as to what I was looking for. I wasn't specifically looking to get the html:link tag working; I was just looking for a solution, with whatever would possibly help. Dennis
Invoking Javascript function from Struts 1.3
Greetings all. I have a problem invoking Javascript that I can't seem to solve. I'm hoping someone here has run into the same kind of thing. When I am iterating through a List of items to display (via the logic:iterate tag), one cell I am trying to write has to be a link to a Javascript function, with three parameters. If I wasn't using Struts, I'd write standard html, like so: a href=javascript:showStuffForPerson('405574', '459', '3')405574/a But if I do this in Struts, I get that exact string in the cell, which isn't what I want. I need to have 405574 in the cell, and when I click on it, the javascript has to be invoked with those three parameters. It really, really needs to work this way. I tried experimenting with the html:link tag, and it *seems* like that's the way to go, but I am lost with respect to the associated html:param tags. I assume I'll need three of them (one for each parameter), but I can't seem to make that work. If I give them a name, it doesn't work, and if I don't give them a name that doesn't work any better. Or maybe I'm going about this all wrong? Any assistance would be very much appreciated. Thanks in advance, Dennis
Re: Struts2 / Hibernate Question
Eduard, I am still getting a ClassNotFound error on OpenSessionInViewFilter at startup. I have found two jar files that contain the class, spring.jar and spring-hibernate3.jar, and it fails with both of them. I have configured applicationContext.xml like this: bean name=openSessionInViewInterceptor class=org.springframework.orm.hibernate3.support.OpenSessionInViewFilter property name=sessionFactory ref bean=sessionFactory / /property property name=flushModeName valueFLUSH_AUTO/value /property /bean is there anything else I have neglected to do? Some other configuration, perhaps? --Dennis From: Eduard Neuwirt eduard.neuw...@googlemail.com To: Struts Users Mailing List user@struts.apache.org Sent: Sat, October 24, 2009 2:52:27 AM Subject: Re: Struts2 / Hibernate Question Hm, interesting. I checked against my configurations. I have in my WEB-INF/lib spring.jar, all necessary hibernate archives and the configuration of filters is done as described in the link I already posted. Best Eduard Dennis Atkinson schrieb: OK, that's good. So -- uh - how would I configure OpenSessionInView? I attempted to do it, but even after I loaded the spring-hibernate3-2.0.8.jar file, I got a ClassNotFound error, so I couldn't even get past that. And you are absolutely correct about it being rather interesting. But it seems so common, that there should be a common and standard way of dealing with it, but so far it seems not. --Dennis From: Eduard Neuwirt eduard.neuw...@googlemail.com To: Struts Users Mailing List user@struts.apache.org Sent: Fri, October 23, 2009 3:19:09 PM Subject: Re: Struts2 / Hibernate Question Hi Dennis, sorry i don't know anything about FullHibernatePlugin. I am using only the OpenSessionInView-approach. The Google delivers several threads to this topic. It seems to be rather interesting problem. Regards Eduard Dennis Atkinson schrieb: Eduard, I thought the FullHibernatePlugin implements this. --Dennis From: Eduard Neuwirt eduard.neuw...@googlemail.com To: Struts Users Mailing List user@struts.apache.org Sent: Fri, October 23, 2009 3:08:44 PM Subject: Re: Struts2 / Hibernate Question Hi, please have a look to the https://www.hibernate.org/43.html Regards Eduard Thomas Sattler schrieb: So it sounds like both the FullHibernatePlugin and the OpenSessionInViewFilter class work. Thanks for the quick replies. Do you remember how these are configured? The FullHibernatePlugin wiki says only a few lines of configuration are required, but it doesn't say what those lines are. With OpenSessionInView, I add it to my web.xml file, but I get an error that it can't find the class, even though I am fairly certain that the spring-hibernate3-2.0.8.jar file contains it, and I triple-check to make sure that jar is loaded. --Dennis On Fri, Oct 23, 2009 at 2:35 PM, Eduard Neuwirt eduard.neuw...@googlemail.com wrote: Hi, Obviously there is a gap between Hibernate and Web-Application. OpenSessionInViewFilter working well, almost. I am using this filter and in the most cases it is enough. Sometimes I have to load Collection with size(). The another solution is to store only keys in the session and load the objects for every request from the Database/second level cash. The Eager Initialization does not work for two or more Lists in the class :( Regards Eduard Dennis Atkinson schrieb: Hello all. I am running into the infamous closed session issue, whereby I get a LazyInitializationException on a lazy-initialized foreign key relationship. The issue, as I understand it, is that the session is closed before the lazy-initialized objects need to be read from the database, so there is no session when the read actually occurs, and the exception is thrown. It seems like any complex Struts / Hibernate system would eventually run into this issue, as I have. I could specify everything as EAGER, but that would (eventually) load my entire database and that's far from an optimal solution. As suggestions for fixing this, I have found references to the FullHibernatePlugin, and also the OpenSessionInViewFilter class. Both claim that no code changes are required, and all that's needed are some configuration changes. The documentation on how to use these two solutions is sparse, at best. Has anyone used either of these two solutions? Is there any documentation floating around that I haven't found yet? Or is there another, better solution that someone has found? I know this is a Hibernate issue and not a Struts issue, but I think people here must have experience with this issue. Thanks in advance, Dennis
Struts2 / Hibernate Question
Hello all. I am running into the infamous closed session issue, whereby I get a LazyInitializationException on a lazy-initialized foreign key relationship. The issue, as I understand it, is that the session is closed before the lazy-initialized objects need to be read from the database, so there is no session when the read actually occurs, and the exception is thrown. It seems like any complex Struts / Hibernate system would eventually run into this issue, as I have. I could specify everything as EAGER, but that would (eventually) load my entire database and that's far from an optimal solution. As suggestions for fixing this, I have found references to the FullHibernatePlugin, and also the OpenSessionInViewFilter class. Both claim that no code changes are required, and all that's needed are some configuration changes. The documentation on how to use these two solutions is sparse, at best. Has anyone used either of these two solutions? Is there any documentation floating around that I haven't found yet? Or is there another, better solution that someone has found? I know this is a Hibernate issue and not a Struts issue, but I think people here must have experience with this issue. Thanks in advance, Dennis
Re: Struts2 / Hibernate Question
Eduard, I thought the FullHibernatePlugin implements this. --Dennis From: Eduard Neuwirt eduard.neuw...@googlemail.com To: Struts Users Mailing List user@struts.apache.org Sent: Fri, October 23, 2009 3:08:44 PM Subject: Re: Struts2 / Hibernate Question Hi, please have a look to the https://www.hibernate.org/43.html Regards Eduard Thomas Sattler schrieb: So it sounds like both the FullHibernatePlugin and the OpenSessionInViewFilter class work. Thanks for the quick replies. Do you remember how these are configured? The FullHibernatePlugin wiki says only a few lines of configuration are required, but it doesn't say what those lines are. With OpenSessionInView, I add it to my web.xml file, but I get an error that it can't find the class, even though I am fairly certain that the spring-hibernate3-2.0.8.jar file contains it, and I triple-check to make sure that jar is loaded. --Dennis On Fri, Oct 23, 2009 at 2:35 PM, Eduard Neuwirt eduard.neuw...@googlemail.com wrote: Hi, Obviously there is a gap between Hibernate and Web-Application. OpenSessionInViewFilter working well, almost. I am using this filter and in the most cases it is enough. Sometimes I have to load Collection with size(). The another solution is to store only keys in the session and load the objects for every request from the Database/second level cash. The Eager Initialization does not work for two or more Lists in the class :( Regards Eduard Dennis Atkinson schrieb: Hello all. I am running into the infamous closed session issue, whereby I get a LazyInitializationException on a lazy-initialized foreign key relationship. The issue, as I understand it, is that the session is closed before the lazy-initialized objects need to be read from the database, so there is no session when the read actually occurs, and the exception is thrown. It seems like any complex Struts / Hibernate system would eventually run into this issue, as I have. I could specify everything as EAGER, but that would (eventually) load my entire database and that's far from an optimal solution. As suggestions for fixing this, I have found references to the FullHibernatePlugin, and also the OpenSessionInViewFilter class. Both claim that no code changes are required, and all that's needed are some configuration changes. The documentation on how to use these two solutions is sparse, at best. Has anyone used either of these two solutions? Is there any documentation floating around that I haven't found yet? Or is there another, better solution that someone has found? I know this is a Hibernate issue and not a Struts issue, but I think people here must have experience with this issue. Thanks in advance, Dennis - 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 / Hibernate Question
OK, that's good. So -- uh - how would I configure OpenSessionInView? I attempted to do it, but even after I loaded the spring-hibernate3-2.0.8.jar file, I got a ClassNotFound error, so I couldn't even get past that. And you are absolutely correct about it being rather interesting. But it seems so common, that there should be a common and standard way of dealing with it, but so far it seems not. --Dennis From: Eduard Neuwirt eduard.neuw...@googlemail.com To: Struts Users Mailing List user@struts.apache.org Sent: Fri, October 23, 2009 3:19:09 PM Subject: Re: Struts2 / Hibernate Question Hi Dennis, sorry i don't know anything about FullHibernatePlugin. I am using only the OpenSessionInView-approach. The Google delivers several threads to this topic. It seems to be rather interesting problem. Regards Eduard Dennis Atkinson schrieb: Eduard, I thought the FullHibernatePlugin implements this. --Dennis From: Eduard Neuwirt eduard.neuw...@googlemail.com To: Struts Users Mailing List user@struts.apache.org Sent: Fri, October 23, 2009 3:08:44 PM Subject: Re: Struts2 / Hibernate Question Hi, please have a look to the https://www.hibernate.org/43.html Regards Eduard Thomas Sattler schrieb: So it sounds like both the FullHibernatePlugin and the OpenSessionInViewFilter class work. Thanks for the quick replies. Do you remember how these are configured? The FullHibernatePlugin wiki says only a few lines of configuration are required, but it doesn't say what those lines are. With OpenSessionInView, I add it to my web.xml file, but I get an error that it can't find the class, even though I am fairly certain that the spring-hibernate3-2.0.8.jar file contains it, and I triple-check to make sure that jar is loaded. --Dennis On Fri, Oct 23, 2009 at 2:35 PM, Eduard Neuwirt eduard.neuw...@googlemail.com wrote: Hi, Obviously there is a gap between Hibernate and Web-Application. OpenSessionInViewFilter working well, almost. I am using this filter and in the most cases it is enough. Sometimes I have to load Collection with size(). The another solution is to store only keys in the session and load the objects for every request from the Database/second level cash. The Eager Initialization does not work for two or more Lists in the class :( Regards Eduard Dennis Atkinson schrieb: Hello all. I am running into the infamous closed session issue, whereby I get a LazyInitializationException on a lazy-initialized foreign key relationship. The issue, as I understand it, is that the session is closed before the lazy-initialized objects need to be read from the database, so there is no session when the read actually occurs, and the exception is thrown. It seems like any complex Struts / Hibernate system would eventually run into this issue, as I have. I could specify everything as EAGER, but that would (eventually) load my entire database and that's far from an optimal solution. As suggestions for fixing this, I have found references to the FullHibernatePlugin, and also the OpenSessionInViewFilter class. Both claim that no code changes are required, and all that's needed are some configuration changes. The documentation on how to use these two solutions is sparse, at best. Has anyone used either of these two solutions? Is there any documentation floating around that I haven't found yet? Or is there another, better solution that someone has found? I know this is a Hibernate issue and not a Struts issue, but I think people here must have experience with this issue. Thanks in advance, Dennis - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Question about 'if' tag
Yes, this all works now! Thanks so much to Pawel, Wes, Tom for helping a newbie like me. I hope not to be a newbie for too much longer! --Dennis From: Thomas Sattler tomsatt...@gmail.com To: Struts Users Mailing List user@struts.apache.org Sent: Wednesday, September 23, 2009 8:01:22 PM Subject: Re: Question about 'if' tag I think Pawel omitted something in the original reply. You can't say: s:if test=user.canEditCustomer(iter) That won't work. Instead, you have to say: s:if test=user.canEditCustomer(#attr.iter) 2009/9/23 Paweł Wielgus poulw...@gmail.com Hi again, firstly You should read about OGNL basics because You are using it, then if You write s:if test=canEditCustomer it works, why?, because struts is treating it like a regular getter, so it adds get and makes can to camel case Can and in result it searches for getCanEditCustomer() method, and it finds it in action. It is a general shortcut for dealing with fields which has getters and setters. Now when You write s:if test=canEditCustomer() struts sees this () at the end and it searches for canEditCustomer() method and of course it's not finding it anywhere. And last the method should be isCanEditCustomer(), but that is just my habbit. Also keep in mind what Wes was writing about, hidding a link is not suficient. Best greetings, Paweł Wielgus. 2009/9/23 Dennis Atkinson dennisatkinson...@yahoo.com: I have gone through Pawel's example and it is not working for me. Here is the iterator: s:iterator value=allCustomers id=iter status=table_stat I created three methods in my action class: public boolean getCanEditCustomer() { return false ; } public boolean getCanEditCustomer(Integer anInt) { return false ; } public boolean getCanEditCustomer(Customer aCustomer) { return false ; } These are dummy methods just to see if everything will work. I set an Eclipse breakpoint on each return statement. So in theory, Eclipse should stop on one of the statements whether I pass in nothing, an integer, or a Customer object. The results are: s:if test=canEditCustomer (This stops in the first method) s:if test=canEditCustomer()(This never stops) s:if test=canEditCustomer(5) (This never stops) s:if test=canEditCustomer(iter) (This never stops) So it seems like no parameters are being passed in; in fact when I use the braces to indicate no parameter, that doesn't work either. From: Wes Wannemacher w...@wantii.com To: Struts Users Mailing List user@struts.apache.org Sent: Wednesday, September 23, 2009 4:20:33 PM Subject: Re: Question about 'if' tag In addition to what Pawel is saying, be careful that you also check the 'canEditCustomer(target)' call in the target action since there is nothing to stop someone from figuring out the URL pattern and editing people they weren't intended to edit. -Wes 2009/9/23 Paweł Wielgus poulw...@gmail.com: Hi Dennis, You are nesting tags, it's not possible/permitted, what You should do is something like: s:iterator value=... id=iter or s:iterator value=... var=iter s:if test=user.canEditCustomer(iter) Which simply is naming your iterator variable to iter and use it in if tag, depending on struts2 version it will be id or var. Best greetings, Paweł Wielgus. 2009/9/23 Dennis Atkinson dennisatkinson...@yahoo.com: Hi all. In my Struts2 application, I have a collection of Customer objects, and various users have the rights to edit some of them and not others. I have created a Struts iterator tag, and in the iterator, I put the various Customer attributes into an HTML table. All this works. In one cell of the table, I have the string Edit, and if it's clicked, it goes to another Action class to edit that particular Customer object. All that works too. What I want to do is only show the Edit string if the user has the right to edit that Customer. I'm trying to set a s:if tag to do this, but I am sure I'm not doing it right (because it's not working). I am trying: s:if test=%{user.canEditCustomer(s:property)} hoping property is the current object in the iteration. But whatever is happening, this doesn't do what I hope it does. Am I anywhere close to the right solution here? Thanks, Dennis - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org -- 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
Question about 'if' tag
Hi all. In my Struts2 application, I have a collection of Customer objects, and various users have the rights to edit some of them and not others. I have created a Struts iterator tag, and in the iterator, I put the various Customer attributes into an HTML table. All this works. In one cell of the table, I have the string Edit, and if it's clicked, it goes to another Action class to edit that particular Customer object. All that works too. What I want to do is only show the Edit string if the user has the right to edit that Customer. I'm trying to set a s:if tag to do this, but I am sure I'm not doing it right (because it's not working). I am trying: s:if test=%{user.canEditCustomer(s:property)} hoping property is the current object in the iteration. But whatever is happening, this doesn't do what I hope it does. Am I anywhere close to the right solution here? Thanks, Dennis
Re: Question about 'if' tag
I have gone through Pawel's example and it is not working for me. Here is the iterator: s:iterator value=allCustomers id=iter status=table_stat I created three methods in my action class: public boolean getCanEditCustomer() { return false ; } public boolean getCanEditCustomer(Integer anInt) { return false ; } public boolean getCanEditCustomer(Customer aCustomer) { return false ; } These are dummy methods just to see if everything will work. I set an Eclipse breakpoint on each return statement. So in theory, Eclipse should stop on one of the statements whether I pass in nothing, an integer, or a Customer object. The results are: s:if test=canEditCustomer (This stops in the first method) s:if test=canEditCustomer()(This never stops) s:if test=canEditCustomer(5) (This never stops) s:if test=canEditCustomer(iter) (This never stops) So it seems like no parameters are being passed in; in fact when I use the braces to indicate no parameter, that doesn't work either. From: Wes Wannemacher w...@wantii.com To: Struts Users Mailing List user@struts.apache.org Sent: Wednesday, September 23, 2009 4:20:33 PM Subject: Re: Question about 'if' tag In addition to what Pawel is saying, be careful that you also check the 'canEditCustomer(target)' call in the target action since there is nothing to stop someone from figuring out the URL pattern and editing people they weren't intended to edit. -Wes 2009/9/23 Paweł Wielgus poulw...@gmail.com: Hi Dennis, You are nesting tags, it's not possible/permitted, what You should do is something like: s:iterator value=... id=iter or s:iterator value=... var=iter s:if test=user.canEditCustomer(iter) Which simply is naming your iterator variable to iter and use it in if tag, depending on struts2 version it will be id or var. Best greetings, Paweł Wielgus. 2009/9/23 Dennis Atkinson dennisatkinson...@yahoo.com: Hi all. In my Struts2 application, I have a collection of Customer objects, and various users have the rights to edit some of them and not others. I have created a Struts iterator tag, and in the iterator, I put the various Customer attributes into an HTML table. All this works. In one cell of the table, I have the string Edit, and if it's clicked, it goes to another Action class to edit that particular Customer object. All that works too. What I want to do is only show the Edit string if the user has the right to edit that Customer. I'm trying to set a s:if tag to do this, but I am sure I'm not doing it right (because it's not working). I am trying: s:if test=%{user.canEditCustomer(s:property)} hoping property is the current object in the iteration. But whatever is happening, this doesn't do what I hope it does. Am I anywhere close to the right solution here? Thanks, Dennis - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org -- 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
How to prevent validations from running?
Hi all. I have a data entry page with a button to redirect to another page. Problem is, pressing that button causes all validations to run on every field in the page. I want to immediately get away from that page without having to enter data. I know that if I redirect to the input method, the validations don't run. But whatever other method I call, the validations are always run. Could someone tell me how to do this? Are there other methods I could call? Or is there a parameter I can set that I haven't found yet? Thanks in advance, Dennis
Re: How to prevent validations from running?
Hi Greg. I am running Struts2; sorry I did not include that. The button is not causing a redirect; tt is invoking the execute method in the action class, and then the action class determines that button was pressed, and then returns the string list, which the struts.xml file then uses to redirect to another action class. Except that never happens because the validation is done first. From: Greg Lindholm greg.lindh...@gmail.com To: Struts Users Mailing List user@struts.apache.org Sent: Tuesday, September 22, 2009 10:49:06 AM Subject: Re: How to prevent validations from running? Are you running Struts 1 or 2? How is your button causing a redirect? On Tue, Sep 22, 2009 at 10:00 AM, Dennis Atkinson dennisatkinson...@yahoo.com wrote: Hi all. I have a data entry page with a button to redirect to another page. Problem is, pressing that button causes all validations to run on every field in the page. I want to immediately get away from that page without having to enter data. I know that if I redirect to the input method, the validations don't run. But whatever other method I call, the validations are always run. Could someone tell me how to do this? Are there other methods I could call? Or is there a parameter I can set that I haven't found yet? Thanks in advance, Dennis
Re: How to prevent validations from running?
Greg, Thanks for the reply. In going through the tag reference, I find I can also say action=SomeOther and that will also redirect to that action class without hitting the execute() method. I didn't know about putting a redirect-action in the name field so I'm going to try a few different things to see how everything reacts. Thanks again. Dennis From: Greg Lindholm greg.lindh...@gmail.com To: Struts Users Mailing List user@struts.apache.org Sent: Tuesday, September 22, 2009 11:30:29 AM Subject: Re: How to prevent validations from running? If you want to avoid going the the execute method then you can use a feature of DefaultActionMapper [1] and the submit button like this: s:submit key=Code.action.cancel name=redirect-action:CodeList / This will cause a redirect to another action, in this example CodeList. Or you can specify an alternate execute Method or Action on the submit button [2] s:submit key=xxx method=AlternateMethod / s:submit key=xxx action=AlternateAction / [1] http://struts.apache.org/2.1.6/struts2-core/apidocs/org/apache/struts2/dispatcher/mapper/DefaultActionMapper.html [2] http://struts.apache.org/2.1.6/docs/submit.html On Tue, Sep 22, 2009 at 11:10 AM, Dennis Atkinson dennisatkinson...@yahoo.com wrote: Hi Greg. I am running Struts2; sorry I did not include that. The button is not causing a redirect; tt is invoking the execute method in the action class, and then the action class determines that button was pressed, and then returns the string list, which the struts.xml file then uses to redirect to another action class. Except that never happens because the validation is done first. From: Greg Lindholm greg.lindh...@gmail.com To: Struts Users Mailing List user@struts.apache.org Sent: Tuesday, September 22, 2009 10:49:06 AM Subject: Re: How to prevent validations from running? Are you running Struts 1 or 2? How is your button causing a redirect? On Tue, Sep 22, 2009 at 10:00 AM, Dennis Atkinson dennisatkinson...@yahoo.com wrote: Hi all. I have a data entry page with a button to redirect to another page. Problem is, pressing that button causes all validations to run on every field in the page. I want to immediately get away from that page without having to enter data. I know that if I redirect to the input method, the validations don't run. But whatever other method I call, the validations are always run. Could someone tell me how to do this? Are there other methods I could call? Or is there a parameter I can set that I haven't found yet? Thanks in advance, Dennis
Re: New to Struts, a Question
I have a follow-up question about this subject (redirecting to an Action class rather than a jsp file). When I do the redirect, and the target is an Action class with validated input fields, when the screen is initially shown, I get ... field is required messages on everything. Apparently the Action class thinks a user submit was done, and so it runs all its validations. This isn't the behavior I would like to see; I tried removing the input result from struts.xml but that just causes a No result defined error. Does anyone know the trick to this? Thanks, Dennis From: Dennis Atkinson dennisatkinson...@yahoo.com To: Struts Users Mailing List user@struts.apache.org Sent: Thursday, July 30, 2009 1:18:12 PM Subject: 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
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
New to Struts, a Question
Hello everyone. I am new to Struts2, and I like what I see so far. I want to use it for all my web programming. I have a question, and I hope I don't sound too foolish for asking it. I created a login screen, which has two fields, id and password. I fill those fields, press the Login button, and it goes to the LoginAction class, which validates everything, and I return success. This invokes userDisplay.jsp which writes the user's information out to the screen. When the userDisplay screen appeared, I saw the field descriptions but I didn't see any data. It seems like the getter methods for the fields are not being called in the UserDisplayAction class. When I add the getter methods to the LoginAction class, the data appears. It seems to me that the LoginAction class is still in control. So in theory, if I have an action class that invokes (via a pick list or a series of buttons) a way of displaying a dozen different tables by routing to a dozen different jsp files, that action class will need getter methods for every field in every one of these tables? Am I reading this right? I hope one of the experts can clear this up for me. Thanks in advance, Dennis Atkinson
Re: New to Struts, a Question
Burton, Thanks very much for the reply. I have tried this and it works great. I appreciate the assistance. Is it possible to do the same thing, but on a menu selection? The menu says: a href=/betaSystem/jsp/userDisplay.jspMy Acccount/a Can I direct this to an action class, rather than to a jsp file? From: Burton Rhodes burtonrho...@gmail.com To: Struts Users Mailing List user@struts.apache.org Sent: Wednesday, July 29, 2009 1:13:37 PM Subject: Re: New to Struts, a Question I think you want to investigate an 'actionredirect' on 'success' instead of just displaying the user jsp file. This will 'handoff' control to your user action. On 7/29/09, Dennis Atkinson dennisatkinson...@yahoo.com wrote: Hello everyone. I am new to Struts2, and I like what I see so far. I want to use it for all my web programming. I have a question, and I hope I don't sound too foolish for asking it. I created a login screen, which has two fields, id and password. I fill those fields, press the Login button, and it goes to the LoginAction class, which validates everything, and I return success. This invokes userDisplay.jsp which writes the user's information out to the screen. When the userDisplay screen appeared, I saw the field descriptions but I didn't see any data. It seems like the getter methods for the fields are not being called in the UserDisplayAction class. When I add the getter methods to the LoginAction class, the data appears. It seems to me that the LoginAction class is still in control. So in theory, if I have an action class that invokes (via a pick list or a series of buttons) a way of displaying a dozen different tables by routing to a dozen different jsp files, that action class will need getter methods for every field in every one of these tables? Am I reading this right? I hope one of the experts can clear this up for me. Thanks in advance, Dennis Atkinson - 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
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? Thanks, Dennis From: Dave Newton newton.d...@yahoo.com To: Struts Users Mailing List user@struts.apache.org Sent: Wednesday, July 29, 2009 5:49:04 PM Subject: Re: New to Struts, a Question Dennis Atkinson wrote: The menu says: a href=/betaSystem/jsp/userDisplay.jspMy Acccount/a Can I direct this to an action class, rather than to a jsp file? Action URLs are URLs like any other, including a JSP. Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org