How to use Foreach in Xquery

This is my Biz service Output:
<OutputParameters xmlns="http://=XYZ/pcbpel/adapter/db/WT/WT_IN_CS5_PKG/WT_IN_PROM_OSB/" xmlns:xsi="XYZ/XMLSchema-instance">
<P_REC_TYPE>
<P_REC_TYPE_ITEM>
<ATTRIBUTE_NAME>
Free MMS to newly activated subscribers Balance
</ATTRIBUTE_NAME>
<ATTRIBUTE_VALUE>5.000</ATTRIBUTE_VALUE>
</P_REC_TYPE_ITEM>
<P_REC_TYPE_ITEM>
<ATTRIBUTE_NAME>
Free MMS to newly activated subscribers Expiry Date
</ATTRIBUTE_NAME>
<ATTRIBUTE_VALUE>03-10-2012</ATTRIBUTE_VALUE>
</P_REC_TYPE_ITEM>
<P_REC_TYPE_ITEM>
<ATTRIBUTE_NAME>Monetary bonus for all contracts Balance</ATTRIBUTE_NAME>
<ATTRIBUTE_VALUE>1.118</ATTRIBUTE_VALUE>
</P_REC_TYPE_ITEM>
<P_REC_TYPE_ITEM>
<ATTRIBUTE_NAME>
Monetary bonus for all contracts Expiry Date
</ATTRIBUTE_NAME>
<ATTRIBUTE_VALUE>03-10-2012</ATTRIBUTE_VALUE>
</P_REC_TYPE_ITEM>
</P_REC_TYPE>
<P_ERR_MSG xsi:nil="true"/>
<P_ERR_STATUS xsi:nil="true"/>
</OutputParameters>
THis is my Current Xquery.Want to Iterate for P_REC_TYPE_ITEM above.
How to write the Xquery Source,plz suggest
(:: pragma bea:global-element-parameter parameter="$outputParameters1" element="ns1:OutputParameters" location="../../OraCRMServices_SB/XSD/WT_WT_IN_CS5_PKG_WT_IN_PROM_OSB.xsd" ::)
(:: pragma bea:global-element-return element="ns0:PrepaidPromotionDtlsResponse" location="../XSD/ShowPrepaidPromotionDtlsResponse.xsd" ::)
declare namespace ns1 = XYX/db/WT/WT_IN_CS5_PKG/WT_IN_PROM_OSB/";
declare namespace ns0 = "http:///xml/ShowPrepaidPromotionDtlsResponse";
declare namespace xf = "http:///ShowPrepaidDtls_SB/Transformations/InPromotionReadToSiebel/";
declare function xf:InPromotionReadToSiebel($outputParameters1 as element(ns1:OutputParameters))
as element(ns0:PrepaidPromotionDtlsResponse) {
<ns0:PrepaidPromotionDtlsResponse>
<ns0:ListOfPrepaidPromotions>
<ns0:PrepaidPromotionDtls Name = "{ data($outputParameters1/ns1:P_REC_TYPE/ns1:P_REC_TYPE_ITEM[1]/ns1:ATTRIBUTE_NAME) }"
Value = "{ data($outputParameters1/ns1:P_REC_TYPE/ns1:P_REC_TYPE_ITEM[1]/ns1:ATTRIBUTE_VALUE) }"/>
for $P_ERR_MSG in $outputParameters1/ns1:P_ERR_MSG
return
<ns0:ErrorMessage>{ data($P_ERR_MSG) }</ns0:ErrorMessage>
for $P_ERR_STATUS in $outputParameters1/ns1:P_ERR_STATUS
return
<ns0:ErrorCode>{ data($P_ERR_STATUS) }</ns0:ErrorCode>
</ns0:ListOfPrepaidPromotions>
</ns0:PrepaidPromotionDtlsResponse>
declare variable $outputParameters1 as element(ns1:OutputParameters) external;
xf:InPromotionReadToSiebel($outputParameters1)
Regards
Shona

http://www.java2s.com/Code/XML/XQuery/Nestedforloop.htm
http://www.w3schools.com/xquery/xquery_select.asp
Thanks,
Vijay

Similar Messages

  • How to use lookup in xquery(OSB)

    Hi
    In xquery , I have hardcoded the value and compare the hard coded value against input payload and fetch the corresponding value for hard coded value .
    In this way, I have hardcoded around 35 values in Xquery .
    But the client wants to use lookup or xref, some what like name value pair and not to use hard coding in xquery .
    Please let me know, how to implement in Xquery .

    Additionally you may refer this one also..
    http://guidoschmutz.wordpress.com/2009/12/25/implement-domain-value-maps-dvm-with-oracle-service-bus-osb-10r3/
    With custom Xpaths.
    http://beatechnologies.wordpress.com/tag/lookup-shared-dvm-in-osb/

  • How To Use OSB's XQuery to do this example?

    Hi All Friends:
    My WSDL Service document is :
    <taij:DownloadBusinessNO xmlns:taij="http://www.taiji.com.cn/">
    <!--Optional:-->
    <taij:condition>
    <!--Optional:-->
    <taij:StartDate>string</taij:StartDate>
    <!--Optional:-->
    <taij:EndDate>string</taij:EndDate>
    <!--Optional:-->
    <taij:DataType>string</taij:DataType>
    <!--Optional:-->
    <taij:PaperType>string</taij:PaperType>
    <!--Optional:-->
    <taij:AcceptOrg>string</taij:AcceptOrg>
    <!--Optional:-->
    <taij:IsContain>string</taij:IsContain>
    </taij:condition>
    </taij:DownloadBusinessNO>
    I want Use the JAVA Callout Function Return variable is StartDate (type String) to the XQuery Text
    so what should i write the XQuery Text?
    thanks all friend!

    I Use U function
    but in test Model,Have error message is : type error.
    In the Invocation Trace the code is :
    <taij:DownloadBusinessNO xmlns:taij="http://www.taiji.com.cn/">
    <!--Optional:-->
    <taij:condition>
    <!--Optional:-->
    <taij:StartDate>data($StartDate)</taij:StartDate>
    <!--Optional:-->
    <taij:EndDate>data($EndDate)</taij:EndDate>
    <!--Optional:-->
    <taij:DataType>2</taij:DataType>
    <!--Optional:-->
    <taij:PaperType></taij:PaperType>
    <!--Optional:-->
    <taij:AcceptOrg></taij:AcceptOrg>
    <!--Optional:-->
    <taij:IsContain></taij:IsContain>
    </taij:condition>
    </taij:DownloadBusinessNO>
    The System should not Translation the Code!
    I Don't Know why!

  • How to use loop controllers...

    hi i'm a new user for jmeter, now i want to test my site which has login details, i don know how to use foreach or other loop controllers to check my site.
    please anyone give me step by step procedure to test my site..
    regards,
    kumar

    Hmmm... using it is just like using a LOOP UNTIL statement in any programming language. You get at least one loop iteration, as opposed to a WHILE loop which may give you zero iterations.
    You simply insert a node of this type in the workflow, and magically there will be a loop inside which you can insert the steps you want to execute in the loop, and by double-clicking at the end node of the loop you can enter the condition for exiting.
    What exactly is it you are having trouble understanding about the use of it?

  • How to use XQuery Exist() Function on a SSIS XML file

    I have a Package Inventory table that has an XML Column named CurrentPackageXML. This XML column contains the SSIS Package XML. I need to use the XQuery Exist() function to determine if the
    errorRowDisposition="IgnoreFailure" exists.
    Below I have a basic SQL statement, but I have no idea how to write the Correct XQuery Expression. In my example below, I just tried to see if the DTS:Name Property existed, but that XQuery Expression is invalid also. It is not what I need in the end, but
    I was just trying to get anything to work.
    Below my SQL, I have included a snip-it of the SSIS package XML where I can find the errorRowDisposition. It is to the far right, so you may have to scroll to the right to see it. I bolded the text so it is easier to find.
    Finally, once I have got a SQL statement that checks if errorRowDisposition exists = False, I need to check for every occurrence of  errorRowDisposition exists = False.
    Would there be an easier way to do this by converting the XML to a varchar(max) then searching for all instances of  errorRowDisposition exists = False?
    SELECT CurrentPackageXML.exist('/DTS:Executable/DTS:Property[DTS:Name]')
    FROM [dbo].[PackageInventory]
    <inputs>
    <input id="43" name="OLE DB Destination Input" description="" hasSideEffects="true" dangling="false" errorOrTruncationOperation="Insert" errorRowDisposition="FailComponent" truncationRowDisposition="NotUsed">
    <inputColumns>
    <inputColumn id="113" name="" description="" lineageId="110" usageType="readOnly" errorOrTruncationOperation="" errorRowDisposition="NotUsed" truncationRowDisposition="NotUsed" externalMetadataColumnId="95" mappedColumnId="0" />
    <inputColumn id="172" name="" description="" lineageId="167" usageType="readOnly" errorOrTruncationOperation="" errorRowDisposition="NotUsed" truncationRowDisposition="NotUsed" externalMetadataColumnId="94" mappedColumnId="0" />
    </inputColumns>
    <externalMetadataColumns isUsed="True">
    <externalMetadataColumn id="50" name="DateCreated" description="" precision="0" scale="0" length="0" dataType="dbTimeStamp" codePage="0" mappedColumnId="0" />
    <externalMetadataColumn id="51" name="ProcessedCount" description="" precision="0" scale="0" length="0" dataType="i4" codePage="0" mappedColumnId="0" />
    <externalMetadataColumn id="52" name="ErrorCount" description="" precision="0" scale="0" length="0" dataType="i4" codePage="0" mappedColumnId="0" />
    <externalMetadataColumn id="90" name="AcknowledgementID" description="" precision="0" scale="0" length="0" dataType="i4" codePage="0" mappedColumnId="0" />
    <externalMetadataColumn id="91" name="Date" description="" precision="0" scale="0" length="0" dataType="dbTimeStamp" codePage="0" mappedColumnId="0" />
    <externalMetadataColumn id="92" name="FileSeqNumber" description="" precision="0" scale="0" length="0" dataType="i4" codePage="0" mappedColumnId="0" />
    <externalMetadataColumn id="93" name="FileType" description="" precision="0" scale="0" length="50" dataType="str" codePage="65001" mappedColumnId="0" />
    <externalMetadataColumn id="94" name="FileName" description="" precision="0" scale="0" length="50" dataType="str" codePage="65001" mappedColumnId="0" />
    <externalMetadataColumn id="95" name="DateReceived" description="" precision="0" scale="0" length="0" dataType="dbTimeStamp" codePage="0" mappedColumnId="0" />
    </externalMetadataColumns>
    </input>
    </inputs>
    Ryan P. Casey • <a href="http://www.R-P-C-Group.com">www.R-P-C-Group.com</a>

    Try this and let know what errors you get.  Note, this is a rough draft of one of a series of queries that I have started writing to document SSIS using SQL XQuery.  I read a file in my version (the one I tested) and get the results.
    -- Get the flat file destinations and their mappings
    with xmlnamespaces ('www.microsoft.com/SqlServer/Dts' as DTS
    ), compflow as (
    SELECT
    task.xml.value('@DTS:ObjectName', 'varchar(200)') as TaskName
    , task.xml.value('@DTS:ExecutableType', 'varchar(200)') as TaskType
    , task.xml.value('@DTS:refId', 'varchar(1000)') as TaskRefId
    --, task.xml.query ('.') as Node
    , component.xml.value ('@name', 'varchar(200)') as ComponentName
    , component.xml.value ('@refId', 'varchar(1000)') as ComponentRefId
    , component.xml.value ('@componentClassID', 'varchar(1000)') AS componentClassID
    --, component.xml.value ('count(inputs/input)', 'int') AS NumberOfInputs
    --, component.xml.value ('count(outputs/output)', 'int') AS NumberOfOutputs
    --, component.xml.value ('count(outputs/output[@isErrorOut="true"])', 'int') AS NumberOfErrorOutputs
    , component.xml.query('.') as ComponentNode
    FROM [dbo].[PackageInventory] pk
    cross apply pk.CurrentPackageXML.nodes('//DTS:Executable[@DTS:ExecutableType="Microsoft.Pipeline"]') as task (xml)
    OUTER APPLY task.xml.nodes('DTS:ObjectData/pipeline/components/component') as component (xml)
    WHERE [PackageInventory_ID] = 13
    , inputNode as (
    SELECT c.*
    , input.xml.value ('@name', 'varchar(200)') as InputName
    , input.xml.value ('@refId', 'varchar(1000)') as InputRefId
    , input.xml.value ('@hasSideEffects', 'varchar(1000)') as InputHasSideEffects
    , input.xml.value ('count(inputColumns/inputColumn)', 'int') AS NumberOfInputColumns
    , input.xml.value ('count(externalMetadataColumns/externalMetadataColumn)', 'int') AS NumberOfExternalMetadataColumns
    , input.xml.value ('@errorOrTruncationOperation', 'varchar(1000)') as InputerrorOrTruncationOperation
    , input.xml.value ('@errorRowDisposition', 'varchar(1000)') as InputerrorRowDisposition
    , col.xml.value ('@errorOrTruncationOperation', 'varchar(1000)') as InputColumnErrorOrTruncationOperation
    , col.xml.value ('@errorRowDisposition', 'varchar(1000)') as InputColumnErrorRowDisposition
    from compFlow c
    OUTER APPLY c.ComponentNode.nodes ('component/inputs/input') as input (xml)
    OUTER APPLY input.xml.nodes ('inputColumns/inputColumn') as col (xml)
    , inputAnal as (
    select
    TaskName
    ,TaskType
    ,TaskRefId
    ,ComponentName
    ,ComponentRefId
    ,componentClassID
    ,InputName
    ,InputRefId
    ,InputHasSideEffects
    , Null as IsError
    ,NumberOfInputColumns
    ,NumberOfExternalMetadataColumns
    ,InputerrorOrTruncationOperation
    ,InputerrorRowDisposition
    ,InputColumnErrorOrTruncationOperation
    ,InputColumnErrorRowDisposition
    , count(*) as NumRec
    from inputNode
    group by TaskName
    ,TaskType
    ,TaskRefId
    ,ComponentName
    ,ComponentRefId
    ,componentClassID
    ,InputName
    ,InputRefId
    ,InputHasSideEffects
    ,NumberOfInputColumns
    ,NumberOfExternalMetadataColumns
    ,InputerrorOrTruncationOperation
    ,InputerrorRowDisposition
    ,InputColumnErrorOrTruncationOperation
    ,InputColumnErrorRowDisposition
    , xoutputNode as (
    SELECT
    TaskName
    ,TaskType
    ,TaskRefId
    ,ComponentName
    ,ComponentRefId
    ,componentClassID
    , xout.xml.value ('@name', 'varchar(200)') as OutputName
    , xout.xml.value ('@refId', 'varchar(1000)') as OutputRefId
    , xout.xml.value ('@hasSideEffects', 'varchar(1000)') as OutputHasSideEffects
    , xout.xml.value ('@isErrorOut', 'varchar(1000)') as OutputIsError
    , xout.xml.value ('count(outputColumns/outputColumn)', 'int') AS NumberOfOutputColumns
    , xout.xml.value ('count(externalMetadataColumns/externalMetadataColumn)', 'int') AS NumberOfExternalMetadataColumns
    , xout.xml.value ('@errorOrTruncationOperation', 'varchar(1000)') as OutputerrorOrTruncationOperation
    , xout.xml.value ('@errorRowDisposition', 'varchar(1000)') as OutputerrorRowDisposition
    , col.xml.value ('@errorOrTruncationOperation', 'varchar(1000)') as OutputColumnErrorOrTruncationOperation
    , col.xml.value ('@errorRowDisposition', 'varchar(1000)') as OutputColumnErrorRowDisposition
    from compFlow c
    OUTER APPLY c.ComponentNode.nodes ('component/outputs/output') as xout (xml)
    OUTER APPLY xout.xml.nodes ('outputColumns/outputColumn') as col (xml)
    , outputAnal as(
    select
    TaskName
    ,TaskType
    ,TaskRefId
    ,ComponentName
    ,ComponentRefId
    ,componentClassID
    ,OutputName
    ,OutputRefId
    ,OutputHasSideEffects
    ,OutputIsError
    ,NumberOfOutputColumns
    ,NumberOfExternalMetadataColumns
    ,OutputerrorOrTruncationOperation
    ,OutputerrorRowDisposition
    ,OutputColumnErrorOrTruncationOperation
    ,OutputColumnErrorRowDisposition
    , count (*) as NumberOfRows
    from xoutputNode
    group by TaskName
    ,TaskType
    ,TaskRefId
    ,ComponentName
    ,ComponentRefId
    ,componentClassID
    ,OutputName
    ,OutputRefId
    ,OutputHasSideEffects
    ,OutputIsError
    ,NumberOfOutputColumns
    ,NumberOfExternalMetadataColumns
    ,OutputerrorOrTruncationOperation
    ,OutputerrorRowDisposition
    ,OutputColumnErrorOrTruncationOperation
    ,OutputColumnErrorRowDisposition
    select 'Input' as RowType, i.* from inputAnal i
    union all
    select 'Output' as RowType, o.* from outputAnal o
    Russel Loski, MCT, MCSE Data Platform/Business Intelligence. Twitter: @sqlmovers; blog: www.sqlmovers.com

  • How use forEach tag in xml tag library

    Hi,
    Can u please explain the procedure for using forEach tag for displaying the parsed xml tags?
    This is the code snippet
    <%@ page contentType="text/html" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
    <%@ taglib prefix="x" uri="http://java.sun.com/jstl/xml" %>
    <html>
    <body>
         <c:import url="\books.xml" var="url" />
         <x:parse xml="${url}" var="doc" />
              <x:forEach var="n" select="${doc}/books/book">
                   <x:out select="${n}/title"/>
                   <x:out select="${n}/author" />
         </x:forEach>
    </body>
    </html>
    but I got the fallowing error.
    java.lang.NoClassDefFoundError: org/saxpath/SAXPathException
         at org.apache.taglibs.standard.tag.common.xml.ForEachTag.prepare(ForEachTag.java:51)
         at javax.servlet.jsp.jstl.core.LoopTagSupport.doStartTag(LoopTagSupport.java:262)
         at jsp_servlet.__index._jspService(__index.java:197)
         at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:971)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:402)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6350)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3635)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2585)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)

    Just the same way as you do in JSP. Since JSF 1.2 you can use unified EL #{ } in c:forEach.
    You can also use Tomahawk's [t:dataList|http://myfaces.apache.org/tomahawk-project/tomahawk12/tagdoc/t_dataList.html] by the way. It is more efficient.

  • How to use the .aliases file to resolve a host's address?

    I am trying to setup a communication between a
    RT PXI system and a windows computer using network shared variables
    (shortened to "shared variables" in the further text). Both of the
    computers shall run compiled executables. The documentation concerning
    this topic has been spread over several places and this is what I ended
    up with.
    There are three different possible setups.
    1.
    I am using shared variable nodes both on the RT PXI and on the windows
    computer. The shared variables on the RT PXI are defined as "target
    absolute" and are residing in a library on the RT PXI. The shared
    variables on the windows computer will be set to "target relative" and
    are residing in a library on the windows computer. The variables used
    on the windows computer will be bound to the corresponding variables on
    the RT PXI. If I run the applications on computers different from the
    ones I used during development, I have only to change the .aliases file
    for the windows computer and set there the correct IP for the RT PXI.
    Additionally,
    I have to deploy the library both on the RT PXI and on the windows
    computer. This can be done from the windows computer, as the RT PXI
    target does not support the invoke node that has to be used for this
    purpose. Running the invoke node twice, once for localhost with the
    client library and once for the IP of the RT PXI system and the host
    library, I can deploy the libraries containing the shared variables
    programmatically. At this point, the magic of the .aliases file will
    fail and I have to find the IP of the RT PXI either by user input or
    maybe by running the RT ping controllers.vi. The "Target IPAddress"
    property of the "Deploy Library" invoke node makes sense in this
    combination as we can deploy libraries also to other computers or
    platforms.
    See attached Shared Setup 1.png.
    2. I am
    using shared variable nodes both on the RT PXI and on the
    windows computer. The shared variables on the RT PXI are defined as
    "target absolute" and are residing in a library on the RT PXI. The
    shared variables on the windows computer will also be set to "target
    absolute" and will be taken from the library that resides on the RT
    PXI. If I run the applications on
    computers different from the ones I used during development, I have
    only to change the .aliases file for the windows computer and set there
    the correct IP for the RT PXI.
    Additionally, I have to deploy
    the library only on the RT PXI. Again, this can done by a helper
    application on windows when the IP of the RT PXI is known or found by
    using RT ping controllers.vi.
    See attached Shared Setup 2.png.
    3. I am using
    shared variable nodes only on the RT PXI. The shared variables on the
    RT PXI are defined as
    "target absolute" and are residing in a library on the RT PXI. On the
    windows side, I use direct access to the PSP by using DataSocket
    functions. I can address a variable by using a DataSocket Open function
    and inputting psp://IP_or_Hostname_of_RT_PXI/LibraryName/VariableName.
    The magic of the .aliases files will fail already at this step. So I
    have to find the correct IP or hostname by user input, setting a DNS
    server to point to the correct IP or using the RT ping controllers.vi.
    As
    always, I have to deploy the library containing the shared variables to
    the RT PXI. Again, this can done by a helper application on windows
    when the IP of
    the RT PXI is known or found by using RT ping controllers.vi.
    As
    I can use this approach to setup an array of valid variable names and
    process the array by one single DataSocket read function inside of a
    for loop more conveniently than using a case selector inside of a
    for-loop and reading from different shared variable nodes, I prefer
    this approach over the others.
    See attached Shared Setup 3.png.
    For approaches 2 and 3, at least the deploy process can be run by an
    installer application independently of the main application as the
    library will remain on the PXI until I manually undeploy it, even if I
    reboot the PXI controller.
    My questions are:
    1. Did I describe the possible setups regarding the use of the shared variables correctly?
    2.
    Is there any means to get the IP address mapping from the .aliases
    file, needed for deploying and for approach 3, other than opening and
    reading the file itself?
    Attachments:
    Shared Setup 3.png ‏52 KB
    Shared Setup 1.png ‏42 KB
    Shared Setup 2.png ‏51 KB

    Thank you for the reply... I am using a hardcoded filename for the
    connection manager. How do I take the variable and change the filename in the connection manager?
    Also there will be multiple filename and I would like to take the latest file and not just check if the same file has been updated.
    UPDATE: I added the dynamic filename to the expression of the connection
    manager and it worked.
    You can use Foreach loop with file enumerator for that. It will iterate through files in folder and you can retrieve filenames using a variable created. Then pass variable as a parameter to script task.
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • How to use an BPM Instance Variable in JSP page

    Hi All,
    I am using the JSP Presentation, but i don't know how to use an Instance variable in JSP page, that instance already declared in the process. And Can u explain the syntax that to include the JS file into jsp page
    Regards
    Vasu.
    Edited by bpmvasu at 04/03/2007 10:43 PM

    Hi Mariano,
    I'm using JSP presentation too. In "Interactive Component Call" active i'm using "Use JSP presentation", but i only can define one instance variable, i need to add more instance variables. In "Advanced" option of this task, i have the argument mapping .. but i don't understand how to use it.
    I have a instance variable called "genders" of the type String[Int] (Associative Array) and i'm mapping this instance variable in "Arguments Show In" option of the advanced option of JSP presentation. In JSP presentation i have the code:
    <select <f:fieldName att="person.gender"/>>
                   <c:forEach var="gender" begin="0" items="${genders}" varStatus="status">
                        <c:choose>
                             <c:when test="${person.gender == gender}">
                                  <option value="<c:out value="${gender}"/>" selected="true"><c:out value="${gender}"/></option>
                             </c:when>
                             <c:otherwise>
                                  <option value="<c:out value="${gender}"/>"><c:out value="${gender}"/></option>
                             </c:otherwise>
                        </c:choose>
                   </c:forEach>
              </select>And in my screenflow i have the code:
    genders[0] = "Male"
    genders[1] = "Female"But when i run my application, i have the error: "The task could not be successfully executed. Reason: 'java.lang.ClassCastException: java.lang.Integer'."
    What's the problem?

  • How to use For-Each Structure with Multiple node XML structure

    Hi,
      How to use for-each (BPEL 2.0) construct for Multinode XML structure.
    Here is the easy case: I have list of suppliers specified by supplier
    <supplierList>
    <supplier>1</supplier>
    <supplier>2</supplier>
    <supplier>3</supplier>
    </supplierList>
    Now there is a web service http://hostname/getsupplierdetails/wsdl which accepts one supplier at a time.
    like
    <supplier>1</supplier>
    reponse object is
    <message> notfound/found </message>
    But how can I use for each of XML node to call this service and collect the result like
    <supplierList1>
         <Suppinfo>
            <supplier>1</supplier>
            <message> not found</message>
    </suppinfo>
        <suppinfo>
            <supplier>1</supplier>
            <message> not found</message>
    </suppinfo>
    </supplierlist1>
    Thanks

    For looping you use foreach loop and , loop for the number of occurences and when constructing response, adding a new element you have to use bpelx:append.  Good sample at Enterprise Integration: Oracle SOA Suite 11g: Populating a list or an array in BPEL without using XSLT.

  • How to use logic:present tag in struts el tag

    Hi
    I am trying to use struts el tags in the jsp page.I am struggling with the following exception: Cannot find bean: "result" in any scope.I couldn't understand why this error is coming even i had the property "result" in my ActionForm.
    ActionForm:
    package com.finocus.cam.struts.bean;
    import java.util.List;
    import javax.servlet.http.HttpServletRequest;
    import org.apache.struts.action.ActionError;
    import org.apache.struts.action.ActionErrors;
    import org.apache.struts.action.ActionMapping;
    import com.finocus.cam.common.ValidateFormat;
    public class DetailsForm extends org.apache.struts.action.ActionForm {
         private final static String LOG_TAG = DetailsForm.class.getName() + ".";
         private static final long serialVersionUID = 1L;
         // VARIABLES DECLARATION
         private String name = null;
         private String searchField = null;
         private String searchCriteria = null;
         private String phonenumber = "";
         private String email = "";
         private List results = null;
         private String adminUserName = "";
         private String adminUserEmail = "";
         public DetailsForm() {
         // GETTER AND SETTER METHODS
         public String getName() {
              return name;
         public void setName(String name) {
              this.name = name;
         public String getSearchCriteria() {
              return searchCriteria;
         public void setSearchCriteria(String searchCriteria) {
              this.searchCriteria = searchCriteria;
         public String getSearchField() {
              return searchField;
         public void setSearchField(String searchField) {
              this.searchField = searchField;
         public String getEmail() {
              return email;
         public void setEmail(String email) {
              this.email = email;
         public List getResults() {
              return results;
         public void setResults(List results) {
              this.results = results;
         public String getPhonenumber() {
              return phonenumber;
         public void setPhonenumber(String phonenumber) {
              this.phonenumber = phonenumber;
         public String getAdminUserEmail() {
              return adminUserEmail;
         public void setAdminUserEmail(String adminUserEmail) {
              this.adminUserEmail = adminUserEmail;
         public String getAdminUserName() {
              return adminUserName;
         public void setAdminUserName(String adminUserName) {
              this.adminUserName = adminUserName;
         // DUMPING THE VALUES IN THE CONSOLE
         public void dumpValues() {
              StringBuffer sb = new StringBuffer();
              sb.append("Name'");
              sb.append(name);
              sb.append("SearchField");
              sb.append(searchField);
              sb.append("searchCriteria");
              sb.append(searchCriteria);
              sb.append("'");
              sb.append(" ");
              System.out.println(sb.toString());
         // RESET() METHOD IS USED FOR STORE FORM'S CURRENT VARIABLES DECLARATION
         public void reset(ActionMapping actionMapping, HttpServletRequest request) {
              System.out.println("reset() method is called");
              this.email = null;
              this.searchCriteria = null;
              this.searchField = null;
              this.results = null;
         // VALIDATE() METHOD IS USED TO VALIDATE THE FORM DATA
         public ActionErrors validate(ActionMapping actionMapping,
                   HttpServletRequest request) {
              ActionErrors errors = new ActionErrors();
              System.out.println("Validate()is called");
              // Determine if name has been entered.
              if (getName() == null || getName().length() == 0
                        || getName().equals(" ")) {
                   errors.add("accountText", new ActionError("searchText.error"));
              } else if ((getSearchField().equals("name") == true)
                        && (ValidateFormat.isValidText(getName()) == false)) {
                   errors.add("validAccountName", new ActionError("validName.error"));
              if (getSearchField() == null || getSearchField().length() == 0) {
                   errors.add("accountSearchField", new ActionError(
                             "searchField.error"));
              } else if ((getSearchField().equals("email") == true)
                        && (ValidateFormat.isValidEmail(getName()) == false)) {
                   errors
                             .add("validAccountEmail", new ActionError(
                                       "validEmail.error"));
              } else if ((getSearchField().equals("phonenumber") == true)
                        && (ValidateFormat.isValidPhoneNoFormat(getName()) == false)) {
                   errors.add("validPhoneFormat", new ActionError(
                             "validPhoneFormat.error"));
              if ((getSearchField().equals("searchallfields"))
                        && ((ValidateFormat.isValidText(getName()) == false)
                                  && (ValidateFormat.isValidEmail(getName()) == false) && (ValidateFormat
                                  .isValidPhoneNoFormat(getName()) == false))) {
                   errors.add("validNameEmail",
                             new ActionError("validNameEmail.error"));
              return errors;
    Action class:
    package com.finocus.cam.struts.action;
    import java.util.ArrayList;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.http.HttpSession;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionForward;
    import org.apache.struts.action.ActionMapping;
    import com.finocus.cam.db.CAMDbAccess;
    import com.finocus.cam.struts.bean.DetailsForm;
    public class DetailsAction extends org.apache.struts.action.Action implements
              com.finocus.cam.common.CAMConstants {
         private final static String LOG_TAG = DetailsAction.class.getName() + ".";
         // Global Forwards
         public static final String GLOBAL_FORWARD_search = "login";
         // Local Forwards
         public static final String SUCCESS_search = "success";
         private boolean dumpRequestParams = true;
         public DetailsAction() {
         public ActionForward execute(ActionMapping mapping, ActionForm form,
                   HttpServletRequest request, HttpServletResponse response)
                   throws Exception {
              System.out.println("SearchAccount execute() is called");
              HttpSession session = request.getSession(true);
              ArrayList results = null;
              DetailsForm search = (DetailsForm) form;
              String name = search.getName();
              String searchField = search.getSearchField();
              String searchCriteria = search.getSearchCriteria();
              // Dumping the values of input patameters
              if (dumpRequestParams == true) {
                   request.setAttribute("SearchCriteria", searchCriteria);
                   request.setAttribute("SearchField", searchField);
                   request.setAttribute("Text", name);
                   search.dumpValues();
              // Perform search based on what criteria and search Field was entered.
              CAMDbAccess dbAccess = CAMDbAccess.getInstance();
              if (null != searchCriteria && searchField != null) {
                   System.out.println("Search Criteria =" + searchCriteria
                             + "Selected Option =" + searchField);
                   if (searchCriteria.equals(Search_Account) && searchField != null) {
                        results = dbAccess.searchByAccountInfo(name, searchCriteria,
                                  searchField);
                        System.out.println(" Search criteria :Exact Match was selected.<BR>");
              // Place search results in SearchForm for access by JSP.
              search.setResults(results);
              // Forward control to this Action's input page.
              return mapping.findForward(SUCCESS_search);
    My jsp page:
    <%@ taglib uri="/WEB-INF/tld/struts-bean" prefix="bean" %>
    <%@ taglib prefix="logic" uri="http://struts.apache.org/tags-logic-el" %>
    <%@ taglib uri="/WEB-INF/tld/struts-html" prefix="html" %>
    <html:html>
    <head>
    <title>Search Page</title>
    </head>
    <body colorants="LightGreen">
         <table width="100%" bgcolor="LightGreen">
              <tr>
                   <td align="left"><font color="brown"><h3><b>Search Info</b></h3></font><hr></td>
              </tr>
                   <tr>
              <td align="left"><h4><font color="brown"><b>Search Text:</b></font><%=request.getAttribute("Text")%></h4></td>
                   </tr><tr>
              <td align="left"><h4><font color="brown"><b>Search Field:</b></font><%=request.getAttribute("SearchField")%></h4></td>
              </tr><tr>
                   <td align="left"><h4><font color="brown"><b>Search Criteria:</b></font><%=request.getAttribute("SearchCriteria")%></h4></td>
                   </tr><tr>
                   <html:form action="/results.do">
                        <td><center><html:submit value="AllSearchOptions " /></center></td>
                        </html:form>
                   </tr>
              <tr>
                   <td align="left"><font color="brown"><hr><h2><b>Search Results</b></h2></font></td>
              </tr>
              <tr>
              <td>
              <table border="1" cellspacing="1" cellpadding="3" width="70%"
                   bgcolor="white">
                   <logic:present name="searchbyaccount" property="results">
                   Results exists
                        <c:if test="${size==0 }">
                   <center><font color="red"><b>No Results Found</b></font></center>
                   </c:if>
                   <br>
                        <c:if test="${size>0}">
                        Size is greater than ZERO
                             <table border="1" cellspacing="1" cellpadding="3" width="70%"
                                  bgcolor="white">
                                  <tr>
                                      <th>Customerid</th>
                                       <th>First Name</th>
                                       <th>Last Name</th>
                                       <th>Email</th>
                                       <th>phone Number</th>
                                       <th>Details</th>
                                  </tr>
                                       <c:forEach var="result" items="${results}">
                                        <c:out value="${result}"/>
                                       <tr>
                                            <td><bean:write name="result" property="customerid"></bean:write></td>
                                            <td><bean:write name="result"
                                                 property="accountAdminFirstName"></bean:write></td>
                                            <td><bean:write name="result"
                                                 property="accountAdminLastName" /></td>
                                            <td><bean:write name="result" property="accountability" /></td>
                                            <td><bean:write name="result" property="accountAdminPhone" /></td>
                                            <td><html:form action="/accountDetails.do">
                                                      <html:submit value="Details" />
                                            </html:form></td>
                                       </tr>
                                  </c:forEach>
                             </table>
                        </c:if>
              </logic:present>
              </table>
              </td>
              </tr>
         </table>
    </body>
    </html:html> Please refer me where i done a mistake.Thanks in Advance

    hi all,
    I am doing programs in sturts. My program
    My program purpose is to retrieve data from the
    database.My database is MySql. I know that we can
    write connection code in Action Class, it is ok for
    some less prog's if i want to use the sane connection
    code in more Action Classes it is vasting time and
    so.I don't think it's a good idea to put database code in Action classes. (That's one of the biggest drawbacks of Struts - it's completely tied to Actions, HTTP, and the Web.) Better to move that code into plain old Java objects and let the Actions call them.
    You'll be able to test them without the container or Struts, and you'll be able to reuse those objects in other, non-Web contexts.
    So i want to use <data-sources> tag that is available
    in struts-config.xml. I know that thre is tag withThis is the wrong place to configure a connection pool, too. Struts should have nothing to do with it. What if you change Web frameworks to WebWork or Spring? The connection pool should be configured in the container that hosts your app, not Struts.
    this name, but the problem is i don't know how to use
    this tag. If any budy know how to use this please
    tell me the syntax or any example.
    plese... reply soon..Don't do it. Think about doing it in your container, not Struts.
    %

  • How to use ugm:getGroupNamesForUser tag in jsp

    when I use the tag in jsp ,run in server,the console write"weblogic.servlet cannot be resolved or is not a field <p><ugm:getGroupNamesForUser username="weblogic" id="weblogic"/>"
    I don't how to use it,please tell me,thank you!

    I'm not sure why you are getting the console message, but here is how you might use the tag. This will simply print out the list of immediate groups (not parent groups) to which user "weblogic" is a member.
    &lt;%@ taglib uri="http://www.bea.com/servers/p13n/tags/userGroupManagement" prefix="ugm" %&gt;
    &lt;%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %&gt;
    &lt;ugm:getGroupNamesForUser username="weblogic" id="groupNames"/&gt;
    &lt;c:forEach items="${groupNames}" var="groupName"&gt;
    bq. &lt;c:out value="${groupName}"/&gt;
    &lt;/c:forEach&gt;

  • How to use List within javaFX(*.fx) script?

    How to use java.util.List within javaFX(*.fx) script?
    The following is my code in Java
    PDBFileReader pdbreader = new PDBFileReader();
              pdbreader.setPath("/Path/To/PDBFiles/");
              pdbreader.setParseSecStruc(true);// parse the secondary structure information from PDB file
              pdbreader.setAlignSeqRes(true);  // align SEQRES and ATOM records
              pdbreader.setAutoFetch(true);    // fetch PDB files from web if they can't be found locally
              try{
                   Structure struc = pdbreader.getStructureById(code);
                   System.out.println("The SEQRES and ATOM information is available via the chains:");
                   int modelnr = 0 ; // also is 0 if structure is an XRAY structure.
                   List<Chain> chains = struc.getChains(modelnr);
                   for (Chain cha:chains){
                        List<Group> agr = cha.getAtomGroups("amino");
                        List<Group> hgr = cha.getAtomGroups("hetatm");
                        List<Group> ngr = cha.getAtomGroups("nucleotide");
                        System.out.print("chain: >"+cha.getName()+"<");
                        System.out.print(" length SEQRES: " +cha.getLengthSeqRes());
                        System.out.print(" length ATOM: " +cha.getAtomLength());
                        System.out.print(" aminos: " +agr.size());
                        System.out.print(" hetatms: "+hgr.size());
                        System.out.println(" nucleotides: "+ngr.size()); 
              } catch (Exception e) {
                   e.printStackTrace();
              }The following is my code in JavaFX(getting errors)
    var loadbtn:SwingButton = SwingButton{
        text:"Load"
        action: function():Void{
            var pdbreader = new PDBFileReader();
            var structure = null;
            try{
                structure = pdbreader.getStructure(filepath.text);
                List<Chain> chains = structure.getChains(0);
                foreach (Chain cha in chains){
                        List < Group > agr = cha.getAtomGroups("amino");
                        List < Group > hgr = cha.getAtomGroups("hetatm");
                        List < Group > ngr = cha.getAtomGroups("nucleotide");
            } catch (e:IOException) {
                e.printStackTrace();
        };I'm using Netbeans 6.5 with JavaFX
    (PDBFileReader, Chain, Structure etc are classes from my own package, already added to the library folder under the project directory)
    Simply put, How to use List and Foreach in JavaFX?

    We can not use Java Generics syntax in JavaFX. But we can use Java Collection classes using the keyword 'as' for type-casting.
    e.g.
    import java.util.LinkedList;
    import java.util.List;
    import javafx.scene.shape.Rectangle;
    var outerlist : List = new LinkedList();
    var innerlist : List = new LinkedList();
    innerlist.add(Rectangle{
        width: 10 height:10});
    innerlist.add(Rectangle{
        width: 20 height:20});
    outerlist.add(innerlist);
    for (inner in outerlist) {
        var list : List = inner as List;
        for (element in list) {
            var rect : Rectangle = element as Rectangle;
            println("(width, height)=({rect.width}, {rect.height})");
    }

  • How to use XmlModify to sort the XML Data?

    Hello,
    I saw some examples explain how to use XmlModify in BDB XML package. I want to sort the XML data by several elements but my Java program could not work correctly.
    <CustomerData>
    <Transaction>
    <DLSFIELDS>
    <ADR_PST_CD>12345</ADR_PST_CD>
    <CLT_IRD_NBR>002</CLT_IRD_NBR>
    </DLSFIELDS>
    </Transaction>
    <Transaction>
    <DLSFIELDS>
    <ADR_PST_CD>12345</ADR_PST_CD>
    <CLT_IRD_NBR>102</CLT_IRD_NBR>
    </DLSFIELDS>
    </Transaction>
    // many nodes like transaction ...
    </CustomerData>
    My XQuery script was executed successfully in the shell. The script looks as follows:
    "for $i in collection('sample.dbxml')/CustomerData/Transaction order by xs:decimal($i//ADR_PST_CD), xs:decimal($i//CLT_IRD_NBR) return $i".
    The Java code :
    // create XmlManager
    XmlManager manager = // ...;
    // open XmlContainer
    XmlContainer container = // ...;
    XmlQueryContext context = manager.createQueryContext(XmlQueryContext.LiveValues, XmlQueryContext.Eager);
    XmlQueryExpression expression = manager.prepare("for $i in collection('sample.dbxml')/CustomerData/Transaction order by xs:decimal($i//ADR_PST_CD),xs:decimal($i//CLT_IRD_NBR) return $i", context);
    XmlModify modify = manager.createModify();
    XmlUpdateContext uc = manager.createUpdateContext();
    XmlDocument xmldoc = container.getDocument("sample.xml");
    XmlValue value = new XmlValue(xmldoc);
    long numMod = modify.execute(value, context, uc);
    System.out.println("Peformed " + numMod     + " modification operations");
    Could you point out the errors above or offer some suggestion?
    Thanks.

    I have other question of the sorting issue. Here are a large XML need to sort so I have to split it to multiple small XML files. After importing these files, I will use the XmlModify and XQuery to sort them. I'm not clear on the multiple XML files processing.
    1. Can the BDB XML ensure that all these XML files were sorted or how to update all documents with same logic.
    2. If I want export all these sorted documents, how can I ensure these files processed in sequence? Which document needs process first?
    The export method:
    public void export(String outputfile)throws Exception{
    final int BLOCK_SIZE = 5 * 1024 * 1024; // 5Mb
    try{
    File theFile = new File(outputfile);
    FileOutputStream fos = new FileOutputStream(theFile);
    byte[] buff= new byte[BLOCK_SIZE];                         
    XmlResults rs = container.getAllDocuments(new XmlDocumentConfig());               
    while(rs.hasNext()){
         XmlDocument xmlDoc = rs.next().asDocument();
         XmlInputStream inputStream = xmlDoc.getContentAsXmlInputStream();                    
         long read=0;
         while(true){
         read = inputStream.readBytes(buff, BLOCK_SIZE);
    fos.write(buff,0,(int)read);                    
         if(read < BLOCK_SIZE) break;
    inputStream.delete();
    xmlDoc.delete();
    rs.delete();
    //MUST CLOSE!
    fos.close();               
    catch(Exception e){
    System.err.println("Error exporting file from container " + container);
    System.err.println(" Message: " + e.getMessage());
    Thanks.

  • How to use oracle TRIM functionality in XML messages

    When i am selecting data from XML message as per below query, it is returing values correctly.
    SELECT extractValue(x.column_value, '/DETAILS/EMPID') as emp_id,
    extractValue(x.column_value, '/DETAILS/NAME') as emp_name,
    extractValue(x.column_value, '/DETAILS/SALARY') as emp_sal
    FROM TABLE(
    XMLSequence(
    Extract( xmltype('<DETAILS><EMPID>2482</EMPID><NAME>SMITH</NAME><SALARY>4854</SALARY><LOC>CHENNAI</LOC></DETAILS>'),'/DETAILS'))) x;
    But when i am selecting data by using below query some additional spaces also coming with column values
    SELECT extractValue(x.column_value, '/DETAILS/EMPID') as emp_id,
    extractValue(x.column_value, '/DETAILS/NAME') as emp_name,
    extractValue(x.column_value, '/DETAILS/SALARY') as emp_sal
    FROM TABLE(
    XMLSequence(
    Extract( xmltype('<DETAILS>
                   <EMPID>
                             2482
                             </EMPID>
                             <NAME>
                             SMITH
                             </NAME>
                             <SALARY>
                             4854
                             </SALARY>
                             <LOC>
                             CHENNAI
                             </LOC>
                             </DETAILS>'),'/DETAILS'))) x;
    Please suggest how to remove additional spaces by using second query.
    Thanks
    Vikrant Jain.

    It appears that the ability to use XPath functions in the PATH expression doesn't work prior to 11g :
    Connecté à :
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> var xmldoc varchar2(4000)
    SQL> begin :xmldoc := '<DETAILS>
      2  <EMPID>
      3  2482
      4  </EMPID>
      5  <NAME>
      6  SMITH
      7  </NAME>
      8  <SALARY>
      9  4854
    10  </SALARY>
    11  <LOC>
    12  CHENNAI
    13  </LOC>
    14  </DETAILS>';
    15  end;
    16  /
    Procédure PL/SQL terminée avec succès.
    SQL> SELECT emp_id, emp_name, emp_sal
      2    FROM XMLTable('/DETAILS'
      3                  PASSING XMLTYPE(:xmldoc)
      4                  COLUMNS
      5                  emp_id     NUMBER        PATH 'normalize-space(EMPID)',
      6                  emp_name   VARCHAR2(20)  PATH 'NAME',
      7                  emp_sal    VARCHAR2(20)  PATH 'SALARY');
    SELECT emp_id, emp_name, emp_sal
    ERREUR à la ligne 1 :
    ORA-31011: Echec d'analyse XML
    ORA-19202: Une erreur s'est produite lors du traitement la fonction XML (
    LPX-00601: Invalid token in: '/*/normalize-space(EMPID)')Using it in XQuery will work though :
    SQL> SELECT *
      2  FROM XMLTable(
      3   'for $i in /DETAILS
      4    return element r
      5    {
      6     for $j in $i/*
      7     return element {local-name($j)} {normalize-space($j)}
      8    }'
      9   PASSING XMLTYPE(:xmldoc)
    10   COLUMNS
    11     emp_id     NUMBER        PATH 'EMPID',
    12     emp_name   VARCHAR2(20)  PATH 'NAME',
    13     emp_sal    NUMBER        PATH 'SALARY'
    14  );
        EMP_ID EMP_NAME                EMP_SAL
          2482 SMITH                      4854

  • How to use taglibs in JSP for Database access

    Hi
    Could any one please tell me how to use taglibs in JSP for Database access
    with regrds
    Jojo

    This is a sample how to connect to a MySQL database with JSTL 1.0:
    <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
    <%@ taglib uri="http://java.sun.com/jstl/sql" prefix="sql" %>
    <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>JSTL MySQL</title>
    <link href="styles.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <c:catch var="e">
    <sql:setDataSource var="datasource" url="jdbc:mysql://Your_Server_Name_Here/You_Schema_Here"
                           user="Your_Username_Here" password="Your_Password_Here"
                           driver="com.mysql.jdbc.Driver"/>
    <c:out value="datasource= ${datasource},  Class = ${driver.class}"/>
    <br />
    <br />
    <sql:query var="deejays" dataSource="${datasource}">SELECT * FROM Your_Table_Name_Here</sql:query>
    <table>
    <%-- Get the column names for the header of the table --%>
    <c:forEach var="columnName" items="${deejays.columnNames}"><th><c:out value="${columnName}"/></th></c:forEach>
    <tbody>
    <%-- Get the value of each column while iterating over rows --%>
    <c:forEach var="row" items="${deejays.rows}">
      <tr><c:forEach var="column" items="${row}">
            <td><c:out value="${column.value}"/></td>
          </c:forEach>
      </tr>
    </c:forEach>
    </tbody>
    </table>
    </c:catch>
    <br />
    <br />
    <c:if test="${e!=null}"><span class="error">Error</span>�
      <c:out value="${e}" />
    </c:if>
    </body>
    </html>And this thread might help you:
    http://forum.java.sun.com/thread.jspa?threadID=639471&tstart=44

Maybe you are looking for