Problem matching parameters in a method

Hi, all:
I'm processing a LOT of data for some research. I have millions of lines of data I've generated and am working with. I've created a class that lets me do the things I need to with my data. In that class, I analyze the data (lines of several numbers) by averaging some output based on the input. Here's my problem. Though I've got the class working great when it comes to averaging when I'm only sweeping one parameter, there are problems when I'm trying to sweep over two parameters. The problem comes from the method I'm using to detect whether I've moved to the next set of parameter values. Here's an example of switching from one parameter to the next:
Run, Tick, numSoldiers, randomSeed, strengthBooster, numGreens, numMagentas, winnerOrLoser.
99,120.0,25,1218306701906,0,0.0,8.0,1.0
100,448.0,25,1218306701953,0,0.0,1.0,1.0
101,69.0,50,1218306702015,0,7.0,0.0,0.0
102,514.0,50,1218306702062,0,0.0,1.0,1.0
The third number (numSoldiers) is input; see where it switches from 25 to 50? My method can tell I've moved to the next parameter of 50 instead of 25 when I'm generating output, no problem. Here's right where the problem happens:
1599,176.0,400,1218306810437,0,0.0,7.0,1.0
1600,601.0,400,1218306810515,0,0.0,1.0,1.0
1601,151.0,25,1218306810609,0.5,0.0,2.0,1.0
1602,437.0,25,1218306810656,0.5,0.0,1.0,1.0
See, that fifth number (strengthBooster) is ALSO input, not output. I've moved from an input of 400 (third value) and 0 (fifth value) to inputs of 25 and 0.5. I'm having problems structuring a method that can tell when EITHER of those two parameters have changed (which means that some other methods in the class get executed to calculate averages and write data to a text file, etc, etc.). Here's the method I'm using:
     public void checkTheParameterSweep () {
          lineStorage = new ArrayList <String>();//initializes the main storage for the data.
          sendMe = new ArrayList <Double>();
          for(int k = 0; k < (soldierColumnList.size() - 1); k++) {//for every element in soldier column list,
               sendMe = checkerList.get(k); //go get the checker arraylist out of the master list that corresponds to this index,
               double g = soldierColumnList.get(k);//get the k'th element and cast it to a double.
               if (soldierColumnList.get(k + 1) != null) {//if we're not at the last line,
                    double h = soldierColumnList.get(k + 1);//get the k + 1 element and cast it to a double.
                    if (h > g) {//if the second double is larger than the first (we've switched parameters)
                         executeMeAfterAParameterSweep();
                    else {//if we haven't changed parameters,
                         processARowIntoArrayLists(sendMe);//and send it to be processed.
               else if (soldierColumnList.get(k + 1) == null) {//we're at the last line.
                    executeMeAtTheEndOfTheLists();
               else {
                    System.out.println("There's something wrong here.");
          for(int b = 0; k < (strengthBoosterList.size() - 1); k++) {//for every element in strength booster list,
               sendMe = checkerList.get(b); //go get the checker arraylist out of the master list that corresponds to this index,
               double f = strengthBoosterList.get(b);//get the k'th element and cast it to a double.
               if (strengthBoosterList.get(b+ 1) != null) {//if we're not at the last line,
                    double h = strengthBoosterList.get(b + 1);//get the k + 1 element and cast it to a double.
                    if (h > f) {//if the second double is larger than the first (we've switched parameters)
                         executeMeAfterAParameterSweep();
                    else {//if we haven't changed parameters,
                         processARowIntoArrayLists(sendMe);//and send it to be processed.
               else if (strengthBoosterList.get(k + 1) == null) {//we're at the last line.
                    executeMeAtTheEndOfTheLists();
               else {
                    System.out.println("There's something wrong here.");
     } I need EITHER of those two for loops to work, and I'm not sure how to get them to do so. If I comment out one of the for loops, the output works just fine for either of the two parameters, but not at the same time. What do I do? (Also, suggestions on how to make my code more elegant are very welcome;-)

I wold suggest something more object oriented and modular, along the lines ofpublic class Something {
   private int numSoldiers;
   private int strengthBooster;
   private boolean somethingNeedsToBeDone = false;
   public void checkTheParameterSweep() {
      int paramNumSoldiers = 0;
      int paramStrengthBooster = 0;
      // get the parameters from soldierColumnList
      setNumSoldiers(paramNumSoldiers);
      setStrengthBooster(paramStrengthBooster);
      if (somethingNeedsToBeDone) {
         doSomething();
   public void setNumSoldiers(int numSoldiers) {
      if (this.numSoldiers != numSoldiers && !somethingNeedsToBeDone) {
         this.numSoldiers = numSoldiers;
         somethingNeedsToBeDone = true;
   public void setStrengthBooster(int strengthBooster) {
      if (this.strengthBooster != strengthBooster && !somethingNeedsToBeDone) {
         this.strengthBooster = strengthBooster;
         somethingNeedsToBeDone = true;
   private void doSomething() {
      // do whatever
      somethingNeedsToBeDone = false;
}db

Similar Messages

  • Passing input parameters to the method call in ADF task flow.

    Hi,
    I have the following use case:
    There is a task flow with 2 jspx pages. In the first page I have 2 input search parameters and search button. the search button calls the webservice data control execute (GET_ACCOUNTOperation) method .
    Displaying the search results in the same page is not a problem , but my requirement is that the search results are to be displayed in the second page in tabular form.
    To achieve this, I dragged the execute method as the method call in the task flow and specified the input parameters for the method call (right click and add parameters) . I am getting the following exception :
    javax.el.MethodNotFoundException: Method not found: GET_ACCOUNTOperation.execute(java.lang.String, java.lang.String)
         at com.sun.el.util.ReflectionUtil.getMethod(Unknown Source)
         at com.sun.el.parser.AstValue.getMethodInfo(Unknown Source)
         at com.sun.el.MethodExpressionImpl.getMethodInfo(Unknown Source)
         at oracle.adf.controller.internal.util.ELInterfaceImpl.getReturnType(ELInterfaceImpl.java:214)
         at oracle.adfinternal.controller.activity.MethodCallActivityLogic.execute(MethodCallActivityLogic.java:135)
         at oracle.adfinternal.controller.engine.ControlFlowEngine.executeActivity(ControlFlowEngine.java:1035)
         at oracle.adfinternal.controller.engine.ControlFlowEngine.doRouting(ControlFlowEngine.java:921)
         at oracle.adfinternal.controller.engine.ControlFlowEngine.doRouting(ControlFlowEngine.java:820)
         at oracle.adfinternal.controller.engine.ControlFlowEngine.routeFromActivity(ControlFlowEngine.java:552)
         at oracle.adfinternal.controller.engine.ControlFlowEngine.performControlFlow(ControlFlowEngine.java:148)
         at oracle.adfinternal.controller.application.NavigationHandlerImpl.handleAdfcNavigation(NavigationHandlerImpl.java:109)
         at oracle.adfinternal.controller.application.NavigationHandlerImpl.handleNavigation(NavigationHandlerImpl.java:78)
         at org.apache.myfaces.trinidadinternal.application.NavigationHandlerImpl.handleNavigation(NavigationHandlerImpl.java:43)
         at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:130)
         at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:190)
         at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475)
         at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:756)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._invokeApplication(LifecycleImpl.java:889)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:379)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:194)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:205)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:106)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
         at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:271)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:177)
         at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
         at java.security.AccessController.doPrivileged(Native Method)
         at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
         at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)
    even though the execute method is there and the service is up and running. I am not sure whether its the correct way of doing it. Please shed some light on how to solve this use case
    Some additional info:
    Under the data controls pallete, the GET_ACCOUNTOperation method has a parameters section , which has "part" (java.lang.Object) as
    the input parameter.
    Regards,
    Rampal

    Hi,
    thanks for the quick turn-around. Jdev version that i am using is Studio Edition Version 11.1.1.6.0. And i am using SOAP. Isnt there a way without using a backing bean? I am planning to use it as a portlet. Would'nt creating a backing bean cause a problem in that case?? Also i am confused here . The method that i am dragging is GET_ACCOUNTOperation(Object). I tried passing the hashmap . It gave the following exception :
    javax.el.MethodNotFoundException: Method not found: GET_ACCOUNTOperation.execute(java.util.HashMap)
    Rampal

  • Passing Parameters via Post Method from Webdynpro Java to a web application

    Hello Experts,
    I want to pass few parameters from a web dynpro application to an external web application.
    In order to achieve this, I am referring to the below thread:
    HTTP Post
    As mentioned in the thread, I am trying to create an additional Suspend Plug parameter (besides 'Url' of type String) with name 'postParams' and of type Map.
    But when I build my DC, I am getting the same error which most of the people in the thread have mentioned:
    Controller XXXCompInterfaceView [Suspend]: Outbound plug (of type 'Suspend') 'Suspend' may have at most two parameters: 'Url' of type 'string' and 'postParams' of type 'Map'.
    I am using SAP NetWeaver Developer Studio Version: 7.01.00
    Kindly suggest if this is the NWDS version issue or is it something else that I am missing out.
    Also, if it is the NWDS version issue please let me know the NWDS version that I can use to avoid this error.
    Any other suggestion/alternative approach to pass the parameters via POST method from webdynpro java to an external web application apart from the one which is mentioned in the above thread is most welcome.
    Thanks & Regards,
    Anurag

    Hi,
    This is purely a java approach, even you can try this for your requirement.
    There are two types of http calls synchronous call or Asynchronous call. So you have to choose the way to pass parameters in post method based on the http call.
    if it is synchronous means, collect all the values from users/parameters using UI element eg: form and pass all the values via form to the next page is nothing but your web application url.
    If it is Asynchronous  means, write a http client in java and integrate the same with your custom code and you can find an option for sending parameters in post method.
    here you go and find the way to implement Asynchronous  scenario,
    http://www.theserverside.com/news/1365153/HttpClient-and-FileUpload
    http://download.oracle.com/javase/tutorial/networking/urls/readingWriting.html
    http://digiassn.blogspot.com/2008/10/java-simple-httpurlconnection-example.html
    Thanks & Regards
    Rajesh A

  • HT204152 I am unable to update my App  store Updations. the reason being billing problem asking to update payment method.many times i updated my credit card details but refusing from the system .how can i update my app store updations like  Face book etc.

    I am unable to update my App  store Updations. the reason being billing problem asking to update payment method.Many a  times i updated my credit card details but refusing from the system .how can i update my app store updations like  Face book etc....Using ! phone 6plus  .IOS8.3

    What do you mean by 'refusing from the system', if you are getting an error message then what does it say ?
    For a credit card to have a chance of being accepted it needs to be registered to the same name and address (including format and spacing etc) that you have on your iTunes account, and have been issued by a bank in the country where you and your iTunes account are. If it is and if you are getting a 'declined' message then you could check with the card issuer to see if it's them that are declining it, and if not then try contacting iTunes Support (these are user-to-user forums) and see if they know why it's being declined : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then Purchases, Billing & Redemption
    If when trying to download you are getting a message about a 'problem with a previous purchase' then that implies that iTunes wasn't able to collect the money for your last purchase. If that is the case then you won't be able to download anything else (including app updates) until you've paid off what you owe : Pay an unpaid balance in the iTunes Store - Apple Support
    If you aren't getting the 'problem with a previous purchase' message then try logging into your account (not when trying to download something) and see if you get the 'none' option so that you can remove the card's details and be able to download updates to your apps : Change or remove your payment information from your iTunes Store account (Apple ID) - Apple Support

  • Problem with MixingFloatAudioInputStream.java available() method

    I've always been under the impression that the available() method for an AudioInputStream +returns the maximum number of bytes that can be read (or skipped over) from this audio input stream without blocking+.
    Unfortunately, this doesn't seem to be the case for the available() method in the MixingFloatAudioInputStream class (found on jsresources).
          * The minimum of available() of all input stream is calculated and
          * returned.
         public int available() throws IOException {
              int nAvailable = 0;
              Iterator streamIterator = audioInputStreamList.iterator();
              while (streamIterator.hasNext()) {
                   AudioInputStream stream = (AudioInputStream) streamIterator.next();
                   nAvailable = Math.min(nAvailable, stream.available());
              return nAvailable;
         }Is there a reason why this specific method returns the minimum as opposed to the maximum number of bytes? Can I simply just modify the Math.min function to Math.max to revert it back to its normal behavior?

    Once again, great explanation.
    Like you noticed, I thought that the available() method implied total length minus amount processed so far... Because of this, I decided to use it to measure the length of an InputStream, used in an audio fade class (I've started another thread on this topic with more details).
    public FadeFilterInputStream(InputStream inputStream){
            super(inputStream);
            try {
                streamLength = super.available();
            } catch (Exception e) {
                    e.printStackTrace();
                    System.exit(0);
            fadeLengthBegin = (int) ((0.8)*streamLength);
            fadeLengthEnd = (int) ((0.15)*streamLength);
    } Seeing that FadeFilterInputStream extends FilterInputStream, I can only use an InputStream. Unfortunately, unlike the AudioInputStream, it doesn't have a getFrameLength() method to measure the length of the stream. I tried getting creative with the "available()" method instead.
    What got me thinking that the available() method implied total length minus amount processed so far was the following output from my code:
    available():317520000  length_read:4096  streamLength:317520000  fadeLengthBegin:254016000  fadeLengthEnd:47628000
    available():317515904  length_read:4096  streamLength:317520000  fadeLengthBegin:254016000  fadeLengthEnd:47628000
    available():317511808  length_read:4096  streamLength:317520000  fadeLengthBegin:254016000  fadeLengthEnd:47628000
    available():317507712  length_read:4096  streamLength:317520000  fadeLengthBegin:254016000  fadeLengthEnd:47628000
    available():317503616  length_read:4096  streamLength:317520000  fadeLengthBegin:254016000  fadeLengthEnd:47628000
    available():317499520  length_read:4096  streamLength:317520000  fadeLengthBegin:254016000  fadeLengthEnd:47628000
    available():317495424  length_read:4096  streamLength:317520000  fadeLengthBegin:254016000  fadeLengthEnd:47628000
    available():317491328  length_read:4096  streamLength:317520000  fadeLengthBegin:254016000  fadeLengthEnd:47628000
    available():317487232  length_read:4096  streamLength:317520000  fadeLengthBegin:254016000  fadeLengthEnd:47628000
    available():317483136  length_read:4096  streamLength:317520000  fadeLengthBegin:254016000  fadeLengthEnd:47628000
    available():317479040  length_read:4096  streamLength:317520000  fadeLengthBegin:254016000  fadeLengthEnd:47628000
    available():317474944  length_read:4096  streamLength:317520000  fadeLengthBegin:254016000  fadeLengthEnd:47628000
    available():317470848  length_read:4096  streamLength:317520000  fadeLengthBegin:254016000  fadeLengthEnd:47628000
    available():317466752  length_read:4096  streamLength:317520000  fadeLengthBegin:254016000  fadeLengthEnd:47628000
    available():317462656  length_read:4096  streamLength:317520000  fadeLengthBegin:254016000  fadeLengthEnd:47628000
    available():317458560  length_read:4096  streamLength:317520000  fadeLengthBegin:254016000  fadeLengthEnd:47628000
    available():317454464  length_read:4096  streamLength:317520000  fadeLengthBegin:254016000  fadeLengthEnd:47628000
    available():317450368  length_read:4096  streamLength:317520000  fadeLengthBegin:254016000  fadeLengthEnd:47628000
    available():317446272  length_read:4096  streamLength:317520000  fadeLengthBegin:254016000  fadeLengthEnd:47628000
    ...Like you mentioned, seeing that the combined AudioInputStreams were all the same length, it didn't cause me any problems when I modified the method to find the maximum length of the longest stream. From your explanation, this might not be the case if I decide to combine streams of different lengths.
    Using the available() method to measure the total length of the InputStream is probably not the best way to approach this problem. Any ideas?
    +On a side note, according to your example, shouldn't the available() method be returning the same value until the end (in this case 2 seconds worth of bytes)? That doesn't seem to be the case from my output.+

  • How to Pass Multiple Parameters To ReportReuest Method in Oracle  BI 11g

    Hi,
    Am integrate Oracle BI Publisher 11g via Web Services in Oracle Forms,For that am developing code in PublicReportServiceClient Class. This worked properly with out passing parameter to the report. so how to pass parameters to the report . If Report is requried some Parameters to generate report.
    If any one knows about How to Passing Multiple Parameters to ReportRequest Methos in Oracle 11g. Pls help me.
    Am trying with the below code for PassParameters to ReportReuest Method in Oracle BI 11g. But by using this code am able to pass only one parameter to the Report, not for multiple Parameter Passing.
    ArrayOfParamNameValue PnameValue=new ArrayOfParamNameValue();
    ParamNameValue Namevalue=new ParamNameValue();
    Namevalue.setName("P_SNO"):
    ArrayOfString aos=new ArrayOfString();
    aos.getItem().add("2");
    Namevalue.setValues(aos);
    PnameValue.getItem().add(Namevalue);
    ReportRequest RepReq = new ReportRequest();
    RepReq.setParmeterNameValues(PnameValue);
    Following method  callRunReport() with an array of parameters used in Oracle Bi 10g,To pass multiple report parameters to ReportRequest method.
    public void callRunReport (String reportPath, String[] paramName, String[] paramValue, Stringusername, String password, String format, String template, String outFile)
    try {
    bip_webservice.proxy.PublicReportServiceClient myPort =new bip_webservice.proxy.PublicReportServiceClient();
    // Calling runReport
    ReportRequest repRequest = new ReportRequest();
    repRequest.setReportAbsolutePath(reportPath);
    repRequest.setAttributeTemplate(template);
    repRequest.setAttributeFormat(format);
    repRequest.setAttributeLocale(“en-US”);
    repRequest.setSizeOfDataChunkDownload(-1);
    if (paramName != null)
    ParamNameValue[] paramNameValue = new ParamNameValue[paramName.length];
    String[] values = null;
    for (int i=0; i<paramName.length; i++)
    paramNameValue[i] = new ParamNameValue();
    paramNameValue.setName(paramName[i]);
    values = new String[1];
    values[0] = paramValue[i];
    paramNameValue[i].setValues(values);
    repRequest.setParameterNameValues(paramNameValue);

    Ramani_vadakadu wrote:
    window.open("http://hq-orapp-03.kuf.com:9704/xmlpserver/~weblogic/kufpec/BTA/KUF_CONF_ITINUD.xdo?_xpf=&_xpt=1&_xdo=%2F~weblogic%2Fkuf%2FBTA%2FKUF_CONF_ITINUD.xdo&_xmode=&_paramsP_BTM_ID="+parseInt(document.getElementById('P3_BTA_ID').value)+"&_xt=KUF_CONF_ITINUD&_xf=pdf&_xautorun=true&id=weblogic&passwd=kuf2011","_blank");
    the above code we are using apex JS to BI publisher calling for report as PDF
    i don't know exactly where your parameters , did you customize my link to multiple parameters
    'http://192.168.0.57:8889/reports/rwservlet?userid=retail/1@xe&destype=cache&desformat=PDF&paramform=no&report=item_cost&P_BATCH_NO='+$v('P138_BATCH_NO'); 

  • OLE object -Properties/Parameters of a method

    HI,
      Sample code,
    CREATE OBJECT application 'excel.application'.
    SET PROPERTY OF application 'visible' = '1'.
    CALL METHOD OF application 'Workbooks' = workbook.
    CALL METHOD OF workbook 'Add'.
    CALL METHOD OF sheet 'Cells' = cells EXPORTING #1 = index.
    GET PROPERTY OF cells 'Font' = gs_font .
    SET PROPERTY OF gs_font  'Bold' = 1.
    SET PROPERTY OF gs_font 'ColorIndex' = 5.
    SET PROPERTY OF cells 'Value' = 'Server name'.
    In this sample code , properties Visible, Bold, Colorindex, Value are set to some values.
    How to find these properties ?
    In which DB Table they are stored ?
    How to get all the properties/parameters of a method ?
    All are concerned with ABAP OLE Objects .
    Pls help regarding this .

    Hi
    Try make in Excel a macro, which do what you need  and analyse than the code of the macro.
    It is very helpfull to find the properites.
    JS

  • Dynamic parameters in addEventListener method

    Hi all,
    I've got an question. I would like to make dynamic parameters for the method addEventListener. Like the example below
    var temp:String = "class.method";
    schermObject.addEventListener(MouseEvent.CLICK, temp);
    But this do not work.
    It needs a function Object. But i hadn't figure out how to make a dynamic function object with the
    correct method in it.
    so....
    Does anybody knows how to pull this off?
    kind regards,
    Anton Pierhagen

    Hi Anton Pierhagen,
    There is no direct way for doing this , but there is nice work aorund for this as shown below:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="init()">
    <mx:Script>
    <![CDATA[
      private function init():void
       var temp:String = "class.method";
       schermObjectBtn.addEventListener(MouseEvent.CLICK, function (event:MouseEvent):void{
                   callAnotherFunction(event,temp);
      private function callAnotherFunction(event:MouseEvent, temp:String):void
    ]]>
    </mx:Script>
    <mx:Button id="schermObjectBtn" label="Click ME"/>
    </mx:Application>
    If this post answers your question or helps, please kindly mark it as such.
    Thanks,
    Bhasker Chari

  • Wrong Number Of Parameters For A Method

    Exactly like the title. If I pass in too many or too few parameters in a method, am I allowed to add a customized error message?
    JW, Thanks.

    It's not possible to pass in too many or too few characters. The compiler would prevent it, and generate its own error message.
    I suppose you could do something like this if you were using varargs....but why bother?

  • Problems passing parameters

    I have problems passing parameters from the html to the applet which is driving me crazy !!!
    HTML:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>Test</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <body>
    <APPLET code="com.b4.test.AppletTest.class" width="250" height="250">
    <PARAM NAME="val" value="9999">
    </APPLET>
    </body>
    </html>And here the Java Code:
    package com.b4.test;
    import java.awt.Dimension;
    import javax.swing.JApplet;
    import javax.swing.JComponent;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    public class TestAp extends javax.swing.JApplet {
         private String val;
         private JLabel jlblVal;
         public static void main(String[] args) {
              JFrame frame = new JFrame();
              TestAp inst = new TestAp();
              frame.getContentPane().add(inst);
              ((JComponent)frame.getContentPane()).setPreferredSize(inst.getSize());
              frame.pack();
              frame.setVisible(true);
         public void init(){
              val = this.getParameter("val");
         public TestAp() {
              super();
              initGUI();
              jlblVal.setText(this.val);
         private void initGUI() {
              try {
                   this.setSize(200, 200);
                   this.getContentPane().setBackground(new java.awt.Color(0,255,0));
                        jlblVal = new JLabel();
                        this.getContentPane().add(jlblVal);
                        jlblVal.setText("Nothing");
              } catch (Exception e) {
                   e.printStackTrace();
    }

    constructor TestApp gets called before init.
    import java.applet.Applet;
    public class test extends Applet {
         private String val;
         public void init() {
              val = this.getParameter("val");
         public test() {
              super();
              System.out.println(this.val);
    }This will work
    import java.applet.Applet;
    public class test extends Applet {
         private String val;
         public void init() {
              val = this.getParameter("val");
              System.out.println(this.val);
         public test() {
              super();
    }

  • How I can pass parameters by POST method?

    How I can pass parameters by POST method?
    I use URL Template iView. I checked Requested Method - POST, but when I started the iView the program says:"It's a GET method!"
    I use httpServletRequest.getMethod()in the program.
    Environment: EP6 SP2
    Thank's! 

    Hi Kremena,
    the OSS stands for "Online Service System" - service.sap.com - messages or directly: service.sap.com/message.
    Hope it helps
    Detlev

  • Using null for parameterized "newInstance(Object [])" method in Object[].

    I have a really serious problem. I am creating instances of specific classes by using reflection techniques. I am reading a flat file, finding class from its name and creating it by using its parameterized constructor. Example:
    line 1: Dummy("A",Dummy2("B"),12,,"C");
    I create an instance of Dummy with parameters "A", an instance of Dummy2 object with value "B", 12 (I use here Integer as wrapper), null (There is no wrapper for null :( ) and "C".
    I find constructor by using findConstructors() and looking their parameter counts, creating an object array with given values and calling:
    constructorIFoundBefore.newInstance(objectArrayIPrepared);
    But!!!
    Because I use null directly, I got this message:
    java.lang.IllegalArgumentException: argument type mismatch
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
         at reader.parser.ObjectCreator.createObjectFromObjectItem(ObjectCreator.java:192)
         at reader.parser.ObjectCreator.createObjectFromParseItem(ObjectCreator.java:112)
         at reader.parser.ObjectCreator.createObject(ObjectCreator.java:78)
         at reader.analyzer.FileAnalyzer.analyzeAndCreateObjects(FileAnalyzer.java:95)
         at reader.ReverseReader.main(ReverseReader.java:43)
    I will be very glad if you help me.
    Thanks a lot!
    Gokcer

    I said something wrong. Sorry. While invoking a method (or a constructor) we need an object array which are equivalent to parameters. For example to call a method or constructor for class A;
    class A {
    int age;
    String name;
    public A(int age, String name){
    this.age = age;
    this.name = name;
    public set(int age, String name){
    this.age = age;
    this.name = name;
    we use in any place
    A a1 = new A(12,"Gokcer");
    A a2 = new A(15,null);
    To achieve this by using reflection techniques, we must find constructor with two parameters of class A. At this point "BetterMethodFinder" will give great help.
    After finding right constructor, we must create an object array to tell the constructor parameters (age and name). At this point we need an object array which stores our parameters. Code must be like this.
    Object []params = new Object[2]; // we have two parameters.
    params[0] = new Integer(12); // we can't use params[0]=12
    // because 12 is not an object. (It is a
    // primitive type)
    params[1] = "Gokcer";
    Now create the new object.
    A a1;
    a1 = constructorWeFound.newInstance(params);
    While creating param[], we could also use:
    Object []params = new Object[2] {new Integer(12),"Gokcer"};
    While creating a2, we can use "null" directly for second parameter.
    params = new Object[2] = {new Integer(15), null};
    or
    Object []params = new Object[2];
    params[0] = new Integer(15);params[1] = null;
    Thanks again everyone who replied me.
    My sincerely...

  • Problem with parameters in xsl

    Hi there,
    I have some trouble to use parameters or varaibles between models.
    Here is my xml file format :
    <ROOT>
    <PARAM>
    <NAME>NUMBER_STATION</NAME>
    <TYPE>INT</TYPE>
    <VAL>20</VAL>
    </PARAM>
    <PARAM>
    <NAME>NAME_STATION</NAME>
    <TYPE>TEXT</TYPE>
    <VAL>LAX</VAL>
    </PARAM>
    </ROOT>
    What I would like to do in the xsl code is to deal with PARAM differently if TYPE is INT or TEXT.
    Here is my xsl code :
    <xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:java="java"
    xmlns:display="base.Display"
    version="1.0">
    <xsl:param name="name_p">0</xsl:param>
    <xsl:param name="type_p">INT</xsl:param>
    <xsl:output method="html" />
    <xsl:template match="/">
    <xsl:apply-templates select="ROOT/PARAM[NAME=$name_p]/TYPE" />
    <xsl:apply-templates select="ROOT/PARAM[NAME=$name_p]/VAL" />
    </xsl:template>
    <xsl:template match="TYPE">
    <xsl:variable name="type_p" select="text()"/>
    </xsl:template>
    <xsl:template match="VAL">
    <xsl:choose>
    <xsl:when test="$type_p = 'POURCENT'">
    <td>
    </td>
    </xsl:when>
    <xsl:otherwise>
    <td>
    </td>
    </xsl:othewise>
    </xsl:choose>
    </xsl:template>
    But of course this is not working...I also tried to use <xsl:call-template> with a parameter but without sucess. Does anybody have some idear about that ?
    Thanks in advance !

    "Not working" is not much information to go on. So I will just throw out some ideas. First make sure you are actually passing the parameters to your transform. Second, use XPath expressions that actually select something from your XML. The ones you are using are looking for a TYPE element that's the child of a PARAM element (that has a NAME child with a particular value), and there are no such elements in your example.
    PC&#178;

  • Problems returning VARRAY (or  TABLE) / method  on _IOraDatabase failure

    I am trying to return a VARRAY through OO4O (currently using VB6) but am getting an error back that I don't seem to be able to resolve.
    The SQL procedure is declared as:
    PROCEDURE "RD_GET_TOPOAREAS2_SIZED" (
    minX IN NUMBER, minY IN NUMBER, maxX IN NUMBER, maxY IN NUMBER,
    maxArea IN NUMBER, dt IN DATE, timing OUT NUMBER,
    IDLIST OUT v_numArray, RETDATA OUT NOCOPY t_cursor
    types are defined in the package spec as:
    TYPE t_cursor IS REF CURSOR ;
    TYPE v_numArray IS VARRAY(20000) OF NUMBER;
    TYPE nt_numArray IS TABLE OF NUMBER;
    The calling code is:
    Dim odb As OraDatabase
    Dim oparams As OraParameters
    Dim odyn As OraDynaset
    Set oparams = odb.Parameters
    oparams.Add "minx", 406000, ORAPARM_INPUT, ORATYPE_NUMBER
    oparams.Add "miny", 259000, ORAPARM_INPUT, ORATYPE_NUMBER
    oparams.Add "maxx", 410000, ORAPARM_INPUT, ORATYPE_NUMBER
    oparams.Add "maxy", 261000, ORAPARM_INPUT, ORATYPE_NUMBER
    oparams.Add "maxarea", 100, ORAPARM_INPUT, ORATYPE_NUMBER
    oparams.Add "dt", Null, ORAPARM_INPUT, ORATYPE_DATE
    oparams.Add "time", 0, ORAPARM_OUTPUT, ORATYPE_NUMBER
    oparams.Add "IDLIST", Null, ORAPARM_OUTPUT,
    ORATYPE_VARRAY, "V_NUMARRAY"
    oparams.Add "RETDATA", Null, ORAPARM_OUTPUT, ORATYPE_CURSOR
    Set odyn = odb.CreatePlsqlDynaset(sql, "RETDATA", 8)
    Calling the sql gives me the following error message:
    Run-time error: '-2147417848 (80010108)':
    Method 'CreatePlsqlDynaset' of object '_IOraDatabase' failed
    I have also tried passing the parameter as:
    oparams.AddTable "IDLIST", ORAPARM_OUTPUT, ORATYPE_NUMBER, 20000
    but this gives me a parameter type mismatch.
    Ideally, I would prefer to return the data in a nested table (type nt_numArray),
    but I can't get the call to work with that either (same error).
    I've seen the other couple of posts on this subject, and the fact that a bug giving the same error message was supposed to have been fixed in v 4.3.
    I am currently using the version that came with 11.1.0.6.20 which is v 5.0 I think.
    What's going wrong, and how can I fix it?
    Richard

    Forgot to add the calling sql:
    sql = "begin rd_get_topoareas2_sized " + _
    (:minx,:miny,:maxx,:maxy,:maxarea,:dt,:time,:IDLIST,:R
    ETDATA); end;"
    RichardThat is, I forgot to add that line to the problem, NOT that that was what was causing it!

  • Optional parameters to webservice method over FORM-GET

    Hi.
    I'm developing a proof of concept webservice using Workshop and my test method looks something like this:
         * @common:operation
         * @jws:protocol soap-style="rpc" http-xml="false"
            form-post="true" http-soap="true"
        public void foobar(
            String param1, String param2, String param3)
        }The schema elements I map to the parameters specifies that they are optional.
    There are no problems when using this as a webservice - I'm able to specify these optional parameters (or not). When I invoke this using FORM-GET, it seems that these parameters are all required (although I can specify an empty value).
    E.g. The following works fine:
    http://localhost:7001/TestWebService/Test.jws?param1=abc&param2=def&param3=ghi
    The following works fine and calls my code with param1 being an empty string:
    http://localhost:7001/TestWebService/Test.jws?param1=&param2=def&param3=ghi
    The following returns an error:
    http://localhost:7001/TestWebService/Test.jws?param2=def&param3=ghi
    The error is: "Unable to transform query arguments to Java arguments Parameter 'param1' - No value found"
    Can anyone advise on how to not require the presence of optional parameters using FORM-GET?
    Regards,
    Michael.

    Hi,
    thanks for the quick turn-around. Jdev version that i am using is Studio Edition Version 11.1.1.6.0. And i am using SOAP. Isnt there a way without using a backing bean? I am planning to use it as a portlet. Would'nt creating a backing bean cause a problem in that case?? Also i am confused here . The method that i am dragging is GET_ACCOUNTOperation(Object). I tried passing the hashmap . It gave the following exception :
    javax.el.MethodNotFoundException: Method not found: GET_ACCOUNTOperation.execute(java.util.HashMap)
    Rampal

Maybe you are looking for

  • OS 10.9 Finder sidebar suddenly does not displaying proper contents

    OS 10.9 Finder sidebar suddenly does not display most items; only shows couple items I don't even want there.  Can change what shows in first finder window but sidebar not responding to "Preference" changes.  Screen shot is what it shows now. I downl

  • Web Services Language

    Hi guys, We are testing a bunch of We Services with SOAPUI tool, and we are having the folllowing problem: All descriptions depending on language are displayed in english in SOAPUI. Our client works in spansh language, so they are getting problems wi

  • Smartview 11.1.2.1 - Compatible with Essbase 9.3.1?

    Hi, Migrating from 9.3.1 Planning/Essbase to 11.1.2.1 However company wants to run concurrently for a few months. How can users do this with only one version of Smartview installed? Can 11.1.2.1 Smartview work against the 9.3.1 Essbase databases?

  • ITunes Randomly Quits - Help

    Hey, I have been having an Issue with my iTunes Randomly Quitting / Crashing on me for about the last  month. I am not sure what the exact issue is I have re-installed my OS, Repair Premmssions. This happens when iTunes is not doing anything. Usually

  • Photoshop Elements 13 - Will no longer load / open!!!

    Hi, I downloaded the photoshop elements 13 this afternoon. Once download was complete, I used the programme fine. I then closed the programme down, and now it won't let me re-open. No message comes up - but it just does nothing!!!! I have spent HOURS