Help needed in understanding the Java code.

Hi All,
I have recently started learning the Java language. I came across this example and had a problem in understanding the output of the program. I could follow that if the continue statement is present in the below program the output is "Found 9 p's in the string" . But if the continue statement is removed I could not understand why the output would be "Found 35 p's in the string" .Is it because of the spaces and characters other than p... (eter ier icked a eck of ickled eers)
Example-----------------------
The continue statement skips the current iteration of a for, while , or do-while loop. The unlabeled form skips to the end of the innermost loop's body and evaluates the boolean expression that controls the loop. The following program, ContinueDemo , steps through a String, counting the occurences of the letter "p". If the current character is not a p, the continue statement skips the rest of the loop and proceeds to the next character. If it is a "p", the program increments the letter count.
class ContinueDemo {
public static void main(String[] args) {
String searchMe
= "peter piper picked a " +
"peck of pickled peppers";
int max = searchMe.length();
int numPs = 0;
for (int i = 0; i < max; i++) {
// interested only in p's
if (searchMe.charAt(i) != 'p')
continue;
// process p's
numPs++;
System.out.println("Found " +
numPs + " p's in the string.");
Here is the output of this program:
Found 9 p's in the string.
To see this effect more clearly, try removing the continue statement and recompiling. When you run the program again, the count will be wrong, saying that it found 35 p's instead of 9.

The answer is already in your example - "The unlabeled form skips to the end of the innermost loop's body and evaluates the boolean expression that controls the loop."
It unloads the current loop iteration when condition is matching. Loop is again starting from boolean expression inside loop declaration.
Java Programming - java forum

Similar Messages

  • HELP NEED FOR INVOKING THE JAVA CODE INSIDE JSP

    Hello,
    any one knows how to Write a java code inside the .jsp files... please if any one knows it please ....help me .....

    hi .
    Use scriptlets , for example :
    <html>
    <%
    int x;
    for(x=1;x<=5;x++)
    out.println(x);
    %>
    </html>

  • Help needed in understanding the code.

    Hi All,
    I am just trying to understand the Java code in one Self Serice page. However, I am having tough in understanding the CO code. In the prosessRequest class, I have the below code.
    oapagecontext.putTransactionValue("AddAssignmentInsertRowFlag", "N");
    oaapplicationmodule.getTransaction().commit();
    As soon as, oaapplicationmodule.getTransaction().commit();
    gets executed, its calling some other class. Not sure what is being called, but i can see the log messages that its executing some other class which actually does the calls to DB APIs and inserting data into main tables.
    Can you please explain me what is being called to make DB API calls. I would greatly appreciate your help.
    Thanks in Advance!
    - Rani
    ****************************Here is the full code of class for your reference****************************
    public void processFormRequest(OAPageContext oapagecontext, OAWebBean oawebbean)
    if("SelectedResourceLink".equals(oapagecontext.getParameter("event")))
    Debug.log(oapagecontext, this, "SelectedResourceLink has been pressed", 3);
    oapagecontext.redirectImmediately("OA.jsp?akRegionCode=PA_SELECTED_RESOURCES_LAYOUT&akRegionApplicationId=275", true, "RP");
    String s = (String)oapagecontext.getTransactionValue("AssignmentType");
    super.processFormRequest(oapagecontext, oawebbean);
    Debug.log(oapagecontext, this, "in processFormRequest()", 3);
    OAApplicationModule oaapplicationmodule = oapagecontext.getRootApplicationModule();
    if(!"Y".equals(oapagecontext.getParameter("paMass")))
    String s1 = oapagecontext.getParameter("event");
    if("lovUpdate".equals(s1))
    Debug.log(oapagecontext, this, "*** User Selected a value from LOV ***", 3);
    String s3 = oapagecontext.getParameter("source");
    Debug.log(oapagecontext, this, "*** lovInputSourceId = " + s3 + " ***", 3);
    if("ProjectNumber".equals(s3) && "Project".equals(s))
    Hashtable hashtable = oapagecontext.getLovResultsFromSession(s3);
    String s10 = (String)hashtable.get("ProjectId");
    Debug.log(oapagecontext, this, "*** ProjectId ***" + s10, 3);
    oapagecontext.putTransactionValue("paProjectId", s10);
    if("Project".equals(s))
    Debug.log(oapagecontext, this, "*** Setting default value for Delivery assignment ***", 3);
    oaapplicationmodule.invokeMethod("defaultProjectAttrs");
    if("RoleName".equals(s3))
    Hashtable hashtable1 = oapagecontext.getLovResultsFromSession(s3);
    Debug.log(oapagecontext, this, "*** RoleName Hashtable Contents ***" + hashtable1.toString(), 3);
    String s11 = (String)hashtable1.get("RoleId");
    Debug.log(oapagecontext, this, "*** RoleId ***" + s11, 3);
    Debug.log(oapagecontext, this, "*** AssignmentType = " + s + "***", 3);
    if("Open".equals(s))
    Debug.log(oapagecontext, this, "*** Calling defaultJobAttrs for Open Assignment***", 3);
    Serializable aserializable[] = {
    s11
    oaapplicationmodule.invokeMethod("defaultJobAttrs", aserializable);
    if("Template".equals(s) || "Open".equals(s))
    Debug.log(oapagecontext, this, "*** Defaulting Competencies ***" + s11, 3);
    OAViewObject oaviewobject = (OAViewObject)oapagecontext.getApplicationModule(oawebbean).findViewObject("RoleCompetenciesVO");
    oaviewobject.setMaxFetchSize(-1);
    oaviewobject.setWhereClauseParam(0, s11);
    oaviewobject.executeQuery();
    Debug.log(oapagecontext, this, "*** End LOV event ***", 3);
    String s4 = "";
    String s8 = "";
    OASubTabLayoutBean oasubtablayoutbean1 = (OASubTabLayoutBean)oawebbean.findIndexedChildRecursive("AddAssignmentSubTabLayout");
    if("Project".equals(s) && !oasubtablayoutbean1.isSubTabClicked(oapagecontext))
    OAViewObject oaviewobject1 = (OAViewObject)oapagecontext.getApplicationModule(oawebbean).findViewObject("AddNewAssignmentVO");
    s4 = (String)oaviewobject1.first().getAttribute("ProjectId");
    s8 = (String)oaviewobject1.first().getAttribute("ProjectNumber");
    Debug.log(oapagecontext, this, "*** lProjectId = " + s4, 3);
    Debug.log(oapagecontext, this, "*** lProjectNumber = " + s8, 3);
    if("Project".equals(s) && !oasubtablayoutbean1.isSubTabClicked(oapagecontext) && !StringUtils.isNullOrEmpty(s8))
    Debug.log(oapagecontext, this, "Delivery Assignment, Project Number is there but no Project Id", 3);
    if(s4 == null || s4.equals(""))
    ViewObject viewobject = oapagecontext.getApplicationModule(oawebbean).findViewObject("ObtainProjectId");
    if(viewobject == null)
    String s14 = "SELECT project_id FROM PA_PROJECTS_ALL WHERE segment1 =:1";
    viewobject = oaapplicationmodule.createViewObjectFromQueryStmt("ObtainProjectId", s14);
    viewobject.setWhereClauseParam(0, s8);
    viewobject.executeQuery();
    int j = viewobject.getRowCount();
    if(j != 1)
    Debug.log(oapagecontext, this, "Error : Project Number is Invalid or not unique", 3);
    OAException oaexception4 = null;
    oaexception4 = new OAException("PA", "PA_PROJECT_NUMBER_INVALID");
    oaexception4.setApplicationModule(oaapplicationmodule);
    throw oaexception4;
    oracle.jbo.Row row = viewobject.last();
    if(row != null)
    Object obj2 = row.getAttribute(0);
    if(obj2 != null)
    s4 = obj2.toString();
    if(s4 != null)
    oapagecontext.putTransactionValue("paProjectId", s4);
    if(oaapplicationmodule.findViewObject("AddNewAssignmentsVO") != null)
    oaapplicationmodule.findViewObject("AddNewAssignmentVO").first().setAttribute("ProjectId", s4);
    } else
    Debug.log(oapagecontext, this, "Error : No rows returned in Project Number query", 3);
    OAException oaexception5 = null;
    oaexception5 = new OAException("PA", "PA_PROJECT_NUMBER_INVALID");
    oaexception5.setApplicationModule(oaapplicationmodule);
    throw oaexception5;
    String s12 = "F";
    if(s4 != null && !s4.equals(""))
    String s13 = Security.checkUserPrivilege("PA_ASN_CR_AND_DL", "PA_PROJECTS", s4, oapagecontext, false);
    if("F".equals(s13))
    OAException oaexception3 = null;
    oaexception3 = new OAException("PA", "PA_ADD_DELIVERY_ASMT_SECURITY");
    oaexception3.setApplicationModule(oaapplicationmodule);
    Debug.log(oapagecontext, this, "ERROR:" + oaexception3.getMessage(), 3);
    throw oaexception3;
    OAViewObject oaviewobject2 = (OAViewObject)oapagecontext.getApplicationModule(oawebbean).findViewObject("AddNewAssignmentVO");
    Object obj = oaviewobject2.first().getAttribute("BillRateOverride");
    Object obj1 = oaviewobject2.first().getAttribute("BillRateCurrOverride");
    Object obj3 = oaviewobject2.first().getAttribute("MarkupPercentOverride");
    Object obj4 = oaviewobject2.first().getAttribute("DiscountPercentOverride");
    Object obj5 = oaviewobject2.first().getAttribute("TpRateOverride");
    Object obj6 = oaviewobject2.first().getAttribute("TpCurrencyOverride");
    Object obj7 = oaviewobject2.first().getAttribute("TpCalcBaseCodeOverride");
    Object obj8 = oaviewobject2.first().getAttribute("TpPercentAppliedOverride");
    Object obj9 = null;
    Object obj10 = null;
    Debug.log(oapagecontext, this, "in AddAssignmentsTopCO processFcstInfoRg(): getting the implementation options", 3);
    Object obj11 = oaviewobject2.first().getAttribute("BrRateDiscReasonCode");
    Object obj12 = oapagecontext.getTransactionValue("rateDiscReasonFlag");
    Object obj13 = oapagecontext.getTransactionValue("brOverrideFlag");
    Object obj14 = oapagecontext.getTransactionValue("brDiscountOverrideFlag");
    String s22 = oapagecontext.getParameter("BillRateRadioGroup");
    if("BRCurrencyRadioButton".equals(s22))
    Debug.log(oapagecontext, this, "BRCurrencyRadioButton chosen", 3);
    if(obj == null || obj1 == null)
    Debug.log(oapagecontext, this, "error", 3);
    OAException oaexception6 = new OAException("PA", "PA_CURR_BILL_RATE_REQUIRED");
    oaexception6.setApplicationModule(oaapplicationmodule);
    throw oaexception6;
    } else
    if("BRMarkupRadioButton".equals(s22))
    Debug.log(oapagecontext, this, "BRMarkup%RadioButton chosen", 3);
    if(obj3 == null)
    Debug.log(oapagecontext, this, "error", 3);
    OAException oaexception7 = new OAException("PA", "PA_MARKUP_PERCENT_REQUIRED");
    oaexception7.setApplicationModule(oaapplicationmodule);
    throw oaexception7;
    } else
    if("BRDiscountRadioButton".equals(s22))
    Debug.log(oapagecontext, this, "BRDiscount%RadioButton chosen", 3);
    if(obj4 == null)
    Debug.log(oapagecontext, this, "error", 3);
    OAException oaexception8 = new OAException(oapagecontext.getMessage("PA", "PA_DISCOUNT_PERCENT_REQUIRED", null));
    oaexception8.setApplicationModule(oaapplicationmodule);
    throw oaexception8;
    if("Y".equals(oapagecontext.getTransactionValue("paMass")) || "Admin".equals(s) || "Template".equals(s))
    Debug.log(oapagecontext, this, "Need not have this check for team templates ", 3);
    } else
    if(obj13 != null && obj13.equals("Y") && obj12 != null && obj12.equals("Y") && "BRCurrencyRadioButton".equals(s22) && StringUtils.isNullOrEmpty((String)obj11))
    Debug.log(oapagecontext, this, "error 1", 3);
    OAException oaexception9 = new OAException("PA", "PA_RATE_DISC_REASON_REQUIRED");
    oaexception9.setApplicationModule(oaapplicationmodule);
    throw oaexception9;
    if(obj14 != null && obj14.equals("Y") && obj12 != null && obj12.equals("Y") && "BRDiscountRadioButton".equals(s22) && StringUtils.isNullOrEmpty((String)obj11))
    Debug.log(oapagecontext, this, "error 2", 3);
    OAException oaexception10 = new OAException("PA", "PA_RATE_DISC_REASON_REQUIRED");
    oaexception10.setApplicationModule(oaapplicationmodule);
    throw oaexception10;
    Debug.log(oapagecontext, this, "*** Selected transfer price radio shr = " + s22, 3);
    oapagecontext.putTransactionValue("BROGroupSelected", s22);
    Debug.log(oapagecontext, this, "*** 1 :Selected bill rate radio = " + s22, 3);
    if(s22 != null)
    oapagecontext.putSessionValue("BROGroupSelected", s22);
    s22 = oapagecontext.getParameter("TransferPriceRadioGroup");
    Debug.log(oapagecontext, this, "*** Selected transfer price radio = " + s22, 3);
    if("TPCurrencyRadioButton".equals(s22))
    Debug.log(oapagecontext, this, "***TPCurrencyRadioButton chosen", 3);
    if(obj5 == null || obj6 == null)
    Debug.log(oapagecontext, this, "error", 3);
    OAException oaexception11 = new OAException("PA", "PA_CURR_RATE_REQUIRED");
    oaexception11.setApplicationModule(oaapplicationmodule);
    throw oaexception11;
    } else
    if("TPBasisRadioButton".equals(s22))
    Debug.log(oapagecontext, this, "***TPBasisRadioButton chosen", 3);
    if(obj7 == null || obj8 == null)
    Debug.log(oapagecontext, this, "error", 3);
    OAException oaexception12 = new OAException("PA", "PA_BASIS_APPLY_PERCENT_REQD");
    oaexception12.setApplicationModule(oaapplicationmodule);
    throw oaexception12;
    oapagecontext.putTransactionValue("TPORadioGroupSelected", s22);
    if(oaapplicationmodule.findViewObject("AddNewAssignmentVO").first().getAttribute("RoleId") != null)
    Debug.log(oapagecontext, this, "*** Role Id is + " + oaapplicationmodule.findViewObject("AddNewAssignmentVO").first().getAttribute("RoleId"), 3);
    if(oapagecontext.getParameter("SearchCompetencies") != null)
    String s2 = "OA.jsp?akRegionCode=PA_COMP_SEARCH_LAYOUT&akRegionApplicationId=275&paCallingPage=AddAssignment";
    oapagecontext.redirectImmediately(s2, true, "RP");
    OASubTabLayoutBean oasubtablayoutbean = (OASubTabLayoutBean)oawebbean.findIndexedChildRecursive("AddAssignmentSubTabLayout");
    if(s.equals("Project") && oasubtablayoutbean.isSubTabClicked(oapagecontext) && !StringUtils.isNullOrEmpty((String)oapagecontext.getTransactionValue("paProjectId")))
    String s5 = "PA_ASN_FCST_INFO_ED";
    String s9 = "F";
    s9 = Security.checkUserPrivilege(s5, "PA_PROJECTS", (String)oapagecontext.getTransactionValue("paProjectId"), oapagecontext, false);
    if(s9.equals("F"))
    Debug.log(oapagecontext, this, "Error : PA_ASN_FCST_INFO_ED previelge not found", 3);
    OAException oaexception2 = null;
    oaexception2 = new OAException("PA", "PA_NO_SEC_FIN_INFO");
    oaexception2.setApplicationModule(oaapplicationmodule);
    throw oaexception2;
    if(oapagecontext.getParameter("GoBtn") != null)
    if("Y".equals(oapagecontext.getTransactionValue("paMass")) && "0".equals(oapagecontext.getTransactionValue("paNumSelectedResources")))
    OAException oaexception = new OAException("PA", "PA_NO_RESOURCE_SELECTED");
    oaexception.setApplicationModule(oapagecontext.getRootApplicationModule());
    Debug.log(oapagecontext, this, "ERROR:" + oaexception.getMessage(), 3);
    throw oaexception;
    String s6 = "T";
    if(s.equals("Admin") && "Y".equals(oapagecontext.getTransactionValue("paMass")) && "1".equals(oapagecontext.getTransactionValue("paNumSelectedResources")))
    Debug.log(oapagecontext, this, "resource id[19] is " + (String)oapagecontext.getTransactionValue("paResourceId"), 3);
    if(oapagecontext.getTransactionValue("AdminSecurityChecked") == null)
    String s7 = Security.checkPrivilegeOnResource("-999", (String)oapagecontext.getTransactionValue("paResourceId"), SessionUtils.getResourceName((String)oapagecontext.getTransactionValue("paResourceId"), oapagecontext), "PA_ADM_ASN_CR_AND_DL", null, oapagecontext, false);
    if("F".equals(s7))
    OAException oaexception1 = new OAException("PA", "PA_ADD_ADMIN_ASMT_SECURITY");
    oaexception1.setApplicationModule(oapagecontext.getRootApplicationModule());
    Debug.log(oapagecontext, this, "ERROR:" + oaexception1.getMessage(), 3);
    throw oaexception1;
    if("SUBMIT_APPRVL".equals(oapagecontext.getParameter("AddAsgmtApplyAction")))
    oapagecontext.putTransactionValue("Save", "N");
    else
    oapagecontext.putTransactionValue("Save", "Y");
    String as[] = oaapplicationmodule.getApplicationModuleNames();
    String as1[] = oaapplicationmodule.getViewObjectNames();
    Debug.log(oapagecontext, this, "no of app module: " + as.length, 3);
    Debug.log(oapagecontext, this, "no of view: " + as1.length, 3);
    for(int i = 0; i < as.length; i++)
    Debug.log(oapagecontext, this, "app module: " + as, 3);
    for(int k = 0; k < as1.length; k++)
    Debug.log(oapagecontext, this, "app module: " + as1[k], 3);
    Debug.log(oapagecontext, this, "*** assignmentType = " + s, 3);
    Debug.log(oapagecontext, this, "*** projectId = " + oapagecontext.getTransactionValue("paProjectId"), 3);
    if("Project".equals(s) && !StringUtils.isNullOrEmpty((String)oapagecontext.getTransactionValue("paProjectId")) && !"Y".equals(oapagecontext.getParameter("paMass")))
    Debug.log(oapagecontext, this, "*** Setting default staffing owner for add delivery assignment -- projectId = " + oapagecontext.getTransactionValue("paProjectId"), 3);
    oaapplicationmodule.invokeMethod("setDefaultStaffingOwner");
    OAViewObject oaviewobject3 = (OAViewObject)oaapplicationmodule.findViewObject("RoleCompetenciesVO");
    oaviewobject3.setMaxFetchSize(0);
    oaviewobject3.setRangeSize(-1);
    oracle.jbo.Row arow[] = oaviewobject3.getAllRowsInRange();
    for(int l = 0; l < arow.length; l++)
    RoleCompetenciesVORowImpl rolecompetenciesvorowimpl = (RoleCompetenciesVORowImpl)oaviewobject3.getRowAtRangeIndex(l);
    Debug.log(oapagecontext, this, "roleCompetenciesVORowImpl" + rolecompetenciesvorowimpl, 3);
    rolecompetenciesvorowimpl.setPlsqlState((byte)0);
    oapagecontext.putTransactionValue("AddAssignmentInsertRowFlag", "N");
    oaapplicationmodule.getTransaction().commit();
    if("Y".equals(oapagecontext.getTransactionValue("paMass")) && !"1".equals(oapagecontext.getTransactionValue("paNumSelectedResources")))
    if(!"SUBMIT_APPRVL".equals(oapagecontext.getParameter("AddAsgmtApplyAction")))
    Debug.log(oapagecontext, this, "Save, Mass, NumSelectedResources>1", 3);
    Debug.log(oapagecontext, this, "work flow has been launched", 3);
    OADialogPage oadialogpage = new OADialogPage((byte)3, new OAException("PA", "PA_MASS_ASSIGNMENT_CONFIRM"), null, "OA.jsp?akRegionCode=PA_RESOURCE_LIST_LAYOUT&akRegionApplicationId=275&addBreadCrumb=N", null);
    oadialogpage.setRetainAMValue(false);
    oapagecontext.redirectToDialogPage(oadialogpage);
    return;
    Debug.log(oapagecontext, this, "SaveAndSubmit, Mass, NumSelectedResources>1", 3);
    putParametersOnSession(oapagecontext);
    int i1 = 0;
    int j1 = 0;
    String s21 = "SelectedResourceId";
    int l1 = Integer.parseInt(oapagecontext.getTransactionValue("paNumSelectedResources").toString());
    Debug.log(oapagecontext, this, "size of resourceArray = " + l1, 3);
    String as2[] = new String[l1];
    for(; !"END".equals(oapagecontext.getTransactionValue(s21.concat(Integer.toString(i1)))); i1++)
    if(oapagecontext.getTransactionValue(s21.concat(Integer.toString(i1))) != null)
    Debug.log(oapagecontext, this, "resource id = " + oapagecontext.getTransactionValue(s21.concat(Integer.toString(i1))).toString(), 3);
    as2[j1] = oapagecontext.getTransactionValue(s21.concat(Integer.toString(i1))).toString();
    j1++;
    SessionUtils.putMultipleParameters("paResourceId", as2, oapagecontext);
    Debug.log(oapagecontext, this, "redirect to Mass Submit for Approval page", 3);
    oapagecontext.redirectImmediately("OA.jsp?akRegionCode=PA_MASS_SUBMIT_LAYOUT&akRegionApplicationId=275&paCallingPage=MassAdd&paProjectId=" + oapagecontext.getTransactionValue("p_project_id"), false, "RP");
    return;
    if("RETURN_TO".equals(oapagecontext.getParameter("AddAsgmtApplyAction")))
    Debug.log(oapagecontext, this, "Return to Option Selected ", 3);
    String s15 = (String)oapagecontext.getTransactionValue("PrevPageUrl");
    int k1 = s15.indexOf("OA.jsp?");
    s15 = s15.substring(k1);
    Debug.write(oapagecontext, this, "*** RETURN_TO URL: " + s15, 3);
    oapagecontext.redirectImmediately(s15);
    } else
    if("ADD_ANOTHER".equals(oapagecontext.getParameter("AddAsgmtApplyAction")))
    Debug.log(oapagecontext, this, "Add Another Option Selected", 3);
    oaapplicationmodule.invokeMethod("resetAddNewAssignment");
    if(oaapplicationmodule.findViewObject("RoleCompetenciesVO") != null)
    oaapplicationmodule.findViewObject("RoleCompetenciesVO").clearCache();
    String s16;
    if(!s.equals("Project") && !s.equals("Admin"))
    s16 = "OA.jsp?akRegionCode=PA_ADD_ASSIGNMENTS_PAGE_LAYOUT&akRegionApplicationId=275&paProjectId=" + oapagecontext.getTransactionValue("paProjectId") + "&paAssignmentType=" + s + "&OA_SubTabIdx=0";
    else
    s16 = "OA.jsp?akRegionCode=PA_ADD_ASSIGNMENTS_PAGE_LAYOUT&akRegionApplicationId=275&paResourceId=" + oapagecontext.getTransactionValue("paResourceId") + "&paAssignmentType=" + s + "&OA_SubTabIdx=0";
    Debug.log(oapagecontext, this, "nextUrl " + s16, 3);
    if("Template".equals(s))
    oapagecontext.redirectImmediately(s16, true, "S");
    else
    oapagecontext.redirectImmediately(s16, false, "S");
    } else
    if("UPDATE_DETAILS".equals(oapagecontext.getParameter("AddAsgmtApplyAction")))
    Debug.log(oapagecontext, this, "Update Details Selected ", 3);
    String s17 = "";
    if("Staffed".equals(s))
    s17 = "ProjStaffedAsmt";
    else
    if("Admin".equals(s))
    s17 = "AdminAsmt";
    else
    if("Project".equals(s))
    s17 = "PersonStaffedAsmt";
    else
    if("Open".equals(s))
    s17 = "OpenAsmt";
    else
    if("Template".equals(s))
    s17 = "TemplateAsmt";
    String s19 = "OA.jsp?akRegionCode=PA_ASMT_LAYOUT&akRegionApplicationId=275&paProjectId=" + oapagecontext.getTransactionValue("paProjectId") + "&paAssignmentId=" + oapagecontext.getTransactionValue("wfOutAssignmentId") + "&paCalledPage=" + s17 + "&addBreadCrumb=RP";
    Debug.log(oapagecontext, this, "UPDATE_DETAILS: URL: " + s19, 3);
    oapagecontext.redirectImmediately(s19, false, "RP");
    if(s.equals("Staffed") || s.equals("Admin") || s.equals("Project"))
    String s18 = (String)oapagecontext.getTransactionValue("wfOutResourceId");
    String s20 = (String)oapagecontext.getTransactionValue("wfOutAssignmentId");
    Debug.log(oapagecontext, this, "outResourceId " + s18, 3);
    Debug.log(oapagecontext, this, "outAssignmentId " + s20, 3);
    if("SUBMIT_APPRVL".equals(oapagecontext.getParameter("AddAsgmtApplyAction")))
    if(s.equals("Staffed"))
    oapagecontext.redirectImmediately("OA.jsp?akRegionCode=PA_SUBMIT_ASMT_APR_LAYOUT&akRegionApplicationId=275&paAsgmtId=" + s20 + "&paResourceId=" + s18 + "&paProjectId=" + oapagecontext.getTransactionValue("paProjectId") + "&paAsgmtAprStatus=ASGMT_APPRVL_WORKING&paAssignmentType=" + s + "&paCallingPage=AddAssignment", false, "RP");
    return;
    oapagecontext.redirectImmediately("OA.jsp?akRegionCode=PA_SUBMIT_ASMT_APR_LAYOUT&akRegionApplicationId=275&paAsgmtId=" + s20 + "&paResourceId=" + s18 + "&paAsgmtAprStatus=ASGMT_APPRVL_WORKING&paAssignmentType=" + s + "&paCallingPage=AddAssignment", false, "RP");

    Hi Rani,
    As soon as the transaction is commited the methods in the VORowImpl Class are called.
    You can check in the VORowImpl class and search for the log messages.
    Thanks,
    Gaurav

  • Help needed in understanding the concept of hierarchical queries

    I really need help in this matter. I have a flafile containing about 4000 rows. It is from my supplier, it's structure is as follows:
    create table Flatfile
    (Pgroup varchar2(30),
    Pclass varchar2(30),
    Manufacturer varchar2(30),
    Article varchar2(30),
    Price Number(6,2));
    Insert into Flatfile Values
    ('Application Software','Database Software','Oracle','Oracle 10G',115);
    Insert into Flatfile Values
    ('Application Software','Database Software','Microsoft','MS SQL Server 2000',200);
    Insert into Flatfile Values
    ('Application Software','Spreadsheet Software','Microsoft','Excel',100);
    Insert into Flatfile Values
    ('Monitor','15"','Acer','Acer 15"" TFT superscreen',199);
    Insert into Flatfile Values
    ('Monitor','15"','Sony','Sony R1500 flat',225);
    Insert into Flatfile Values
    ('Monitor','17"','Philips','Philips Flatscreen',250);
    Insert into Flatfile Values
    ('Monitor','19"','Viewsonic','Viewsonic PLasma Monitor',275);
    Insert into Flatfile Values
    ('Processor','AMD','AMD','FX-55',600);
    Insert into Flatfile Values
    ('Processor','Intel','Intel','P4 3 GHZ',399);
    My goal is to make a hierarchical query with the start with and connect by clauses. From what I have read is that I need to normalize the data of the flatfile.
    How do I achieve a table which I can query so that the query will represent the hierarchy that exists. Namely
    Pgroup
    ++Pclasse
    Application Software
    ++Database Software
    ++Spreadsheet Software
    So a 2-level hierarchy. I'd like to understand this simple concept first. I built on the knowledge that I gain. So the questions are:
    1.What do I need to do to make the table so that I can use a hierarchical query on it?
    2. How should the query syntax be?
    3. Is it also possible to get the data in the hierarchical query sorted asec?
    I would only like to use the simple structures of the start with and connect by clauses first. I've read there are some new additions to 10G. The problem with the examples used by the tutorials is that the tables are already made so that they are suitable for hierarchical queries. I hope to understand it by this example. And take it a step further.
    Sincerely,
    Pete

    Primarily hierarchy query serves to process tree-like structures which RDBMS simulates using through parent-child relation, often in a single table (see famoust
    EMP table where employee can have the manager who is an employee at the same time).
    In your case it could look like:
    SQL> select pgroup, pclass from flatfile;
    PGROUP                         PCLASS
    Application Software           Database Software
    Application Software           Database Software
    Application Software           Spreadsheet Software
    Monitor                        15"
    Monitor                        15"
    Monitor                        17"
    Monitor                        19"
    Processor                      AMD
    Processor                      Intel
                                   Application Software
                                   Monitor
                                   Processor
    12 rows selected.
    SQL> select decode(level,1,pclass,'  ' || pclass), Manufacturer from flatfile
      2  start with pgroup is null
      3  connect by prior pclass = pgroup
      4  /
    DECODE(LEVEL,1,PCLASS,''||PCLASS MANUFACTURER
    Application Software
      Database Software              Oracle
      Database Software              Microsoft
      Spreadsheet Software           Microsoft
    Monitor
      15"                            Acer
      15"                            Sony
      17"                            Philips
      19"                            Viewsonic
    Processor
      AMD                            AMD
      Intel                          Intel
    12 rows selected.The hierarchy syntax is described completely in the documentation including
    LEVEL and PRIOR keywords.
    As for the ordering question you can use siblings ordering:
    SQL> select decode(level,1,pclass,'  ' || pclass), Manufacturer from flatfile
      2  start with pgroup is null
      3  connect by prior pclass = pgroup
      4  order siblings by 1 desc
      5  /
    DECODE(LEVEL,1,PCLASS,''||PCLASS MANUFACTURER
    Processor
      Intel                          Intel
      AMD                            AMD
    Monitor
      19"                            Viewsonic
      17"                            Philips
      15"                            Acer
      15"                            Sony
    Application Software
      Spreadsheet Software           Microsoft
      Database Software              Oracle
      Database Software              Microsoft
    12 rows selected.Rgds.

  • Help needed in running the HTML code

    <html>
    <head>
    <script language="LiveScript">
    function WinOpen() {
    msg=open("","DisplayWindow","toolbar=no,directories=no,menubar=no");
    msg.document.write("<HEAD><TITLE>Yo!</TITLE></HEAD>");
    msg.document.write("<CENTER><h1><B>This is really cool!</B></h1></CENTER>");
    msg.document.write("<body>Hi</body>");
    </script>
    </head>
    <body>
    <form>
    <input type="button" name="Button1" value="Push me" onclick="WinOpen()">
    </form>
    </body>
    </html>
    whenever i save the abouve code in .htm extension and try to run it, I am able to run it sucessfully.
    But whenever I run the below code by saving it as .htm extension then its not running sucessfully:
    <html>
    <head>
    <script language="LiveScript">
    function WinOpen() {
    msg=open("","DisplayWindow","toolbar=no,directories=no,menubar=no");
    msg.document.write("<HEAD><TITLE>Yo!</TITLE></HEAD>");
    msg.document.write("<CENTER><h1><B>This is really cool!</B></h1></CENTER>");
    msg.document.write("<body><form>
    <TABLE cellSpacing=1 cellPadding=1 width="75%" bgColor=silver border=1>
    <TR>
    <TD><STRONG>Enter Numeric Value *:</STRONG> </TD>
    <TD><INPUT name="tbAlphaNumeric" CatsType="NUMERIC" label="Alphanumeric" Mandatory="YES"> </TD>
    </TR>
    </TABLE>
    </form></body>");
    </script>
    </head>
    <body>
    <form>
    <input type="button" name="Button1" value="Push me" onclick="WinOpen()">
    </form>
    </body>
    </html>
    Here I want to display text box in a new fresh field...
    Thanks in advance:)

    Hi,
    The code did work. But I am not sucessfully able to display the values entered in 2nd page in the 3rd page.Please find the code below:
    <html>
    <head>
    <script language="LiveScript">
    function WinOpen() {
    if (document.form1.cap.value == "")
    alert("Enter value in text box");
    return;
    msg=open("","DisplayWindow","toolbar=no,directories=no,menubar=no, scrollbars=yes");
    msg.document.write("<HTML><HEAD><TITLE>Yo!</TITLE></HEAD>");
    msg.document.write("<CENTER><h1><B>This is really cool!</B></h1></CENTER>");
    msg.document.write('<BODY><form name="form2">');
    for(var i =0; i < document.form1.cap.value; i++)
    msg.document.write("<INPUT type=text name=tbAlphaNumeric>");
    msg.document.write("<br>");
    msg.document.write('<input type="button" name="Button2" value="Steal" onClick="javascript:window.opener.WinShow();">');
    msg.document.write('</form></BODY></HTML>');
    function WinShow() {
    msg=open("","DisplayWindow","toolbar=no,directories=no,menubar=no, scrollbars=yes");
    msg.document.write("<HTML><HEAD><TITLE>Great!</TITLE></HEAD>");
    msg.document.write("<CENTER><h1><B>Display of second page text elements!</B></h1></CENTER>");
    msg.document.write('<BODY><form name="form3">');
    for(var j =0; j < document.form1.cap.value; j++)
    msg.document.write(document.form2.tbAlphaNumeric[j].value);
    msg.document.write("<br>");
    msg.document.write('</form></BODY></HTML>');
    </script>
    </head>
    <body>
    <form name="form1">
    <INPUT type= "text" name=cap>
    <input type="button" name="Button1" value="Push me" onClick="WinOpen()">
    </form>
    </body>
    </html>

  • Please help me in understanding the following code.

    public static void main(String args[]){
    int x=0,c=0;
    for(int i=0;i<3;i++)
    x = x + x++;
    System.out.println(x);
    why this program always prints zero(0) as output. I am not able to understand the execution sequence of it.

    bkyadav wrote:
    at certain point of time in porgram
    (x++) should be treated as x = x+1; but that is not happening.Here's the rule : you have to proceed the expression from left to right.
    For example :
    int x = 8;
    x = x + ++x; // x = 8 + 9 = 17
    int x = 8;
    x = x + x++; // x = 8 + 8 = 16
    int x = 8;
    x = x + --x; // x = 8 + 7 = 15Also, in the for statement of your example :
    for(int i=0;i<3;i++)the value of i+ is first tested before being incremented for the next iteration otherwise the test on value of i+ = 0 would have been skipped.

  • Help needed in understanding the compiled format of actionscripts

    Hi all,
    I need to inject an actionscript to an existing .SWF file. So
    can anyone help me out in explaining the process involved in the
    compilation of the action script into binary form which has to be
    injected into the existing SWF file. I need to do this
    programmatically using Java. So pls dont suggest me any Third party
    softwares which does that.
    Please help me out..
    Thanks in advance.
    Prabakaran Srinivasan.

    Hi all,
    I need to inject an actionscript to an existing .SWF file. So
    can anyone help me out in explaining the process involved in the
    compilation of the action script into binary form which has to be
    injected into the existing SWF file. I need to do this
    programmatically using Java. So pls dont suggest me any Third party
    softwares which does that.
    Please help me out..
    Thanks in advance.
    Prabakaran Srinivasan.

  • Help needed in executing the java/jsp program from UCM .

    Hi ,
    I have a .jsp program running in my Jdeveloper which when executed pops a window to browse and select files and with few custom options .
    But i want to execute that Program from within UCM (create a new jsp page in UCM OR provide link ? i am not sure .... ) , could anyone help on how i can execute/run the program from UCM ?
    thanks in Advance
    Plaxman

    If your jsp makes use of jars you may want to look into using a WAR instead. You can check the WAR into content server and there is even a link on the administration page for JSP Web App Admin. Treating the JSP(s) and jar(s) as an entity may be a more successful path for you.
    You can find some jsp examples and ever a war example in this directory: <install root>\samples\JspServer
    And the briefest of help about that stuff here: [http://localhost/idc/help/wwhelp/wwhimpl/js/html/wwhelp.htm|http://localhost/idc/help/wwhelp/wwhimpl/js/html/wwhelp.htm]

  • Need to understand the relation between ManualResetEvent and thread

    please help me to understand the below code
    what is resetEvent.Set() and WaitOne() ? what it does ?
    var resetEvent = new ManualResetEvent(false);
    ThreadPool.QueueUserWorkItem(
    arg =>
    DoWork();
    resetEvent.Set();
    resetEvent.WaitOne();
    again help me to understand the below code
    var events = new List<ManualResetEvent>();
    foreach(var job in jobs)
    var resetEvent = new ManualResetEvent(false);
    ThreadPool.QueueUserWorkItem(
    arg =>
    DoWork(job);
    resetEvent.Set();
    events.Add(resetEvent);
    WaitHandle.WaitAll(events.ToArray());
    why this line WaitHandle.WaitAll(events.ToArray()); is required ?
    why adding ManualResetEvent instance to list ?
    looking for discussion. thanks

    WaitOne() will cause the current (main) thread to wait until the thread pool thread has called the Set() method. If you don't call the WaitOne() method, the code line below ThreadPool.QueueUserWorkItem(...) will get executed before the delegate that you
    pass do the ThreadPool.QueueUserWorkItem method has actually finished its execution because the threads are being executed simultaneously:
    var resetEvent = new ManualResetEvent(false);
    ThreadPool.QueueUserWorkItem(
    arg =>
    //this will be executed simultaneously on thread B
    Thread.Sleep(10000);
    //tell thread A to continue
    resetEvent.Set();
    //thread A waits here until thread B calls the Set() method...
    resetEvent.WaitOne();
    string s = "abc"; //this line won't get executed until thread B has called the Set() method provided that the WaitOne() method is called by thread A above.
    >>why this line WaitHandle.WaitAll(events.ToArray()); is required ?
    It causes the main thread to wait until the Set method of all ManualResetEvent objects in the events list has been called. Othwerwise the execution of the main thread would continue immediately after the foreach loop has been executed. By this time the DoWork
    method of all jobs has not yet been completed because they are being executed on another thread.
    WaitHandle.WaitAll(events.ToArray());
    string s = "abc"; //this line won't get executed until all the Set() method of all ManualResetEvent objects in events has been called
    >>why adding ManualResetEvent instance to list ?
    Because you (appearantly) want to wait for all objects in the list, i.e. you want to wait for the DoWork method to complete for all jobs before you continue the execution of the main thread (and go on to assign the string s to the value "abc"
    in the above example).
    Hope that helps.
    Please remember to close your threads by marking helpful posts as answer then start a new thread if you have a new question. Please don't ask several questions in the same thread.

  • I need to trigger my java code automatically daily once ... help me

    hi
    i am working with a java program which updates database(mySql) daily once
    i need to make my java code run daily once automatically
    how can i make it to do that
    please someone help me
    thanks in advance

    U can use, autoexec.bat file for executing u'r
    code , but problem is that it will run every time
    system will start,
    so their is a another option for scheduling, try
    at/? in command prompt it will give u enough
    detail to use it for scheduling."Scheduled Tasks" is a UI for the "at" command, and it might be a bit easier for the OP to use that.
    /Kaj

  • Need help in writing a small java code

    Hi,
    I have a small requirement where I need write a small java code. I am thinking of using array. Please suggest if you know the solution:
    1. Need to compare user logon id is preset in the lookup table or not.
    2. If user id present in the lookup then send type "A" mail
    3. If user id in not present in the lookup then send type "B" email.
    Please suggest.
    Thanks,
    Kalpana.

    use this code . you have to pass userlogin and lookup name
    Public String GetEmail(String UserLogin,String lookupcode)
    String email;
    try{
    tcLookupOperationIntf lookupIntf = Platform.getService(tcLookupOperationIntf.class);
    HashMap<String, String> lookupValues = getLookupHashMap(lookupIntf, lookupCode);
    String found = lookupValues.get(UserLogin);
    if (found!=null) email= "EMAIL A";
    else
    email= "EMAIL B";
    }catch(Exception e){}
    return email;
    private HashMap<String, String> getLookupHashMap(tcLookupOperationsIntf lookupOperationsIntf, String lookupCode)throws tcAPIException,tcInvalidLookupException,tcColumnNotFoundException {
    HashMap<String, String> lookupMap = new HashMap<String, String>();
              tcResultSet resultLookupHashMap = lookupOperationsIntf
                        .getLookupValues(lookupCode);
              int countResultLookupHashMap = resultLookupHashMap.getRowCount();
    if (countResultLookupHashMap > 0) {
                   for (int i = 0; i < countResultLookupHashMap; i++) {
                        resultLookupHashMap.goToRow(i);
                        lookupMap.put(resultLookupHashMap..getStringValue("Lookup Definition.Lookup Code Information.Code Key"),
    resultLookupHashMap.getStringValue("Lookup Definition.Lookup Code Information.Decode"));
    return lookupMap;
    }

  • OIC: Need to find the Source Code for the YTDSummary.java file

    Hi All,
    We have 11.5.10 implemention and we are using the OIC(Incentive Compensation) Application. In the Report Module for the Year-To-Date Summary we need look for the Java Source Code.The cnytdsum.jsp file call the YTDSummary.java file. We have teh following question
    1. How we can get the Java Source Code and where and which directory we need to look into?
    2. Let say if we need to customize the java file how we can do that?
    3. where and which directory we have to complie the java file?
    Highly appreciate for any pointers
    Thanks,
    Johnson.

    But those must be platform dependant, not really that
    interesting to look at. I have never felt any need to
    look at those at least.Wake up and smell the coffee, abbie! I read the source code all the time and constantly tell my students to do that, too.
    1. Java source code is not platform dependent. The original poster wanted to look at linked list code, how could that be platform dependent?
    2. It is the implementation of the SDK APIs, so by definition it is implementation dependent code, liable to change in a later version. So don't assume anything beyond what is claimed in the API documentation. However, sometimes the documentation is incomplete or ambiguous to you, and reading the source can provide some insight, however implementation dependent. (Light a candle or curse the darkness.)
    3. Why read source code? It's a good way to learn how to program. You see something in the API and ask: how'd they do that? Or you realize you want to do something broadly similar, but you can't reuse the source code.
    For example, Images are not Serializable, but suppose you want a small image that is part of an object to be serialized with the rest of the object without too much fuss (ie, without using javax.imageio). You notice ImageIcon is serializable, so you use it. (An ImageIcon has-an Image.) Then you wonder: how'd they do that? You read the source and then you know.
    You live, you learn,
    Nax

  • Specifying Schema Location in XML file and not in the Java code

    I have a repository of schema xsd files. When I receive my xml file, I need to validate it against the specified schema. The xml file would declare the schema location, using the following syntax:
    <CERD:CERD xsi:schemaLocation = "..\CERD.xsd" xmlns:CERD = "CERD.xsd" xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance">
    Is it really necessary to define the schema location again in the JAVA code? Why set the schemaLocation in the xml file at all then?
    Does anybody have any examples where the schema location is not set in the JAVA code? I am using Java 1.6, and at this point in time I only need to validate. Any help would be appreciated.

    Thank you very much for your quick reply. I have made some progress but I am still stumped.
    In my code I am doing this:
    SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
    Schema schema = factory.newSchema();
    Validator validator = schema.newValidator();
    validator.validate(XML_SOURCE);
    I find this works if my schema does not have a target namespace. I have downloaded the following simple example from the internet that uses a target namespace and it fails:
    library1.xsd:
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://example.org/prod"
    xmlns:prod="http://example.org/prod">
    <xsd:element name="product" type="prod:ProductType"/>
    <xsd:complexType name="ProductType">
    <xsd:sequence>
    <xsd:element name="number" type="xsd:integer"/>
    <xsd:element name="size" type="prod:SizeType"/>
    </xsd:sequence>
    <xsd:attribute name="effDate" type="xsd:date"/>
    </xsd:complexType>
    <xsd:simpleType name="SizeType">
    <xsd:restriction base="xsd:integer">
    <xsd:minInclusive value="2"/>
    <xsd:maxInclusive value="18"/>
    </xsd:restriction>
    </xsd:simpleType>
    </xsd:schema>
    <prod:product xmlns:prod="http://example.org/prod"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="library1.xsd"
    effDate="2001-04-02">
    <number>557</number>
    <size>10</size>
    </prod:product>
    I get the following SAXParseException when I validate:
    [line 4, col 36|
    cvc-elt.1: Cannot find the declaration of element 'prod:product'.
    Am I doing something wrong with the namespace declaration?
    Edited by: alfredamorrissey on Oct 31, 2007 6:34 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Pass the data back from the jsp page to the java code

    Hi,
    I have written an iView that receives an event using EPCF and extracts data from the client data bag.
    I need this iView to pass the data back from the jsp page to the java code.
    I am trying to do this using a hidden input field, but I cannot get the code to work.
    Here is the code on the jsp page.
    <%@ taglib uri="tagLib" prefix="hbj" %>
    <hbj:content id="myContext" >
      <hbj:page title="PageTitle">
       <hbj:form id="myFormId">
    <hbj:inputField id="myInputField" type="string" maxlength="100" value="" jsObjectNeeded="true">
    <% myInputField.setVisible(false);%>
    </hbj:inputField>      
       </hbj:form>
      </hbj:page>
    </hbj:content>
    <script language=JavaScript>
    EPCM.subscribeEvent("urn:com.peter", "namedata", window, "eventReceiver");
    function eventReceiver(eventObj) {
         var url = eventObj.dataObject;
         var funcName = htmlb_formid+"_getHtmlbElementId";
         func = window[funcName];
         var ipField = eval(func("myInputField"));
         ipField.setValue(url);
         var form = document.all(htmlb_formid);
         form.submit();
    </script> 
    Here is my java code
    package com.sap.training.portal;
    import com.sapportals.htmlb.InputField;
    import com.sapportals.htmlb.page.DynPage;
    import com.sapportals.htmlb.page.PageException;
    import com.sapportals.portal.htmlb.page.JSPDynPage;
    import com.sapportals.portal.htmlb.page.PageProcessorComponent;
    public class ListSalesOrder extends PageProcessorComponent {
      public DynPage getPage(){
        return new ListSalesOrderDynPage();
      public static class ListSalesOrderDynPage extends JSPDynPage{
         private String merong;
        public void doInitialization(){
        public void doProcessAfterInput() throws PageException {
              InputField reportfld = (InputField) getComponentByName("myInputField");
              if (reportfld != null)      merong = reportfld.getValueAsDataType().toString();
        public void doProcessBeforeOutput() throws PageException {
              if ( merong != null ) setJspName("merong.jsp");
              else setJspName("ListSalesOrder.jsp");
    Here is DD
    <?xml version="1.0" encoding="utf-8"?>
    <application>
      <application-config>
        <property name="SharingReference" value="com.sap.portal.htmlb"/>
        <property name="PrivateSharingReference" value="com.sap.portal.htmlb"/>
      </application-config>
      <components>
        <component name="SearchSalesOrder">
          <component-config>
            <property name="ComponentType" value="jspnative"/>
            <property name="JSP" value="/pagelet/SearchSalesOrder.jsp"/>
          </component-config>
          <component-profile>
            <property name="tagLib" value="/SERVICE/htmlb/taglib/htmlb.tld"/>
          </component-profile>
        </component>
        <component name="ListSalesOrder">
          <component-config>
            <property name="ClassName" value="com.sap.training.portal.ListSalesOrder"/>
          </component-config>
          <component-profile>
            <property name="tagLib" value="/SERVICE/htmlb/taglib/htmlb.tld"/>
          </component-profile>
        </component>
      </components>
      <services/>
    </application>
    After receive event, then call java script function "eventReceiver" and call "form.submit()".
    But .. PAI Logic in Java code doesn't called ...
    Where is my problme ?
    Help me ...
    Regards, Arnold.

    Hi Arnold,
    you should not do a form.submit yourself. Instead you can put a component called ExternalSubmit to your page:
    ExternalSubmit exSubmit = new ExternalSubmit("EX_SUBMIT"));
    exSubmit.setServerEventName("MyEvent");
    This results in a java script funtion on the page which is called "_htmlb_external_submit_". If you call this function the the form gets submitted and your event handler is called.
    regards,
    Martin

  • Need explanation of the following code

    HI All,
    I need your help on explanation of the following code :
    what I don't understand is how it route the request (all the benefit of the replace statement )
    If the input is /scarr/LH/SPFLI/402
    how he know to route it and
    what is the benefit for using the wild card and the concatenate CONCATENATE '^' lv_verif_pattern '$'
    Edited by: James Herb on Apr 13, 2010 9:53 AM
    Edited by: James Herb on Apr 13, 2010 9:53 AM

    DATA: lt_routing_tab TYPE z_resource_routing_tab,
      CONSTANTS: param_wildcard TYPE string VALUE '([^/])*'.
      FIELD-SYMBOLS: <ls_routing> LIKE LINE OF lt_routing_tab.
      CALL METHOD get_routing
        RECEIVING
          rt_routing_tab = lt_routing_tab.
      LOOP AT lt_routing_tab ASSIGNING <ls_routing>.
    *   replace all parameters placeholders by regex
        lv_verif_pattern = <ls_routing>-url_info.
        lv_signature = <ls_routing>-url_info.
        REPLACE ALL OCCURRENCES OF REGEX '\{([A-Z]*[_]*[a-z]*[0-9]*)*\}'
        IN lv_verif_pattern WITH param_wildcard.
        CONCATENATE '^' lv_verif_pattern '$'  INTO lv_verif_pattern.
    *   check if pattern matches current entry
        FIND ALL OCCURRENCES OF REGEX lv_verif_pattern
        IN url_info MATCH COUNT lv_count.
    *   pattern matched
        IF lv_count > 0.
    *     get controller class name
          lv_controller_name = <ls_routing>-handler_class.
          ls_class-clsname = lv_controller_name.
    *     check if class exists
    *     class found
          IF sy-subrc = 0.
    *       create controller
            CREATE OBJECT eo_controller TYPE (lv_controller_name).
    *       create parameter table
            SHIFT lv_verif_pattern RIGHT DELETING TRAILING '$'.
            SHIFT lv_verif_pattern LEFT DELETING LEADING ' ^'.
            SPLIT lv_verif_pattern AT param_wildcard INTO TABLE lt_url_parts.
            lv_url_info = url_info.
            LOOP AT lt_url_parts INTO lv_url_part.
              SHIFT lv_signature LEFT DELETING LEADING lv_url_part.
              SHIFT lv_signature LEFT DELETING LEADING '{'.
              SHIFT lv_url_info LEFT DELETING LEADING lv_url_part.
    Edited by: James Herb on Apr 13, 2010 9:56 AM

Maybe you are looking for