Re: kindly help please
okay thats fine .No problem.I will find it out Regards Pradhap On 6/9/06, Frank W. Zammetti [EMAIL PROTECTED] wrote: Sorry, I don't have any applicable links to give. Some time with Google might find you some details. Frank xavier prad wrote: hai *Zammetti,* *Thanks for the help you have extended me .Kindly let me know some websites to find the details .* *Regards ,* *Pradhap.* On 6/9/06, Frank W. Zammetti [EMAIL PROTECTED] wrote: Hi Pradhap, Yes, you can. However, your JSPs will in all probability NOT be rendering markup for display to the user... they will probably generate some sort of data structure that your Swing client will use to update the view. Maybe XML for example. Your Swing app just makes HTTP requests to the app on the server as usual. I know this because about 3 years ago I was asked to do this... the project didn't go beyond proof-of-concept, but it was working just fine before it was aborted. Now, keep in mind that when you use JSPs, assuming you use Struts tags, you'll be giving that stuff up, or more precisely, you'll have to code it all yourself... if input validation fails for instance, you'll have to deal with redisplaying the entered values (if they were ever not visible that is). Frank xavier prad wrote: Can I use swings instead of jsp as view in struts Regards Pradhap -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com AIM: fzammetti Yahoo: fzammetti MSN: [EMAIL PROTECTED] Java Web Parts - http://javawebparts.sourceforge.net Supplying the wheel, so you don't have to reinvent it! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com AIM: fzammetti Yahoo: fzammetti MSN: [EMAIL PROTECTED] Java Web Parts - http://javawebparts.sourceforge.net Supplying the wheel, so you don't have to reinvent it! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
tiles and forwards
Hi, I use struts 1.2 with tiles. There are a template layout.jsp, a tile locale.jsp and 2 tileDefinitions a.page and b.page. With the org.apache.struts.actions.LocaleAction there are problems. In the locale.jsp: (language switch) html:select property=language size=1 html:option key=label.de value=de/ html:option key=label.en value=en/ /html:select html:hidden property=page value=a.page/ If the page attribute is set to a tilesDefintions it works, but if not occurs a exception: In the struts-config-xml: action path=/processLanguage name=languageForm type=org.apache.struts.actions.LocaleAction forward name=success path=b.page/ /action java.lang.IllegalArgumentException: Path does not start with a / character at org.apache.catalina.core.ApplicationContext.getRequestDispatcher(ApplicationContext.java:377) at org.apache.catalina.core.ApplicationContextFacade.getRequestDispatcher(ApplicationContextFacade.java:198) at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1056) at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:263) at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:386) at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:318) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:229) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432) 1.What is wrong? Why is the forward to the tilesDefinition b.page not valid ? I test it with it with a action and jsp as pathAttribute (witch starts with a /) but the same Exception occurs. 2.How can I get the actual tilesDefintion in the jsp (local.jsp) (Perhaps with jstl-core and EL) or in the action (LocaleAction.java) to set the pageAttribute to forward to. Best Regards rula - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Validation not working for 'double' with Struts 1.2
this to work you need to define the property in your ActionForm as a String, not a Double. Hi , I have treid this but couldnt find any luck, now instead of a defaut value 0.0 in the case of 'Double' the invalid 'char/string' gets stored in the database. As if the validtion is not working at all for 'depends= double' I tried to extend 'ValidatiorActionForm' instead of 'ActionForm' since there is no '.js' like 'validateDouble.js' for 'double'. Then being a financial project I really dont want to change it to a 'String' data type from a 'Double' so that no precision is lost if I ever have to cast it to a 'Double' while implementing b.Logic in the future.. To be frank enough I started to look for a '.js' function so that I can do the validation for 'Double' in the client side itself. Thanking you all Antony -- View this message in context: http://www.nabble.com/Validation-not-working-for-%27double%27-with-Struts-1.2-t1754076.html#a4787921 Sent from the Struts - User forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: tiles and forwards
Where do you define the tiles? (Filename) How did you specify the filename to the tiles request processor/struts config? -DAvid -Original Message- From: rula2005 [mailto:[EMAIL PROTECTED] Sent: Friday, June 09, 2006 3:06 AM To: user@struts.apache.org Subject: tiles and forwards Hi, I use struts 1.2 with tiles. There are a template layout.jsp, a tile locale.jsp and 2 tileDefinitions a.page and b.page. With the org.apache.struts.actions.LocaleAction there are problems. In the locale.jsp: (language switch) html:select property=language size=1 html:option key=label.de value=de/ html:option key=label.en value=en/ /html:select html:hidden property=page value=a.page/ If the page attribute is set to a tilesDefintions it works, but if not occurs a exception: In the struts-config-xml: action path=/processLanguage name=languageForm type=org.apache.struts.actions.LocaleAction forward name=success path=b.page/ /action java.lang.IllegalArgumentException: Path does not start with a / character at org.apache.catalina.core.ApplicationContext.getRequestDispatcher(Application Context.java:377) at org.apache.catalina.core.ApplicationContextFacade.getRequestDispatcher(Appli cationContextFacade.java:198) at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:10 56) at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcesso r.java:263) at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProces sor.java:386) at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequ estProcessor.java:318) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:229) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432) 1.What is wrong? Why is the forward to the tilesDefinition b.page not valid ? I test it with it with a action and jsp as pathAttribute (witch starts with a /) but the same Exception occurs. 2.How can I get the actual tilesDefintion in the jsp (local.jsp) (Perhaps with jstl-core and EL) or in the action (LocaleAction.java) to set the pageAttribute to forward to. Best Regards rula - 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: multibox not works when all checkboxes are unselected!
Thanks for this great explanations I already solved this problem and now 'm quite close to understand it! It would be great to have a sequence diagramm to see this flow submit-reset-populate-validate because knowing this flow isn't quite clear to a normal struts-user. THANKS A LOT starki78 wrote: Hi! I've a large problem with html:multibox. I've tree checkboxes. When I choose one or two or three it arrives correct at the next action! Only then all checkboxes are deselected it remembers the state of the checkboxes that was selected before! The state of the form is session in struts-config. Can you help me with this problem?? I really don't have an idea how to solve it! As Adam J. mentioned, it sounds like you're using a session-scoped bean. Try overriding (if you haven't already) the reset() method of your form bean and resetting the property: public void reset( ActionMapping mapping, HttpServletRequest request ) { this.values = new String[0]; } If you're _not_ using a session bean (and are using a request-scoped one instead), you'll _still_ want to do the above. Using this way in both cases, values from the previous request are discarded. If the web browser doesn't send any checkbox values over (because none are checked), then this.values will be an empty array, which corresponds to the very state of the submitted form's checkboxes (ie: none are checked). The array of values in your formbean for an html:multibox are a list of values of checked checkboxes. So... 1. Form bean looks like this: this.values = { value1, value3, value5 }; 2. Displayed form looks like this: html:multibox property=valuesvalue1/html:multibox 1 html:multibox property=valuesvalue2/html:multibox 2 html:multibox property=valuesvalue3/html:multibox 3 html:multibox property=valuesvalue4/html:multibox 4 html:multibox property=valuesvalue5/html:multibox 5 3. HTML sent to browser looks like this: input type=checkbox name=values value=value1 checked 1 input type=checkbox name=values value=value1 2 input type=checkbox name=values value=value1 checked 3 input type=checkbox name=values value=value1 4 input type=checkbox name=values value=value1 checked 5 4. User unchecks ALL checkboxes, and submits the form. 5. Struts calls reset() on your form - Your reset() method sets this.values = new String[0] 6. Struts populates your form, and _doesn't touch values_, because nothing is checked, so values remains an empty array. Sound good? - Scott - 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: tiles and forwards
Hi David, I defined the tiles in a tiles-def.xml: definition name=main.layout path=/pages/layout.jsp put name=title value=baseTitle/ put name=header value=/pages/header.jsp/ put name=locale value=/pages/locale.jsp/ put name=menu value=/pages/menu.jsp/ put name=body value=/ put name=footer value=/pages/footer.jsp/ put name=copywrite value=copyWriteBy/ /definition definition name=a.page extends=main.layout put name=title value=aTitle/ put name=body value=/pages/bodyA.jsp/ /definition definition name=b.page extends=main.layout put name=title value=bTitle/ put name=body value=/pages/bodyB.jsp/ /definition I specified no filenames in struts-config.xml only the forward: action path=/processLanguage name=languageForm type=org.apache.struts.actions.LocaleAction forward name=success path=b.page/ /action regards rula - Original Message - From: David Friedman [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Friday, June 09, 2006 7:21 AM Subject: RE: tiles and forwards Where do you define the tiles? (Filename) How did you specify the filename to the tiles request processor/struts config? -DAvid -Original Message- From: rula2005 [mailto:[EMAIL PROTECTED] Sent: Friday, June 09, 2006 3:06 AM To: user@struts.apache.org Subject: tiles and forwards Hi, I use struts 1.2 with tiles. There are a template layout.jsp, a tile locale.jsp and 2 tileDefinitions a.page and b.page. With the org.apache.struts.actions.LocaleAction there are problems. In the locale.jsp: (language switch) html:select property=language size=1 html:option key=label.de value=de/ html:option key=label.en value=en/ /html:select html:hidden property=page value=a.page/ If the page attribute is set to a tilesDefintions it works, but if not occurs a exception: In the struts-config-xml: action path=/processLanguage name=languageForm type=org.apache.struts.actions.LocaleAction forward name=success path=b.page/ /action java.lang.IllegalArgumentException: Path does not start with a / character at org.apache.catalina.core.ApplicationContext.getRequestDispatcher(Application Context.java:377) at org.apache.catalina.core.ApplicationContextFacade.getRequestDispatcher(Appli cationContextFacade.java:198) at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:10 56) at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcesso r.java:263) at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProces sor.java:386) at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequ estProcessor.java:318) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:229) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432) 1.What is wrong? Why is the forward to the tilesDefinition b.page not valid ? I test it with it with a action and jsp as pathAttribute (witch starts with a /) but the same Exception occurs. 2.How can I get the actual tilesDefintion in the jsp (local.jsp) (Perhaps with jstl-core and EL) or in the action (LocaleAction.java) to set the pageAttribute to forward to. Best Regards rula - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: multibox not works when all checkboxes are unselected!
I dont' have such a sequence like that, but you can get the same when you read the source code of the RequestProcessor class. starki78 wrote: Thanks for this great explanations I already solved this problem and now 'm quite close to understand it! It would be great to have a sequence diagramm to see this flow submit-reset-populate-validate because knowing this flow isn't quite clear to a normal struts-user. THANKS A LOT starki78 wrote: Hi! I've a large problem with html:multibox. I've tree checkboxes. When I choose one or two or three it arrives correct at the next action! Only then all checkboxes are deselected it remembers the state of the checkboxes that was selected before! The state of the form is session in struts-config. Can you help me with this problem?? I really don't have an idea how to solve it! As Adam J. mentioned, it sounds like you're using a session-scoped bean. Try overriding (if you haven't already) the reset() method of your form bean and resetting the property: public void reset( ActionMapping mapping, HttpServletRequest request ) { this.values = new String[0]; } If you're _not_ using a session bean (and are using a request-scoped one instead), you'll _still_ want to do the above. Using this way in both cases, values from the previous request are discarded. If the web browser doesn't send any checkbox values over (because none are checked), then this.values will be an empty array, which corresponds to the very state of the submitted form's checkboxes (ie: none are checked). The array of values in your formbean for an html:multibox are a list of values of checked checkboxes. So... 1. Form bean looks like this: this.values = { value1, value3, value5 }; 2. Displayed form looks like this: html:multibox property=valuesvalue1/html:multibox 1 html:multibox property=valuesvalue2/html:multibox 2 html:multibox property=valuesvalue3/html:multibox 3 html:multibox property=valuesvalue4/html:multibox 4 html:multibox property=valuesvalue5/html:multibox 5 3. HTML sent to browser looks like this: input type=checkbox name=values value=value1 checked 1 input type=checkbox name=values value=value1 2 input type=checkbox name=values value=value1 checked 3 input type=checkbox name=values value=value1 4 input type=checkbox name=values value=value1 checked 5 4. User unchecks ALL checkboxes, and submits the form. 5. Struts calls reset() on your form - Your reset() method sets this.values = new String[0] 6. Struts populates your form, and _doesn't touch values_, because nothing is checked, so values remains an empty array. Sound good? - Scott - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Reload the same page
Forward the request to an action instead of a jsp. In the action code set the request and forward to jsp Hope that helps Cheers -Original Message- From: Maya menon [mailto:[EMAIL PROTECTED] Sent: 08 June 2006 21:31 To: Struts Users Mailing List Subject: Reload the same page All, I have a page, results.jsp with a link ahref=deleteAction.do?/ In deleteAction, the record will be deleted by calling the helper classes and on succesful delete the request should be forwarded again to the results.jsp. How can I achieve this ? In strts-config, i have it properly pointed. But the page doesnot refresh. Am I missing anything ? Thanks __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Encryption / decryption problem in multi threading
Hii I m having this strange problem. I m encrypting the password using java JCE AES encryption algorithm and storing the password as varchar(30) in the mySQL database. The Encryption/Decryption is working fine if i am doing it sequentially (single thread) but i m getting a javax.crypto.BadPaddingException: Given final block not properly padded exception when i am running a multi threaded test !! any ideas ?? - Shanky
Re: tiles and forwards
rula2005 ha scritto: I specified no filenames in struts-config.xml That's funny, how do you think that Tiles knows what definition file to use? http://struts.apache.org/struts-action/struts-tiles/installation.html As you can see it states: * *Using Tiles With Struts Action* - You will also need to configure the Tiles Plugin and the Tiles Request Processor to allow the framework to respond to Tiles-based Action Forwards. Below is a sample Tiles Plugin configuration. plug-in className=org.apache.struts.tiles.TilesPlugin set-property property=definitions-config value=/WEB-INF/tiles-defs.xml/ /plug-in HTH Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Re: Extending Struts with Spring
Ciao! Do you have experience with AOP and specially using a Interceptor for metrics? I really cannot imagine how to implement a solution for an application! Do you mean like in a filter implement code for time-stopping or similar? Nice greetings Starki Don't forget about the AOP aspect (no pun intended) of Spring. While the IoC is handy, it is nothing, in my opinion, in comparison to the solution regarding logging, security, metrics, etc. in Spring with AOP. On 6/8/06, Julian Tillmann [EMAIL PROTECTED] wrote: Thanks very much for all your answers, I'd be very keen to learn more about this soon. -- Echte DSL-Flatrate dauerhaft für 0,- Euro*! Feel free mit GMX DSL! http://www.gmx.net/de/go/dsl - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[SOLVED] struts-config xml file throws a java exception
The problem is solved. The struts-config file had no declaration of the data source type to use. So it took by default org.apache.struts.action.dataSources instead of : org.apache.struts.util.GenericDataSource Thanks for your help... -Message d'origine- De : Samere, Adam J [mailto:[EMAIL PROTECTED] Envoyé : jeudi 8 juin 2006 16:01 À : Struts Users Mailing List Objet : RE: struts-config xml file throws a java exception Does your struts-config have: action-mappings type=com.ex.struts.EmployesActionMapping ... /action-mappings It didn't in the example you provided earlier. -Original Message- From: Olivier Bex [mailto:[EMAIL PROTECTED] Sent: Thursday, June 08, 2006 9:58 AM To: 'Struts Users Mailing List' Subject: RE: struts-config xml file throws a java exception Here is my Actionmapping class using the property loginRequired : package com.ex.struts; import org.apache.struts.action.ActionMapping; public class EmployesActionMapping extends ActionMapping { private static final long serialVersionUID = 1L; protected boolean loginRequired = false; public void setLoginRequired(boolean loginRequired) { this.loginRequired = loginRequired; } public boolean getLoginRequired() { return loginRequired; } } -Message d'origine- De : Dave Newton [mailto:[EMAIL PROTECTED] Envoyé : jeudi 8 juin 2006 15:19 À : Struts Users Mailing List Objet : Re: struts-config xml file throws a java exception Olivier Bex wrote: LoginRequired is referenced in the action tags of each action. I may have missed it, but did you provide the source for your custom ActionMapping class that you are expecting the set-property... element to act upon? (If you didn't, or haven't sub-classed ActionMapping or aren't using somebody else's custom ActionMapping, consider this a hint ;) 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] - The information contained in this message may be privileged, confidential, and protected from disclosure. If the reader of this message is not the intended recipient, or any employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the message and deleting it from your computer. Thank you. Paychex, Inc. - 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]
Selecting and setting Bean Object from html:select
Hi, I am trying to get an html:select with html:optionsCollection to set a property in my ActionForm with the actuall bean that was selected rather than the associated value: // Bean class public class Item { int id; String name; public int getId() { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } } // ActionForm public class itemForm extends ActionForm { Item selectedItem; ListItem allItems; public Item getSelectedItem() { return selectedItem; } public void setSelectedItem(Item selectedItem) { this.selectedItem = selectedItem; } public ListItem getAllItems() { ... } } // jsp page html:select property=selectedItem html:optionsCollection property=allItems label=name value=id/ /html:select Obviously this fails since it will try and call setSelectedItem with an int value causing a argument type mismatch exception. Is there a way to make it use the actual Item Bean that was selected or it is simpler for me to just retrieve the id value and use this to match the selected bean elsewhere? Thanks in advance. Andy McDowall __ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email __
best way to send parameters through more requests
Title: Message Hello, all! Is there a solution besides using session, to send some request parameters from one request to another? I would like to implement something like a shopping cart (a functionality which needs about4-5 steps) and I do not want to store the objects in the session (it is alread too big)! So, do you have any ideas? Kind regards, Emilia - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: hotkeys
Miguel Galves wrote: What exactly do you want to do ? On 6/8/06, Marcus [EMAIL PROTECTED] wrote: Is there a way of adding hotkeys to a form field in struts? I would like to add the keys F1-F4 to my form fields 1-4. I think he wants to use F1-F4 as hotkeys into the form fields. I'm guessing that wouldn't work w/o browser keymap hackery (for instance, in FireFox and most other Windows programs, F1 is the Help key). Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] Re: XML Help
Krishnakanth wrote: Note : I just took the getElementByTagName(table) that time I got the length as 2 it is ok.but after that I iterate that NodeList in a for loop and take NodeList.item(i).getChildNodes, Now I get some 8 or 10 childsSo I'm totally confused Any Idea Please advise Me too, since you didn't provide any information about how you're accessing the XML, etc. Simplistic XML merging (for me) has generally consisted only of a couple of hash tables and loops and minor decision-making about which attributes to use for node 'equality' comparisons. It sounds like you're having problems at an even higher level, i.e., you don't know how to use your XML library. Can't help, don't know what you're using and how it represents elements. Urgent !!! Urgent !!! Urgent !!! Urgent !!! Urgent !!! If it's that urgent you might want to consider Google or an XML forum. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] Re: Encryption / decryption problem in multi threading
Shshank Jain wrote: any ideas ?? Not without any code. If you're doing it inside a Struts Action are you using an instance variable in the Action? Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: tiles and forwards
Hi, sorry, i misunderstood the meaning of specified filename, i have already used the tiles-plugin with the tiles-def.xml in the struts-config.xml like this: plug-in className=org.apache.struts.tiles.TilesPlugin !-- Path to XML definition file -- set-property property=definitions-config value=/WEB-INF/tiles-defs.xml / !-- Set Module-awareness to true -- set-property property=moduleAware value=true / /plug-in Tiles works well with the ForwardAction like: action path=/viewA type=org.apache.struts.actions.ForwardAction parameter=a.page/ but not with the LocaleAction like: action path=/processLanguage name=languageForm type=org.apache.struts.actions.LocaleAction forward name=success path=b.page/ /action when the pageAttribute in the jsp is not set and the forward in the struts-config is used. Then occurs the following exception: java.lang.IllegalArgumentException: Path does not start with a / character I am confused, because I use tiles an so I can take the tilesDefinition as pathAttribute. But the requestProcessor( not the TilesRequestProcessor ) has a Problem with this. at org.apache.catalina.core.ApplicationContext.getRequestDispatcher(ApplicationContext.java:377) at org.apache.catalina.core.ApplicationContextFacade.getRequestDispatcher(ApplicationContextFacade.java:198) at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1056) at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:263) at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:386) at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:318) regards rula - Original Message - From: Antonio Petrelli [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Friday, June 09, 2006 8:08 AM Subject: Re: tiles and forwards rula2005 ha scritto: I specified no filenames in struts-config.xml That's funny, how do you think that Tiles knows what definition file to use? http://struts.apache.org/struts-action/struts-tiles/installation.html As you can see it states: * *Using Tiles With Struts Action* - You will also need to configure the Tiles Plugin and the Tiles Request Processor to allow the framework to respond to Tiles-based Action Forwards. Below is a sample Tiles Plugin configuration. plug-in className=org.apache.struts.tiles.TilesPlugin set-property property=definitions-config value=/WEB-INF/tiles-defs.xml/ /plug-in HTH Antonio - 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: [SOLVED] struts-config xml file throws a java exception
Olivier Bex wrote: The problem is solved. The struts-config file had no declaration of the data source type to use. So it took by default org.apache.struts.action.dataSources instead of : org.apache.struts.util.GenericDataSource ?! Fixing that removed the error regarding your set-property... element??? Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: best way to send parameters through more requests
Emilia Ipate wrote: Is there a solution besides using session, to send some request parameters from one request to another? I would like to implement something like a shopping cart (a functionality which needs about4-5 steps) and I do not want to store the objects in the session (it is alread too big)! So, do you have any ideas? Keep the shopping cart in the DB and load it on every page. Personally I'd rather keep things like that in the session, though, unless there's a requirement to keep the cart sticky. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: tiles and forwards
rula2005 ha scritto: Hi, sorry, i misunderstood the meaning of specified filename, i have already used the tiles-plugin with the tiles-def.xml in the struts-config.xml like this: plug-in className=org.apache.struts.tiles.TilesPlugin !-- Path to XML definition file -- set-property property=definitions-config value=/WEB-INF/tiles-defs.xml / !-- Set Module-awareness to true -- set-property property=moduleAware value=true / /plug-in Mmm... this is strange... Can you post the code of your action? At least the part when you return the forward in the execute method? I have a suspect. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: best way to send parameters through more requests
You also may be able to store state in hidden fields in the rendered markup, or by encoding the raw binary data in a single hidden field. This goes a bit beyond the scope of this list though. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, June 09, 2006 7:40 AM To: user@struts.apache.org; [EMAIL PROTECTED] Subject: RE: best way to send parameters through more requests Also a word of caution I presume all the objects you store in session are seriallizable. If they are not then your solution wont work if the application is deployed on cluster Small piece of information can be transferred through hidden fields from form to form through struts actions Cheers -Original Message- From: Dave Newton [mailto:[EMAIL PROTECTED] Sent: 09 June 2006 12:33 To: Struts Users Mailing List Subject: Re: best way to send parameters through more requests Emilia Ipate wrote: Is there a solution besides using session, to send some request parameters from one request to another? I would like to implement something like a shopping cart (a functionality which needs about4-5 steps) and I do not want to store the objects in the session (it is alread too big)! So, do you have any ideas? Keep the shopping cart in the DB and load it on every page. Personally I'd rather keep things like that in the session, though, unless there's a requirement to keep the cart sticky. 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] - The information contained in this message may be privileged, confidential, and protected from disclosure. If the reader of this message is not the intended recipient, or any employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the message and deleting it from your computer. Thank you. Paychex, Inc. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: best way to send parameters through more requests
Using hidden fields is good, but what if you have like 4-5 request steps? You will end up at step 5 to send to server a long list of hidden fileds (all the fields used in step 1,2,3 and 4)... And this sounds like a unmaintable code!!! Emilia -Original Message- From: Samere, Adam J [mailto:[EMAIL PROTECTED] Sent: vrijdag 9 juni 2006 13:57 To: Struts Users Mailing List Subject: RE: best way to send parameters through more requests You also may be able to store state in hidden fields in the rendered markup, or by encoding the raw binary data in a single hidden field. This goes a bit beyond the scope of this list though. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, June 09, 2006 7:40 AM To: user@struts.apache.org; [EMAIL PROTECTED] Subject: RE: best way to send parameters through more requests Also a word of caution I presume all the objects you store in session are seriallizable. If they are not then your solution wont work if the application is deployed on cluster Small piece of information can be transferred through hidden fields from form to form through struts actions Cheers -Original Message- From: Dave Newton [mailto:[EMAIL PROTECTED] Sent: 09 June 2006 12:33 To: Struts Users Mailing List Subject: Re: best way to send parameters through more requests Emilia Ipate wrote: Is there a solution besides using session, to send some request parameters from one request to another? I would like to implement something like a shopping cart (a functionality which needs about4-5 steps) and I do not want to store the objects in the session (it is alread too big)! So, do you have any ideas? Keep the shopping cart in the DB and load it on every page. Personally I'd rather keep things like that in the session, though, unless there's a requirement to keep the cart sticky. 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] - The information contained in this message may be privileged, confidential, and protected from disclosure. If the reader of this message is not the intended recipient, or any employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the message and deleting it from your computer. Thank you. Paychex, Inc. - 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: best way to send parameters through more requests
Typically the best solution is to keep this data in the session. That is what the session is for. As I mentioned, the other option would be to encode the data using base64 encoding (or something similar) and store it in a single hidden field. What makes you so sure you have too much data in the session? Perhaps you could streamline some of the other data you store in the session or make sure you cleanup unneeded data. -Adam -Original Message- From: Emilia Ipate [mailto:[EMAIL PROTECTED] Sent: Friday, June 09, 2006 8:04 AM To: Struts Users Mailing List Subject: RE: best way to send parameters through more requests Using hidden fields is good, but what if you have like 4-5 request steps? You will end up at step 5 to send to server a long list of hidden fileds (all the fields used in step 1,2,3 and 4)... And this sounds like a unmaintable code!!! Emilia -Original Message- From: Samere, Adam J [mailto:[EMAIL PROTECTED] Sent: vrijdag 9 juni 2006 13:57 To: Struts Users Mailing List Subject: RE: best way to send parameters through more requests You also may be able to store state in hidden fields in the rendered markup, or by encoding the raw binary data in a single hidden field. This goes a bit beyond the scope of this list though. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, June 09, 2006 7:40 AM To: user@struts.apache.org; [EMAIL PROTECTED] Subject: RE: best way to send parameters through more requests Also a word of caution I presume all the objects you store in session are seriallizable. If they are not then your solution wont work if the application is deployed on cluster Small piece of information can be transferred through hidden fields from form to form through struts actions Cheers -Original Message- From: Dave Newton [mailto:[EMAIL PROTECTED] Sent: 09 June 2006 12:33 To: Struts Users Mailing List Subject: Re: best way to send parameters through more requests Emilia Ipate wrote: Is there a solution besides using session, to send some request parameters from one request to another? I would like to implement something like a shopping cart (a functionality which needs about4-5 steps) and I do not want to store the objects in the session (it is alread too big)! So, do you have any ideas? Keep the shopping cart in the DB and load it on every page. Personally I'd rather keep things like that in the session, though, unless there's a requirement to keep the cart sticky. 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] - The information contained in this message may be privileged, confidential, and protected from disclosure. If the reader of this message is not the intended recipient, or any employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the message and deleting it from your computer. Thank you. Paychex, Inc. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Re: XML Help
I have had such scenarios, sometimes in your xml if you have tabs or other escape characters it adds them on as text nodes while parsing. So you may have to modify your xml to be free of such characters. To find it out print out each node type, you will be able to resolve. Hope this helps. Regards, Meena. On 6/9/06, Dave Newton [EMAIL PROTECTED] wrote: Krishnakanth wrote: Note : I just took the getElementByTagName(table) that time I got the length as 2 it is ok.but after that I iterate that NodeList in a for loop and take NodeList.item(i).getChildNodes, Now I get some 8 or 10 childsSo I'm totally confused Any Idea Please advise Me too, since you didn't provide any information about how you're accessing the XML, etc. Simplistic XML merging (for me) has generally consisted only of a couple of hash tables and loops and minor decision-making about which attributes to use for node 'equality' comparisons. It sounds like you're having problems at an even higher level, i.e., you don't know how to use your XML library. Can't help, don't know what you're using and how it represents elements. Urgent !!! Urgent !!! Urgent !!! Urgent !!! Urgent !!! If it's that urgent you might want to consider Google or an XML forum. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: best way to send parameters through more requests
One way can be to use the values in session and somehow explicitly delete these attributes after they have been used. Event listeners can I think help here. Just pump an event when you are done with. This should delete the session attributes. Any good patterns in this regard?? References? Using hidden fields is good, but what if you have like 4-5 request steps? You will end up at step 5 to send to server a long list of hidden fileds (all the fields used in step 1,2,3 and 4)... And this sounds like unmaintable code!!! Thomas Joseph - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: best way to send parameters through more requests
Emilia Ipate wrote: Now the question comes: when does the object come useless? It is useless when users gets to step 5 and also when from a middle step (like 3) decides to get out of the this 5 step request-chain. In both cases, the object should be removed from session. I would say to have a configuration file that says for which url-patterns request should the object be kept in the session. So, when another request (which is not part of the url-patterns) comes in, the filter will remove the object from session! What do you think? I think that's not worth the effort. What else I could do to make sure the session does not become too big? Encode64 sounded like a good idea. Huh? That would make binary data _bigger_, not smaller, unless you then zipped it, which seems... silly. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Re: Encryption / decryption problem in multi threading
Shshank Jain wrote: Thanks in advance. Still OT, but anyway. Can't read your code. I'd still check to see if you're using a single-instance of an unsynchronized variable so it's getting corrupted when being hit by multiple threads. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Uncompress
Hello all, I have a question which is unrelated to Struts but wanted to try it out here considering this as a huge java based group. I am trying to uncompress a .Z file using java on windows. Have anyone of you tried this out, if so please share the solution.. I checked Java API with no luck. TIA Gnan This email message is for the sole use of the intended recipient (s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. To reply to our email administrator directly, send an email to [EMAIL PROTECTED] Toys R Us, Inc. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: tiles and forwards
Correct, i used the internal strutsAction: org.apache.struts.actions.LocaleAction and the source could something like this, which i found in the validator struts-example: public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { // Extract attributes we will need HttpSession session = request.getSession(); Locale locale = getLocale(request); String language = null; String country = null; String page = null; try { language = (String) PropertyUtils.getSimpleProperty(form, language); country = (String) PropertyUtils.getSimpleProperty(form, country); page = (String) PropertyUtils.getSimpleProperty(form, page); } catch (Exception e) { log.error(e.getMessage(), e); } if ((language != null language.length() 0) (country != null country.length() 0)) { locale = new java.util.Locale(language, country); } else if (language != null language.length() 0) { locale = new java.util.Locale(language, ); } session.setAttribute(Globals.LOCALE_KEY, locale); if (null==page) return mapping.findForward(success); else return new ActionForward(page); } } - Original Message - From: Antonio Petrelli [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Friday, June 09, 2006 1:00 PM Subject: Re: tiles and forwards Antonio Petrelli ha scritto: Can you post the code of your action? At least the part when you return the forward in the execute method? I have a suspect. Uh sorry, I didn't notice that you used an internal Struts action! Anyway let me think about it - 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: best way to send parameters through more requests
Do not get into encoding and decodingas you might be aware that you can specify the charset at many places like web.xml, in javascript tag and also when you encode/decode in java. This means that decoding result can be different from what you expect if a different charset is used...It might solve your problem in short run ... So a good idea to avoid it if you can Regards -Original Message- From: Dave Newton [mailto:[EMAIL PROTECTED] Sent: 09 June 2006 14:06 To: Struts Users Mailing List Subject: Re: best way to send parameters through more requests Emilia Ipate wrote: Now the question comes: when does the object come useless? It is useless when users gets to step 5 and also when from a middle step (like 3) decides to get out of the this 5 step request-chain. In both cases, the object should be removed from session. I would say to have a configuration file that says for which url-patterns request should the object be kept in the session. So, when another request (which is not part of the url-patterns) comes in, the filter will remove the object from session! What do you think? I think that's not worth the effort. What else I could do to make sure the session does not become too big? Encode64 sounded like a good idea. Huh? That would make binary data _bigger_, not smaller, unless you then zipped it, which seems... silly. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] Re: Uncompress
Shabada, Gnaneshwer wrote: Hello all, I have a question which is unrelated to Struts but wanted to try it out here considering this as a huge java based group. I am trying to uncompress a .Z file using java on windows. Have anyone of you tried this out, if so please share the solution.. I checked Java API with no luck. The old Unix 'compress' command doesn't use the same algorithm as ZIP files. http://www.unidata.ucar.edu/support/help/MailArchives/netcdf/msg03482.html IIRC there's an org.apache.commons.${something} that _might_ do this, but I don't know: the 30 seconds with google that lead me to the above exhausted me. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Re: Encryption / decryption problem in multi threading
Shshank Jain wrote: making the decryt/encrypt synchronized didnt help Ok. Dave PS If the only difference is single- vs. multi-threaded then I'll almost guarantee you you're walking on something, somewhere, even if it's in your test code. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Re: Encryption / decryption problem in multi threading
i will run some test cases here and get back... i ran it sequentially it worked fine On 6/9/06, Dave Newton [EMAIL PROTECTED] wrote: Shshank Jain wrote: making the decryt/encrypt synchronized didnt help Ok. Dave PS If the only difference is single- vs. multi-threaded then I'll almost guarantee you you're walking on something, somewhere, even if it's in your test code. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: best way to send parameters through more requests
The thought here(base64 encode) was to store the data on the client. This would also be a large effort requiring all POST requests, making sure you always send the data in both directions, extra network etc. Got that, thanks for the explaination. Bottom line, storing state for a particular client is what the session is there for. Anything else will most likely cost more in development effort than upgrading hardware. I am working on a very big project (has about 3 requests a day)! A lot of the functionality are different settings that the user can make in a 4-5 steps request (in the last step the user can decide to cancel the entire operation or at step 3 he simply gets out of the step-by-step setting process). So I cannot just hold these objects in session forever, that's why I think a session mantaining functionality is required: 1. have a configuration file that specifies exactly what objects can be hold in session 2. for each object that can be hold in session, specify the url-patterns for which the object must still be in the session 3. have a filter that mantains the session accordingly Emilia -Original Message- From: Samere, Adam J [mailto:[EMAIL PROTECTED] Sent: vrijdag 9 juni 2006 15:20 To: Struts Users Mailing List Subject: RE: best way to send parameters through more requests The thought here(base64 encode) was to store the data on the client. This would also be a large effort requiring all POST requests, making sure you always send the data in both directions, extra network etc. Bottom line, storing state for a particular client is what the session is there for. Anything else will most likely cost more in development effort than upgrading hardware. Adam -Original Message- From: Dave Newton [mailto:[EMAIL PROTECTED] Sent: Friday, June 09, 2006 9:06 AM To: Struts Users Mailing List Subject: Re: best way to send parameters through more requests Emilia Ipate wrote: Now the question comes: when does the object come useless? It is useless when users gets to step 5 and also when from a middle step (like 3) decides to get out of the this 5 step request-chain. In both cases, the object should be removed from session. I would say to have a configuration file that says for which url-patterns request should the object be kept in the session. So, when another request (which is not part of the url-patterns) comes in, the filter will remove the object from session! What do you think? I think that's not worth the effort. What else I could do to make sure the session does not become too big? Encode64 sounded like a good idea. Huh? That would make binary data _bigger_, not smaller, unless you then zipped it, which seems... silly. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - The information contained in this message may be privileged, confidential, and protected from disclosure. If the reader of this message is not the intended recipient, or any employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the message and deleting it from your computer. Thank you. Paychex, Inc. - 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: tiles and forwards
What expect you with the returned ActionForward? Is the pageAttribute correct set in the jsp like: html:select property=language size=1 html:option key=label.de value=de/ html:option key=label.en value=en/ /html:select html:hidden property=page value=a.page/ the forward works well with the tilesDefinition, but if not, the forward in struts-config do not work well with the tileDefinition. - Original Message - From: Antonio Petrelli [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Friday, June 09, 2006 12:45 PM Subject: Re: tiles and forwards Can you post the code of your action? At least the part when you return the forward in the execute method? I have a suspect. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Uncompress
I haven't done it but a Google search returns an example as the for the result. http://www.devx.com/getHelpOn/10MinuteSolution/20447 On 6/9/06, Shabada, Gnaneshwer [EMAIL PROTECTED] wrote: Hello all, I have a question which is unrelated to Struts but wanted to try it out here considering this as a huge java based group. I am trying to uncompress a .Z file using java on windows. Have anyone of you tried this out, if so please share the solution.. I checked Java API with no luck. TIA Gnan This email message is for the sole use of the intended recipient (s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. To reply to our email administrator directly, send an email to [EMAIL PROTECTED] Toys R Us, Inc. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: best way to send parameters through more requests
Emilia Ipate wrote: So I cannot just hold these objects in session forever, Fortunately sessions don't generally _last_ forever. that's why I think a session mantaining functionality is required: 1. have a configuration file that specifies exactly what objects can be hold in session 2. for each object that can be hold in session, specify the url-patterns for which the object must still be in the session 3. have a filter that mantains the session accordingly Yuck. Why no just keep everything in the DB and retrieve it when needed? Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Re: Extending Struts with Spring
I cannot tell if this is a question or a statement. Do you want to know how to use AOP or are you saying you don't think that would be a good idea? On 6/9/06, starki78 [EMAIL PROTECTED] wrote: Ciao! Do you have experience with AOP and specially using a Interceptor for metrics? I really cannot imagine how to implement a solution for an application! Do you mean like in a filter implement code for time-stopping or similar? Nice greetings Starki Don't forget about the AOP aspect (no pun intended) of Spring. While the IoC is handy, it is nothing, in my opinion, in comparison to the solution regarding logging, security, metrics, etc. in Spring with AOP. On 6/8/06, Julian Tillmann [EMAIL PROTECTED] wrote: Thanks very much for all your answers, I'd be very keen to learn more about this soon. -- Echte DSL-Flatrate dauerhaft für 0,- Euro*! Feel free mit GMX DSL! http://www.gmx.net/de/go/dsl - 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] - 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~
RE: best way to send parameters through more requests
Al, your solution is good, except for one thing: what do you do if the user leaves the application at step2? You will have in DB all the items the user checked, but they are no longer necessary Emilia -Original Message- From: Albert L. Sapp [mailto:[EMAIL PROTECTED] Sent: vrijdag 9 juni 2006 16:20 To: Struts Users Mailing List Subject: Re: best way to send parameters through more requests Emilia Ipate wrote: Hello, all! Is there a solution besides using session, to send some request parameters from one request to another? I would like to implement something like a shopping cart (a functionality which needs about4-5 steps) and I do not want to store the objects in the session (it is alread too big)! So, do you have any ideas? Kind regards, Emilia --- - - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Emilia, Wanted so what everyone had to say before I dropped in my 2 cents. The only thing we keep in session is the userID and the unitID for where they are shopping. This happens in step 1. In step 2, we query the db to see if they already have shopping cart items from a previous trip to the storeroom. This step is repeated over and over again as they add items to their cart. They can add, delete or update an item from this jsp and are always returned to it. Finally in step 3, they say ok check me out and we collect the account information we need, create the accounting transactions, update stock levels, remove the shopping cart items and give them a chance to print out a listing of their purchases. The 2 session attributes are cleared and we go back to the jsp where the next person enters their userID. 3 steps with one of them being repeated. We went with the db approach because we had to try and capture the items a person said they were taking in case they give a invalid account or simply get too rushed and leave without completing the shopping process. Believe me, that happens more than we like. I hope this was helpful. Al - 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: best way to send parameters through more requests
Emilia Ipate wrote: Al, your solution is good, except for one thing: what do you do if the user leaves the application at step2? You will have in DB all the items the user checked, but they are no longer necessary 1) Not if they come back, in which case they'll be delighted you cared enough to remember. 2) Use a session listener to remove them. 3) Use a sweeper that goes through and removes items with a timestamp some reasonable value. 4) Pay us for solving your problem! Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Re: Encryption / decryption problem in multi threading
he dave !! problem solved !! the problem was muti threading (the sychronized block) plus the database had the password field as varchar i encoded the data and make the character encoding base 64 ( http://forum.java.sun.com/thread.jspa?threadID=555631messageID=2729521) and it works now Thanks for ur support. On 6/9/06, Shshank Jain [EMAIL PROTECTED] wrote: i will run some test cases here and get back... i ran it sequentially it worked fine On 6/9/06, Dave Newton [EMAIL PROTECTED] wrote: Shshank Jain wrote: making the decryt/encrypt synchronized didnt help Ok. Dave PS If the only difference is single- vs. multi-threaded then I'll almost guarantee you you're walking on something, somewhere, even if it's in your test code. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [SOLVED] struts-config xml file throws a java exception
Yes it did... Regards, Olivier -Message d'origine- De : Dave Newton [mailto:[EMAIL PROTECTED] Envoyé : vendredi 9 juin 2006 13:31 À : Struts Users Mailing List Objet : Re: [SOLVED] struts-config xml file throws a java exception Olivier Bex wrote: The problem is solved. The struts-config file had no declaration of the data source type to use. So it took by default org.apache.struts.action.dataSources instead of : org.apache.struts.util.GenericDataSource ?! Fixing that removed the error regarding your set-property... element??? 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: best way to send parameters through more requests
Emilia Ipate wrote: Al, your solution is good, except for one thing: what do you do if the user leaves the application at step2? You will have in DB all the items the user checked, but they are no longer necessary Emilia -Original Message- From: Albert L. Sapp [mailto:[EMAIL PROTECTED] Sent: vrijdag 9 juni 2006 16:20 To: Struts Users Mailing List Subject: Re: best way to send parameters through more requests Emilia Ipate wrote: Hello, all! Is there a solution besides using session, to send some request parameters from one request to another? I would like to implement something like a shopping cart (a functionality which needs about4-5 steps) and I do not want to store the objects in the session (it is alread too big)! So, do you have any ideas? Kind regards, Emilia --- - - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Emilia, Wanted so what everyone had to say before I dropped in my 2 cents. The only thing we keep in session is the userID and the unitID for where they are shopping. This happens in step 1. In step 2, we query the db to see if they already have shopping cart items from a previous trip to the storeroom. This step is repeated over and over again as they add items to their cart. They can add, delete or update an item from this jsp and are always returned to it. Finally in step 3, they say ok check me out and we collect the account information we need, create the accounting transactions, update stock levels, remove the shopping cart items and give them a chance to print out a listing of their purchases. The 2 session attributes are cleared and we go back to the jsp where the next person enters their userID. 3 steps with one of them being repeated. We went with the db approach because we had to try and capture the items a person said they were taking in case they give a invalid account or simply get too rushed and leave without completing the shopping process. Believe me, that happens more than we like. I hope this was helpful. Al - 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] Emilia, That is the point for us. This application is used in the storeroom to allow a user to enter the stock they are taking out of the storeroom. Granted we could have people walk out with stock and not even enter it, but, if they do enter it, we want to be able to contact them and ask what they did with the stock. Did they put it back? Did they take and forget to checkout? Did they take it and the account they used come back as invalid? Then, the storekeeper can either complete the checkout or clear the shopping cart for the user. We have some indication available to our storekeepers that some activity has taken place and contact information to use to follow up with. I mean we are relieve them of the data entry they were doing. They just have a new job of following up on checkouts not performed. Our next step is to allow for ordering of items for delivery or pickup and using the shopping cart to build the pick list for the storekeepers. If this were a shopping cart for a web site, I can see where they would like it in session because then it is cleared when the session teminates and they don't have all this unneeded information in their db. For us the situation is different and we really need that information to make sure all information needed for a final transaction is captured. This is even more important when our pricing might change the next minute because a storekeeper is adding new stock received and price averaging is occuring. Hope this clarifies how we look at things. By the way, I work for a university and these storerooms are supplying student labs and researchers and we have some really strict stock control issues with chemicals and such. Al - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: best way to send parameters through more requests
On 6/9/06, Samere, Adam J [EMAIL PROTECTED] wrote: Emilia Ipate wrote: Is there a solution besides using session, to send some request parameters from one request to another? I would like to implement something like a shopping cart (a functionality which needs about4-5 steps) and I do not want to store the objects in the session (it is alread too big)! So, do you have any ideas? You also may be able to store state in hidden fields in the rendered markup, or by encoding the raw binary data in a single hidden field. This goes a bit beyond the scope of this list though. Using hidden fields incurs the following restrictions: * All pages must contain HTML FORMs. * All pages must be executed in strict order, so they are tightly interconnected in one flow, as well as server actions. * You cannot use redirection. * Going back and forth without redirection causes POSTDATA messages. With either hidden fields or request parameters used to store the state: * Going back may result in rolling back your cart * Going forward may result in rolling forward your cart * It is impossible to navigate directly to a certain URL because in this state info will be lost Bottom line: storing stuff like shopping cart in hidden fields sucks. It makes system very unflexible where usability is an unknown term. Store it on server, whether in the session or in database. On 6/9/06, Emilia Ipate [EMAIL PROTECTED] wrote: I was more thinking of something like: - store the complex object in the session and remove it when it becomes useless! Right. Now the question comes: when does the object come useless? It is useless when users gets to step 5 and also when from a middle step (like 3) decides to get out of the this 5 step request-chain. In both cases, the object should be removed from session. I would say to have a configuration file that says for which url-patterns request should the object be kept in the session. So, when another request (which is not part of the url-patterns) comes in, the filter will remove the object from session! Nope. Clean the cart when a user bails out or finishes checkout process. Cleaning should be corresponded to user/cart state, not to URLs. On 6/9/06, Emilia Ipate [EMAIL PROTECTED] wrote: So I cannot just hold these objects in session forever Session expires automatically. You can set a shorter timeout interval if you need. My bank has 10 minute timeout. On 6/9/06, Albert L. Sapp [EMAIL PROTECTED] wrote: Wanted so what everyone had to say before I dropped in my 2 cents. The only thing we keep in session is the userID and the unitID for where they are shopping. This happens in step 1. In step 2, we query the db to see if they already have shopping cart items from a previous trip to the storeroom. This step is repeated over and over again as they add items to their cart. They can add, delete or update an item from this jsp and are always returned to it. Finally in step 3, they say ok check me out and we collect the account information we need, create the accounting transactions, update stock levels, remove the shopping cart items and give them a chance to print out a listing of their purchases. So, do you keep an open db transaction related to a shopping cart, or you commit each and every cart event. Then, if a user bails out, you run a correcting transaction, removing all stuff related to shopping cart? I like database for it robustness and for time-proven clustering solutions, but considering these transaction-related issues I would rather use the session. I guess your case is different. It is not like I want to buy this, this and this, it is I already have taken this, this and this, so the cart reflects events that a user already did to the stock, and you must not lose them. Michael. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: best way to send parameters through more requests
Michael Jouravlev wrote: On 6/9/06, Samere, Adam J [EMAIL PROTECTED] wrote: Emilia Ipate wrote: Is there a solution besides using session, to send some request parameters from one request to another? I would like to implement something like a shopping cart (a functionality which needs about4-5 steps) and I do not want to store the objects in the session (it is alread too big)! So, do you have any ideas? You also may be able to store state in hidden fields in the rendered markup, or by encoding the raw binary data in a single hidden field. This goes a bit beyond the scope of this list though. Using hidden fields incurs the following restrictions: * All pages must contain HTML FORMs. * All pages must be executed in strict order, so they are tightly interconnected in one flow, as well as server actions. * You cannot use redirection. * Going back and forth without redirection causes POSTDATA messages. With either hidden fields or request parameters used to store the state: * Going back may result in rolling back your cart * Going forward may result in rolling forward your cart * It is impossible to navigate directly to a certain URL because in this state info will be lost Bottom line: storing stuff like shopping cart in hidden fields sucks. It makes system very unflexible where usability is an unknown term. Store it on server, whether in the session or in database. On 6/9/06, Emilia Ipate [EMAIL PROTECTED] wrote: I was more thinking of something like: - store the complex object in the session and remove it when it becomes useless! Right. Now the question comes: when does the object come useless? It is useless when users gets to step 5 and also when from a middle step (like 3) decides to get out of the this 5 step request-chain. In both cases, the object should be removed from session. I would say to have a configuration file that says for which url-patterns request should the object be kept in the session. So, when another request (which is not part of the url-patterns) comes in, the filter will remove the object from session! Nope. Clean the cart when a user bails out or finishes checkout process. Cleaning should be corresponded to user/cart state, not to URLs. On 6/9/06, Emilia Ipate [EMAIL PROTECTED] wrote: So I cannot just hold these objects in session forever Session expires automatically. You can set a shorter timeout interval if you need. My bank has 10 minute timeout. On 6/9/06, Albert L. Sapp [EMAIL PROTECTED] wrote: Wanted so what everyone had to say before I dropped in my 2 cents. The only thing we keep in session is the userID and the unitID for where they are shopping. This happens in step 1. In step 2, we query the db to see if they already have shopping cart items from a previous trip to the storeroom. This step is repeated over and over again as they add items to their cart. They can add, delete or update an item from this jsp and are always returned to it. Finally in step 3, they say ok check me out and we collect the account information we need, create the accounting transactions, update stock levels, remove the shopping cart items and give them a chance to print out a listing of their purchases. So, do you keep an open db transaction related to a shopping cart, or you commit each and every cart event. Then, if a user bails out, you run a correcting transaction, removing all stuff related to shopping cart? I like database for it robustness and for time-proven clustering solutions, but considering these transaction-related issues I would rather use the session. I guess your case is different. It is not like I want to buy this, this and this, it is I already have taken this, this and this, so the cart reflects events that a user already did to the stock, and you must not lose them. Michael. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Right, Michael. Each individual item is stored by userID and unitID. Therefore, a user can have multiple carts depending on storeroom they are shopping in. The user can clear a cart any time prior to a successful checkout. Honor system on the user's part. The storekeeper can process, correct or clear a cart for his storeroom after speaking to the user by phone or email to determine where the stock is. Once a successful checkout has occured, the storekeeper is the only one who can return a stock item. Returns might be due to an incorrect quantity being entered by the user or they took the wrong stock to begin with. He will look up the invoice for the user in his storeroom, select the items from the invoi ce to insure he is crediting it at the price it was sold and give the user a copy of the completed storekeeper invoice showing the item was credited. We very clearly defined responsibilities of each user of the system and defined roles to assign to users of our complete
Re: Variable 'input' attribute in struts-config.xml
Hi Scott, this is how I would implemented it. What we have is a standard CRUD stuff for Entity object. There are two ways to navigate to Entity. Either you simply navigate to it and it renders itself according to its state, or you navigate to it with a certain command, like view or update or delete or create. The latter way is simpler and occurs more often and is easiter to understand and implement, so let's discuss that one. Say, you have a table with a rows, each row represents an Entity. You may click the row to pull Entity out. Say, each row has links like view, update or delete. There is also one link or button called create. To view, update or delete an entity, you call EntityAction with a corresponding command along with entity ID. To create an entity you call EntityAction without ID. See, EntityAction is a perfect candidate to be implemented with dispatch action, I suggest EventDispatchAction. If you call EntityAction with view command, the action loads existing entity and forwards to view_entity.jsp. I prefer to use session-scoped formbeans so I set Entity state in the form to view. If you prefer to use request-scoped beans, you can save Entity state in the hidden field in view_entity.jsp. Same thing with edit command, the action loads existing entity, sets state to edit and forwards to edit_entity.jsp. To create Entity, the action initializes formbean, sets state to create and forwards to create_entity.jsp. In fact, all these JSP pages may be actually one page, you just need to update the title and maybe to show/hide ID field. After you filled in the form, you call EntityAction with store command. It validates the input and then tries to update/store data. If input is not valid, the action checks the state field and forward to a JSP that corresponds to that state. The page will be displayed along with the errors. If data is saved successfully, you forward to your success page, which is probably the item list. Same with deletion, after delete event is served, you forward to success page. So, the only problem here is what happens if a user navigates to EntityAction without command parameter? This is up to you. If you use dispatch action, you would correlate commands with action methods. If no command is passed to the action, the execute() will be called instead of a specific method handler. Because there is no active Entity, you can either show No entity message or forward to some error page. If you prefer to use redirection instead of forwarding, then you would have to either save state on the server (this is what I do), or to pass all state info in redirected request. A combination of these approaches is to pass Entity ID and maybe mode ID (like updating or creating) in redirected request, and to store everything else in the session. As you may see, one dispatch action, one form bean and maybe even one JSP page is enough to serve all your commands. Michael. On 6/8/06, Scott Van Wart [EMAIL PROTECTED] wrote: Michael Jouravlev wrote: I suggest to look at your issue from another perspective. Do you really need the functionality you are asking for? First, a small clarification. There is no input page for an action, input attribute is poorly named, it should be called error or errorTarget, because Struts forwards to that location if input data does not validate. Your request is always sent to action/actionform. That might be it then... it might just be a matter of having to separate things out a little more. So let's say I had a page that edits an entity. I might call this edit_entity.jsp, with an EntityForm, and a SaveEntityAction. I found things got a little cumbersome in the .jsp, so I separated it out into a create_entity.jsp and edit_entity.jsp. These two forms submit to the same action. Obviously, they have a lot of code in common, but I thought of factoring that out into tags. Perhaps I should do the same thing to the action class (CreateEntityAction and UpdateEntityAction rather than all-encompassing SaveEntityAction; any code duplication can go into base classes or utility classes). The other side of this is that I also have a ShowEntityForm and ShowEntityAction. The action is mapped to /showEntity, and there are three forward mappings from there. Two are success-like forwards called create and edit, which forward to create_entity.jsp and edit_entity.jsp. The 3rd one, the failure forward's destination would depend on who called /showEntity in the first place. The ShowEntityForm has validation, to ensure the given entityId is a number, and the failure forward gets hit when the entityId can't be found in the database table. While I can break the failure out into multiple forwards, I can't do the same with input. So the question is, then, do I break up my ShowEntityX classes into things like NewEntityAction-create_entity.jsp-CreateEntityAction and EditEntityAction-edit_entity.jsp-UpdateEntityAction? It's starting to sound like a lot more classes, but if I'm on
Re: Variable 'input' attribute in struts-config.xml
What I would do is having an AvailableItems web resource with two states: no items (default) and items found. For no items it would render a search page, for items found it would render items list. Michael. On 6/9/06, Albert L. Sapp [EMAIL PROTECTED] wrote: Scott, I think your approach, if I understand it right, should be fine. In our application, we start with a query page that allows entry of data for a query or has a link to create a new object. If they enter query information we go to a query action which generates a results jsp or returns them to the query jsp if no matchs are found. On the results page on each line displaying a item, we have 3 links that either show them the details for the item, allow them to update the item or delete the item. Links are displayed based on the role that the user might have. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Digester Error while reading struts config file
Thanks Adam. -- View this message in context: http://www.nabble.com/Digester-Error-while-reading-struts-config-file-t1755486.html#a4802823 Sent from the Struts - User forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Page does not refresh after action
Hi, I have a page with a bunch of orders, and each order has a Cancel button next to it and the status text of that order. When I cancel a particular order, the appropriate action is called, the order is canceled and the action then returns to the same page. I can see the page being reloaded (thru the status bar on the browser), but the status text (which should now say Canceled) for the order remains the same until I hit Refresh again (or come back to the page by navigating to it). Is it possible that the browser is caching the status text and how can I overcome this problem? Thanks, -Riz. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Thank you to the list.
Hi Albert, Nicely done; I'm sure the developers appreciate it. I'm in the same situation as you. What I like the most about this list is everyone has a positive attitude towards answering questions. I'm sure it's tough to be a part of the brains behind a project, to know the code intimately, and to have the most basic questions asked time and again by a countless numbers of new users. I also like it when the developers (I'm assuming they're Struts developers from the discussion content :) get into discussions about underlying implementations; it gives me a great deal of insight into how the tools are written. It can be a little discouraging for a developer to pick up a library like Struts, have questions, and receive an RTFM-type answer. I've yet to see such an answer on this list, and appreciate the practical usages and best practices stressed in a lot of the list replies. Keep coding Albert; knowledge received is knowledge to be shared :). - Scott Albert L. Sapp wrote: Guys, I want to thank everyone on the list for all the new ideas and technologies that have floated up as answers to many of the questions posed here. I have learned that I need to get a good book on Struts, because I am sure we are missing a lot of stuff that would make our current project a lot easier. Struts was one of 5 new technologies I had never dealt with before when we start this project, but this forum has and continues to be a great help in getting what I need to move forward. Thanks, again to all off you who take time to help out a newbie - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Re: Encryption / decryption problem in multi threading
Shshank Jain wrote: the problem was muti threading (the sychronized block) plus the database had the password field as varchar i encoded the data and make the character encoding base 64 ( http://forum.java.sun.com/thread.jspa?threadID=555631messageID=2729521) and it works now So was it solely the encoding issue? I've always made sure to base64 any binary data that absolutely had to be stored in a char-derived column; was this the only issue? - Scott - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: best way to send parameters through more requests
there is another option. you can use apache JCS cache or open symphony's OScache for caching all objects that are required during user interaction. On 6/9/06, Emilia Ipate [EMAIL PROTECTED] wrote: Hello, all! Is there a solution besides using session, to send some request parameters from one request to another? I would like to implement something like a shopping cart (a functionality which needs about4-5 steps) and I do not want to store the objects in the session (it is alread too big)! So, do you have any ideas? Kind regards, Emilia - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- When I tell the truth, it is not for the sake of convincing those who do not know it, but for the sake of defending those that do
Re: tiles and forwards
Antonio Petrelli ha scritto: Can you post the code of your action? At least the part when you return the forward in the execute method? I have a suspect. Now I use my own LocaleAction (extends Action !) with the following returns : if (page != null page.length() 0) return new ActionForward(page); else return mapping.findForward(success); and this works and no exception occurs, if the pageAttribute not exist. The next is, how can I get the actual tilesDefintion in the locale.jsp (perhaps by jstl and EL) or in the LocaleAction.java ? This is important, because the tile locale.jsp do the languageSwitch and is part of every page. So, after the languageSwitch I have to forward to the actual tilesDefinition (to stay in the page). - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]