Re: has struts reached the saturation
Sorry, I didn't ment portals in sense of JSR-168, but portals in the common sense of what is a portal, like yahoo.com, match.com, amazon.com and such... Leon On 3/16/06, Michael Jouravlev [EMAIL PROTECTED] wrote: URLs are universal, while JSR-168 manages portlets through central controller (speaking of Front Controller and MVC) and specialized API. A very intrusive approach if you ask me. But this is offtopic for this thread ;) On 3/15/06, Leon Rosenberg [EMAIL PROTECTED] wrote: Speaking of JSF, is there somewhere a Filter or n extension allowing you to use JSF/Shale/MyFaces without having a single url and send everything over POST? Until there is one, I don't see how you can use JSF in portals, but if there is one, I'd love to try it out :-) - 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]
[Transfer data from Form to business bean]
hi all can anybody tell me which is the best way to transfer data from a form bean to business object? A formbean can be used as business object? If no, what is the other way to transfer the data easily from a form to business object THanks -- Regards, Deva. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: query about application resource and charset
Roy, Ansuman ha scritto: Thanks Antonio, that solved the problem. I used java.util.Properties so now the special characters are not coming by the way, what if I try to put russian characters or use non ascii characters in my keys?? You'll find a lot of \u, not very readable ;-) What I can say is that Italian stressed characters are converted the \u way. what would be the display like for example the Pound symbol Do you mean '£'? \u00A3 if I am correct Ciao Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Transfer data from Form to business bean]
Hi, you could use the BeanUtils.copyProperties(...) http://jakarta.apache.org/commons/beanutils/ Methods to copy values from FormBean attributes into BOs attributes. (In order to do this, the attribute names have to correspond of course) Kind regards, Thomas -Ursprüngliche Nachricht- Von: Struts Users Mailing List user@struts.apache.org Gesendet: 16.03.06 10:08:14 An: Struts Users Mailing List user@struts.apache.org Betreff: [Transfer data from Form to business bean] hi all can anybody tell me which is the best way to transfer data from a form bean to business object? A formbean can be used as business object? If no, what is the other way to transfer the data easily from a form to business object THanks -- Regards, Deva. - 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]
ActionForm Stringvariables
Hi there, I'm a newbie to struts and I have a question concerning ActionForms. What's more clever: to initialize the String-parameters with null or with (empty strings)? thx ciao 4 now Julian -- Feel free mit GMX FreeMail! Monat für Monat 10 FreeSMS inklusive! http://www.gmx.net - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ActionForm Stringvariables
1. The general rule is: never use null. 2. The specific rule for your application must be given by your application, but in doubt the general rule applies. regards leon On 3/16/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi there, I'm a newbie to struts and I have a question concerning ActionForms. What's more clever: to initialize the String-parameters with null or with (empty strings)? thx ciao 4 now Julian -- Feel free mit GMX FreeMail! Monat für Monat 10 FreeSMS inklusive! http://www.gmx.net - 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: query about application resource and charset
yes... £ symbol -Original Message- From: Antonio Petrelli [mailto:[EMAIL PROTECTED] Sent: Thursday, March 16, 2006 2:49 PM To: Struts Users Mailing List Subject: Re: query about application resource and charset Roy, Ansuman ha scritto: Thanks Antonio, that solved the problem. I used java.util.Properties so now the special characters are not coming by the way, what if I try to put russian characters or use non ascii characters in my keys?? You'll find a lot of \u, not very readable ;-) What I can say is that Italian stressed characters are converted the \u way. what would be the display like for example the Pound symbol Do you mean '£'? \u00A3 if I am correct Ciao Antonio - 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]
struts validator | validwhen rule not working
I am using struts validator framework for client side server side validations. I am facing issue with validwhen rule. Validator rules like 'required', 'minlength', 'maxlength' are working fine. The form has 2 fields 1. Radio button - 'currentMember'. This has values yes no. 2. Text field - 'memberNumber'. I am trying to apply following validations on the above fields 1. memberNumber field should not be blank when the value of the currentMember is yes 2. memberNumber field should be blank when the value of currentMember is no. I have added following code in validation.xml to achieve the above validation rule. field property=memberNumber depends=validwhen arg0 key=registrationForm.memberNumber/ var var-nametest/var-name var-value(((*this* != null) and (currentMember == yes)) or (*this* == null))/var-value /var /field I have also added registrationForm.memberNumber key in MessageResources.properties. The validwhen rule is not working for any field in the form. If I view the source of generated html, I am not able to find validation specific to 'memberNumber'. Please let me know if you have a solution to this problem. Thanks PD
Re: struts validator | validwhen rule not working
validwhen is server side only. Niall On 3/16/06, Partha Pratim Dutta [EMAIL PROTECTED] wrote: I am using struts validator framework for client side server side validations. I am facing issue with validwhen rule. Validator rules like 'required', 'minlength', 'maxlength' are working fine. The form has 2 fields 1. Radio button - 'currentMember'. This has values yes no. 2. Text field - 'memberNumber'. I am trying to apply following validations on the above fields 1. memberNumber field should not be blank when the value of the currentMember is yes 2. memberNumber field should be blank when the value of currentMember is no. I have added following code in validation.xml to achieve the above validation rule. field property=memberNumber depends=validwhen arg0 key=registrationForm.memberNumber/ var var-nametest/var-name var-value(((*this* != null) and (currentMember == yes)) or (*this* == null))/var-value /var /field I have also added registrationForm.memberNumber key in MessageResources.properties. The validwhen rule is not working for any field in the form. If I view the source of generated html, I am not able to find validation specific to 'memberNumber'. Please let me know if you have a solution to this problem. Thanks PD - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Transfer data from Form to business bean]
Based on my rudimentary knowledge, you can do the folling, BeanUtils.copy(form,urBusinessObject); in that way you'll be copying data from your ActionForm right into the business Object in a very convenient manner. I am also a junior developer still learning. On 3/16/06, Deva Pitchai(NatureSoft) [EMAIL PROTECTED] wrote: hi all can anybody tell me which is the best way to transfer data from a form bean to business object? A formbean can be used as business object? If no, what is the other way to transfer the data easily from a form to business object THanks -- Regards, Deva. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Regards Name : Oshima Tlholoe Cell No: +2773 342 4393 Tel No : +2712 350 1282(w) E-mail : [EMAIL PROTECTED] simplicity is the ultimate sophistication
Set focus on a table on page load.
Hi all, I have a JSP page, which has a table (table). On load of the page, I need to set focus on this table. I gave an id to the table, and tried something like this: var tblObj = document.getElementById(...); docTblObj.focus(); But this does not work. So, I declared an anchor tag (a), just below the table; and tried in the same way. This way, it works in the Firefox Mozilla browser, but, does not work in IE. Is there any other way by which it can be achieved? With best regards, Anjishnu. CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS***
Re: ActionForm Stringvariables
hi Leon, is this rule because of the NullPointerException you get when, for example you check the Strings .length() or is there (also) another reason for this practice? thanks in advance Julian --- Ursprüngliche Nachricht --- Von: Leon Rosenberg [EMAIL PROTECTED] An: Struts Users Mailing List user@struts.apache.org Betreff: Re: ActionForm Stringvariables Datum: Thu, 16 Mar 2006 11:06:50 +0100 1. The general rule is: never use null. 2. The specific rule for your application must be given by your application, but in doubt the general rule applies. regards leon On 3/16/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi there, I'm a newbie to struts and I have a question concerning ActionForms. What's more clever: to initialize the String-parameters with null or with (empty strings)? thx ciao 4 now Julian -- Feel free mit GMX FreeMail! Monat für Monat 10 FreeSMS inklusive! http://www.gmx.net - 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] -- 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]
[OT] Commons Logging 1.1 Release Candidate 6
Jakarta Commons Logging 1.1 release candidate 6 is now available for testing (please note this is not yet an official Apache release) from: http://people.apache.org/~rdonkin/commons-logging/ Details of announcements here: http://www.mail-archive.com/commons-dev%40jakarta.apache.org/msg76921.html http://www.mail-archive.com/commons-dev%40jakarta.apache.org/msg76927.html The logging team would appreciate help in testing this release candidate on as many containers as possible. You can either post feedback here (and I'll forward it to the commons dev list) or on the Commons Dev list: http://jakarta.apache.org/site/mail2.html#Commons Thanks Niall - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Transfer data from Form to business bean]
Based on my rudimentary knowledge, you can do the folling, BeanUtils.copyProperties(urBusinessObject,form); in that way you'll be copying data from your ActionForm right into the business Object in a very convenient manner. I am also a junior developer still learning. On 3/16/06, Oshima Tlholoe [EMAIL PROTECTED] wrote: Based on my rudimentary knowledge, you can do the folling, BeanUtils.copy(form,urBusinessObject); in that way you'll be copying data from your ActionForm right into the business Object in a very convenient manner. I am also a junior developer still learning. On 3/16/06, Deva Pitchai(NatureSoft) [EMAIL PROTECTED] wrote: hi all can anybody tell me which is the best way to transfer data from a form bean to business object? A formbean can be used as business object? If no, what is the other way to transfer the data easily from a form to business object THanks -- Regards, Deva. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Regards Name : Oshima Tlholoe Cell No: +2773 342 4393 Tel No : +2712 350 1282(w) E-mail : [EMAIL PROTECTED] simplicity is the ultimate sophistication -- Regards Name : Oshima Tlholoe Cell No: +2773 342 4393 Tel No : +2712 350 1282(w) E-mail : [EMAIL PROTECTED] simplicity is the ultimate sophistication
Re: has struts reached the saturation
On 3/16/06, Leon Rosenberg [EMAIL PROTECTED] wrote: same here, jobpilot (germans monster.com): java 1538 java struts 120 java jsf 18 And at Dice: Java 14,891 JSF or JavaServer Faces 311 Struts 1719 WebWork 31 As for books since 2003: JSF 12 Struts Action 20 (or 32 since 2001) WebWork 4 Articles since 2003: JSF 177 Strut Action 188 WebWork 27 Sources: * Dice.com * Amazon.com * JSFCentral.com * StrutsCentral.net -T. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Common Resource bundles across web projects, ActionMessage and html:messages
Title: Common Resource bundles across web projects, ActionMessage and html:messages Hi all, We are using the ActionMessage-s with replacement values. We want to divide the resource bundles so that we have a 'common-layout-jar' which contains common messages in 'GeneralMessages.properties' and so the application war itself contains *all application specific messages* in 'ApplicationResources.properties', the last one set up as the default bundle in struts-config.xml. Generally, it seems that resource bundle texts from the default bundle *only* are accessible for an ActionMessage contructor by their key - (new ActionMessage(String key, Object o);) Therefore, from our experience, all bundle texts with *replacement objects* specifically, must be placed in the *default bundle*. If not, the ActionMessage contructor with key (or possibly the html:messages... tag) and replacement values does not play - and an JspException is generated, see below. Does anyone have a solution to this, we want to refer *directly* to message keys in common resource bundles instead of having to concatenating strings manually. (That is the workaround we found to work if we insist on having the common messages once and for all defined in the common layout jar.) Thanks! Regards, Gudny H. --- Code example: In the Action-class: ActionMessages messages = new ActionMessages(); ActionMessage(general.textWithOneReplacementValue, replacementValue); messages.add(Globals.MESSAGE_KEY, msg); Message associated with the key in the resource bundle: general.textWithOneReplacementValue= Some message with one replacement value: '{0}' The JSP code we used for outputting the messages is: html:messages id=msg message=true bean:write name=msg /br/ /html:messages If general.textWithOneReplacementValue property is placed in other than the default bundle, this JspException is generated: 2006-03-16 10:45:03,779 ERROR [[/nims-web-5.0-SNAPSHOT].[action]] Servlet.service() for servlet action threw exception javax.servlet.jsp.JspException: Cannot find bean: msg in any scope. --- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Common Resource bundles across web projects, ActionMessage and html:messages
When you use messages from an alternate (i.e. non default) message resources you need to specify the bundle attribute in the html:messages tag. So if you have something like this in your struts-config,xml: message-resources parameter=ApplicationResources/ message-resources parameter='GeneralMessages key=common / Then to use your 'GeneralMessages in your jsp you specify bundle=common: html:messages id=msg message=true bundle=common bean:write name=msg /br/ /html:messages I notice that you are storing your messages using a property of Globals.MESSAGE_KEY - often people get confused between the property the message is associated with in the ActionMessages object and the request attribute under which that ActionMessages object is stored. Globals.MESSAGE_KEY is usually used as the request attribute key - rather than the propery a message is associated with in ActionMessages. You may be wanting to store messages from different bundles in the same ActionMessages object. The only way to do this would be to store them under different property names in the ActionMessages and then use that property in the jsp tags to filter messages for a specific resources bundle: ActionMessages messages = new ActionMessages(); messages.add(defaultFoo, new ActionMessage(...); messages.add(commonBar, new ActionMessage(...); saveMessages(request, messages); then in your jsp: html:messages id=msg message=true property=defaultFoo bean:write name=msg /br/ /html:messages html:messages id=msg message=true bundle=common property=commonBar bean:write name=msg /br/ /html:messages This is however a misuse of what property was designed for and it would be better to store messages from different bundles in different ActionMessages objects ActionMessages defaultMsgs = new ActionMessages(); defaultMsgs.add(foo, new ActionMessage(...); saveMessages(request, defaultMsgs); ActionMessages commonMsgs = new ActionMessages(); commonMsgs.add(bar, new ActionMessage(...); request.setAttribute(commonMsgs, commonMsgs); ...then in your jsp html:messages id=msg message=true bean:write name=msg /br/ /html:messages html:messages id=msg name=commonMsgs bundle=common property=commonBar bean:write name=msg /br/ /html:messages More info here http://www.niallp.pwp.blueyonder.co.uk/HelpTagsErrorsAndMessages.html Niall On 3/16/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi all, We are using the ActionMessage-s with replacement values. We want to divide the resource bundles so that we have a 'common-layout-jar' which contains common messages in 'GeneralMessages.properties' and so the application war itself contains *all application specific messages* in 'ApplicationResources.properties', the last one set up as the default bundle in struts-config.xml. Generally, it seems that resource bundle texts from the default bundle *only* are accessible for an ActionMessage contructor by their key - (new ActionMessage(String key, Object o);) Therefore, from our experience, all bundle texts with *replacement objects* specifically, must be placed in the *default bundle*. If not, the ActionMessage contructor with key (or possibly the html:messages... tag) and replacement values does not play - and an JspException is generated, see below. Does anyone have a solution to this, we want to refer *directly* to message keys in common resource bundles instead of having to concatenating strings manually. (That is the workaround we found to work if we insist on having the common messages once and for all defined in the common layout jar.) Thanks! Regards, Gudny H. --- Code example: In the Action-class: ActionMessages messages = new ActionMessages(); ActionMessage(general.textWithOneReplacementValue, replacementValue); messages.add(Globals.MESSAGE_KEY, msg); Message associated with the key in the resource bundle: general.textWithOneReplacementValue= Some message with one replacement value: '{0}' The JSP code we used for outputting the messages is: html:messages id=msg message=true bean:write name=msg /br/ /html:messages If general.textWithOneReplacementValue property is placed in other than the default bundle, this JspException is generated: 2006-03-16 10:45:03,779 ERROR [[/nims-web-5.0-SNAPSHOT].[action]] Servlet.service() for servlet action threw exception javax.servlet.jsp.JspException: Cannot find bean: msg in any scope. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ActionForm Stringvariables
well, two reasons, the practical one: checks for null are annoying, and people tend to lazily forget them. the more theoretical reason, is that null is not a truly OO concept (at least according to some authors), and you should use a NullObject concept (being of same type as your normal Object expected by the code) instead. In opposite to the NullObject the null misses important semantics about the objects structure. Using null for string initialization is an entry point to bad practices, absolutely 'bad' are following practices: putting null in lists/maps transporting null over network (rmi,corba,soap etc) putting null beans in scopes (not sure this works, but should never bin tried :-)) returning null from functions instead of more meaningfull reply: For example getUser(String userName) should throw a NotSuchUserException if there is no corresponding User object instead of returning null. There are very few scenarios (mostly high performance, where null is actually expected - i.e. caches) where this rule can be broken. I think you can find more examples in a good pattern book :-) HTH Leon On 3/16/06, manny Calaverra [EMAIL PROTECTED] wrote: hi Leon, is this rule because of the NullPointerException you get when, for example you check the Strings .length() or is there (also) another reason for this practice? thanks in advance Julian --- Ursprüngliche Nachricht --- Von: Leon Rosenberg [EMAIL PROTECTED] An: Struts Users Mailing List user@struts.apache.org Betreff: Re: ActionForm Stringvariables Datum: Thu, 16 Mar 2006 11:06:50 +0100 1. The general rule is: never use null. 2. The specific rule for your application must be given by your application, but in doubt the general rule applies. regards leon On 3/16/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi there, I'm a newbie to struts and I have a question concerning ActionForms. What's more clever: to initialize the String-parameters with null or with (empty strings)? thx ciao 4 now Julian -- Feel free mit GMX FreeMail! Monat für Monat 10 FreeSMS inklusive! http://www.gmx.net - 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] -- 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[ANN] JAVAWUG BOF XVI / Friday 3rd March 2006 @ 19:00 / Oracle Ci ty of London
Dear All I would like to formally announce that JAVAWUG (Java Web User Group) is holding the sixteenth Birds-of-Feather (Meet up XVI) at the Oracle City of London offices on Friday, 17th March 2006. The meeting will take place in a room with Audio/Visual facilities between 7-9:30 pm. There will be a series of presentations, Quickies, inspired by the JavaPolis short presentation format. The confirmed speakers are: Phil Zoio ``Struts Java 5 Extension Framework'' (special guest speaker) Emmanuel Okeyere ``Spring into RIFE Framework Continued'' Peter Pilgrim ``WebWork Quickie Experiences'' There will be probably be one additional speaking slot by Duncan Mills * S TO P P R E S S * After providing the key note and presentations at JAVA UK 06 in London. Craig McClanahan plans to attend on Friday night. Afterwards members can retire to the nearby the ``All Bar One'' pub/restaurant for more in depth discussion dinner, food and drink ... The address is: Oracle City Of London One South Place London, England EC2M 2RB. If you would like to attend Join the http://groups.google.com/group/javawug JAVAWUG at Google Groups and ``Send a mail to the list you are attending'' Send mail to myself at peter dot pilgrim at credit-suisse.com and duncan dot mills at oracle.com Here is some relevant travel information: By Underground: - Moorgate: Take the Moorgate East exit, turn right, one block to South Place. Bank: Take the Northern line to Moorgate. Liverpool Street: Take the Broadgate exit, turn right onto South Place Map: http://www.oracle.com/global/uk/corporate/locations/citymap.html The venue has graciously been organised by Duncan Mills of Oracle Corp. We all appreciate this generous gift. http://www.javawug.com/ http://jroller.com/page/peter_pilgrim PS: The presentations will be recorded and I hope to upload them all Google Video Site. search against JAVAWUG for the last video uploads. -- Peter Pilgrim :: J2EE Software Development Architecture Operations/IT - Credit Suisse Group - One Bank, Floor 15, 5 Canada Square, London E14 4QJ, United Kingdom Tel: +44-(0)207-883-4497 peter dot pilgrim at credit-suisse.com == Please access the attached hyperlink for an important electronic communications disclaimer: http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html == - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ActionForm Stringvariables
ah, ok, well thanks, that was rather illuminating :) thanks a thousand Julian --- Ursprüngliche Nachricht --- Von: Leon Rosenberg [EMAIL PROTECTED] An: Struts Users Mailing List user@struts.apache.org Betreff: Re: ActionForm Stringvariables Datum: Thu, 16 Mar 2006 14:19:41 +0100 well, two reasons, the practical one: checks for null are annoying, and people tend to lazily forget them. the more theoretical reason, is that null is not a truly OO concept (at least according to some authors), and you should use a NullObject concept (being of same type as your normal Object expected by the code) instead. In opposite to the NullObject the null misses important semantics about the objects structure. Using null for string initialization is an entry point to bad practices, absolutely 'bad' are following practices: putting null in lists/maps transporting null over network (rmi,corba,soap etc) putting null beans in scopes (not sure this works, but should never bin tried :-)) returning null from functions instead of more meaningfull reply: For example getUser(String userName) should throw a NotSuchUserException if there is no corresponding User object instead of returning null. There are very few scenarios (mostly high performance, where null is actually expected - i.e. caches) where this rule can be broken. I think you can find more examples in a good pattern book :-) HTH Leon On 3/16/06, manny Calaverra [EMAIL PROTECTED] wrote: hi Leon, is this rule because of the NullPointerException you get when, for example you check the Strings .length() or is there (also) another reason for this practice? thanks in advance Julian --- Ursprüngliche Nachricht --- Von: Leon Rosenberg [EMAIL PROTECTED] An: Struts Users Mailing List user@struts.apache.org Betreff: Re: ActionForm Stringvariables Datum: Thu, 16 Mar 2006 11:06:50 +0100 1. The general rule is: never use null. 2. The specific rule for your application must be given by your application, but in doubt the general rule applies. regards leon On 3/16/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi there, I'm a newbie to struts and I have a question concerning ActionForms. What's more clever: to initialize the String-parameters with null or with (empty strings)? thx ciao 4 now Julian -- Feel free mit GMX FreeMail! Monat für Monat 10 FreeSMS inklusive! http://www.gmx.net - 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] -- 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- 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]
Validwhen and array
Hi, I have an array of two adress lines in my form. I want to check if AT LEAST one line is not empty. I want to use the validwhen to check the first line. The first line is valid only it's not null or the second line is not null. But I have an error on my page when the instruction is called in the validator unexpected token adr ... . here is my code field property=adr[0] depends =validwhen var var-nametest/var-name var-value((*this*!=null) or adr (adr[1]))/var-value /var /field Is it possible to check that with the validwhen? -- View this message in context: http://www.nabble.com/Validwhen-and-array-t1291360.html#a3435828 Sent from the Struts - User forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Validwhen and array
Take a look at the struts-examples webapp, theres a validwhen example in the validator module - since 1.2.7 or 1.2.8 I think Niall On 3/16/06, coudot [EMAIL PROTECTED] wrote: Hi, I have an array of two adress lines in my form. I want to check if AT LEAST one line is not empty. I want to use the validwhen to check the first line. The first line is valid only it's not null or the second line is not null. But I have an error on my page when the instruction is called in the validator unexpected token adr ... . here is my code field property=adr[0] depends =validwhen var var-nametest/var-name var-value((*this*!=null) or adr (adr[1]))/var-value /var /field Is it possible to check that with the validwhen? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Validwhen and array
Thanks but I have already looked at this example. There is not control validwhen on an element of an array. All the other controls(intRange,required...) works fine on my field adr[0]. the problem is the adr[1] in the var-value, although it seems to be allowed in the struts documentation. -- View this message in context: http://www.nabble.com/Validwhen-and-array-t1291360.html#a3436463 Sent from the Struts - User forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Set focus on a table on page load.
Anjishnu Bandyopadhyay wrote: I have a JSP page, which has a table (table). On load of the page, I need to set focus on this table. Why would you want to set focus on something that can't receive user input? Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Map backed actionForm and pushing multiselect value in the map - No response :-(
Struts Group, Is it such a dumb question that i am not getting any response? or is it a bug. If someone can let me know, that it is ok to tweak the bean util code i will. I am not sure whether it has other side effects. I just want to make sure that it does not cause obvious side effects. Struts gurus - Any pointers will be very helpful. Thanks, Vijay vijay venkataraman wrote: Can someone take time to answer this question. Thanks, Vijay vijay venkataraman wrote: Hi, Sorry if you receive this twice. I didn't see this mail for more than 4 hours after sending it. I have a Form bean backed by a Map. I want to capture the responses of the input fields in the jsp in to this Map. When the selected values results into Array(String[]) in case of Multiselect only the first value in the array gets in to this map as a value. This is the case with radio buttons fields having same names. My action form bean is a copy of the bean given in struts document. public FooForm extends ActionForm { private final Map values = new HashMap(); public void setValue(String key, Object value) { values.put(key, value); } public Object getValue(String key) { return values.get(key); } } Here is the JSP fragment html-el:select multiple=true property=value('5') html-el:option value=oneONE/html-el:option html-el:option value=twoTWO/html-el:option /html-el:select When the JPS page is rendered i am able to see the value as ONE and TWO for my multiselect. Now in the UI when i select ONE and TWO, only one value that is the first one in index zero is part of the map. I debugged it and found that this is handled by ||setProperty(Object bean, String name, Object value)|| in bean util class I have cut and pasted the code at the end of mail for quick reference and using that as context to explain the problem. The obtained descriptor is instanceof MappedPropertyDescriptor.| |Look for the comments HERE - From this point all idenfitcation for setting up the value takes place. At this point the type.isArray fails, the obtained value is: type = java.lang.ObjectT (The return type for getValue) value = String[ONE, TWO] - This comes out fine. The code skips condition : HERE1 and goes through HERE3 I am not sure whether my coding of form bean is wrong or if the jsp is wrong, i thought i could generically add objects in to the map. I am working with dynamic form fields, which can be of any type, (html radio,checkbox, input, multiselect), hence i thought i can get it resolved using map based ActionForms, but the problem is that only the first item in the array gets into the map. Can anyone let me know what the mistake is? Using struts 1.2.4 Note : I tried with the latest version of bean utils and the bean utils that comes with 1.2.4. Any pointers will be higly appreciated. Kindly cc to me: vijay [EMAIL PROTECTED] since i am not member of the users list. The code: - public void setProperty(Object bean, String name, Object value) throws IllegalAccessException, InvocationTargetException { // Trace logging (if enabled) if (log.isTraceEnabled()) { StringBuffer sb = new StringBuffer( setProperty(); sb.append(bean); sb.append(, ); sb.append(name); sb.append(, ); if (value == null) { sb.append(NULL); } else if (value instanceof String) { sb.append((String) value); } else if (value instanceof String[]) { String values[] = (String[]) value; sb.append('['); for (int i = 0; i values.length; i++) { if (i 0) { sb.append(','); } sb.append(values[i]); } sb.append(']'); } else { sb.append(value.toString()); } sb.append(')'); log.trace(sb.toString()); } // Resolve any nested expression to get the actual target bean Object target = bean; int delim = findLastNestedIndex(name); if (delim = 0) { try { target = getPropertyUtils().getProperty(bean, name.substring(0, delim)); } catch (NoSuchMethodException e) { return; // Skip this property setter } name = name.substring(delim + 1); if (log.isTraceEnabled()) { log.trace(Target bean = + target); log.trace(Target name = + name); } } // Declare local variables we will require String propName = null; // Simple name of target property Class type = null; // Java type of target property int index = -1; // Indexed subscript value (if any) String key = null; // Mapped key value (if any) // Calculate the
Re: has struts reached the saturation
Dakota Jack wrote: I cannot see how Struts is going to be able to be viable in the long run. Personally, I think the trick is in the tooling. JSF is obviously designed for tooling and works well, similarly to the .NET/Visual Studio 'experience'. Struts irritates me because I have to tweak or create at least 4 files for every action: JSP, resources, tiles, struts-config (although I've started playing with the Spring/Struts stuff) in multiple places. Add validation if there's a form. So I wrote a lame Ruby script that will insert stuff into existing files and create missing ones. If that was integrated into my IDE I'd be much happier with the entire process and would be much less irritated. That said, I'm having more fun right now with the (pure) Spring MVC, but miss some of the things Struts provides out-of-the-box. The Struts/Spring integration actually works quite well for me, but I haven't done a real project with it yet. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Set focus on a table on page load.
Actually, it is a table where rows can be added/deleted. So, after, addition/deletion of a row, (on page load) focus is to be set to the table. -Original Message- From: Dave Newton [mailto:[EMAIL PROTECTED] Sent: Thursday, March 16, 2006 7:37 PM To: Struts Users Mailing List Subject: Re: Set focus on a table on page load. Anjishnu Bandyopadhyay wrote: I have a JSP page, which has a table (table). On load of the page, I need to set focus on this table. Why would you want to set focus on something that can't receive user input? Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS*** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
obtaining server URL (or ip and port) from plugin
Hi there, I need to find URL to my application (http://myhost:8080/myAppContext) from within init() method of struts plugin (implementing PlugIn interface). Any ideas how can I do this programatically without specifying it explicitly in one of application configuration files? Thanks in advance, Wojtek - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
newbie guestion: JSTL Expression language
I want to use JSTL to check the role of the user (it can be one of many) I'm new to JSTL so even the simplest things gives me problems: I've set the role using request.setAttribute(role , role); This tag: c:out value=${role}/ Prints out the role fine While the following statements are newer true: c:if test=${role}==editor The role is editor /c:if c:if test=${role}=='editor' The role is editor /c:if Where do I go wrong? Morten - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: newbie guestion: JSTL Expression language
Morten Andersen wrote: I want to use JSTL to check the role of the user (it can be one of many) I'm new to JSTL so even the simplest things gives me problems: I've set the role using request.setAttribute(role , role); This tag: c:out value=${role}/ Prints out the role fine While the following statements are newer true: c:if test=${role}==editor The role is editor /c:if c:if test=${role}=='editor' The role is editor /c:if Where do I go wrong? test is wrong :-) It should be test=${role eq 'editor'} if you want to compare with strings or test=${role eq editor} if you have variable editor in page/request/session scope with value you want to check against - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: newbie guestion: JSTL Expression language
On 3/16/06, Morten Andersen [EMAIL PROTECTED] wrote: I want to use JSTL to check the role of the user (it can be one of many) I'm new to JSTL so even the simplest things gives me problems: I've set the role using request.setAttribute(role , role); This tag: c:out value=${role}/ Prints out the role fine While the following statements are newer true: c:if test=${role}==editor snip/ Expression must be contained in ${ and } in its entirety i.e. ${role eq 'editor'} The role is editor /c:if c:if test=${role}=='editor' snap/ ${role ne 'editor'} -Rahul The role is editor /c:if Where do I go wrong? Morten - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Validwhen and array
On 3/16/06, coudot [EMAIL PROTECTED] wrote: Thanks but I have already looked at this example. There is not control validwhen on an element of an array. All the other controls(intRange,required...) works fine on my field adr[0]. the problem is the adr[1] in the var-value, although it seems to be allowed in the struts documentation. I would have expected it to work, although I haven't used an array myself. Can you copy/paste the actual xml you're using, because the original sample you gave was clearly not a valid test value: var-value((*this*!=null) or adr (adr[1]))/var-value Niall -- View this message in context: http://www.nabble.com/Validwhen-and-array-t1291360.html#a3436463 Sent from the Struts - User forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
errorStyleClass
This might not be Struts related issue. More of CSS stuff I guess. I am using this errorStyleClass and works great for text fields, where I am highlighting the border with different color when there is an error. If it is a dropdown when there is an error(when the user did not select any) then dropdown border is not changing color why is that? did anyone work on such a thing i.e highlighting the dropdown border with different color when there is an error. Would appreciate your help. Thanks. _ Is your PC infected? Get a FREE online computer virus scan from McAfee® Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: obtaining server URL (or ip and port) from plugin
Wojciech Ciesielski ha scritto: Hi there, I need to find URL to my application (http://myhost:8080/myAppContext) from within init() method of struts plugin (implementing PlugIn interface). Any ideas how can I do this programatically without specifying it explicitly in one of application configuration files? You can't do it, in any part of your web-app! But what do you need your application URL for? Ciao Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Validwhen and array
sorry for the mistake. my code is : field property=adr[0] depends =validwhen var var-nametest/var-name var-value((*this*!=null) or (adr[1] !=null ))/var-value /var /field -- View this message in context: http://www.nabble.com/Validwhen-and-array-t1291360.html#a3437728 Sent from the Struts - User forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: help logic:equals
Alberto Marquÿe9s ha scritto: logic:equal name=lista property=tema value=id_tema PRINT MENSAJE /logic:equal You cannot use logic:equal this way, value must be a constant. You can use JSTL c:if http://java.sun.com/products/jsp/jstl/1.1/docs/tlddocs/index.html Ciao Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: has struts reached the saturation
I'm not sure *anything* is off-topic for this thread :) LOL -- 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! On Thu, March 16, 2006 2:37 am, Michael Jouravlev said: URLs are universal, while JSR-168 manages portlets through central controller (speaking of Front Controller and MVC) and specialized API. A very intrusive approach if you ask me. But this is offtopic for this thread ;) On 3/15/06, Leon Rosenberg [EMAIL PROTECTED] wrote: Speaking of JSF, is there somewhere a Filter or n extension allowing you to use JSF/Shale/MyFaces without having a single url and send everything over POST? Until there is one, I don't see how you can use JSF in portals, but if there is one, I'd love to try it out :-) - 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: url after validation
Karel Honzl ha scritto: Hi, I'm using validation on action form. I have action for displayng input form named /insert and other action for form submission named /insertsubmit . But when form don't pass validation url in browser is changed to /insertsubmit.do, but I want to have there /insert.do. Is it possible to do it? Please post your action mapping... I have a suspect - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: has struts reached the saturation
I just thought I'd chime in here even though I haven't been following the arguments all along. As background - I'm working a contract where we use JSF with ADF controls mixed in. I have had a very pleasant experience using JSF with Eclipse though most of my previous experience was with Struts. There are some problems with refreshing pages and hitting the backbutton but aside from that it's been good to be able to (for instance) tie buttons directly to methods on backing beans. The ADF controls have some pretty cool features. Like partial updates which essentially use Ajax to update part of the page without a full refresh. However the ADF controls haven't been nearly as customizable as the customer wanted so we've had to make do in places where we should have been able to redesign. Recently we found out that a contract had never been negotiated with Oracle on using the ADF controls so we started that process. It turned out we couldn't get the controls by themselves and the cost would be around $50,000. For that amount I could have spent 6 months developing the few controls we really needed myself and they'd be customized (or customizable) to our needs...but it was too late for anything like that. Then ADF was given to Apache - but not everything we needed such as the look and feel - which would take us months to create on our own. So if we wanted to go live we had to pay off Oracle. This is a special case but it does exhibit how it can be dangerous to go with a closed source solution without knowing what you're getting into. Braedan Hegberg On 3/15/06, Greg Reddin [EMAIL PROTECTED] wrote: On Mar 14, 2006, at 10:25 PM, Frank W. Zammetti wrote: JSF is a way for a lot of people to make money. Many vendors have a stake in its commercial success or failure. This has been true from the beginning. Some would say the whole point of JSF from the start was to make money for one company, and eventually a lot of other companies. Incidentally, I'm a happy capitalist, I therefore have no problem whatsoever with that! I just like that fact not being denied, and I for one do see it as fact. Contrast this with how something like Struts began, which came straight from the idealism you speak of, a desire to help a community, a desire by one developer to create something that not only helped themselves but helped others. I think that is a wonderful motivation. And that may have been that same developers' motivation with JSF as well, but I to this day do not believe it was the motivation of the larger entities involved. I find it ironic that people are bemoaning JSF for its commercial interests. First, I seem to remember sometime between 2001 and 2003 there were a lot of people asking When is Struts going to become a JSR?. So, for the moment let's just pretend that the motivation for JSR-127 was to standardize an MVC framework. By the time JSR-127 was introduced we were already discussing the things we'd do differently in version 2 of Struts. Surely we didn't think the output of JSR-127 would be Struts as we knew it then. Surely we wouldn't have been happy if it had. Second, look at who is represented on the Expert Group for JSR-127. Why would companies like Oracle, Borland, IBM, Macromedia, BEA, HP, etc. bother to participate in a such project if they weren't protecting their own interests? Just look at how many tool-makers are present among the expert group. Is it any wonder the resulting spec brings them the opportunity to cash in? That's not even to mention all the other community-driven framework options that were in play when JSF was under development. Personally, I think the resulting framework is not too bad considering. I would've liked the Struts worldview to have been better represented - or maybe I am saying the tool-less developer's worldview. But given all the players, I'm not surprised or disappointed with what we have. Now, directly to your point of commercial interests. You say JSF is a way for a lot of people to make money. What is Java? Do you think Sun developed Java as a love offering to the developer community? Why do any of these organizations exist? For that matter, why do I develop software? Is it because I've found the meaning of life or simply because it's better than working at a rendering plant? Well, for me it's somewhere in the middle. But for organizations like Sun, Oracle, or BEA, it's all about the economics. I'm not talking about the individuals that work at these companies. I'm talking about the organizations themselves. At the organizational level, they are solely about increasing financial gain. And I'm not saying that's bad. If they weren't they would quickly go out of business. People start companies to grow business. People start non-profit organizations (like ASF) for the betterment of mankind. So I guess I find the argument of commercial interests to be completely
Re: has struts reached the saturation
On Thu, March 16, 2006 9:21 am, Dave Newton said: Struts irritates me because I have to tweak or create at least 4 files for every action: JSP, resources, tiles, struts-config (although I've started playing with the Spring/Struts stuff) in multiple places. Add validation if there's a form. -snip- If that was integrated into my IDE I'd be much happier with the entire process and would be much less irritated. I'm not at all disagreeing with your point, but there are ton of Struts-related plug-ins to various IDEs... I wouldn't be surprised if at least one of them did this for you. Here's just a few that came up on Google: http://easystruts.sourceforge.net/ http://www.myeclipseide.com/ContentExpress-display-ceid-55.html http://weblog.cemper.com/a/200311/02-struts-studio-eclipse-plugin-for-struts-modelling.php You may be right that none of them does ALL the steps you mentioned... I don't use any of them so I can't say. But certainly there are enough options to explore. Dave Frank - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] Re: Set focus on a table on page load.
Anjishnu Bandyopadhyay wrote: Actually, it is a table where rows can be added/deleted. So, after, addition/deletion of a row, (on page load) focus is to be set to the table. I'm not convinced you can set focus on a non-input item; that really wouldn't make any sense. I believe you'll need to set focus on a user-input control. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Re: Set focus on a table on page load.
Dave Newton wrote: I'm not convinced you can set focus on a non-input item; that really wouldn't make any sense. +1 I'd try using a fragment identifier (pointing to a name) either from the link that leads to the page or via JS on load (the first way is better). hth, Manos - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: obtaining server URL (or ip and port) from plugin
Antonio Petrelli wrote: Wojciech Ciesielski ha scritto: I need to find URL to my application (http://myhost:8080/myAppContext) from within init() method of struts plugin (implementing PlugIn interface). Any ideas how can I do this programatically without specifying it explicitly in one of application configuration files? You can't do it, in any part of your web-app! But what do you need your application URL for? getServletContextName from ServletContext will give you the app context (I think). AFAIK the only way you can get the host and port etc. is by servicing a request, but I have no idea if that's really true or not. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: has struts reached the saturation
Frank W. Zammetti wrote: http://easystruts.sourceforge.net/ http://www.myeclipseide.com/ContentExpress-display-ceid-55.html http://weblog.cemper.com/a/200311/02-struts-studio-eclipse-plugin-for-struts-modelling.php You may be right that none of them does ALL the steps you mentioned... I don't use any of them so I can't say. But certainly there are enough options to explore. I'll look in to them. I didn't think MyEclipse did what I wanted (it's what I use now) but the Special workflow wizard to create Form, Action, and JSP entities in one easy step. sounds promising; I thought they were all separate. The nice thing (and probably the _only_ nice thing ;) about my Ruby script is that it basically takes a YAML file and automagically creates the form bean, JSP, and validation stubs about 80% correct, which is enough to keep me from bitching too much. Thanks! Dave
Re: obtaining server URL (or ip and port) from plugin
I need to find URL to my application (http://myhost:8080/myAppContext) from within init() method of struts plugin (implementing PlugIn interface). Any ideas how can I do this programatically without specifying it explicitly in one of application configuration files? You can't do it, in any part of your web-app! But what do you need your application URL for? Ciao Antonio We are trying to create distributed computing environment based on web-apps with one master server where multiple processing servers register themselves. Communication is done by calling action via HTTP. And therefore I have to let master server know about URL of processing server interface... Wojtek - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] inheritance and equals
Hi, It's almost Friday here so I thought I could throw in an OT, hope you don't mind ... I'm sure that most of you already read the Effective Java of Joshua Bloch. In the item discussing the equals method he talks about the imposibility to write a valid equals method for a subclass that adds a new aspect to the superclass. His example: public class Point { private final int x; private final int y; public Point(int x, int y) { this.x = x; this.y = y; } public boolean equals(Object o) { if (!(o instanceof Point)) return false; Point p = (Point)o; return p.x == x p.y == y; } ... // Remainder omitted } and the subclass which adds the notion of a color: public class ColorPoint extends Point { private Color color; public ColorPoint(int x, int y, Color color) { super(x, y); this.color = color; } ... // Remainder omitted } We have to implement the equals method of ColorPoint but we must respect its contract. The trickier points from this contract are transitivity (if a.equals(b) and b.equals(c) then a.equals(c))and symmetry (if x.equals(y) then y.equals(x)). The first try is something like this and it breaks symmetry: (this is the implementation I usually see :-)) //Broken - violates symmetry! public boolean equals(Object o) { if (!(o instanceof ColorPoint)) return false; ColorPoint cp = (ColorPoint)o; return super.equals(o) cp.color == color; } For: Point p = new Point(1, 2); ColorPoint cp = new ColorPoint(1, 2, Color.RED); p.equals(cp) is true but cp.equals(p) is false. The second try is to handle Points specially in ColorPoint's equals, but it breaks transitivity: //Broken - violates transitivity. public boolean equals(Object o) { if (!(o instanceof Point)) return false; // If o is a normal Point, do a color-blind comparison if (!(o instanceof ColorPoint)) return o.equals(this); // o is a ColorPoint; do a full comparison ColorPoint cp = (ColorPoint)o; return super.equals(o) cp.color == color; } For: ColorPoint p1 = new ColorPoint(1, 2, Color.RED); Point p2 = new Point(1, 2); ColorPoint p3 = new ColorPoint(1, 2, Color.BLUE); p1.equals(p2) is true and p2.equals(p3) is true but p1.equals(p3) is false. So my question is how do you solve this problem? The book says that a workaround is to use composition instead of inheritance, which in general is a good idea, but in my oppinion it doesn't solve the problem at all. If you want a Point to be equal to ColorPoints of any color but with the same coordinates the provided workaround isn't correct. Here it is: // Adds an aspect without violating the equals contract public class ColorPoint { private Point point; private Color color; public ColorPoint(int x, int y, Color color) { point = new Point(x, y); this.color = color; } /** * Returns the point-view of this color point. */ public Point asPoint() { return point; } public boolean equals(Object o) { if (!(o instanceof ColorPoint)) return false; ColorPoint cp = (ColorPoint)o; return cp.point.equals(point) cp.color.equals(color); } ... // Remainder omitted } Does anyone has a valid workaround or you just accept that it isn't possible for a superclass to be equal with all of its subclasses not considering the aspect added by the subclass? Another question is how do you usually add an aspect to an existing class? Composition or inheritance? Thanks and sorry for the long post Tamas
Re: [OT] Re: Set focus on a table on page load.
On Thu, March 16, 2006 10:39 am, Dave Newton said: Anjishnu Bandyopadhyay wrote: Actually, it is a table where rows can be added/deleted. So, after, addition/deletion of a row, (on page load) focus is to be set to the table. I'm not convinced you can set focus on a non-input item; that really wouldn't make any sense. I think you actually can, at least in IE (I was a bit surprised by this). Quick test: htmlheadtitle/title/head body onLoad=document.getElementById('myCell').focus(); table tr td id=myCell onKeyDown=alert('hello');My cell/td td id=myCell2 onKeyDown=alert('hello2');My cell2/td /tr /table /body/html Note that if you load this in IE and just press Return, the onKeyDown handler of the first cell fires. Further, click the second cell and click Return. Again, the handler for *that* cell fires, indicating focus went to the cell. This DOES NOT seem to work in Firefox though, at least when I tried it, so it certainly doesn't seem to be cross-browser. Still, interesting :) I believe you'll need to set focus on a user-input control. Dave Frank -- 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]
[OT ]Re: obtaining server URL (or ip and port) from plugin
Assuming all of the slaves know the id of the master, then maybe you have a RegisterServlet that's called by a slave processing servers during their init? http://javaalmanac.com/egs/javax.servlet/GetReqUrl.html -Dennis Wojciech Ciesielski [EMAIL PROTECTED] 03/16/2006 10:52 AM Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org cc Subject Re: obtaining server URL (or ip and port) from plugin I need to find URL to my application (http://myhost:8080/myAppContext) from within init() method of struts plugin (implementing PlugIn interface). Any ideas how can I do this programatically without specifying it explicitly in one of application configuration files? You can't do it, in any part of your web-app! But what do you need your application URL for? Ciao Antonio We are trying to create distributed computing environment based on web-apps with one master server where multiple processing servers register themselves. Communication is done by calling action via HTTP. And therefore I have to let master server know about URL of processing server interface... Wojtek - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: errorStyleClass
select elements are a bit notorious in not allowing you all the CSS flexibility the other controls do. This is, as I understand it, because a select is treated essentially as a separate window. For instance, note that if you have a div and you position it over a select, regardless of how you try and set the z-index, the select will show through the div. The browser keeps the select at a higher z-index no matter what because it isn't like the other form controls exactly. I think at one point IE literally spawned a separate browser thread for each select, as it did for each frame. I may be remembering that incorrectly, and certainly it isn't true any more in any case. All that possibly shotty memory aside though :), select's don't always behave themselves as you'd like in terms of CSS. Trial and error and research is required. I unfortunately don't have an answer for your specific issue. -- 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! On Thu, March 16, 2006 9:57 am, fea jabi said: This might not be Struts related issue. More of CSS stuff I guess. I am using this errorStyleClass and works great for text fields, where I am highlighting the border with different color when there is an error. If it is a dropdown when there is an error(when the user did not select any) then dropdown border is not changing color why is that? did anyone work on such a thing i.e highlighting the dropdown border with different color when there is an error. Would appreciate your help. Thanks. _ Is your PC infected? Get a FREE online computer virus scan from McAfee® Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 - 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: has struts reached the saturation
Your scripts sound like just the kind of thing that would be well-received as a struts.sourceforge.net project (hint-hint!) Maybe slap a Swing front-end on it and execute the scripts via BSF? -- 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! On Thu, March 16, 2006 10:52 am, Dave Newton said: Frank W. Zammetti wrote: http://easystruts.sourceforge.net/ http://www.myeclipseide.com/ContentExpress-display-ceid-55.html http://weblog.cemper.com/a/200311/02-struts-studio-eclipse-plugin-for-struts-modelling.php You may be right that none of them does ALL the steps you mentioned... I don't use any of them so I can't say. But certainly there are enough options to explore. I'll look in to them. I didn't think MyEclipse did what I wanted (it's what I use now) but the Special workflow wizard to create Form, Action, and JSP entities in one easy step. sounds promising; I thought they were all separate. The nice thing (and probably the _only_ nice thing ;) about my Ruby script is that it basically takes a YAML file and automagically creates the form bean, JSP, and validation stubs about 80% correct, which is enough to keep me from bitching too much. Thanks! Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Re: Set focus on a table on page load.
Frank W. Zammetti wrote: On Thu, March 16, 2006 10:39 am, Dave Newton said: I'm not convinced you can set focus on a non-input item; that really wouldn't make any sense. I think you actually can, at least in IE (I was a bit surprised by this). Ooo, that's spooky... I guess it's a general-purpose element handler, which makes sense, sorta. d - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: obtaining server URL (or ip and port) from plugin
Wojciech Ciesielski ha scritto: We are trying to create distributed computing environment based on web-apps with one master server where multiple processing servers register themselves. Communication is done by calling action via HTTP. And therefore I have to let master server know about URL of processing server interface... This is easier then. When the slave server registers itself, the master server can know its IP address by using ServletRequest.getRemoteAddr (or .getRemoteHost). The context name can be passed by the slave server (as Dave wrote, ServletContext.getServletContextName). For the port... I have no idea... HTH a bit Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT ]Re: obtaining server URL (or ip and port) from plugin
[EMAIL PROTECTED] wrote: Assuming all of the slaves know the id of the master, then maybe you have a RegisterServlet that's called by a slave processing servers during their init? http://javaalmanac.com/egs/javax.servlet/GetReqUrl.html -Dennis The problem is that slaves know master's URL but master also needs to know URL of slave server because it calls their methods (like http://myslave:8080/myProcessingApp/process.do) with tasks to process. And I can't find a good way to determine URL of slave servers :-/ Wojtek - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Re: Set focus on a table on page load.
If i've understood the problem, rather than trying to focus on the table you could create the illusion.. You'd need to get a where the table is on the page and perhaps apply some styles to the table. If you cant get the position of the table then an anchor will do.. Just scroll the window to that. document.getElementById(mytable).offsetTop works on firefox and safari.. dont know about ie.. Mark On 3/16/06, Frank W. Zammetti [EMAIL PROTECTED] wrote: On Thu, March 16, 2006 10:39 am, Dave Newton said: Anjishnu Bandyopadhyay wrote: Actually, it is a table where rows can be added/deleted. So, after, addition/deletion of a row, (on page load) focus is to be set to the table. I'm not convinced you can set focus on a non-input item; that really wouldn't make any sense. I think you actually can, at least in IE (I was a bit surprised by this). Quick test: htmlheadtitle/title/head body onLoad=document.getElementById('myCell').focus(); table tr td id=myCell onKeyDown=alert('hello');My cell/td td id=myCell2 onKeyDown=alert('hello2');My cell2/td /tr /table /body/html Note that if you load this in IE and just press Return, the onKeyDown handler of the first cell fires. Further, click the second cell and click Return. Again, the handler for *that* cell fires, indicating focus went to the cell. This DOES NOT seem to work in Firefox though, at least when I tried it, so it certainly doesn't seem to be cross-browser. Still, interesting :) I believe you'll need to set focus on a user-input control. Dave Frank -- 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: obtaining server URL (or ip and port) from plugin
On Thu, March 16, 2006 10:52 am, Wojciech Ciesielski said: I need to find URL to my application (http://myhost:8080/myAppContext) from within init() method of struts plugin (implementing PlugIn interface). Any ideas how can I do this programatically without specifying it explicitly in one of application configuration files? You can't do it, in any part of your web-app! But what do you need your application URL for? Ciao Antonio Well, that certainly *is* information you can get within a webapp... it's fairly easy to construct that URL from with an Action for instance. From a plug-in though, I'm not so sure (interestingly, this question comes up frequently... would make for a good Wiki post...) Let's walk the object hierarchy and see if we can't find any help... Remember we're trying to construct http://myhost:8080/myAppContext dynamically... PlugIn: void init(ActionServlet servlet, ModuleConfig config) Ok, we have an ActionServlet instance... ActionServlet extends from HttpServlet... HttpServlet exposes a getServletContext() method... ServletContext: getServletContextName() Ah, ok, we have the myAppContext portion at least! Can we get host name? Well, generically we can: try { InetAddress addr = InetAddress.getLocalHost(); String hostname = addr.getHostName(); } catch (UnknownHostException e) { } Ok, so now we need the port and the protocol... and I'm stumped :) I don't think you could get the protocol without making a request, and the port I would think you would *have* to know before-hand anyway. Can you use config params for those two pieces of information? If it's always HTTP, then you just need to get the port, but again, that seems like something that would be OK as an init param. Frank - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT ]Re: obtaining server URL (or ip and port) from plugin
Did you even _LOOK_ at the url that I sent the first time? Your slave starts and fires init() and makes a call to the master, the master will take the request and reconstruct the URL from the slave. Posted again JUST IN CASE: http://javaalmanac.com/egs/javax.servlet/GetReqUrl.html -Dennis Wojciech Ciesielski [EMAIL PROTECTED] 03/16/2006 11:14 AM Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org cc Subject Re: [OT ]Re: obtaining server URL (or ip and port) from plugin [EMAIL PROTECTED] wrote: Assuming all of the slaves know the id of the master, then maybe you have a RegisterServlet that's called by a slave processing servers during their init? http://javaalmanac.com/egs/javax.servlet/GetReqUrl.html -Dennis The problem is that slaves know master's URL but master also needs to know URL of slave server because it calls their methods (like http://myslave:8080/myProcessingApp/process.do) with tasks to process. And I can't find a good way to determine URL of slave servers :-/ Wojtek - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Re: Set focus on a table on page load.
Should work on IE too... OP, what was the underying goal? Do you just want to make sure the added row is on the screen? If so, I think Mark is on the right track. -- 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! On Thu, March 16, 2006 11:18 am, Mark Lowe said: If i've understood the problem, rather than trying to focus on the table you could create the illusion.. You'd need to get a where the table is on the page and perhaps apply some styles to the table. If you cant get the position of the table then an anchor will do.. Just scroll the window to that. document.getElementById(mytable).offsetTop works on firefox and safari.. dont know about ie.. Mark On 3/16/06, Frank W. Zammetti [EMAIL PROTECTED] wrote: On Thu, March 16, 2006 10:39 am, Dave Newton said: Anjishnu Bandyopadhyay wrote: Actually, it is a table where rows can be added/deleted. So, after, addition/deletion of a row, (on page load) focus is to be set to the table. I'm not convinced you can set focus on a non-input item; that really wouldn't make any sense. I think you actually can, at least in IE (I was a bit surprised by this). Quick test: htmlheadtitle/title/head body onLoad=document.getElementById('myCell').focus(); table tr td id=myCell onKeyDown=alert('hello');My cell/td td id=myCell2 onKeyDown=alert('hello2');My cell2/td /tr /table /body/html Note that if you load this in IE and just press Return, the onKeyDown handler of the first cell fires. Further, click the second cell and click Return. Again, the handler for *that* cell fires, indicating focus went to the cell. This DOES NOT seem to work in Firefox though, at least when I tried it, so it certainly doesn't seem to be cross-browser. Still, interesting :) I believe you'll need to set focus on a user-input control. Dave Frank -- 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] - 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]
validator
field property=amt depends=validwhen msg name=validwhen key=lbl.notvalidnumber/ var var-nametest/var-name var-value( ((*this* == ) or (*this* != null)) and (*this* = 0) )/var-value /var /field want the value to be greater than 0, but can be empty or null. Also no chars are allowed. trying using above. but the error gets shown when is a null or empty value. how to fix this? Thanks. _ Dont just search. Find. Check out the new MSN Search! http://search.msn.click-url.com/go/onm00200636ave/direct/01/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT ]Re: obtaining server URL (or ip and port) from plugin
DuhI misunderstood and I apologize. You need a callback URL...lemme think on that a second. -Dennis [EMAIL PROTECTED] 03/16/2006 11:21 AM Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org cc Subject Re: [OT ]Re: obtaining server URL (or ip and port) from plugin Did you even _LOOK_ at the url that I sent the first time? Your slave starts and fires init() and makes a call to the master, the master will take the request and reconstruct the URL from the slave. Posted again JUST IN CASE: http://javaalmanac.com/egs/javax.servlet/GetReqUrl.html -Dennis Wojciech Ciesielski [EMAIL PROTECTED] 03/16/2006 11:14 AM Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org cc Subject Re: [OT ]Re: obtaining server URL (or ip and port) from plugin [EMAIL PROTECTED] wrote: Assuming all of the slaves know the id of the master, then maybe you have a RegisterServlet that's called by a slave processing servers during their init? http://javaalmanac.com/egs/javax.servlet/GetReqUrl.html -Dennis The problem is that slaves know master's URL but master also needs to know URL of slave server because it calls their methods (like http://myslave:8080/myProcessingApp/process.do) with tasks to process. And I can't find a good way to determine URL of slave servers :-/ Wojtek - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: obtaining server URL (or ip and port) from plugin
2cents try { InetAddress addr = InetAddress.getLocalHost(); String hostname = addr.getHostName(); } catch (UnknownHostException e) { } This could easily return localhost (and the ip of 127.0.0.1) or something as useless as this depending on your /etc/hosts. There is no valid way to find out your address, since the url/domain that maps to your server is not the domain your server runs at (think about vhosts, loadbalancers, proxies and so on) IMHO configuring it in an external file is the best reliable way to get the data. /2cents Leon - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT ]Re: obtaining server URL (or ip and port) from plugin
Hehe, don't feel bad... I was *this* close to replying with pretty much the same thing you did, I realized I would have been wrong just before I clicked Send :) -- 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! On Thu, March 16, 2006 11:23 am, [EMAIL PROTECTED] said: DuhI misunderstood and I apologize. You need a callback URL...lemme think on that a second. -Dennis [EMAIL PROTECTED] 03/16/2006 11:21 AM Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org cc Subject Re: [OT ]Re: obtaining server URL (or ip and port) from plugin Did you even _LOOK_ at the url that I sent the first time? Your slave starts and fires init() and makes a call to the master, the master will take the request and reconstruct the URL from the slave. Posted again JUST IN CASE: http://javaalmanac.com/egs/javax.servlet/GetReqUrl.html -Dennis Wojciech Ciesielski [EMAIL PROTECTED] 03/16/2006 11:14 AM Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org cc Subject Re: [OT ]Re: obtaining server URL (or ip and port) from plugin [EMAIL PROTECTED] wrote: Assuming all of the slaves know the id of the master, then maybe you have a RegisterServlet that's called by a slave processing servers during their init? http://javaalmanac.com/egs/javax.servlet/GetReqUrl.html -Dennis The problem is that slaves know master's URL but master also needs to know URL of slave server because it calls their methods (like http://myslave:8080/myProcessingApp/process.do) with tasks to process. And I can't find a good way to determine URL of slave servers :-/ Wojtek - 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: errorStyleClass
thankyou, for detail explanation. From: Frank W. Zammetti [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org To: Struts Users Mailing List user@struts.apache.org CC: user@struts.apache.org Subject: Re: errorStyleClass Date: Thu, 16 Mar 2006 11:03:51 -0500 (EST) select elements are a bit notorious in not allowing you all the CSS flexibility the other controls do. This is, as I understand it, because a select is treated essentially as a separate window. For instance, note that if you have a div and you position it over a select, regardless of how you try and set the z-index, the select will show through the div. The browser keeps the select at a higher z-index no matter what because it isn't like the other form controls exactly. I think at one point IE literally spawned a separate browser thread for each select, as it did for each frame. I may be remembering that incorrectly, and certainly it isn't true any more in any case. All that possibly shotty memory aside though :), select's don't always behave themselves as you'd like in terms of CSS. Trial and error and research is required. I unfortunately don't have an answer for your specific issue. -- 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! On Thu, March 16, 2006 9:57 am, fea jabi said: This might not be Struts related issue. More of CSS stuff I guess. I am using this errorStyleClass and works great for text fields, where I am highlighting the border with different color when there is an error. If it is a dropdown when there is an error(when the user did not select any) then dropdown border is not changing color why is that? did anyone work on such a thing i.e highlighting the dropdown border with different color when there is an error. Would appreciate your help. Thanks. _ Is your PC infected? Get a FREE online computer virus scan from McAfee® Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 - 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] _ FREE pop-up blocking with the new MSN Toolbar get it now! http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT ]Re: obtaining server URL (or ip and port) from plugin
[EMAIL PROTECTED] wrote: Did you even _LOOK_ at the url that I sent the first time? Your slave starts and fires init() and makes a call to the master, the master will take the request and reconstruct the URL from the slave. How does this help? This is the URL that the slave requested; the OP needs to know where the request came from--the _slave's_ hostname and port. The port is the killer, AFAICT; I'm not sure if getRemoteHost includes that, or if it did, if it would be useful since the port used to make the request wouldn't be the post the server would _answer_ requests on. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Re: Set focus on a table on page load.
will this sort of thing do? window.onload = function() { if(rowAdded) { var table = document.getElementById(mytable); tableFocus(table); } } function tableFocus(table) { window.scroll(0,table.offsetTop); table.style.borderColor = #f00; table.style.borderStyle = solid; table.style.borderWidth = 1px; rowAdded = false; } On 3/16/06, Mark Lowe [EMAIL PROTECTED] wrote: If i've understood the problem, rather than trying to focus on the table you could create the illusion.. You'd need to get a where the table is on the page and perhaps apply some styles to the table. If you cant get the position of the table then an anchor will do.. Just scroll the window to that. document.getElementById(mytable).offsetTop works on firefox and safari.. dont know about ie.. Mark On 3/16/06, Frank W. Zammetti [EMAIL PROTECTED] wrote: On Thu, March 16, 2006 10:39 am, Dave Newton said: Anjishnu Bandyopadhyay wrote: Actually, it is a table where rows can be added/deleted. So, after, addition/deletion of a row, (on page load) focus is to be set to the table. I'm not convinced you can set focus on a non-input item; that really wouldn't make any sense. I think you actually can, at least in IE (I was a bit surprised by this). Quick test: htmlheadtitle/title/head body onLoad=document.getElementById('myCell').focus(); table tr td id=myCell onKeyDown=alert('hello');My cell/td td id=myCell2 onKeyDown=alert('hello2');My cell2/td /tr /table /body/html Note that if you load this in IE and just press Return, the onKeyDown handler of the first cell fires. Further, click the second cell and click Return. Again, the handler for *that* cell fires, indicating focus went to the cell. This DOES NOT seem to work in Firefox though, at least when I tried it, so it certainly doesn't seem to be cross-browser. Still, interesting :) I believe you'll need to set focus on a user-input control. Dave Frank -- 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: validator
fea jabi wrote: var-value( ((*this* == ) or (*this* != null)) and (*this* = 0) )/var-value Never used validwhen, but wouldn't the boolean equation be something more like: this == or this == null or this = 0? You have something more like it's valid when the value is empty and the value is = 0, which is improbable at best. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT ]Re: obtaining server URL (or ip and port) from plugin
Hehe, don't feel bad... I was *this* close to replying with pretty much the same thing you did, I realized I would have been wrong just before I clicked Send :) So may be I should apologize for lack of precision in initial post :-) Absolutely no offense taken anyway and thanks for will to assist. Wojtek - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT ]Re: obtaining server URL (or ip and port) from plugin
OK, thank you all. I thought that it's possible in some easy way through J2EE/Struts API. If not we will try to work around it somehow... Reagards, Wojtek - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: validator
I wouldn't use validwhen to do this - use intRange or I think theres a minvalue - from memory added in 1.2.8, but I could be wrong. Niall - Original Message - From: fea jabi [EMAIL PROTECTED] Sent: Thursday, March 16, 2006 4:22 PM field property=amt depends=validwhen msg name=validwhen key=lbl.notvalidnumber/ var var-nametest/var-name var-value( ((*this* == ) or (*this* != null)) and (*this* = 0) )/var-value /var /field want the value to be greater than 0, but can be empty or null. Also no chars are allowed. trying using above. but the error gets shown when is a null or empty value. how to fix this? Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT ]Re: obtaining server URL (or ip and port) from plugin
a bit crazy suggestion. Why don't you just parse the server.xml at startup to determine the port? regards Leon On 3/16/06, Wojciech Ciesielski [EMAIL PROTECTED] wrote: OK, thank you all. I thought that it's possible in some easy way through J2EE/Struts API. If not we will try to work around it somehow... Reagards, Wojtek - 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: obtaining server URL (or ip and port) from plugin
On Thu, March 16, 2006 1:07 pm, Leon Rosenberg said: a bit crazy suggestion. Why don't you just parse the server.xml at startup to determine the port? I'll one-up your crazyness Leon... How about having a servlet as part of your webapp that starts up before Struts does... then, from your plugin, you scan the local machine by sending a request to every port from 1 to 1, and whichever you get the appropriate reply from is your port. Since we already know you can get the hostname and the context name in the plugin, as long as you can assume HTTP vs. HTTPS, this should work. Might delay startup, dunno how much. Yeah, yeah, I know, I know... NUTS! ;) LOL regards Leon Frank -- 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]
Re: [OT ]Re: obtaining server URL (or ip and port) from plugin
Frank W. Zammetti wrote: How about having a servlet as part of your webapp that starts up before Struts does... then, from your plugin, you scan the local machine by sending a request to every port from 1 to 1, and whichever you get the appropriate reply from is your port. Since we already know you can get the hostname and the context name in the plugin, as long as you can assume HTTP vs. HTTPS, this should work. Might delay startup, dunno how much. I just lost my lunch. But it's better than the JSF thread ;) Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT ]Re: obtaining server URL (or ip and port) from plugin
On Thu, March 16, 2006 1:33 pm, Dave Newton said: Frank W. Zammetti wrote: How about having a servlet as part of your webapp that starts up before Struts does... then, from your plugin, you scan the local machine by sending a request to every port from 1 to 1, and whichever you get the appropriate reply from is your port. Since we already know you can get the hostname and the context name in the plugin, as long as you can assume HTTP vs. HTTPS, this should work. Might delay startup, dunno how much. I just lost my lunch. But it's better than the JSF thread ;) Glad I could help keep your weight down :-) LOL Hey, at least with this solution (ahem) you can't accuse me of not being creative! Dave Frank - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT ]Re: obtaining server URL (or ip and port) from plugin
Why cant the master server provide the information, as i assume that some form of request is being made via a socket or otherwise to register the client? Even if no you can still do what you need by creating a socket or url connection to the master, and have the master send the details back. A bit like when folk ask me for my mobile phone number i never remember it.. So i get them to give me their number and i call them and hang up to give them my number.. It all seems a bit promiscuous for me, but it should work just fine.. Mark On 3/16/06, Frank W. Zammetti [EMAIL PROTECTED] wrote: On Thu, March 16, 2006 1:07 pm, Leon Rosenberg said: a bit crazy suggestion. Why don't you just parse the server.xml at startup to determine the port? I'll one-up your crazyness Leon... How about having a servlet as part of your webapp that starts up before Struts does... then, from your plugin, you scan the local machine by sending a request to every port from 1 to 1, and whichever you get the appropriate reply from is your port. Since we already know you can get the hostname and the context name in the plugin, as long as you can assume HTTP vs. HTTPS, this should work. Might delay startup, dunno how much. Yeah, yeah, I know, I know... NUTS! ;) LOL regards Leon Frank -- 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT ]Re: obtaining server URL (or ip and port) from plugin
On 3/16/06, Mark Lowe [EMAIL PROTECTED] wrote: Why cant the master server provide the information, as i assume that some form of request is being made via a socket or otherwise to register the client? Even if no you can still do what you need by creating a socket or url connection to the master, and have the master send the details back. A bit like when folk ask me for my mobile phone number i never remember it.. So i get them to give me their number and i call them and hang up to give them my number.. It all seems a bit promiscuous for me, but it should work just fine.. No, because when in the webserver you have to unidirectional lines instead of one bidirectional as in the mobile phone. Your caller number is not the same as your callee number :-) Mark regards Leon - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] PropertyEditor
I have a custom tag in which I am evaluating an attribute as follow: (Locale)ExpressionEvaluatorManager.evaluate(locale, expr, Locale.class, this, pageContext) But I get an error: javax.servlet.jsp.JspException: An error occurred while evaluating custom action attribute locale with value en_US: Attempt to convert String en_US to type java.util.Locale, but there is no PropertyEditor for that type (null) at org.apache.taglibs.standard.lang.jstl.Evaluator.evaluate(Unknown Source) at org.apache.taglibs.standard.lang.jstl.Evaluator.evaluate(Unknown Source) at org.apache.taglibs.standard.lang.support.ExpressionEvaluatorManager.evaluate(Unknown Source) I am using standard.jar (v 1.1). If I want to convert a String to Locale object, I assume I need to define some sort of PropertyEditor?? Any help is appreciated. Thanks, Mujahid - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[Shale]/jsf Referencing a component
I'm enjoying the helper methods extended from the AbstractViewController and I'd like to send a message to a particular component. For example, here's the slick error() method. protected void error(javax.faces.component.UIComponent component, java.lang.String summary) I'm not sure how to reference the desired component. Can I refer to the component with its ID? Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] PropertyEditor
I'm not sure about the convertor, but could you instead just do: String localCode = (String)ExpressionEvaluatorManager.evaluate(locale, expr, String.class, this, pageContext); Locale locale = new Locale(localCode); At least that way your only asking the ExpressionEvaluatorManager to deal with a basic type that by default it knows how to handle. I know, it's not one concise line then :) -- 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! On Thu, March 16, 2006 3:00 pm, Mujahid Ali said: I have a custom tag in which I am evaluating an attribute as follow: (Locale)ExpressionEvaluatorManager.evaluate(locale, expr, Locale.class, this, pageContext) But I get an error: javax.servlet.jsp.JspException: An error occurred while evaluating custom action attribute locale with value en_US: Attempt to convert String en_US to type java.util.Locale, but there is no PropertyEditor for that type (null) at org.apache.taglibs.standard.lang.jstl.Evaluator.evaluate(Unknown Source) at org.apache.taglibs.standard.lang.jstl.Evaluator.evaluate(Unknown Source) at org.apache.taglibs.standard.lang.support.ExpressionEvaluatorManager.evaluate(Unknown Source) I am using standard.jar (v 1.1). If I want to convert a String to Locale object, I assume I need to define some sort of PropertyEditor?? Any help is appreciated. Thanks, Mujahid - 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] PropertyEditor
Yep thats what I ended up doing. The code (Locale)ExpressionEvaluatorManager.evaluate(locale, expr,Locale.class, this, pageContext) was working against standard.jar (1.0).So just not sure why this is breaking all of a sudden. Thanks, Mujahid Frank W. Zammetti wrote: I'm not sure about the convertor, but could you instead just do: String localCode = (String)ExpressionEvaluatorManager.evaluate(locale, expr, String.class, this, pageContext); Locale locale = new Locale(localCode); At least that way your only asking the ExpressionEvaluatorManager to deal with a basic type that by default it knows how to handle. I know, it's not one concise line then :) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[Shale] shale-mailreader could not be started
Hi : Today I got the shale-mailreader-20060316.war, dropped it into my webapps dir, went to the tomcat manager and it wasn't running. I tried to start it and was told Message: FAIL - Application at context path /shale-mailreader-20060316 could not be started I am using Apache Tomcat/5.0.19and JVM version 1.4.2_02-b03. I also get this error: 2006-03-16 15:29:03 StandardContext[/shale-mailreader-20060316]Exception starting filter shale java.lang.UnsupportedClassVersionError: org/apache/shale/tiger/faces/LifecycleListener (Unsupported major.minor version 49.0) The shale-usecases-20060316.war seems to be running fine. So are does simple.war from myfaces. Another example jsf-crud.war also seems to be ok. What am I missing/doing wrong. thanks in advance mas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Shale]/jsf Referencing a component
On 3/16/06, James Reynolds [EMAIL PROTECTED] wrote: I'm enjoying the helper methods extended from the AbstractViewController and I'd like to send a message to a particular component. Good idea :-). For example, here's the slick error() method. protected void error(javax.faces.component.UIComponent component, java.lang.String summary) I'm not sure how to reference the desired component. Can I refer to the component with its ID? You can't use a component identifier, because the method signature quoted above requires a component *instance*. There are two reasonable approaches to how you can acquire such a component reference. * Use the UIComponent.findComponent() method, perhaps on the root UIViewRoot component, to find the component instance for the specified client id. NOTE -- the Proposed Final Draft 2 version of the JSF 1.2 spec has added an additional related option here. * Use the binding attribute on your JSP tag to attach the component instance into your backing bean. The most common use case I've had for this is when you want to implement pagination on a table component (but the same principle applies to the question you are asking). Consider a component with the following JSP custom tag: h:dataTable ... binding=#{mybean.table} .../ In the backing bean class referenced by the managed bean name mybean, you need to define a property for the component itself, as opposed to its value: private HtmlDataTable table = null; public HtmlDataTable getTable() { return this.table; } public void setTable(HtmlDataTable table) { this.table = table; } Using the latter approach, any event handler method in the same backing bean has direct access to the component instance -- without even having to know its id. The same sort of approach can be used to expose component instances needed for the first parameter to methods like error(). If you think, on the other hand, that we should also support passing a string (the client id) instead of the component instance, please file an RFE in the issue tracking system: http://issues.apache.org/bugzilla/ Under product Struts and category Shale. Thanks Craig
Re: [OT ]Re: obtaining server URL (or ip and port) from plugin
On 3/16/06, Leon Rosenberg [EMAIL PROTECTED] wrote: On 3/16/06, Mark Lowe [EMAIL PROTECTED] wrote: Why cant the master server provide the information, as i assume that some form of request is being made via a socket or otherwise to register the client? Even if no you can still do what you need by creating a socket or url connection to the master, and have the master send the details back. A bit like when folk ask me for my mobile phone number i never remember it.. So i get them to give me their number and i call them and hang up to give them my number.. It all seems a bit promiscuous for me, but it should work just fine.. No, because when in the webserver you have to unidirectional lines instead of one bidirectional as in the mobile phone. Your caller number is not the same as your callee number :-) Shit .. yeah, Oh well it was worth a go.. Still cant see why the master needs to request the gimp's url anyhow.. Could just send the /someaction.do?foo=bar back to the client in the response, at runtime (when the relevant actions are called). The master need never know anything about the gimp other than what it needs to respond.. send it back to the client and let the client do its thing.. still promiscuous and don't really see why it needs doing in a plugin.. Mark regards Leon - 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: obtaining server URL (or ip and port) from plugin
hmm, I suppose the poster wants to run a n workers for m applications scenario with own load balancing, and wants to add new applications and servers dynamically. right? Leon On 3/16/06, Mark Lowe [EMAIL PROTECTED] wrote: On 3/16/06, Leon Rosenberg [EMAIL PROTECTED] wrote: On 3/16/06, Mark Lowe [EMAIL PROTECTED] wrote: Why cant the master server provide the information, as i assume that some form of request is being made via a socket or otherwise to register the client? Even if no you can still do what you need by creating a socket or url connection to the master, and have the master send the details back. A bit like when folk ask me for my mobile phone number i never remember it.. So i get them to give me their number and i call them and hang up to give them my number.. It all seems a bit promiscuous for me, but it should work just fine.. No, because when in the webserver you have to unidirectional lines instead of one bidirectional as in the mobile phone. Your caller number is not the same as your callee number :-) Shit .. yeah, Oh well it was worth a go.. Still cant see why the master needs to request the gimp's url anyhow.. Could just send the /someaction.do?foo=bar back to the client in the response, at runtime (when the relevant actions are called). The master need never know anything about the gimp other than what it needs to respond.. send it back to the client and let the client do its thing.. still promiscuous and don't really see why it needs doing in a plugin.. Mark regards Leon - 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: obtaining server URL (or ip and port) from plugin
Ok, here's another possibility... From the plug-in, launch a daemon thread (daemon just in case the server has to go down before the thread is done, in which case it won't block the shutdown). Have the thread sleep for some amount of time, 30 seconds maybe, however long on average it takes your app to start up. Then, the thread fires off a request to some known URL within your app. Just a simple GET using Commons HTTPClient sort of thing. Have that request execute an Action. Within the Action you can get all the info you need, so construct the URI and send it back to the thread. The thread then makes a request to the master, transmitting that constructed URL. The master then should have everything it needs and can go ahead and ping the slave just to be sure. Upon getting a good response back from the slave, the master returns to the thread a message saying thanks very much, now die. The thread obliges and things should be good to go. What about something like that? If you don't like the whole spawning a thread in a servlet container thing, you should be able to do just about the same thing by sending a message to a JMS queue from your plug-in. That sounds like more work to me though, and I don't like more work :) -- 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! On Thu, March 16, 2006 3:47 pm, Leon Rosenberg said: hmm, I suppose the poster wants to run a n workers for m applications scenario with own load balancing, and wants to add new applications and servers dynamically. right? Leon On 3/16/06, Mark Lowe [EMAIL PROTECTED] wrote: On 3/16/06, Leon Rosenberg [EMAIL PROTECTED] wrote: On 3/16/06, Mark Lowe [EMAIL PROTECTED] wrote: Why cant the master server provide the information, as i assume that some form of request is being made via a socket or otherwise to register the client? Even if no you can still do what you need by creating a socket or url connection to the master, and have the master send the details back. A bit like when folk ask me for my mobile phone number i never remember it.. So i get them to give me their number and i call them and hang up to give them my number.. It all seems a bit promiscuous for me, but it should work just fine.. No, because when in the webserver you have to unidirectional lines instead of one bidirectional as in the mobile phone. Your caller number is not the same as your callee number :-) Shit .. yeah, Oh well it was worth a go.. Still cant see why the master needs to request the gimp's url anyhow.. Could just send the /someaction.do?foo=bar back to the client in the response, at runtime (when the relevant actions are called). The master need never know anything about the gimp other than what it needs to respond.. send it back to the client and let the client do its thing.. still promiscuous and don't really see why it needs doing in a plugin.. Mark regards Leon - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [Shale]/jsf Referencing a component
Works like a charm! I used the binding method and now I'm off and running. Thanks! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Craig McClanahan Sent: Thursday, March 16, 2006 1:42 PM To: Struts Users Mailing List Subject: Re: [Shale]/jsf Referencing a component On 3/16/06, James Reynolds [EMAIL PROTECTED] wrote: I'm enjoying the helper methods extended from the AbstractViewController and I'd like to send a message to a particular component. Good idea :-). For example, here's the slick error() method. protected void error(javax.faces.component.UIComponent component, java.lang.String summary) I'm not sure how to reference the desired component. Can I refer to the component with its ID? You can't use a component identifier, because the method signature quoted above requires a component *instance*. There are two reasonable approaches to how you can acquire such a component reference. * Use the UIComponent.findComponent() method, perhaps on the root UIViewRoot component, to find the component instance for the specified client id. NOTE -- the Proposed Final Draft 2 version of the JSF 1.2 spec has added an additional related option here. * Use the binding attribute on your JSP tag to attach the component instance into your backing bean. The most common use case I've had for this is when you want to implement pagination on a table component (but the same principle applies to the question you are asking). Consider a component with the following JSP custom tag: h:dataTable ... binding=#{mybean.table} .../ In the backing bean class referenced by the managed bean name mybean, you need to define a property for the component itself, as opposed to its value: private HtmlDataTable table = null; public HtmlDataTable getTable() { return this.table; } public void setTable(HtmlDataTable table) { this.table = table; } Using the latter approach, any event handler method in the same backing bean has direct access to the component instance -- without even having to know its id. The same sort of approach can be used to expose component instances needed for the first parameter to methods like error(). If you think, on the other hand, that we should also support passing a string (the client id) instead of the component instance, please file an RFE in the issue tracking system: http://issues.apache.org/bugzilla/ Under product Struts and category Shale. Thanks Craig - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT ]Re: obtaining server URL (or ip and port) from plugin
Leon Rosenberg wrote: hmm, I suppose the poster wants to run a n workers for m applications scenario with own load balancing, and wants to add new applications and servers dynamically. That was my assumption; random slaves should be able to volunteer automagically on startup. Really I would have gone about solving this a different way--running a full app-server seems a bit top-heavy for loosely-coupled distributed processing... Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT ]Re: obtaining server URL (or ip and port) from plugin
Frank W. Zammetti wrote: From the plug-in, launch a daemon thread (daemon just in case the server has to go down before the thread is done, in which case it won't block the shutdown). Have the thread sleep for some amount of time, 30 seconds maybe, however long on average it takes your app to start up. Wouldn't it still have to know the port it was running on? Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT ]Re: obtaining server URL (or ip and port) from plugin
On 3/16/06, Frank W. Zammetti [EMAIL PROTECTED] wrote: Ok, here's another possibility... From the plug-in, launch a daemon thread (daemon just in case the server has to go down before the thread is done, in which case it won't block the shutdown). Have the thread sleep for some amount of time, 30 seconds maybe, however long on average it takes your app to start up. Then, the thread fires off a request to some known URL within your app. Just a simple GET using Commons HTTPClient sort of thing. Have that request execute an Action. Within the Action you can get all the info you need, so construct the URI and send it back to the thread. Aehm... :-) If you would know the url you don't need the thread anymore because the url contains the protocol, the host, the port and the path. It's everything he needs :-) regards Leon - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Shale] shale-mailreader could not be started
On 3/16/06, Mark Shifman [EMAIL PROTECTED] wrote: Hi : Today I got the shale-mailreader-20060316.war, dropped it into my webapps dir, went to the tomcat manager and it wasn't running. I tried to start it and was told Message: FAIL - Application at context path /shale-mailreader-20060316 could not be started I am using Apache Tomcat/5.0.19and JVM version 1.4.2_02-b03. I also get this error: 2006-03-16 15:29:03 StandardContext[/shale-mailreader-20060316]Exception starting filter shale java.lang.UnsupportedClassVersionError: org/apache/shale/tiger/faces/LifecycleListener (Unsupported major.minor version 49.0) Hmm ... the only time I have seen this kind of problem is when the sources for the application are compiled with a 1.5 compiler without setting the target option in the build script to say please build class files compatible with 1.4. Could you please file an issue ih our issue tracing system, and be sure to detail all the platform specifics you are using? http://issues.apache.org/buzilla/ Craig The shale-usecases-20060316.war seems to be running fine. So are does simple.war from myfaces. Another example jsf-crud.war also seems to be ok. What am I missing/doing wrong. thanks in advance mas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT ]Re: obtaining server URL (or ip and port) from plugin
Hmm... yeah, I guess your right :) D'oh! I made the onconscious assumption that the slave would know about itself, but if that were true there wouldn't be any reason to do any of this, it could just send that information to the master straight away. Sorry, I missed the obvious :) -- 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! On Thu, March 16, 2006 4:06 pm, Leon Rosenberg said: On 3/16/06, Frank W. Zammetti [EMAIL PROTECTED] wrote: Ok, here's another possibility... From the plug-in, launch a daemon thread (daemon just in case the server has to go down before the thread is done, in which case it won't block the shutdown). Have the thread sleep for some amount of time, 30 seconds maybe, however long on average it takes your app to start up. Then, the thread fires off a request to some known URL within your app. Just a simple GET using Commons HTTPClient sort of thing. Have that request execute an Action. Within the Action you can get all the info you need, so construct the URI and send it back to the thread. Aehm... :-) If you would know the url you don't need the thread anymore because the url contains the protocol, the host, the port and the path. It's everything he needs :-) regards Leon - 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: [Shale] shale-mailreader could not be started
On 3/16/06, Mark Shifman [EMAIL PROTECTED] wrote: I also get this error: 2006-03-16 15:29:03 StandardContext[/shale-mailreader-20060316]Exception starting filter shale java.lang.UnsupportedClassVersionError: org/apache/shale/tiger/faces/LifecycleListener (Unsupported major.minor version 49.0) This means that classes were compiled for Java SE 5 (JDK 1.5) but you're trying to run them on JDK 1.4. In this case, it's shale-tiger.jar, which requires JDK 1.5. However, I don't think the Mailreader app actually uses the Tiger extensions, so try deleting shale-tiger.jar from shale-mailreader/WEB-INF/lib and restarting the container. Can you please open a ticket for this? http://issues.apache.org/bugzilla with product Struts and component Shale Thank you, -- Wendy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT ]Re: obtaining server URL (or ip and port) from plugin
On 3/16/06, Frank W. Zammetti [EMAIL PROTECTED] wrote: Hmm... yeah, I guess your right :) D'oh! I made the onconscious assumption that the slave would know about itself, but if that were true there wouldn't be any reason to do any of this, it could just send that information to the master straight away. Sorry, I missed the obvious :) :-) Personally, I still think that parsing the server.xml and the context.xml or whatever config files the webserver is using is the second best option. The best option imho would be simply configure it with an external configuration file / system and don't spend too much time with magic and trickery. But this thread and especially your ideas, Frank, are a welcome alternation to the day in, day out same questions about validators and ajax :-))) regards Leon -- 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! On Thu, March 16, 2006 4:06 pm, Leon Rosenberg said: On 3/16/06, Frank W. Zammetti [EMAIL PROTECTED] wrote: Ok, here's another possibility... From the plug-in, launch a daemon thread (daemon just in case the server has to go down before the thread is done, in which case it won't block the shutdown). Have the thread sleep for some amount of time, 30 seconds maybe, however long on average it takes your app to start up. Then, the thread fires off a request to some known URL within your app. Just a simple GET using Commons HTTPClient sort of thing. Have that request execute an Action. Within the Action you can get all the info you need, so construct the URI and send it back to the thread. Aehm... :-) If you would know the url you don't need the thread anymore because the url contains the protocol, the host, the port and the path. It's everything he needs :-) regards Leon - 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: obtaining server URL (or ip and port) from plugin
On Thu, March 16, 2006 4:29 pm, Leon Rosenberg said: On 3/16/06, Frank W. Zammetti [EMAIL PROTECTED] wrote: Hmm... yeah, I guess your right :) D'oh! I made the onconscious assumption that the slave would know about itself, but if that were true there wouldn't be any reason to do any of this, it could just send that information to the master straight away. Sorry, I missed the obvious :) :-) Personally, I still think that parsing the server.xml and the context.xml or whatever config files the webserver is using is the second best option. At this point I think your right... I'd be loathe to use a vendor-specific solution, but that seems like the option to go with. The best option imho would be simply configure it with an external configuration file / system and don't spend too much time with magic and trickery. Agreed. I had a similar requirement last year where I had a number of instances of an app accross a cluster, and I had some background threads that did periodic processing. Problem was, the threads could only execute on one machine at a time, so they had to communicate with each other. I spent some time trying to find a really cool, dynamic answer, but in the end I wound up just hard-coding some necessary values in the config file. But this thread and especially your ideas, Frank, are a welcome alternation to the day in, day out same questions about validators and ajax :-))) Glad I could entertain you :) LOL Actually, I *thought* I was on to something a second ago... let me post what I had, in the hopes that someone can see why it doesn't work... A simple servlet: import java.io.*; import javax.servlet.*; import javax.servlet.http.*; import java.util.*; import java.net.*; public class TestServlet extends HttpServlet { public void init(ServletConfig config) { try { ServletContext context = config.getServletContext(); URL u = context.getResource(/test.fwz); System.out.println(u.getProtocol() + :// + u.getHost() + : + u.getPort() + / + context.getServletContextName()); } catch (Exception e) { e.printStackTrace(); } } } From my reading of the docs, getResource() should be returning a URL to that resource, which does exist (NPE if it didn't) which would have all the details needed. Unfortunately, the only detail that is coming up properly is the ServletContextName... I get JNDI for the protocol, -1 for the port and I think nothing for the host. Am I reading the docs wrong, should that actually NOT work, as I'm seeing? Because you can get at the ServletContext from a plug-in too, this seemed like the perfect answer. Unfortunately, it has one minor drawback: it doesn't work :) regards Leon Frank - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT ]Re: obtaining server URL (or ip and port) from plugin
Frank W. Zammetti wrote: import java.io.*; import javax.servlet.*; import javax.servlet.http.*; import java.util.*; import java.net.*; public class TestServlet extends HttpServlet { public void init(ServletConfig config) { try { ServletContext context = config.getServletContext(); URL u = context.getResource(/test.fwz); System.out.println(u.getProtocol() + :// + u.getHost() + : + u.getPort() + / + context.getServletContextName()); } catch (Exception e) { e.printStackTrace(); } } } From my reading of the docs, getResource() should be returning a URL to that resource, which does exist (NPE if it didn't) which would have all the details needed. Unfortunately, the only detail that is coming up properly is the ServletContextName... I get JNDI for the protocol, -1 for the port and I think nothing for the host. Am I reading the docs wrong, should that actually NOT work, as I'm seeing? Because you can get at the ServletContext from a plug-in too, this seemed like the perfect answer. Two things jump out at me: 1) It looks like it's container-dependent: The servlet container must implement the URL handlers and |URLConnection| objects that are necessary to access the resource. 2) It's not making a real request so the container might short-circuit the normal request procedure in order to return the resource as efficiently as possible? Unfortunately, it has one minor drawback: it doesn't work :) Minor quibble. Dave
[OT] JSTL question
I am trying to access a session object where the key is the field ACCOUNT_PROFILE_SESSION_ATTRIBUTE in a Constants JAVA file called GlobalConstants. I created a wrapper around it that extends Map (JSTLConstants) to contain all the constants so I could access it via JSTL. I am trying to do the following: jsp:useBean id=GlobalConstants class=com.JSTLConstants/ c:set var=accountProfile value=${GlobalConstants.ACCOUNT_PROFILE_SESSION_ATTRIBUTE} scope=page/ c:out value=${sessionScope[accountProfile].accountName}/ My question is, how can I use the GlobalConstants.ACCOUNT_PROFILE_SESSION_ATTRIBUTE value to lookup my object in the Session using JSTL? Dan
Re: [OT ]Re: obtaining server URL (or ip and port) from plugin
On 3/16/06, Dave Newton [EMAIL PROTECTED] wrote: Frank W. Zammetti wrote: Unfortunately, it has one minor drawback: it doesn't work :) Minor quibble. Dave Frank, Dave... even if it would work, how can you guarantee it resolves the proper hostname? the default linux installation resolves InetAdress.getLocalhost() to localhost until you remove the 127.0.0.1 line from your etc/hosts. Whats with vhosts? If the master simply make connections to the slave, that any master-accessible url is ok, but if the master sends the user a redirect to the slave, then knowing the outer address is important. Speaking about crazy solutions... what you actually could do would be opening a socket to the master, let the master send your incoming requests via this connection, fake the container, creating your own HttpServlerRequest/Response objects, send the reply over the same connection. This would be fun to implement, but you'll be in no need for the container (and the master will need a lot of synch and threadpools). thinking further, you don't need to fake anything, you could define your own connector in tomcat config and let him connect to the master and maintain the connection for incoming requests. I'm not quite sure whether you can easily switch connectors under tomcat or whatever jsp engine you are using, but it can be patched :-) However, once you leave the company for a better job, they will have to rewrite the complete load balancing or hire someone with good research skills, to find this threat und understand the design decision :-) regards Leon - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT]FIELDSET and Screen Size
I put a FIELDSET (i.e., the fieldset ) around a 'table'. I (as a developer) am viewing a 1280*1024 screen. Everything looks fine. The FIELDSET (a thin line box) is drawn along the right and left edges of the screen. Because most of the users have a screen size of 1024*768. When I adjust the screen properties settings to 1024*768, the 'table' together with other textfields, textareas displayed in the same web page automatically adjust to fit the smaller screen size. But, the size of the FIELDSET is not automatically adjusted to fit the smaller screen size. Instead a horizontal scrollbar is automatically created because the FIELDSET is still 1280 in width. We really do not want the horizontal scrollabar. Is there anyway to make the FIELDSET adjust to fit the smaller screen size accordingly? Thanks for your guidance. __ 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]
Re: [OT]FIELDSET and Screen Size
Caroline Jen wrote: Instead a horizontal scrollbar is automatically created because the FIELDSET is still 1280 in width. Why? I'm not aware that fieldsets take a width argument. Is it inside another element that defines an absolute width? Maybe an HTML newsgroup would be better. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: has struts reached the saturation
I believe Dakota is correct in this area. The problem is not with JSF itself, but the way the Struts team has divided itself into competing camps. JSF and Struts are competing because their approaches are orthogonal; it doesn't make any sense to do both unless you are on a migration path. When you have really great talent like Craig leave the Action Framework to contribute putting his total/almost total effort into Shale, it sends the signal TO ME (my opinion here) of the boat is sinking (Struts) and the next big thing (JSF) is on the horizon. Craig has put a ton of time and effort into Shale and I think that's awesome, but at the same time, I wish he would do the same to Struts. The Action Framework needs a lot of constant dedication to make it better, and there are ton of great contributions on board, but Craig appears to have an abundance of time and effort no one else has :-) and I wish that talent was retained for Struts. I think Struts does have a future, but I believe there needs to be honesty about the competition here. Struts DOES COMPETE against JSF and Shale, and putting these competitors into one mailing list will definitely bring out the passion on both sides. -- Paul --- Dakota Jack [EMAIL PROTECTED] wrote: I don't think JSF is polarizing. I think that the way it has been pushed into areas it does not belong is polarizing. There is absolutely nothing wrong with JSF, in my opinion, but there is something wrong with the way its advocates have strong-armed and misled people. That's what I have disliked. On 3/15/06, Greg Reddin [EMAIL PROTECTED] wrote: On Mar 15, 2006, at 11:26 AM, Frank W. Zammetti wrote: Isn't it interesting how polarizing JSF seems to be? I don't know about you, but I talk to more people with a strong opinion either way than most other technologies. The only other one I can think of in the same vein is EJBs. Seems like you either love EJBs or you hate them, and the same seems, largely, to be true of JSF. There seems to be relatively few of us in the middle. I think it's largely because the JCP moved into a space that was already well-populated and people tend to be very skeptical of governing bodies. I think that the simple fact that JSF is a standard means there's a certain slice of people who will automatically refuse to accept it. I wonder how different the response would be if the exact same technology had been developed by ASF or FSF without the involvement of a standards body. Conversely, I wonder how different the response to Struts would've been if it had started out as a JSR. Developers seem to have the most difficult time with the not created here syndrome. At my last job I was on an architecture team for a large firm. We inherently held great skepticism for any framework handed to us that we didn't develop ourselves. And any framework we developed ourselves seemed to be completely rejected by everyone else. The portal software I'm working with right now really needs to be rewritten IMO. The only frameworks that seem to gain widespread acceptance are those that are developed in an open community rather than a closed one. Hmm. But there's always politics and egos involved. I strive to be the developer who can walk into any framework already in use and get work done without complaining about how broken everything is. I'm still a long way from achieving that goal. Greg - 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~ __ 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]
[Problem Solved]Re: [OT]FIELDSET and Screen Size
I am very sorry, Dave, for taking up your time. I have found the problem. The problem is not the FIELDSET. The problem is caused by something else in that web page. My apology. --- Dave Newton [EMAIL PROTECTED] wrote: Caroline Jen wrote: Instead a horizontal scrollbar is automatically created because the FIELDSET is still 1280 in width. Why? I'm not aware that fieldsets take a width argument. Is it inside another element that defines an absolute width? Maybe an HTML newsgroup would be better. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ 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]
Re: [OT ]Re: obtaining server URL (or ip and port) from plugin
Dave Newton wrote: Two things jump out at me: 1) It looks like it's container-dependent: The servlet container must implement the URL handlers and |URLConnection| objects that are necessary to access the resource. 2) It's not making a real request so the container might short-circuit the normal request procedure in order to return the resource as efficiently as possible? Both good points. Either or both could be right. Unfortunately, it has one minor drawback: it doesn't work :) Minor quibble. :) Dave Frank - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]