How to create a Waiting Page for long requests?
Hi I want to prevent a user from submitting long during database queries twice. Therefore I try to include a waiting page. Can someone name me an example or give me a tip how to implement it? Thanks a lot Julian -- Feel free - 10 GB Mailbox, 100 FreeSMS/Monat ... Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to create a Waiting Page for long requests?
when a user submits anything on the jsp page you can try and disable the submit button and display a message for please wait. all this can be achieved with the help of java script. regards, Roy -Original Message- From: Julian Tillmann [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 03, 2006 11:44 AM To: [EMAIL PROTECTED]; user@struts.apache.org Subject: How to create a Waiting Page for long requests? Hi I want to prevent a user from submitting long during database queries twice. Therefore I try to include a waiting page. Can someone name me an example or give me a tip how to implement it? Thanks a lot Julian -- Feel free - 10 GB Mailbox, 100 FreeSMS/Monat ... Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Where dose JSP works in JSF request lifecycle?
Oh,yeah,I see, that's why you use new keyword in the code above. private HtmlOutputText dynamicText = new HtmlOutputText(); Then,I have a pretty weird idea. If you dosen't new a HtmlOutputText,will there be a NullpointerException popped up in this case? -- Wang Zeng
Re: How to create a Waiting Page for long requests?
Hii One way could be to dynamically create a full page size div and place it over the whole page on the higher z-index this will disable the access to the underlying buttons etc. If you have select list with submission on onchange event then you may have to disable them manually using javascript as browser places them on the highest z-index exposing them during the request. - Shanky On 5/3/06, Roy, Ansuman [EMAIL PROTECTED] wrote: when a user submits anything on the jsp page you can try and disable the submit button and display a message for please wait. all this can be achieved with the help of java script. regards, Roy -Original Message- From: Julian Tillmann [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 03, 2006 11:44 AM To: [EMAIL PROTECTED]; user@struts.apache.org Subject: How to create a Waiting Page for long requests? Hi I want to prevent a user from submitting long during database queries twice. Therefore I try to include a waiting page. Can someone name me an example or give me a tip how to implement it? Thanks a lot Julian -- Feel free - 10 GB Mailbox, 100 FreeSMS/Monat ... Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to use Html:Select
try using bean tags to write the specific values. On 5/2/06, Joey Watson [EMAIL PROTECTED] wrote: Hi All. I got a problem when I was using Html:Select. I used to use Select before. like select property=accSubj_nc name=applicationItem indexed=true onchange=doSubmitWithIndex(this.form, '%=ApplicationAction.ACCSUBJ_CHANGE%', '%=index%') /select those codes can work well. but now I want to use Html:Select. but the code '%=ApplicationAction.ACCSUBJ_CHANGE%', and '%=index%' value can not be get. the value passd to the doSubmitWithIndex function is %=ApplicationAction.ACCSUBJ_CHANGE% and %=index% , not accsubj_change and 0,1,2. Thanks. Joey - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to create a Waiting Page for long requests?
Hi again, thanks for the suggestions, but I'd rather not use JavaScript, so any advice besides that? ciao 4 now Julian --- Ursprüngliche Nachricht --- Von: Shshank Jain [EMAIL PROTECTED] An: Struts Users Mailing List user@struts.apache.org Betreff: Re: How to create a Waiting Page for long requests? Datum: Wed, 3 May 2006 12:34:08 +0530 Hii One way could be to dynamically create a full page size div and place it over the whole page on the higher z-index this will disable the access to the underlying buttons etc. If you have select list with submission on onchange event then you may have to disable them manually using javascript as browser places them on the highest z-index exposing them during the request. - Shanky On 5/3/06, Roy, Ansuman [EMAIL PROTECTED] wrote: when a user submits anything on the jsp page you can try and disable the submit button and display a message for please wait. all this can be achieved with the help of java script. regards, Roy -Original Message- From: Julian Tillmann [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 03, 2006 11:44 AM To: [EMAIL PROTECTED]; user@struts.apache.org Subject: How to create a Waiting Page for long requests? Hi I want to prevent a user from submitting long during database queries twice. Therefore I try to include a waiting page. Can someone name me an example or give me a tip how to implement it? Thanks a lot Julian -- Feel free - 10 GB Mailbox, 100 FreeSMS/Monat ... Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- GMX Produkte empfehlen und ganz einfach Geld verdienen! Satte Provisionen für GMX Partner: http://www.gmx.net/de/go/partner - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
tiles
Can someone give me good start for tiles? I need a step by step details abt using tiles with struts framework. Thanks in advance mano
RE: tiles
Hi, http://www.roseindia.net/struts/struts_tiles.shtml will give you a good start for tiles. Also try downloading Struts Live PDF from the serverside.com Thanks and Regards, S.Ramkumar Associate Consultant - Investment Banking PrimeSourcing(tm) Add Value Reduce Risk i-flex solutions limited, Bangalore Ph:+ 91-80- 22086000/57596000- extn 6873 E-Mail:[EMAIL PROTECTED] -Original Message- From: Manopriya Jagadeesan , Tidel Park - Chennai [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 03, 2006 2:10 PM To: Struts Users Mailing List Subject: tiles Importance: Low Can someone give me good start for tiles? I need a step by step details abt using tiles with struts framework. Thanks in advance mano - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: tiles
Hi, A good amount of resource on Tiles can be found here: http://www.lifl.fr/~dumoulin/tiles/index.html HTH, On 5/3/06, Manopriya Jagadeesan , Tidel Park - Chennai [EMAIL PROTECTED] wrote: Can someone give me good start for tiles? I need a step by step details abt using tiles with struts framework. Thanks in advance mano -- Vinit Sharma IBM
AW: How to POST data to an external site from an action?
Thank you all for answering! But I seem not to have stated my problem clearly: I know how I can POST to an uri using Java. My problem is that I want the user to be redirected (or forwarded) to the page my action has posted the data to. The easy way to handle this is: put a button on my page by which the customer selects his preferred payment service. creati an action which prepares the values needed by this payment service. This action forwards to a little jsp-page which contains a form with all the data. When the user submits the form, he is transferred to the payment service with all neccessary information. This means two clicks by the user for just selecting a payment service. I do want to make a one-click procedure from this. A solution found by googling automates the second submit by javascript. This is what I now have implemented. The question is: is there a more elegant way? If I use any of the http client approaches (either using java.net or commons httpclient) I get the response somewhere in my action, but it should be in the user's browser. Probably one could say that I need sort of (transparent) proxy like behaviour. Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to create a Waiting Page for long requests?
I have used div and js and it works fine. but if u dont want to use it...maybe just an idea. redirect the user to a page with the waiting message and the hidden form and resubmit that.. -shanky On 5/3/06, Julian Tillmann [EMAIL PROTECTED] wrote: Hi again, thanks for the suggestions, but I'd rather not use JavaScript, so any advice besides that? ciao 4 now Julian --- Ursprüngliche Nachricht --- Von: Shshank Jain [EMAIL PROTECTED] An: Struts Users Mailing List user@struts.apache.org Betreff: Re: How to create a Waiting Page for long requests? Datum: Wed, 3 May 2006 12:34:08 +0530 Hii One way could be to dynamically create a full page size div and place it over the whole page on the higher z-index this will disable the access to the underlying buttons etc. If you have select list with submission on onchange event then you may have to disable them manually using javascript as browser places them on the highest z-index exposing them during the request. - Shanky On 5/3/06, Roy, Ansuman [EMAIL PROTECTED] wrote: when a user submits anything on the jsp page you can try and disable the submit button and display a message for please wait. all this can be achieved with the help of java script. regards, Roy -Original Message- From: Julian Tillmann [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 03, 2006 11:44 AM To: [EMAIL PROTECTED]; user@struts.apache.org Subject: How to create a Waiting Page for long requests? Hi I want to prevent a user from submitting long during database queries twice. Therefore I try to include a waiting page. Can someone name me an example or give me a tip how to implement it? Thanks a lot Julian -- Feel free - 10 GB Mailbox, 100 FreeSMS/Monat ... Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- GMX Produkte empfehlen und ganz einfach Geld verdienen! Satte Provisionen für GMX Partner: http://www.gmx.net/de/go/partner - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[ANN] struts i18n admininistration webabpp
Hi, I am pleased to announce the alpha release of the codeczar i18n web-app. The purpose is to provide an intuitive gui for managing all internationalised resources within struts web-apps. Messages are stored in a db rather than properties files. i18n.war is released under an Apache OS License. All documentation can be found here: http://wiki.codeczar.com/index.php/I18n The primary purpose of this release is to get developer feedback from the live demo: http://www.codeczar.com/i18n This app is not ready for the prime-time. Whilst i18n-1.0-alpha.war manages its own i18n resources, future releases (beta) will include client jars to access the i18n messages from your own apps. There are known issues (like incorrect tab display in IE). Hopefully the beta will arrive in 2 weeks and 1.0 in 4 weeks. Please post any questions, suggestions and comments to the i18n forum: http://forum.codeczar.com/viewforum.php?f=2 Please report bugs with bugzilla: http://bugzilla.codeczar.com/buglist.cgi?product=i18n cheers Nathan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [ANN] struts i18n admininistration webabpp
shame I can't spell :) admininistration anyone? Nathan Coast wrote: Hi, I am pleased to announce the alpha release of the codeczar i18n web-app. The purpose is to provide an intuitive gui for managing all internationalised resources within struts web-apps. Messages are stored in a db rather than properties files. i18n.war is released under an Apache OS License. All documentation can be found here: http://wiki.codeczar.com/index.php/I18n The primary purpose of this release is to get developer feedback from the live demo: http://www.codeczar.com/i18n This app is not ready for the prime-time. Whilst i18n-1.0-alpha.war manages its own i18n resources, future releases (beta) will include client jars to access the i18n messages from your own apps. There are known issues (like incorrect tab display in IE). Hopefully the beta will arrive in 2 weeks and 1.0 in 4 weeks. Please post any questions, suggestions and comments to the i18n forum: http://forum.codeczar.com/viewforum.php?f=2 Please report bugs with bugzilla: http://bugzilla.codeczar.com/buglist.cgi?product=i18n cheers Nathan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Please help
Hi all, I have the following requirement in my application(For pocket PC2003 on windows CE 4): Links become active on user selections. Inactive links are grayed out. I tried this with onmouseover=this.style.color='black'; onmouseout=this.style.color='gray'; If I use the desktop IE, it works just fine. However, When i view the same webpage on my Pocket PC 2003 emulator, it does not work. I was under the impression Pocket PC 2003 runs javascript? Does anyone know how i can make the emulator support the javascript on the above webpage??? Thanks Regards, Meenakshi. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Best Practice - Correct usage???
Hello all, I have an application to edit some data stored in the database. I have 2 situations. 1. When a user clicks New or Edit Mouse, the user is brought to a form that either displays an empty form or one that is pre-populated. This is done with the following mapping: pre action path = /mouseAction type = org.jax.mgi.mtb.jaxpathwi.actions.MouseDispatchAction name = MouseSubmitForm scope = request validate = true parameter = dispatch input = mouse.jsp forward name=setupSuccess path=/WEB-INF/jsp/mouse.jsp/ forward name=insertSuccess path=/WEB-INF/jsp/mouse.jsp/ forward name=updateSuccess path=/WEB-INF/jsp/mouse.jsp/ /action /pre This works fine, but upon successful insert why couldn't I just forward it back to the setupSuccess portion? Like the following: pre action path = /mouseAction type = org.jax.mgi.mtb.jaxpathwi.actions.MouseDispatchAction name = MouseSubmitForm scope = request validate = true parameter = dispatch input = mouse.jsp forward name=setupSuccess path=/WEB-INF/jsp/mouse.jsp/ forward name=insertSuccess path=/mouseAction.do/ forward name=updateSuccess path=/WEB-INF/jsp/mouse.jsp/ /action /pre Do I have to do something different in my Action class? It is running in an infinite loop and eventually running out of memory. 2. When a user updates a mouse, I want them to be directed to a summary screen of the mouse which has the following mapping: pre action path = /mouseSummary type = org.jax.mgi.mtb.jaxpathwi.actions.MouseSummaryAction scope=request forward name=success path=/WEB-INF/jsp/mouseSummary.jsp/ /action /pre would I change my action mapping to the following pre action path = /mouseAction type = org.jax.mgi.mtb.jaxpathwi.actions.MouseDispatchAction name = MouseSubmitForm scope = request validate = true parameter = dispatch input = mouse.jsp forward name=setupSuccess path=/WEB-INF/jsp/mouse.jsp/ forward name=insertSuccess path=/mouseAction.do/ forward name=updateSuccess path=/mouseSummary.do/ /action /pre But how does one pass in the variables that mouse summary needs to know like the id of the mouse? Am I making any sense to anyone? Thanks! Matt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: validation breaks my form prepopulation
If you don't associate your setup action with a form bean, the reset method will not be called, and whatever was in the form will be retained. -Original Message- From: Kyle W. Cartmell [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 03, 2006 2:39 AM To: Struts Users Mailing List Subject: Re: validation breaks my form prepopulation This is extremely helpful, because it gives me the opportunity to prepopulate my form once again should validation fail. There's still a sticky bit here, in that request attributes that are set from a previous form are lost and cannot be recreated. I believe that this is pretty much something that I have to just handle and there aren't any magic spells to drive that process, but please correct me if I'm wrong. :) Thanks again! Michael Jouravlev wrote: On 5/2/06, Kyle W. Cartmell [EMAIL PROTECTED] wrote: Within my web application (using the Struts action framework) when validation of an ActionForm fails and control is returned to the JSP indicated by struts-config.xml, any request attributes that were passed to that JSP originally are lost because a new request object has been created. input attribute of action element in struts-config.xml does not have to refer to JSP page directly, it can point to setup action of your JSP page. Michael. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Kyle W. Cartmell Sr. Software Developer LAP Holdings, LLC dba First Finance Phone: (480) 222-0050 Toll Free: (800) 355-3135 [EMAIL PROTECTED] www.efirstfinance.com DISCLAIMER This email and any files transmitted with it are confidential and contain privileged or copyright information. If you are not the intended recipient you must not copy, distribute or use this email or the information contained in it for any purpose other than to notify us of the receipt thereof. If you have received this message in error, please notify the sender immediately, and delete this email from your system. Please note that e-mails are susceptible to change.The sender shall not be liable for the improper or incomplete transmission of the information contained in this communication,nor for any delay in its receipt or damage to your system.The sender does not guarantee that this material is free from viruses or any other defects although due care has been taken to minimise the risk. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to use Html:Select
u meant using bean:write tag or what? I tried to use the bean:write, but it doesn't work. I think the reason is. struts is not allow use java or tag for the paramater's value. like html:select property=accSubj_nc name=applicationItem indexed=true onchange=doSubmitWithIndex(this.form, '%=ApplicationAction.ACCSUBJ_CHANGE%', '%=index%') /html:select the result html is select name=applicationItem[0].accSubj_nc onchange=doSubmitWithIndex(this.form, '%=ApplicationAction.ACCSUBJ_CHANGE%', '%=index%') option value=/option /select struts does not translate the '%=ApplicationAction.ACCSUBJ_CHANGE%' to its value 'accsubj_change'. even I use the bean:write. it does be translated. On 5/3/06, Shshank Jain [EMAIL PROTECTED] wrote: try using bean tags to write the specific values. On 5/2/06, Joey Watson [EMAIL PROTECTED] wrote: Hi All. I got a problem when I was using Html:Select. I used to use Select before. like select property=accSubj_nc name=applicationItem indexed=true onchange=doSubmitWithIndex(this.form, '%=ApplicationAction.ACCSUBJ_CHANGE%', '%=index%') /select those codes can work well. but now I want to use Html:Select. but the code '%=ApplicationAction.ACCSUBJ_CHANGE%', and '%=index%' value can not be get. the value passd to the doSubmitWithIndex function is %=ApplicationAction.ACCSUBJ_CHANGE% and %=index% , not accsubj_change and 0,1,2. Thanks. Joey - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
request scope paging
Is there a way in struts to chain a series of requests (paging through a list) and pass data through request scope? In my scenario, I keep the a result list in session, but this prevents me from opening two windows (same session) and paging through two different lists (one in each window) independently. Thanks in advance for insights. -Thomas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: request scope paging
On 5/3/06, Y. Thomas Gan [EMAIL PROTECTED] wrote: Is there a way in struts to chain a series of requests (paging through a list) and pass data through request scope? In my scenario, I keep the a result list in session, but this prevents me from opening two windows (same session) and paging through two different lists (one in each window) independently. Thanks in advance for insights. -Thomas If you have one list but you want to see different pages in different windows, pass page number parameter in request, and set list offset somewhere in the request as well. If you want to have two different session-scoped lists, then you need to take care of it yourself. Obviously, you cannot store one list on an actionform, so you either store a collection of lists, or you store a nested container object, that in turn contains the collection of lists. The container would take a list ID and maybe a page number as parameters, and returns a particular list and maybe an offset in the list. Unless you have a Javascript hooked up to window close event, you cannot detect when a list is not needed anymore, so you can set a limit for number of simultaneously created lists. Michael. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: request scope paging
I understand the concept behind this, but does anyone actually use this in production code? Seems more trouble than it's worth since the user could simply start multiple sessions. Michael Jouravlev wrote: On 5/3/06, Y. Thomas Gan [EMAIL PROTECTED] wrote: Is there a way in struts to chain a series of requests (paging through a list) and pass data through request scope? In my scenario, I keep the a result list in session, but this prevents me from opening two windows (same session) and paging through two different lists (one in each window) independently. Thanks in advance for insights. -Thomas If you have one list but you want to see different pages in different windows, pass page number parameter in request, and set list offset somewhere in the request as well. If you want to have two different session-scoped lists, then you need to take care of it yourself. Obviously, you cannot store one list on an actionform, so you either store a collection of lists, or you store a nested container object, that in turn contains the collection of lists. The container would take a list ID and maybe a page number as parameters, and returns a particular list and maybe an offset in the list. Unless you have a Javascript hooked up to window close event, you cannot detect when a list is not needed anymore, so you can set a limit for number of simultaneously created lists. Michael. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Kyle W. Cartmell Sr. Software Developer LAP Holdings, LLC dba First Finance Phone: (480) 222-0050 Toll Free: (800) 355-3135 [EMAIL PROTECTED] www.efirstfinance.com
Re: How to POST data to an external site from an action?
On 5/3/06, Martin Kindler [EMAIL PROTECTED] wrote: Thank you all for answering! But I seem not to have stated my problem clearly: I know how I can POST to an uri using Java. My problem is that I want the user to be redirected (or forwarded) to the page my action has posted the data to. The easy way to handle this is: put a button on my page by which the customer selects his preferred payment service. creati an action which prepares the values needed by this payment service. This action forwards to a little jsp-page which contains a form with all the data. When the user submits the form, he is transferred to the payment service with all neccessary information. When a user is transferred to a payment service right from the browser, how does your application know about this? This means two clicks by the user for just selecting a payment service. I do want to make a one-click procedure from this. A solution found by googling automates the second submit by javascript. This is what I now have implemented. The question is: is there a more elegant way? If I use any of the http client approaches (either using java.net or commons httpclient) I get the response somewhere in my action, but it should be in the user's browser. Probably one could say that I need sort of (transparent) proxy like behaviour. Yep, your action behaves as proxy. Also, your application is in the know of what is happening. Michael. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Is Action Chaining Strongly Discouraged?
You do it by redefining the form relation to the action so that a form acts as a passage between actions Action1 -- Form12 -- Action2. Using action chaining is horrible. Look at the code and you will see why. On 4/30/06, David Evans [EMAIL PROTECTED] wrote: below... On Sun, 2006-04-30 at 17:47 -0500, Joe Germuska wrote: On 4/30/06, Caroline Jen [EMAIL PROTECTED] wrote: I have seen some discussions on this forum regarding action chaining. Primarily, the advices are to think through the business logic before making decision on chaining actions. What are the disadvantages of action chaining? Why action chaining is not a good practice? http://wiki.apache.org/struts/ActionChaining As noted in that page, ActionChaining is using Struts in a way which often works, but for which it was not specifically designed. It's possible that you might run into some odd situations where the assumption that a single HttpRequest results in only a single pass through the RequestProcessor causes something to go wrong. I usually just refactor my app when I find myself wanting to use action chaining, but many people just do it and find that it works. Joe How do you handle the population of the contexts which are passed to the jsp to which you are forwarding? The one use of chaining that seems to make sense to me is the forwarding to a setup action that prepares the contexts with whatever objects the jsp may need to display. I have heard people say that this setup functionality should be moved to its own method in the business layer that could then be called by the forwarding action, but how does this actually look? The objects have to be put in a web tier context object, how do you keep that layer away from the business tier? Is there a reason you don't use the two action (setup and submit) approach? I'm in the process of learning webwork and while i'm at it i'm trying to decide on best practices for action architecture. Webwork makes the two action thing even easier, because you can specify a method to call on an action class in the action mapping, so the setup and submit handling methods can exist in the same action class. or you can even specify the method to call on an action class in the url using the ! character, as in /customer!setup.action. any advice or insight would be appreciated. dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- You can lead a horse to water but you cannot make it float on its back. ~Dakota Jack~ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to create a Waiting Page for long requests?
I've done exactly this in another app with both a meta-tag to resubmit and a button to do same. It would check a status flag somewhere (db, session var, whatever) and when set it will jump to a done action. The tricky part is that you can't create a new thread in your action as it violates the servlet spec (as you don't know what thread will get subsequent requests from the same session, so you've lost the handle to your child thread), so what I did is had a JMS receiver that sat idle until the action sent a JMS message to the receiver which would then start the asynchronous process. The receiver process [thread] would do what it needed to do, set the magic status flag, and then wait for another request. -ed On 5/3/06, Shshank Jain [EMAIL PROTECTED] wrote: I have used div and js and it works fine. but if u dont want to use it...maybe just an idea. redirect the user to a page with the waiting message and the hidden form and resubmit that.. -shanky On 5/3/06, Julian Tillmann [EMAIL PROTECTED] wrote: Hi again, thanks for the suggestions, but I'd rather not use JavaScript, so any advice besides that? ciao 4 now Julian --- Ursprüngliche Nachricht --- Von: Shshank Jain [EMAIL PROTECTED] An: Struts Users Mailing List user@struts.apache.org Betreff: Re: How to create a Waiting Page for long requests? Datum: Wed, 3 May 2006 12:34:08 +0530 Hii One way could be to dynamically create a full page size div and place it over the whole page on the higher z-index this will disable the access to the underlying buttons etc. If you have select list with submission on onchange event then you may have to disable them manually using javascript as browser places them on the highest z-index exposing them during the request. - Shanky On 5/3/06, Roy, Ansuman [EMAIL PROTECTED] wrote: when a user submits anything on the jsp page you can try and disable the submit button and display a message for please wait. all this can be achieved with the help of java script. regards, Roy -Original Message- From: Julian Tillmann [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 03, 2006 11:44 AM To: [EMAIL PROTECTED]; user@struts.apache.org Subject: How to create a Waiting Page for long requests? Hi I want to prevent a user from submitting long during database queries twice. Therefore I try to include a waiting page. Can someone name me an example or give me a tip how to implement it? Thanks a lot Julian -- Feel free - 10 GB Mailbox, 100 FreeSMS/Monat ... Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- GMX Produkte empfehlen und ganz einfach Geld verdienen! Satte Provisionen für GMX Partner: http://www.gmx.net/de/go/partner - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to create a Waiting Page for long requests?
Ed, We've used this: http://wiki.apache.org/struts/StrutsPleaseWait?highlight=%28wait%29 To great effect in our struts apps. Hope it helps. -Bill Hansley DHTS Perioperative Services Dev Team CoLead 10083 Hock Plaza w) 919.668.1388 f) 919.668.5568 Ed Griebel [EMAIL PROTECTED] 05/03/2006 01:54 PM Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org cc Subject Re: How to create a Waiting Page for long requests? I've done exactly this in another app with both a meta-tag to resubmit and a button to do same. It would check a status flag somewhere (db, session var, whatever) and when set it will jump to a done action. The tricky part is that you can't create a new thread in your action as it violates the servlet spec (as you don't know what thread will get subsequent requests from the same session, so you've lost the handle to your child thread), so what I did is had a JMS receiver that sat idle until the action sent a JMS message to the receiver which would then start the asynchronous process. The receiver process [thread] would do what it needed to do, set the magic status flag, and then wait for another request. -ed On 5/3/06, Shshank Jain [EMAIL PROTECTED] wrote: I have used div and js and it works fine. but if u dont want to use it...maybe just an idea. redirect the user to a page with the waiting message and the hidden form and resubmit that.. -shanky On 5/3/06, Julian Tillmann [EMAIL PROTECTED] wrote: Hi again, thanks for the suggestions, but I'd rather not use JavaScript, so any advice besides that? ciao 4 now Julian --- Ursprüngliche Nachricht --- Von: Shshank Jain [EMAIL PROTECTED] An: Struts Users Mailing List user@struts.apache.org Betreff: Re: How to create a Waiting Page for long requests? Datum: Wed, 3 May 2006 12:34:08 +0530 Hii One way could be to dynamically create a full page size div and place it over the whole page on the higher z-index this will disable the access to the underlying buttons etc. If you have select list with submission on onchange event then you may have to disable them manually using javascript as browser places them on the highest z-index exposing them during the request. - Shanky On 5/3/06, Roy, Ansuman [EMAIL PROTECTED] wrote: when a user submits anything on the jsp page you can try and disable the submit button and display a message for please wait. all this can be achieved with the help of java script. regards, Roy -Original Message- From: Julian Tillmann [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 03, 2006 11:44 AM To: [EMAIL PROTECTED]; user@struts.apache.org Subject: How to create a Waiting Page for long requests? Hi I want to prevent a user from submitting long during database queries twice. Therefore I try to include a waiting page. Can someone name me an example or give me a tip how to implement it? Thanks a lot Julian -- Feel free - 10 GB Mailbox, 100 FreeSMS/Monat ... Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- GMX Produkte empfehlen und ganz einfach Geld verdienen! Satte Provisionen für GMX Partner: http://www.gmx.net/de/go/partner - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Is Action Chaining Strongly Discouraged?
Tarek Nabil wrote: Do you mean that you're doing a redirect after processing the post? Who, me? If no, ignore the following. I'm not sure I understand the question. In a nutshell: for a GET I do whatever population/misc. stuff I need to do then return the input forward. For a POST I validate and return the input forward if there are errors, otherwise I return whatever forward is warranted. In practice by classes have become more cumbersome than that with methods designed to be overridden that do pre- and post-processing etc. I've been thinking about this action chaining issue for some time since I used it in my last project and it resulted in some code duplication. Isn't that bass-ackwards? Even though I really dislike chaining shouldn't it have less code? 1- A prepare action when the page is called directly (a form bean is configured for that one). 2- A page action when it's called from another action (no form bean is configured to prevent resetting). *shudder* If no other reason here's a strong reason to move that logic out of the actions and into service objects; at least then you're just making calls rather than duplicating the code. Unless I completely misunderstood you. Would anyone care to comment on those two approaches? Does anyone have a different approach that I can consider? At first glance with no clue what you're trying to accomplish it sounds overly complicated. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to create a Waiting Page for long requests?
Ed Griebel wrote: The tricky part is that you can't create a new thread in your action as it violates the servlet spec (as you don't know what thread will get subsequent requests from the same session, so you've lost the handle to your child thread), Oh, yeah? Is that equally valid for a servlet that's run only on initialization that starts a thread that thrashes through the database every now and then doing something? I know I could use jCrontab/etc. but they're already mad enough at me for using not-invented-here stuff :-( Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: request scope paging
Kyle W. Cartmell wrote: I understand the concept behind this, but does anyone actually use this in production code? Seems more trouble than it's worth since the user could simply start multiple sessions. How? Isn't that browser-dependent? And no, I wouldn't bother dealing with this use-case unless it was a requirement (which it sometimes is :) Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: request scope paging
Dave Newton wrote: Kyle W. Cartmell wrote: I understand the concept behind this, but does anyone actually use this in production code? Seems more trouble than it's worth since the user could simply start multiple sessions. How? Isn't that browser-dependent? And OS dependent too. On a Mac (which is what many of our user use) or linux, you can not start two windows on different sessions from the same browser, while on Windows, I can easily start two windows on one or two sessions. Instead of saving result list in session, we decided to carry all form inputs through request params from page to page and make the result for that page. Thanks all for responding. And no, I wouldn't bother dealing with this use-case unless it was a requirement (which it sometimes is :) Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] Re: Please help
Meenakshi Singh wrote: However, When i view the same webpage on my Pocket PC 2003 emulator, it does not work. I was under the impression Pocket PC 2003 runs javascript? Does anyone know how i can make the emulator support the javascript on the above webpage??? No, but maybe try a group or list relating to CE and/or CE applications. Also a little blurb in the subject line giving a clue as to what you need help with is always appreciated :) Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: WebApp Cannot seem to locate Resource Bundle
Do you have the properties file (MessageResources.properties) deployed in the correct directory (com/xxx/i18nMessages) somewhere on your classpath? Either under WEB-INF/classes, or within a jar in WEB-INF/lib? Does the properties file actually contain an entry with the key 'loginEntry.userName'? Have you checked the logs during startup? Does Struts find and successfully load the properties file you specified? You don't mention which version of Struts you're using; most of the servlet config params you listed are no longer used in recent releases, though as long as you have the message-resources/ tag in struts-config.xml it shouldn't hurt to have them. L. Pat Slater wrote: I also have a message resource entry in struts-config.xml file: message-resources parameter=com.xxx.i18nMessages.MessageResources / Pat Slater [EMAIL PROTECTED] wrote: I have defined Action Servlet configuration in web.xml as: action org.apache.struts.action.ActionServlet application com.xxx.i18nMessages.MessageResources config /WEB-INF/conf/struts-config.xml debug 2 detail 2 2 But, when I put this into a jsp page: %@ taglib uri=/WEB-INF/conf/struts-bean.tld prefix=bean % then, I the exception: ERROR - ApplicationDispatcher.invoke(719) | Servlet.service() for servlet jsp threw exception javax.servlet.jsp.JspException: Missing message for key loginEntry.userName ERROR - InsertTag$InsertHandler.doEndTag(922) | ServletException in '/WEB-INF/tiles/login/loginFields.jsp': Missing message for key loginEntry.userName javax.servlet.ServletException: Missing message for key loginEntry.userName My struts app cannot seem to resolve the loginEntry.userName key-value pair for some reason Need help on this. Thank you very much - Love cheap thrills? Enjoy PC-to-Phone calls to 30+ countries for just 2�/min with Yahoo! Messenger with Voice. - New Yahoo! Messenger with Voice. Call regular phones from your PC and save big. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: request scope paging
On 5/3/06, Y. Thomas Gan [EMAIL PROTECTED] wrote: Dave Newton wrote: Kyle W. Cartmell wrote: I understand the concept behind this, but does anyone actually use this in production code? Seems more trouble than it's worth since the user could simply start multiple sessions. How? Isn't that browser-dependent? And OS dependent too. On a Mac (which is what many of our user use) or linux, you can not start two windows on different sessions from the same browser, while on Windows, I can easily start two windows on one or two sessions. You can configure MSIE (at least on Windows) to either start a new process for a new window (default), or to run all windows in one process. MSIE associates session with a process. Instead of saving result list in session, we decided to carry all form inputs through request params from page to page and make the result for that page. Thanks all for responding. This ties your second action to the first action, so your second action won't work properly if you navigate to it directly, just by typing its address in the browser, because it won't have needed parameters. I guess this is ok with you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: How to POST data to an external site from an action?
Michael, -Ursprüngliche Nachricht- Von: Michael Jouravlev [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 3. Mai 2006 19:31 An: Struts Users Mailing List; [EMAIL PROTECTED] Betreff: Re: How to POST data to an external site from an action? On 5/3/06, Martin Kindler [EMAIL PROTECTED] wrote: Thank you all for answering! But I seem not to have stated my problem clearly: I know how I can POST to an uri using Java. My problem is that I want the user to be redirected (or forwarded) to the page my action has posted the data to. The easy way to handle this is: put a button on my page by which the customer selects his preferred payment service. creati an action which prepares the values needed by this payment service. This action forwards to a little jsp-page which contains a form with all the data. When the user submits the form, he is transferred to the payment service with all neccessary information. When a user is transferred to a payment service right from the browser, how does your application know about this? it does not :-), but first the payment service I want to implement is passed an URL and sessionID from my app where it is redirecting (sending) my customer back, after the payment is validated (or not). Second, I would prefer control the change by an action in my app (this is what my question is about). Even then my app only knows about it when the user comes back via the payment service. This means two clicks by the user for just selecting a payment service. I do want to make a one-click procedure from this. A solution found by googling automates the second submit by javascript. This is what I now have implemented. The question is: is there a more elegant way? If I use any of the http client approaches (either using java.net or commons httpclient) I get the response somewhere in my action, but it should be in the user's browser. Probably one could say that I need sort of (transparent) proxy like behaviour. Yep, your action behaves as proxy. Also, your application is in the know of what is happening. Well, it must behave like a proxy. Are there any examples how to do this? Or some supporting software? I surely can pass the response (i. e. the received HTML) to my customer, but he should not be aware that that it is my proxy. Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to create a Waiting Page for long requests?
Hi I think JMS is only valid , i.e. following specification solution. Take a look at: http://www.javaranch.com/newsletter/200403/AsynchronousProcessingFromServlets.html 2006/5/3, Dave Newton [EMAIL PROTECTED]: Ed Griebel wrote: The tricky part is that you can't create a new thread in your action as it violates the servlet spec (as you don't know what thread will get subsequent requests from the same session, so you've lost the handle to your child thread), Oh, yeah? Is that equally valid for a servlet that's run only on initialization that starts a thread that thrashes through the database every now and then doing something? I know I could use jCrontab/etc. but they're already mad enough at me for using not-invented-here stuff :-( Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
newbie question about xhtml, html:form, submit button
I've inherited some struts code and I have a question about the html that it generates. I have a feeling there's a bunch more stuff I need to read but I'm having trouble finding it. I've run the generated html through validator.w3.org and it gave me errors that I don't have end tags on input elements. The code for an offending input element is: html:text property=address size=40/ So, I added html:xhtml/ to my .jsp page and the html validates cleanly. Unfortunately, my page doesn't work anymore. I've got: form id=tryItForm method=post action=/mapview/tryItSubmit.do a href=javascript:document.tryItForm.submit();img class=imgover alt= height=21 width=105 src=images/btn/btn_ok.gif/a /form which is generated by: html:form action=/tryItSubmit a href=javascript:document.tryItForm.submit();img class=imgover alt= height=21 width=105 src=images/btn/btn_ok.gif//a /html:form Unfortunately I get javascript errors in both IE (document.tryItForm is null or not an object) and firefox (document.tryItForm has no properties) unless the form element has a name attribute like this: form name=tryItForm method=post action=/mapview/tryItSubmit.do which is the html that I get without the html:xhtml/ attribute... I'm looking for a way to get the validation clean and a working page. I'm not sure whether this is too much to ask or whether the solution is: 1. patch renderName in FormTag.java to add a name attribute even in the XHTML case. 2. do something different with the html:text to get valid XHTML 3. somehow change my a href=javascript so it works, or replace it with something else that does the same thing. The DOCTYPE element is: !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; The DTD there shows that name is a valid attribute for form elements, so maybe #1 is OK? If not, can someone point me in the right direction? I'm using struts 1.2.9. Thanks much for your help. -DB - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: validation breaks my form prepopulation
I did some tinkering and found that even though my setup action is indeed associated with a form bean, and my reset method is defined and sets my values to null, when I return to an action from a validation failure or forwarded from another action, the form that I originally used to populate the data on that page is present and intact. 1. Is it reasonable to simply make use of this mechanic to allow this data to persist? 2. I find that I am shocked by some astounding discovery regarding Struts functionallity, and I have gone through all of the documentation on the website, can anyone direct me toward comprehensive (or as close as possible) documentation of Struts internals in hopes that I can stop posting silly questions here and not have to resort to reading source? Thanks everyone! Tarek Nabil wrote: If you don't associate your setup action with a form bean, the reset method will not be called, and whatever was in the form will be retained. -Original Message- From: Kyle W. Cartmell [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 03, 2006 2:39 AM To: Struts Users Mailing List Subject: Re: validation breaks my form prepopulation This is extremely helpful, because it gives me the opportunity to prepopulate my form once again should validation fail. There's still a sticky bit here, in that request attributes that are set from a previous form are lost and cannot be recreated. I believe that this is pretty much something that I have to just handle and there aren't any magic spells to drive that process, but please correct me if I'm wrong. :) Thanks again! Michael Jouravlev wrote: On 5/2/06, Kyle W. Cartmell [EMAIL PROTECTED] wrote: Within my web application (using the Struts action framework) when validation of an ActionForm fails and control is returned to the JSP indicated by struts-config.xml, any request attributes that were passed to that JSP originally are lost because a new request object has been created. input attribute of action element in struts-config.xml does not have to refer to JSP page directly, it can point to setup action of your JSP page. Michael. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Kyle W. Cartmell Sr. Software Developer LAP Holdings, LLC dba First Finance Phone: (480) 222-0050 Toll Free: (800) 355-3135 [EMAIL PROTECTED] www.efirstfinance.com DISCLAIMER This email and any files transmitted with it are confidential and contain privileged or copyright information. If you are not the intended recipient you must not copy, distribute or use this email or the information contained in it for any purpose other than to notify us of the receipt thereof. If you have received this message in error, please notify the sender immediately, and delete this email from your system. Please note that e-mails are susceptible to change.The sender shall not be liable for the improper or incomplete transmission of the information contained in this communication,nor for any delay in its receipt or damage to your system.The sender does not guarantee that this material is free from viruses or any other defects although due care has been taken to minimise the risk. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Kyle W. Cartmell Sr. Software Developer LAP Holdings, LLC dba First Finance Phone: (480) 222-0050 Toll Free: (800) 355-3135 [EMAIL PROTECTED] www.efirstfinance.com
Re: newbie question about xhtml, html:form, submit button
without html:xhtml/ struts inserts the name=tryItForm attribute for the form. With html:xhtml/ struts inserts the id=tryItForm attribute. You need to change your javascript to document.getElementById('tryItForm').submit(); David Byron wrote: I've inherited some struts code and I have a question about the html that it generates. I have a feeling there's a bunch more stuff I need to read but I'm having trouble finding it. I've run the generated html through validator.w3.org and it gave me errors that I don't have end tags on input elements. The code for an offending input element is: html:text property=address size=40/ So, I added html:xhtml/ to my .jsp page and the html validates cleanly. Unfortunately, my page doesn't work anymore. I've got: form id=tryItForm method=post action=/mapview/tryItSubmit.do a href=javascript:document.tryItForm.submit();img class=imgover alt= height=21 width=105 src=images/btn/btn_ok.gif/a /form which is generated by: html:form action=/tryItSubmit a href=javascript:document.tryItForm.submit();img class=imgover alt= height=21 width=105 src=images/btn/btn_ok.gif//a /html:form Unfortunately I get javascript errors in both IE (document.tryItForm is null or not an object) and firefox (document.tryItForm has no properties) unless the form element has a name attribute like this: form name=tryItForm method=post action=/mapview/tryItSubmit.do which is the html that I get without the html:xhtml/ attribute... I'm looking for a way to get the validation clean and a working page. I'm not sure whether this is too much to ask or whether the solution is: 1. patch renderName in FormTag.java to add a name attribute even in the XHTML case. 2. do something different with the html:text to get valid XHTML 3. somehow change my a href=javascript so it works, or replace it with something else that does the same thing. The DOCTYPE element is: !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; The DTD there shows that name is a valid attribute for form elements, so maybe #1 is OK? If not, can someone point me in the right direction? I'm using struts 1.2.9. Thanks much for your help. -DB - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: validation breaks my form prepopulation
On 5/3/06, Kyle W. Cartmell [EMAIL PROTECTED] wrote: I did some tinkering and found that even though my setup action is indeed associated with a form bean, and my reset method is defined and sets my values to null, when I return to an action from a validation failure or forwarded from another action, the form that I originally used to populate the data on that page is present and intact. 1. Is it reasonable to simply make use of this mechanic to allow this data to persist? How many forms do you have: one or two? If two, do they have properties with the same names? If I remember correctly, this should work somewhat like this: * You submit an HTML form to a submit action, well, actually to an action mapping * If actionform is defined for the mapping, it is initialized. That means, that if it has request scope, it is created. If it has session scope it is usually reused (this is not guaranteed, but I've yet to encounter the situation when session-scoped form was not reused). * reset() is called on form * form is populated from request parameters * if validate attribute of the action mapping is set to true, validate() is called * if validate() returns non-empty object and you have input attribute set, then control is forwarded to the location defined in the input. (Hmm, what happens if you have validate=true but do not have input attribute?) By the way, it is possible to redirect to input location instead of forwarding, but this is done globally for all mappings in the config file. * If you do a regular forward using input attribute, the request/response sequence has not been finished yet, so all objects that were created when you submitted the request, are still there, including request-scoped actionform and request object itself. So, if you forward to a regular JSP page, you can pull data from the actionform or from request object. * Now, the fun part. If you forward to a setup action, then Struts will look for an actionform associated with this mapping, and will call reset() on it, then it will try to populate it from the request object, then it will call validate() if you have validate=true. So, if you forward to a setup action and you have changed content of the actionform, you should either NOT associate a form with an action. Because otherwise your changes to actionform fields will be overwritted from the request object. Does it make sense? ;-) 2. I find that I am shocked by some astounding discovery regarding Struts functionallity, and I have gone through all of the documentation on the website, can anyone direct me toward comprehensive (or as close as possible) documentation of Struts internals in hopes that I can stop posting silly questions here and not have to resort to reading source? I think that it all clears when you understand how scoped objects are managed, and how the request/response cycle works. The key here is that Struts runs its portion of request/response code whenever you call an action mapping, even if you make a server-side forward. I wrote a small article on that topic [1]. It is not perfect and, frankly, needs a rewrite (I introduced my own names to some of the action/form combinations), I would do some things differently. But some sections of it are still valuable. Take a look at Two actions, one form and Two actions, two forms sections. Currently I prefer to use only one actionform and two action classes (input and render) for one web resource. Oh yeah, and as the article says, use the same scope if you use the same form name :-) Otherwise you'll get some funny results. Michael. [1] http://www.theserverside.com/articles/article.tss?l=StrutsActionMapping - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Are throwing RuntimeExceptions in a struts app 'that evil'?
I think I've read over most of the conventional wisdom that talks about how throwing aRuntimeExceptions are a bad idea, especially from within a catch in a finally block (at least IDEA is warning me about it:) But my question is it really 'that' bad? For example let's say for an updateSomething behavior... UpdateAction -- UpdateService --- UpdateDao Now currently I have an error file defined in my web.xml that is used to display any nasty error that might have trickled up and out of struts and notifies the user. My updateDAO, which in my case uses iBATIS has to catch SqlExcptions, but my point is why do I really care to propogate this error up the chain with checked excpetions? My service class might do... update() { dao.update(something); } Do I really want to have to wrap that with a try/catch or declare that it throws WhateverException? What does that really gain me? I don't see what great advantage that gets me over doing this from my dao: catch (SQLException se) { log.error(Error in deleteProfile, se); throw new RuntimeException(deleteProfile,se); } finally { try { sqlMap.endTransaction(); } catch (SQLException se) { log.error(Error in deleteProfile, se); throw new RuntimeException(deleteProfile, se ); } } The point is my log will still show what went wrong, and it's ok the app crashes at this point since it's something serious and I want it to terminate. I'm not so sure why the layer above the dao needs to worry about having to handle this Exception? I'm guessin the theory is that if I were packaging this up and providing it for some third party to use, I'd definitely want to throw SQLException so the consumer is aware an Exception can occur and of course they might not like a RuntimeException crashing their app if things went wrong. I see the point in that, but I'm certain this a case where the daos aren't going to be leaving this app. So in this case, am I still crazy to be throwing a RuntimeException from this dao? (I feel so dirty doing it, even though I think it makes the app more clean:) -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Where dose JSP works in JSF request lifecycle?
On 5/3/06, 王曾wang_zeng [EMAIL PROTECTED] wrote: Oh,yeah,I see, that's why you use new keyword in the code above. private HtmlOutputText dynamicText = new HtmlOutputText(); Then,I have a pretty weird idea. If you dosen't new a HtmlOutputText,will there be a NullpointerException popped up in this case? No ... if the getter method returns null, the tag handler will create a new component instance, just as if you hadn't declared a binding attribute ... but then it will call the setter so your backing bean still has access to the component instance actually being used. -- Wang Zeng Craig
Re: Are throwing RuntimeExceptions in a struts app 'that evil'?
On 5/3/06, Rick Reumann [EMAIL PROTECTED] wrote: I think I've read over most of the conventional wisdom that talks about how throwing aRuntimeExceptions are a bad idea, especially from within a catch in a finally block (at least IDEA is warning me about it:) But my question is it really 'that' bad? Won't you lose your first RTE when you throw another one from finally block? Do I really want to have to wrap that with a try/catch or declare that it throws WhateverException? What does that really gain me? I guess this is religion/style thing. I would never return SQLwhatever exceptions to business/web layer, I would convert it. If situation is correctable, you should catch the exception somewhere, where you can correct the situation (I don't know, you wanted to update, but there is no such row, so you can automatically call insert right away). In this case you might rethrow it as a specific exception, like PersistentObjectNotFoundException. If situation is fatal, throw RTE and don't bother much to catch, the thing blew up anyway. If this is a business-related exception (say, all new hires must be single girls from 18 to 29 yr old), return checked business exception. Well, I guess this situation arises if you have business rules in the database. Michael. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: validation breaks my form prepopulation
Thank you Michael. This is extremely descriptive, and I'm going to devote my nightly reading time to your article this evening. :) What this tells me for right now is that this method of transferring data isn't really something I should be using. I'm going to put my temporary session object manager back into play. Thank you again for all the help, and thank you everyone for your patience! Michael Jouravlev wrote: On 5/3/06, Kyle W. Cartmell [EMAIL PROTECTED] wrote: I did some tinkering and found that even though my setup action is indeed associated with a form bean, and my reset method is defined and sets my values to null, when I return to an action from a validation failure or forwarded from another action, the form that I originally used to populate the data on that page is present and intact. 1. Is it reasonable to simply make use of this mechanic to allow this data to persist? How many forms do you have: one or two? If two, do they have properties with the same names? If I remember correctly, this should work somewhat like this: * You submit an HTML form to a submit action, well, actually to an action mapping * If actionform is defined for the mapping, it is initialized. That means, that if it has request scope, it is created. If it has session scope it is usually reused (this is not guaranteed, but I've yet to encounter the situation when session-scoped form was not reused). * reset() is called on form * form is populated from request parameters * if validate attribute of the action mapping is set to true, validate() is called * if validate() returns non-empty object and you have input attribute set, then control is forwarded to the location defined in the input. (Hmm, what happens if you have validate=true but do not have input attribute?) By the way, it is possible to redirect to input location instead of forwarding, but this is done globally for all mappings in the config file. * If you do a regular forward using input attribute, the request/response sequence has not been finished yet, so all objects that were created when you submitted the request, are still there, including request-scoped actionform and request object itself. So, if you forward to a regular JSP page, you can pull data from the actionform or from request object. * Now, the fun part. If you forward to a setup action, then Struts will look for an actionform associated with this mapping, and will call reset() on it, then it will try to populate it from the request object, then it will call validate() if you have validate=true. So, if you forward to a setup action and you have changed content of the actionform, you should either NOT associate a form with an action. Because otherwise your changes to actionform fields will be overwritted from the request object. Does it make sense? ;-) 2. I find that I am shocked by some astounding discovery regarding Struts functionallity, and I have gone through all of the documentation on the website, can anyone direct me toward comprehensive (or as close as possible) documentation of Struts internals in hopes that I can stop posting silly questions here and not have to resort to reading source? I think that it all clears when you understand how scoped objects are managed, and how the request/response cycle works. The key here is that Struts runs its portion of request/response code whenever you call an action mapping, even if you make a server-side forward. I wrote a small article on that topic [1]. It is not perfect and, frankly, needs a rewrite (I introduced my own names to some of the action/form combinations), I would do some things differently. But some sections of it are still valuable. Take a look at Two actions, one form and Two actions, two forms sections. Currently I prefer to use only one actionform and two action classes (input and render) for one web resource. Oh yeah, and as the article says, use the same scope if you use the same form name :-) Otherwise you'll get some funny results. Michael. [1] http://www.theserverside.com/articles/article.tss?l=StrutsActionMapping - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Kyle W. Cartmell Sr. Software Developer LAP Holdings, LLC dba First Finance Phone: (480) 222-0050 Toll Free: (800) 355-3135 [EMAIL PROTECTED] www.efirstfinance.com
RE: newbie question about xhtml, html:form, submit button
On Wednesday, May 3, Nathan Coast wrote: You need to change your javascript to document.getElementById('tryItForm').submit(); That does it. Thanks for your help. -DB - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Are throwing RuntimeExceptions in a struts app 'that evil'?
On 5/3/06, Michael Jouravlev [EMAIL PROTECTED] wrote: On 5/3/06, Rick Reumann [EMAIL PROTECTED] wrote: I think I've read over most of the conventional wisdom that talks about how throwing aRuntimeExceptions are a bad idea, especially from within a catch in a finally block (at least IDEA is warning me about it:) But my question is it really 'that' bad? Won't you lose your first RTE when you throw another one from finally block? It's in the catch of the finally block, and even if I did lose it wouldn't matter since my error was logged so I'll know what happened well enough. Do I really want to have to wrap that with a try/catch or declare that it throws WhateverException? What does that really gain me? I guess this is religion/style thing. I would never return SQLwhatever exceptions to business/web layer, I would convert it. Well the daos of course aren't in the web layer, but you bring up another annoying thing about not using RTEs from a backend layer - you end up now having to create other Exceptions to wrap things just so your layer further up (like the web layer or even the service layer) doesn't have to know about SQLExceptions. (ie more work and for what gain?) If situation is correctable, you should catch the exception somewhere, where you can correct the situation (I don't know, you wanted to update, but there is no such row, so you can automatically call insert right away). In this case you might rethrow it as a specific exception, like PersistentObjectNotFoundException. Ok sure, yes this is what I've typically done but it's still the same problem.. now you have to handle that all the way up the chain - which I'm not against but I'm really not sure anymore what that really gains me. (Also, I'm not talking about Exceptions that you would want to handle or do something with.. I'm talking about Exceptions that mean something is seriously broken. If situation is fatal, throw RTE and don't bother much to catch, the thing blew up anyway. right. That's what I'm doing now. If this is a business-related exception (say, all new hires must be single girls from 18 to 29 yr old), return checked business exception. Well, I guess this situation arises if you have business rules in the database. Yup that make sense (...oh and so does the new hires demographic:). -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: validation breaks my form prepopulation
So in a Struts web application if I supply two mappings for a single action, one that has a form and one that does not, and I call the one with the form and then a few seconds later call the one without, the form parameter to the execute method is not null on the second call. I don't understand why this would be so... Michael Jouravlev wrote: On 5/3/06, Kyle W. Cartmell [EMAIL PROTECTED] wrote: I did some tinkering and found that even though my setup action is indeed associated with a form bean, and my reset method is defined and sets my values to null, when I return to an action from a validation failure or forwarded from another action, the form that I originally used to populate the data on that page is present and intact. 1. Is it reasonable to simply make use of this mechanic to allow this data to persist? How many forms do you have: one or two? If two, do they have properties with the same names? If I remember correctly, this should work somewhat like this: * You submit an HTML form to a submit action, well, actually to an action mapping * If actionform is defined for the mapping, it is initialized. That means, that if it has request scope, it is created. If it has session scope it is usually reused (this is not guaranteed, but I've yet to encounter the situation when session-scoped form was not reused). * reset() is called on form * form is populated from request parameters * if validate attribute of the action mapping is set to true, validate() is called * if validate() returns non-empty object and you have input attribute set, then control is forwarded to the location defined in the input. (Hmm, what happens if you have validate=true but do not have input attribute?) By the way, it is possible to redirect to input location instead of forwarding, but this is done globally for all mappings in the config file. * If you do a regular forward using input attribute, the request/response sequence has not been finished yet, so all objects that were created when you submitted the request, are still there, including request-scoped actionform and request object itself. So, if you forward to a regular JSP page, you can pull data from the actionform or from request object. * Now, the fun part. If you forward to a setup action, then Struts will look for an actionform associated with this mapping, and will call reset() on it, then it will try to populate it from the request object, then it will call validate() if you have validate=true. So, if you forward to a setup action and you have changed content of the actionform, you should either NOT associate a form with an action. Because otherwise your changes to actionform fields will be overwritted from the request object. Does it make sense? ;-) 2. I find that I am shocked by some astounding discovery regarding Struts functionallity, and I have gone through all of the documentation on the website, can anyone direct me toward comprehensive (or as close as possible) documentation of Struts internals in hopes that I can stop posting silly questions here and not have to resort to reading source? I think that it all clears when you understand how scoped objects are managed, and how the request/response cycle works. The key here is that Struts runs its portion of request/response code whenever you call an action mapping, even if you make a server-side forward. I wrote a small article on that topic [1]. It is not perfect and, frankly, needs a rewrite (I introduced my own names to some of the action/form combinations), I would do some things differently. But some sections of it are still valuable. Take a look at Two actions, one form and Two actions, two forms sections. Currently I prefer to use only one actionform and two action classes (input and render) for one web resource. Oh yeah, and as the article says, use the same scope if you use the same form name :-) Otherwise you'll get some funny results. Michael. [1] http://www.theserverside.com/articles/article.tss?l=StrutsActionMapping - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Kyle W. Cartmell Sr. Software Developer LAP Holdings, LLC dba First Finance Phone: (480) 222-0050 Toll Free: (800) 355-3135 [EMAIL PROTECTED] www.efirstfinance.com
Are layers 'that evil'?
I found this recent par on a local JUG resonated for me and had some theme parallels to Rick's current thread ... how much do we over-code in ignorance of the natural mechanisms available? (Sure, the uber-coders among us can code better frameworks and deserve the fruits, but not we lesser-lings, who usually tangle things more by trying on that caper.) Rob Paul Reedman wrote: snip/ I still run into Java projects that build their own frameworks !!! Yes Struts or hibernate is not good enough, we need our own framework, so lets spend precious several weeks (or months) of the project time recasting a new web framework. Another thing I have noticed is that Java people love building layers. So a particular developer doesn't like the interface into hibernate or struts (or whatever framework) so they build another layer on top of the framework. This layer then becomes complicated and so a whole bunch of other people add to the layer in an attempt to make it easier. (which doesn't happen because all they have done is to make it more complicated) Of course this new layer hides everything and soon you have no idea what you are doing. Importantly no one documents this new layer, so when new people join the project, they ask I don't understand this framework... Of course they don't know that underneath all of this software is plain old struts which has disappeared from view. snip/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: validation breaks my form prepopulation
Are you saying that you've tried to call two mappings, one with an associated actionForm and another without, and when calling action without associated form you get a valid reference to a form? Are you sure? Because it does not sound right, you should get null. On 5/3/06, Kyle W. Cartmell [EMAIL PROTECTED] wrote: So in a Struts web application if I supply two mappings for a single action, one that has a form and one that does not, and I call the one with the form and then a few seconds later call the one without, the form parameter to the execute method is not null on the second call. I don't understand why this would be so... Michael Jouravlev wrote: On 5/3/06, Kyle W. Cartmell [EMAIL PROTECTED] wrote: I did some tinkering and found that even though my setup action is indeed associated with a form bean, and my reset method is defined and sets my values to null, when I return to an action from a validation failure or forwarded from another action, the form that I originally used to populate the data on that page is present and intact. 1. Is it reasonable to simply make use of this mechanic to allow this data to persist? How many forms do you have: one or two? If two, do they have properties with the same names? If I remember correctly, this should work somewhat like this: * You submit an HTML form to a submit action, well, actually to an action mapping * If actionform is defined for the mapping, it is initialized. That means, that if it has request scope, it is created. If it has session scope it is usually reused (this is not guaranteed, but I've yet to encounter the situation when session-scoped form was not reused). * reset() is called on form * form is populated from request parameters * if validate attribute of the action mapping is set to true, validate() is called * if validate() returns non-empty object and you have input attribute set, then control is forwarded to the location defined in the input. (Hmm, what happens if you have validate=true but do not have input attribute?) By the way, it is possible to redirect to input location instead of forwarding, but this is done globally for all mappings in the config file. * If you do a regular forward using input attribute, the request/response sequence has not been finished yet, so all objects that were created when you submitted the request, are still there, including request-scoped actionform and request object itself. So, if you forward to a regular JSP page, you can pull data from the actionform or from request object. * Now, the fun part. If you forward to a setup action, then Struts will look for an actionform associated with this mapping, and will call reset() on it, then it will try to populate it from the request object, then it will call validate() if you have validate=true. So, if you forward to a setup action and you have changed content of the actionform, you should either NOT associate a form with an action. Because otherwise your changes to actionform fields will be overwritted from the request object. Does it make sense? ;-) 2. I find that I am shocked by some astounding discovery regarding Struts functionallity, and I have gone through all of the documentation on the website, can anyone direct me toward comprehensive (or as close as possible) documentation of Struts internals in hopes that I can stop posting silly questions here and not have to resort to reading source? I think that it all clears when you understand how scoped objects are managed, and how the request/response cycle works. The key here is that Struts runs its portion of request/response code whenever you call an action mapping, even if you make a server-side forward. I wrote a small article on that topic [1]. It is not perfect and, frankly, needs a rewrite (I introduced my own names to some of the action/form combinations), I would do some things differently. But some sections of it are still valuable. Take a look at Two actions, one form and Two actions, two forms sections. Currently I prefer to use only one actionform and two action classes (input and render) for one web resource. Oh yeah, and as the article says, use the same scope if you use the same form name :-) Otherwise you'll get some funny results. Michael. [1] http://www.theserverside.com/articles/article.tss?l=StrutsActionMapping -- Kyle W. Cartmell Sr. Software Developer LAP Holdings, LLC dba First Finance Phone: (480) 222-0050 Toll Free: (800) 355-3135 [EMAIL PROTECTED] www.efirstfinance.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: validation breaks my form prepopulation
Kyle, this is not exactly what you are looking for, but maybe it can help a little: http://wiki.apache.org/struts/DataEntryForm (as you might have noticed, I like to draw pictures with blocks and arrows). Michael. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Where dose JSP works in JSF request lifecycle?
But the prerender() is called before the tag being processed. when the prerender() is called, the reference is still null if this is an initial request. Tree hasn't been constructed, when the prerender() is called. I guess maybe if I want to set a initial value of a component when the page is viewed the first time, the reference to the component must be assigned using a *new* keyword. 2006/5/4, Craig McClanahan [EMAIL PROTECTED]: No ... if the getter method returns null, the tag handler will create a new component instance, just as if you hadn't declared a binding attribute ... but then it will call the setter so your backing bean still has access to the component instance actually being used. -- Wang Zeng Craig -- Wang Zeng
Re: How to create a Waiting Page for long requests?
Great link, thanks!! -ed On 5/3/06, Jakub Milkiewicz [EMAIL PROTECTED] wrote: Hi I think JMS is only valid , i.e. following specification solution. Take a look at: http://www.javaranch.com/newsletter/200403/AsynchronousProcessingFromServlets.html 2006/5/3, Dave Newton [EMAIL PROTECTED]: Ed Griebel wrote: The tricky part is that you can't create a new thread in your action as it violates the servlet spec (as you don't know what thread will get subsequent requests from the same session, so you've lost the handle to your child thread), Oh, yeah? Is that equally valid for a servlet that's run only on initialization that starts a thread that thrashes through the database every now and then doing something? I know I could use jCrontab/etc. but they're already mad enough at me for using not-invented-here stuff :-( Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Where dose JSP works in JSF request lifecycle?
On 5/3/06, 王曾wang_zeng [EMAIL PROTECTED] wrote: But the prerender() is called before the tag being processed. when the prerender() is called, the reference is still null if this is an initial request. Tree hasn't been constructed, when the prerender() is called. I guess maybe if I want to set a initial value of a component when the page is viewed the first time, the reference to the component must be assigned using a *new* keyword. Not quite. IF you use a binding attribute on your component, AND IF the getter method on your backing bean returns a component instance that has been previously configured (in the backing bean's prerender() method), THEN the component tree will include *your* instance instead of creating a new one. The nitty gritty details of how this works are found in Section 3.1.5 of the JSF 1.1specification. Craig
Re: multiple pattern mapping
Have you seen this one? http://sourceforge.net/projects/jsecurity/ -- James Mitchell On Apr 27, 2006, at 8:25 AM, Ted Husted wrote: Sadly, multiple extension mappings is not supported by Action 1 (*). There can only be one. The usual workaround is to use different folders to represent different authentification types. So, you'd have to have something like /auth/something.do versus /open/something.do. For more complex authentification tasks, many people find ServletFilter and Acergi useful. * http://securityfilter.sourceforge.net/ * http://www.acegisecurity.org/ HTH, Ted. (*) Albeit, multiple Action extensions is supported by WebWork2/ Action2. On 4/25/06, Mike Korcynski [EMAIL PROTECTED] wrote: Hi, I'm trying to use 2 different pattern mappings to the action servlet, and have one handle protected action and one handle public actions using security-constraints, the mappings look like this: servlet-mapping servlet-nameaction/servlet-name url-pattern*.auth/url-pattern /servlet-mapping servlet-mapping servlet-nameaction/servlet-name url-pattern*.do/url-pattern /servlet-mapping The problem is in my form.jsp I specify my action specifically as authorize.auth, and yet when the page renders the action is always changed back to authorize.do html:form method=post action=/authorize.auth form name=authorizeForm method=post action=/sample/ authorize.do The action mappings in my struts-config is like this: action path=/authorize input=/form/login.jsp name=authorizeForm type=blah.action.AuthorizeAction scope=request validate=false forward name=success path=/form/mainmenu.jsp/ forward name=failure path=/form/blah.jsp/ /action Any idea what could be wrong? Thanks for your help, Mike - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- HTH, Ted. ** http://www.husted.com/ted/blog/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Loosely coupled pages and actions
Hi, I have some actions that I have decoupled from their jsps, so that I can use the corresponding html components on various pages and move them around as the client changes their mind about requirements. I have implemented a programmatic mechanism for the action to know which assets to populate and which jsp to render after the action has completed, but it's getting a little tricky with some boundary fault cases, as I've also implemented a window uniquifier to permit multiple browser windows being acted in without session collisions. Anyway, can someone point out what I've overlooked? Is there a simpler (framework) way of a loosely coupled action knowing dynamically what jsp it's called from (esp: note the cases of the component being or not being in a jsp:include) so that it can populate the right assets and render the right jsp? Using the struts-config.xml action input entry only allows one point of origin, and using request.getRequestURI() returns the last *action* not the originating jsp to forward back to (not helpful when the last action is itself one of these decoupled actions, as opposed to an inital jsp entry action). Thanks in advance for any input. Rob - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Loosely coupled pages and actions
On 5/3/06, Rob Manthey [EMAIL PROTECTED] wrote: Hi, I have some actions that I have decoupled from their jsps, so that I can use the corresponding html components on various pages and move them around as the client changes their mind about requirements. I have implemented a programmatic mechanism for the action to know which assets to populate and which jsp to render after the action has completed, but it's getting a little tricky with some boundary fault cases, as I've also implemented a window uniquifier to permit multiple browser windows being acted in without session collisions. Anyway, can someone point out what I've overlooked? Is there a simpler (framework) way of a loosely coupled action knowing dynamically what jsp it's called from (esp: note the cases of the component being or not being in a jsp:include) so that it can populate the right assets and render the right jsp? Unless it is the case of jsp:include, I personally believe that action should not know or care to know where the request came from. Anyway. In case of jsp:include, you can either pass a request parameter using jsp:param, or you can check for javax.servlet.include.request_uri attribute of request object to see if the action is included and what is the address of included fragment as well as of parent page. See servlet spec or check out Caucho FAQ [1]. Using the struts-config.xml action input entry only allows one point of origin, and using request.getRequestURI() returns the last *action* not the originating jsp to forward back to (not helpful when the last action is itself one of these decoupled actions, as opposed to an inital jsp entry action). If you think of it, this is logical. When you click on the link in the browser, there is no JSP anymore, there is just an HTML page containing the location where the request is about to be sent. How browser would know about your last JSP? If you like, you can stick your last location into your HTML forms as a hidden field, or into all links as a parameter in a rewrite-URL manner. [1] http://www.caucho.com/resin-3.0/webapp/faq.xtp Michael. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Loosely coupled pages and actions
Thanks Michael. I'm just picking my way through your answer ... Ok, the jsp:include bit is interesting ... and I'm going to consume that in detail later, that's a lesser case at present. One question on the non-include side ... - Michael Jouravlev wrote: On 5/3/06, Rob Manthey [EMAIL PROTECTED] wrote: ... action knowing dynamically what jsp it's called from ... Unless it is the case of jsp:include, I personally believe that action should not know or care to know where the request came from. I'm anticipating that this is on the back of an MVC axiom that the action updates the model and then the jsp just fetches the assets it wants from the model, so the which assets does the action need to populate is catered for by not anticipating which page you are heading for, just update all assets that the action has tainted. (I'm probably still missing the finer points, as this seems not to be as lightweight an approach as updating the assets that were tainted by the action *and* are going to be wanted in the next jsp, but ok it would solve the asset selection problem.) However (correct me please), surely *something* needs to know which jsp to fetch to return to the user ... ? If this is removed from the action's responsibility, how do I configure the Struts1 framework to dynamically route back to the right page when an action can be called from multiple jsps ... ? struts-config.xml seems to only allow one page for an action to anonymously default back to after completion ... action input=pagename. Your patience is appreciated. If the answer is in a nuance of your previous reply, feel free to textually slap me. Rob - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Loosely coupled pages and actions
Michael Jouravlev wrote: On 5/3/06, Rob Manthey [EMAIL PROTECTED] wrote: action knowing dynamically what jsp it's called from ... ... If you like, you can stick your last location into your HTML forms as a hidden field, or into all links as a parameter in a rewrite-URL manner. Yuk. Yes, I was deliberately avoiding that type of bare-your-soul-to-the-user html programmatic stuff. I'm acheiving a lot with serverside programmatic side-steps at present, and was aware of that possibility, but am trying to find any way to avoid adding another special field in my url rewrites. Rob - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Loosely coupled pages and actions
Michael Jouravlev wrote: On 5/3/06, Rob Manthey [EMAIL PROTECTED] wrote: ... action knowing dynamically what jsp it's called from ... [1] http://www.caucho.com/resin-3.0/webapp/faq.xtp request attributes available in target.jsp request.getAttribute(javax.servlet.forward.request_uri) /testapp/index.jsp I'm looking at testing some code around this ... let me know if I'm definitely barking up the wrong tree. Thanks for the tips by the way. Rob - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]