Problems using a static class extending JSPDynPage

When I use the pdk with netweaver for creating a new portal object and I want to create a new PortalComponent (JSPDynpage) the pdk generates me the next code:
public class TestJspDynPage extends PageProcessorComponent {
  public DynPage getPage(){
      return new TestJspDynPageDynPage(); }
  public <b>static</b> class TestJspDynPageDynPage extends JSPDynPage{
    public void doInitialization(){ }
    public void doProcessAfterInput() throws PageException {}
    public void doProcessBeforeOutput() throws PageException {}
Is there any reason for creating the new class that extends JSPDynPage static ?
Regards.

Hi,
That is a common problem, all variables in your JSPDynPage, should be saved in IPortalComponentSession/HttpSession instead of having instance/class variables.
http://help.sap.com/saphelp_nw70/helpdata/en/fc/f28f414141a709e10000000a155106/frameset.htm
http://help.sap.com/saphelp_nw70/helpdata/en/a0/3b7f41009d020de10000000a1550b0/frameset.htm
Greetings,
Praveen Gudapati

Similar Messages

  • Using mouselistener and class extending jbutton

    Hello,
    I wondered if anyone could advice, I am trying wrote a class which lowers the border of a jbutton when the button is clicked, and stays lowered until clicked again. In the sameway as bold does in ms word.
    I understand I can use setBorder(raised) or setBorder(lowered).
    But I was unsure which method here to place this code.
    Thank you
    public class AddButton extends JButton implements MouseListener{
    protected Border raised = new SoftBevelBorder(BevelBorder.RAISED);
         protected Border lowered = new SoftBevelBorder(BevelBorder.LOWERED);
    public void mouseClicked(MouseEvent e) { }
    public void mouseMoved(MouseEvent e) { }
    public void mouseExited(MouseEvent e) { }
    public void mouseReleased(MouseEvent e) { }
    public void mouseEntered(MouseEvent e) { }
    public void mousePressed(MouseEvent e) { }
    public void mouseDragged(MouseEvent e) { }
    }

    import java.awt.*;
    import javax.swing.border.Border;
    import java.awt.event.*;
    import javax.swing.*;
    public class Test3 extends JFrame {
      Border rb = BorderFactory.createRaisedBevelBorder(),
             lb = BorderFactory.createLoweredBevelBorder();
      JButton jb1 = new JButton("I am Button"), jb2 = new JButton("Hear me roar");
      public Test3() {
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        Container content = getContentPane();
        content.setLayout(new FlowLayout());
        jb1.setBorder(rb);
        content.add(jb1);
        jb1.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent ae) {
            jb1.setBorder(jb1.getBorder()==rb?lb:rb);
        jb2.setBorder(rb);
        content.add(jb2);
        jb2.addMouseListener(new MouseAdapter() {
          public void mouseReleased(MouseEvent me) {
            jb2.setBorder(jb2.getBorder()==rb?lb:rb);
        JToggleButton jtb = new JToggleButton("Toggley Button");
        content.add(jtb);
        setSize(300,300);
        setVisible(true);
      public static void main(String[] arghs) { new Test3(); }
    }

  • Using JAXB for classes extending third party objects

    I am trying to use JMX WS connector in my project. I have stuck with a problem I cannot solve. For example, I have class
    public class TypedObjectName extends ObjectName
    I do not know how to annotate this class. If I am trying to use @XmlRootElement annotation and provide no-arg default constructor for this class, JAXB throws an error
    Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
    javax.management.ObjectName does not have a no-arg default constructor.
    this problem is related to the following location:
    at javax.management.ObjectName
    at com.hp.usage.mgmt.naming.TypedObjectName
    I am not able to modify ObjectName because it is a part of jdk, third party class from javax.management. I need to have this class in JAXB context since one my service has a method with this type, for example
    *public interface PerformanceMeasurement {*
    public TypedObjectName getJob();
    Any ideas to make it workable?

    Yes, right, I have seen this blog and if you read it carefully, there is a note rearding root object
    The root object case is not quite as clean. The result of the unmarshal operation will be the adapted object, then you will need to call the conversion code yourself.
    It means I need to change an API, in case of JMX WS Connector, instead of
    public interface PerformanceMeasurement {
    public TypedObjectName getJob();
    I will provide
    public interface PerformanceMeasurement {
    public TypedObjectNameAdapter getJob();
    Not sure that it is a good idea
    Edited by: tvv2000 on 03.02.2013 21:24

  • Problem using 3rd party class

    Hi, I'm trying to compile a java code that needs to use a method from a .class file that was given to me, putting this on top:
    import build.zzzz.*;
    The problem is that I cannot get it to compile, it says it can't find that class:
    bash-2.05a$ javac -verbose -classpath ./ proj2.java
    [parsing started proj2.java]
    [parsing completed 491ms]
    [loading ./build/zzzz.class]
    proj2.java:7: cannot access build.zzzz
    bad class file: ./build/zzzz.class
    class file contains wrong class: zzzz
    Please remove or make sure it appears in the correct subdirectory of the classpath.
    import build.zzzz.*;
    The file zzzz.class is under the "build" directory. I tried to copy it also to the working directory and it won't compile. I also tried the fully-qualified path to both directories and wouldn't compile. Am I just importing it in the wrong way? I think the .class file is fine, I can do a javap zzzz and see the method definitions in there.
    I would really appreciate any suggestions, since I have a limited time left to finish it.
    Thanks!

    You told the compiler to look for classes in a package named build.zzzz but you have a class named build.zzzz so it looks like your import should be "import build.zzzz;" or "import build.*;"

  • Problem using Airport Express to extend wireless network.

    I'm trying to extend my wireless network with an Airport Express (brand new, bought last week), but can only seem to do so by connecting it via cat5 to the router, which doesn't actually extend anything.  I have a Linksys WRT54GS with DD-WRT, and want to have the Airport Express in a different room so cat5 isn't an option.
    I'm using WPA2 Personal security on my network.
    I've tried to follow several sets of instructions from these forums and on blogs, but the only things I've been able to do are...
    1) connect via cat5, selecting "Create a new network" with the same SSID and such, but it doesn't give me any more range.
    2) connect wirelessly selecting "Join an existing network", but that doesn't extend the network at all either, even if I put the AE at the edge of the network now.
    Thanks in advance.  All I really want to do is access my wireless from the other half of my house.
    Zack

    It was possible to create a WDS between the older 802.11g AirPort Express and the Linksys WRT-54GS and this (as you know) has been documented on the Internet. However, I do not know of anyone that has been successful doing so with either of the 802.11n generations.
    The two methods that you have tried would not work as neither is the proper method to set up a WDS. Please check out the following Apple Support article for more details. If you are successful in setting a WDS between them, please post back your results.

  • Problems using time capsule to extend wireless network

    Hi all,
    For some months I had to move to Germany for work (I'm from Italy, sorry for my English).
    I am sharing internet with some other people, the wi-fi router is in their apartment, so basically I don't have access.
    As the signal is strong enough only in one room I would like to use my time capsule to extend it also in the other rooms.
    But when I try to extend it, my macbook pro connects to the network I would like to extend and the time capsule is not seen anymore.
    To see the time capsule again in the airport utility i have to reset it to factory default.
    Do you have any idea?
    The wireless network is WPA2 protected, the provider is the German "Unity Media".

    As the signal is strong enough only in one room I would like to use my time capsule to extend it also in the other rooms.
    Apple's "extend" feature will only work if the Time Capsule is "extending" the wireless signal from another Apple wireless router. In other words, the "extend" feature is not compatible with wireless routers from other manufacturers.
    You will need to connect the Time Capsule to the wireless router using a wired Ethernet connection.  Connect from one of the LAN <-> ports on the wireless router to the WAN "O" port on the Time Capsule.  Then, you can configure the Time Capsule to provide a separate wireless network for your use.

  • Problem using java crypto class... Please help me

    Hi, i'm trying to do application that send information via socket, and i have to send the data encrypted,
    i`m trying to implemented the RC4 algorithm.... I read an article that said that the java sdk 1.4 has already
    implemented the securities classes. So I made this little program:
    import javax.crypto.spec.*;
    import javax.crypto.*;
    import java.security.*;
    import java.io.*;
    public class MicroRC4
    public void encriptaClavePublica(String trama)
    Cipher rc4Cipher;
    byte[] rc4KeyByte;
    SecretKey rc4Key;
    String keyStr;
    String messageEncryp;
    byte[] messageEncrypByte;
    rc4Key = null;
    messageEncryp = trama;
    // Clave para encriptar el mensaje
    keyStr = new String();
    keyStr = "12345678";
    rc4KeyByte = new byte[8];
    messageEncrypByte = new byte[255];
    for(int i=0; i < 8; i++)
    rc4KeyByte[i] = (byte)keyStr.charAt(i);
    try
    for(int i=0; i < messageEncryp.length(); i++)
    messageEncrypByte[i] = (byte)messageEncryp.charAt(i);
    rc4Key = (SecretKey)new SecretKeySpec(rc4KeyByte, "RC4");
    rc4Cipher = Cipher.getInstance("RC4");
    rc4Cipher.init(Cipher.ENCRYPT_MODE, rc4Key);
    byte[] result = null;
    result = rc4Cipher.doFinal(messageEncrypByte);
    System.out.println("Usage:"+result);
    catch(Exception e)
    System.out.println(" Error: " + e.getMessage());
    System.out.println("\n........................................\n");
    I don't know what is wrong but when i run the application it show me the following message :
    Error: Algorithm RC4 not available
    Does anybody know what is wrong ??
    Does anybody can help me ??
    or tell me when can i find some source code that implement de RC4 algorithm
    Thank's in advance..
    Alejandro.

    Hi Alejandro,
    In the ends i decided to implement the algorithm by
    myself, i did it... any way thank's again.... If
    anybody want to see the code, send me a mail......
    AlejandroCan I also get the source code? my email id is [email protected]
    Thanks a lot!
    Srik.

  • Static class could not use by SAP AS[JAVA]

    hello everyone:
      I migrate one J2ee application from a standard J2EE server ,deploy is OK,but it does not work.
      I  found that the static class will not be used in web tier,the detail is :
      there is a static class to implement the MD5 encryption,it will encrypt the data and return encryptd data .
      when I use this static class at my MainServlet ,which is a servlet,exception throw,and I copy the encrypt method as private method of the servlet ,it works!
      now,I really puzzle with it,the web container of SAP AS will not support static class?or it's a BUG of it?or something else?
    regards for any
    steff
    Message was edited by: steff yan

    I'm running into a similiar situation where I am porting over a J2EE application over and I am unable to access the static classes.   Not sure what the previous poster meant by fixing the static class to be "thread safe"?  
    Is it a matter of thread safety?  And if so, it would appear that the WAS is very specific in these requirements.  Is there a way around it?  Or at least a standard to follow?
    -David

  • Do static classes persist for the lifetime of the applet or the JRE in 1.4

    I have an application that runs in a web browser and uses several applets that share data between each other using a static class. This method works fine for version 1.3 but not in 1.4.x. Do static classes now only exist for the lifetime of the applet?

    I had a similar problem and solved it by setting the codebase attribute on the applet tags. The only documentation I have been able to find about this issue is here: http://java.sun.com/products/plugin/1.3.1_01a/new.html#classloader

  • Classloading within Webstart plus static classes

    Hi folks!
    I've a big problem in a software project in "migrating" a normal client-server-RMI-SWT-application to be 100% webstart compatible.
    Everything works really fine except for dynamic classloading on demand.
    The system currently is packaged in some jars.
    Depending on the mask shown to the screen, the system looks for a "customize" class inside the resources. If it finds one, it loads and then does a "defineClass" and then calls a method via the "invoke" mechanism.
    The classes are kind of standardized.
    The problem is, that the "refering" classes from the - let's say - main application are mostly static.
    The called class then tries to call the "namespace" of these classes but only get's null objects - no matter what object it was.
    Run as a normal application - the whole system is working perfectly.
    So as a "big picture", I have the following construct:
    calling Client-Application + Classloader, using a static class for saving object data.
    defining content of one of these static classes:
    DemoObject.setFoobar("Hello world");
    ClassLoader .....
    getResourceAsStream("com/foobar/demo/customizeLogic.class");
    defineClass(byte[] blablablabla,....)
    findMethod.....
    myMethod.invoke(....)inside the dynamic loaded customizeLogic class we do the following
    String demo = DemoObject.getFoobar();
    // this results now into NULL
    // even the ClassLoader is manually loading all java.* plus all other classes because it seems to have a securitymechanism not to share the class-space.I already tried to set the classloader to all variants like SystemClassLoader, ContextClassLoader etc.
    -- but, none worked. I cannot share the same ClassLoader-Resources with the main and "fixed" application... :-(
    Does anyone have a clue or needs more information? I can post some sourcecode also.
    Thorsten

    Hi folks!
    For the most of our problems we're now doing it as "keep it simple".
    I'm just making a Class.forName - "Loading" which works good for alle the classes out of the jars.
    PLUS the setSecurityManager tag - yup.
    During the last weeks I wasn't able to reply because the project ate too much time.
    We'll split the classloading into two or more or less 3-4 parts. One is for the WEBSTART - Edition and one for "normal Client" version. The webstart version we'll split for loading classes vs. loading "normal" resources out of the jars... this will give us flexibility while being able to solve all our problems for now...
    Regards,
    Thorsten

  • Static Class JMS Listener

    I am designing an EJB component (MessageDrivenBean) that requires
    dynamic ("hot") configuration changes. As such, the bean must be
    notified somehow of configuration changes in the DB (rather than have
    to poll the DB for changes at every method call).
    I'm thinking of implementing this functionality using a static class
    instance (singleton) that is shared between the multiple instances of
    the bean. This static instance would listen on a JMS topic for
    configuration change events and update its internal cache accordingly
    (by getting the configuration information from the DB). The beans
    would then access this in-memory static instance everytime they need
    configuration info instead of polling the database. By using the JMS
    topic, I guarantee that clustered instances of Weblogic will all be
    notified of the database changes (each instance would have its own
    "cache" singleton).
    I'm pretty sure all of this will work, but I'm equally sure that I'm
    violating some EJB rules. Singletons and JMS listeners are generally
    discouraged. Are there any alternatives to this design?

    Hi Joost,
    This all seems to be pretty complicated. Not to mention that you can not
    guarantee that members of a cluster will be notified simultaneously.
    Why don't you want using the database?
    "Joost Ouwerkerk" <[email protected]> wrote in message
    news:[email protected]..
    I am designing an EJB component (MessageDrivenBean) that requires
    dynamic ("hot") configuration changes. As such, the bean must be
    notified somehow of configuration changes in the DB (rather than have
    to poll the DB for changes at every method call).
    I'm thinking of implementing this functionality using a static class
    instance (singleton) that is shared between the multiple instances of
    the bean. This static instance would listen on a JMS topic for
    configuration change events and update its internal cache accordingly
    (by getting the configuration information from the DB). The beans
    would then access this in-memory static instance everytime they need
    configuration info instead of polling the database. By using the JMS
    topic, I guarantee that clustered instances of Weblogic will all be
    notified of the database changes (each instance would have its own
    "cache" singleton).
    I'm pretty sure all of this will work, but I'm equally sure that I'm
    violating some EJB rules. Singletons and JMS listeners are generally
    discouraged. Are there any alternatives to this design?Regards,
    Slava Imeshev

  • Static class functions: PLS-00801: internal error [phd_get_defn:D_S_ED:LHS]

    Any ideas why this would generate an internal error - referring to a static class function in that class constructor's parameter signature?
    Test case (on 11.2.0.2) as follows:
    SQL> create or replace type TMyObject is object(
      2          id      integer,
      3          name    varchar2(30),
      4 
      5          static function DefaultID return integer,
      6          static function DefaultName return varchar2,
      7 
      8          constructor function TMyObject(
      9                  objID integer default TMyObject.DefaultID(), objName varchar2 default TMyObject.DefaultName()
    10          )return self as result
    11  );
    12  /
    Type created.
    SQL>
    SQL> create or replace type body TMyObject is
      2 
      3          static function DefaultID return integer is
      4          begin
      5                  return( 0 );
      6          end;
      7 
      8          static function DefaultName return varchar2 is
      9          begin
    10                  return( 'foo' );
    11          end;
    12 
    13          constructor function TMyObject(
    14                  objID integer default TMyObject.DefaultID(), objName varchar2 default TMyObject.DefaultName()
    15          )return self as result is
    16          begin
    17                  self.id := objId;
    18                  self.name := objName;
    19                  return;
    20          end;
    21 
    22  end;
    23  /
    Type body created.
    SQL>
    SQL> declare
      2          obj     TMyObject;
      3  begin
      4          obj := new TMyObject();
      5  end;
      6  /
    declare
    ERROR at line 1:
    ORA-06550: line 0, column 0:
    PLS-00801: internal error [phd_get_defn:D_S_ED:LHS]If the static class functions are removed from the constructor and applied instead inside the constructor body, it works without error. Likewise you can call the constructor with the static class functions as parameters, without an internal error resulting.
    SQL> create or replace type TMyObject is object(
      2          id      integer,
      3          name    varchar2(30),
      4 
      5          static function DefaultID return integer,
      6          static function DefaultName return varchar2,
      7 
      8          constructor function TMyObject(
      9                  objID integer default null, objName varchar2 default null
    10          )return self as result
    11  );
    12  /
    Type created.
    SQL>
    SQL> create or replace type body TMyObject is
      2 
      3          static function DefaultID return integer is
      4          begin
      5                  return( 0 );
      6          end;
      7 
      8          static function DefaultName return varchar2 is
      9          begin
    10                  return( 'foo' );
    11          end;
    12 
    13          constructor function TMyObject(
    14                  objID integer default null, objName varchar2 default null
    15          )return self as result is
    16          begin
    17                  self.id := nvl( objId, TMyObject.DefaultID() );
    18                  self.name := nvl( objName, TMyObject.DefaultName() );
    19                  return;
    20          end;
    21 
    22  end;
    23  /
    Type body created.
    SQL>
    SQL> declare
      2          obj     TMyObject;
      3  begin
      4          obj := new TMyObject();
      5  end;
      6  /
    PL/SQL procedure successfully completed.
    SQL>
    SQL> declare
      2          obj     TMyObject;
      3  begin
      4          obj := new TMyObject(
      5                          objID => TMyObject.DefaultID(),
      6                          objName => TMyObject.DefaultName()
      7                  );
      8  end;
      9  /
    PL/SQL procedure successfully completed.
    SQL> Had a quick look on support.oracle.com and did not turn up any specific notes dealing with the use of static class functions in the parameter signature of the constructor. Known issue? Any other workaround besides the one above?

    Hi,
    there is a bug: "Bug 8470406: OBJECT INSTANCE CREATION FAILS WITH ERROR PLS-00801 IN 11GR1", it shows the behaviour in 11g but not in 10.2. It gives exactly the symptoms you also see, move it to the body and it works. But there is no solution/patch given.
    Herald ten Dam
    http://htendam.wordpress.com

  • Static Classes/Methods vs Objects/Instance Classes/Methods?

    Hi,
    I am reading "Official ABAP Programming Guidelines" book. And I saw the rule:
    Rule 5.3: Do Not Use Static Classes
    Preferably use objects instead of static classes. If you don't want to have a multiple instantiation, you can use singletons.
    I needed to create a global class and some methods under that. And there is no any object-oriented design idea exists. Instead of creating a function group/modules, I have decided to create a global class (even is a abstract class) and some static methods.So I directly use these static methods by using zcl_class=>method().
    But the rule above says "Don't use static classes/methods, always use instance methods if even there is no object-oriented design".
    The book listed several reasons, one for example
    1-) Static classes are implicitly loaded first time they are used, and the corresponding static constructor -of available- is executed. They remain in the memory as long as the current internal session exists. Therefore, if you use static classes, you cannot actually control the time of initialization and have no option to release the memory.
    So if I use a static class/method in a subroutine, it will be loaded into memory and it will stay in the memory till I close the program.
    But if I use instance class/method, I can CREATE OBJECT lo_object TYPE REF TO zcl_class then use method lo_object->method(), then I can FREE  lo_object to delete from the memory. Is my understanding correct?
    Any idea? What do you prefer Static Class OR Object/Instance Class?
    Thanks in advance.
    Tuncay

    @Naimesh Patel
    So you recommend to use instance class/methods even though method logic is just self-executable. Right?
    <h3>Example:</h3>
    <h4>Instance option</h4>
    CLASS zcl_class DEFINITION.
      METHODS add_1 IMPORTING i_input type i EXPORTING e_output type i.
      METHODS subtract_1 IMPORTING i_input type i EXPORTING e_output type i.
    ENDCLASS
    CLASS zcl_class IMPLEMENTATION.
      METHOD add_1.
        e_output = i_input + 1.
      ENDMETHOD.
      METHOD subtract_1.
        e_output = i_input - 1.
      ENDMETHOD.
    ENDCLASS
    CREATE OBJECT lo_object.
    lo_object->add_1(
      exporting i_input = 1
      importing e_output = lv_output ).
    lo_object->subtract_1(
      exporting i_input = 2
      importing e_output = lv_output2 ).
    <h4>Static option</h4>
    CLASS zcl_class DEFINITION.
      CLASS-METHODS add_1 IMPORTING i_input type i EXPORTING e_output type i.
      CLASS-METHODS subtract_1 IMPORTING i_input type i EXPORTING e_output type i.
    ENDCLASS
    CLASS zcl_class IMPLEMENTATION.
      METHOD add_1.
        e_output = i_input + 1.
      ENDMETHOD.
      METHOD subtract_1.
        e_output = i_input - 1.
      ENDMETHOD.
    ENDCLASS
    CREATE OBJECT lo_object.
    lo_object->add_1(
    zcl_class=>add_1(
      exporting i_input = 1
      importing e_output = lv_output ).
    lo_object->subtract_1(
    zcl_class=>subtract_1(
      exporting i_input = 2
      importing e_output = lv_output2 ).
    So which option is best? Pros and Cons?

  • Singleton instance vs static class

    Hi,
    I often got confused to identify when is better to use a singleton instance and when is better use a static class insted.
    Could someone please advise what criteria should be observed to decide which way is better?
    Thanks in advance,

    A class with all static methods generally connotes a helper class that supplies behavior or enforces business rules of other objects. A class with only state and no behavior is typically encountered in distributed systems, also known as a transfer object. Most true objects have both state and behavior. A singleton is simply a normal object that ensures only a single instance of itself will ever be created and returned for use to a caller.
    - Saish

  • What is static class ?

    I know about static function.
    What is static class?
    What is the use of static class?
    how can i use static class.?
    Give me a  static class example?

    Static class and singleton are similar but they are not the same. A singleton is instantiated, and you have a reference to it - just one single reference no matter how many times you instantiate it. Singletons are good for data storage, config settings, loggers things that you may need all around your application, but you always want the same one.
    A static class is not instantiated - an example of this is Flash's Math class. You can just do Math.sin() and get a result, you don't instantiate it in order to use it. Static classes are good for utility classes... essentially they are simply a namespace for a group of methods.
    Oh, and you said you know about static function - what is static class - a static class then is just one that contains only static functions/methods.

Maybe you are looking for

  • Apple should make transfer for iPhone 4 users to iPhone 5c

    Old users can get for free iPhone 5c. Apple have many iPhone 5c models but they are not famous and now you get it?

  • Page size view in mobile

    Any thoughts on why this page when viewed on an iPhone/any mobile device appears close-up on the video, as opposed to scaling back to it's original page format/size? Thanks for your advice.

  • Configuring weblogic as a webserver

    We have a client with the following architecture: 1. Weblogic 5.1 as web server on one host (used for jsp) 2. Weblogic 5.1 as app server on a different host behind the firewall (used for ejb) Both are running on Solaris 7. How do I configure these tw

  • PeopleTools 8.53 Release Value Proposition (RVP) published

    Check out the blog posting on the PeopleTools 8.53 RVP https://blogs.oracle.com/peopletools/entry/oracle_peoplesoft_peopletools_8_53 Edited by: Greg Kelly on Jul 7, 2012 9:48 AM

  • Cover Flow effect anyone?

    I want to use 10 or so stills in a piece and I got the idea that they'd look great if I could have the stills move across the screen as album covers move across the screen in iTunes, or on the iPod & iPhone. Anyone have a formula for making this effe