Return-Path: Delivered-To: apmail-struts-user-archive@www.apache.org Received: (qmail 61292 invoked from network); 4 Jul 2008 16:10:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Jul 2008 16:10:17 -0000 Received: (qmail 83713 invoked by uid 500); 4 Jul 2008 16:10:09 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 83690 invoked by uid 500); 4 Jul 2008 16:10:09 -0000 Mailing-List: contact user-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list user@struts.apache.org Received: (qmail 83679 invoked by uid 99); 4 Jul 2008 16:10:09 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Jul 2008 09:10:09 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: unknown ~allmx (athena.apache.org: encountered unrecognized mechanism during SPF processing of domain of ajaneesh@techmahindra.com) Received: from [203.143.177.249] (HELO mx14.techmahindra.com) (203.143.177.249) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Jul 2008 16:09:14 +0000 Received: from SINBNGEF002.TechMahindra.com ([192.168.5.37]) by mx14.techmahindra.com with InterScan Message Security Suite; Fri, 04 Jul 2008 21:36:49 +0530 Received: from SINBNGEX001.TechMahindra.com ([192.168.5.32]) by SINBNGEF002.TechMahindra.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 4 Jul 2008 21:38:41 +0530 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: RE: Type Casting through OGNL expressions. Date: Fri, 4 Jul 2008 21:38:42 +0530 Message-ID: In-Reply-To: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Type Casting through OGNL expressions. Thread-Index: Acjd6YdU0z6tmpHyT2e3dH5sF/i6igABlYPw References: From: "Ajaneesh Rajashekharaiah" To: "Struts Users Mailing List" X-OriginalArrivalTime: 04 Jul 2008 16:08:41.0937 (UTC) FILETIME=[3A424410:01C8DDF0] X-imss-version: 2.051 X-imss-result: Passed X-imss-scanInfo: M:P L:E SM:0 X-imss-tmaseResult: TT:0 TS:0.0000 TC:00 TRN:0 TV:5.5.1027(16012.000) X-imss-scores: Clean:99.90000 C:2 M:12 S:5 R:5 X-imss-settings: Baseline:2 C:1 M:1 S:1 R:1 (0.1500 0.1500) X-Virus-Checked: Checked by ClamAV on apache.org =20 Oops! Please ignore my earlier mail. It is working fine, I goofed up too early without looking at the error messages in detail!!=20 The logic that I mentioned below *is* indeed working as expected without me having to do any kind of casting or coersion. warm regards ajaneesh =20 -----Original Message----- From: Ajaneesh Rajashekharaiah [mailto:ajaneesh@TechMahindra.com]=20 Sent: Friday, July 04, 2008 8:51 PM To: user@struts.apache.org Subject: Type Casting through OGNL expressions. Hi, =20 I want to do the following, would like to understand if it is possible at all before proceeding any further. =20 basically i am working on generating dynamic screens based on Apache XmlBeans generated classes. =20 =20 While the following is not exactly what i am doing, it will help drive the idea home...=20 =20 i have a number of XSD files for which i generate XmlBeans binding files. All these classes are basically of type XmlObject. Understandably, each class would have diffferent setters and getters based on the XSD. In my action class, i want to declare a property with just the underlying interface (i.e. XmlObject). I am in a position to generate the dynamic screen based on the XML schema... but how do i populate those back to my XmlObject property? =20 for e.g. Action class has=20 =20 XmlObject xmlObject; =20 public XmlObject getXmlObject() { // snip... } public void setXmlObject(XmlObject xmlObject) { // snip... } =20 Suppose i am dealing with a XML with a structure such as =20 Let us assume my schema based XmlObject classes will have the same names as node names. So TopLevel *is a* XmlObject. =20 I want to set values from a HTML form using a OGNL expression.... =20 xmlObject.secondLevel.thirdLevel xmlObject.secondLevelMore.thirdLevel =20 Obviously, OGNL runtime cannot find setSecondLevel() on xmlObject unless it has a way of casting it to *TopLevel* =20 I have been researching a solution to this problem for a long time.,, I found something on TypeConvertors, havent tried it yet and honestly not able to tell if it is a solution to my problem :-) =20 =20 Can someone help me with this? Am i asking for too much or is this actually possible?? If it *is* possible, will it execute with reasonable performance? =20 Any response will be greatly appreciated so that i can atleast take an alternative approach immediately. =20 regards ajaneesh =20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D =20 Disclaimer: This message and the information contained herein is proprietary and confidential and subject to the Tech Mahindra policy statement, you may review the policy at http://www.techmahind ra.com/Disclaimer.html externally and http://tim.techmahind ra.com/Disclaimer.html internally within Tech Mahindra. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 Disclaimer: This message and the information contained herein is proprietary and= confidential and subject to the Tech Mahindra policy statement, you may= review the policy at http://www.techmahindra.co= m/Disclaimer.html externally and http://tim.techmahindra.co= m/Disclaimer.html internally within Tech Mahindra. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional commands, e-mail: user-help@struts.apache.org