JSP and Instance Variables

I have some questions about JSP presentation (Interactive Component Call in Screenflow):
- Only BPM Objects are possible to be mapped in JSP?
- Is possible to map two or more BPM Objects to the JSP?
- What is the difference of mapping using the variable "attributes" in argument mapping and the option "Select BPM object variable" in main task of Interactive Component Call activity?

I seem to be having a similar problem.
If I include this fragment, for an instance variable called "contacts" which is a BPMObject of type "ITSSContactRequest".
<%
Object r = request.getAttribute("contacts");               
Class cl = r.getClass();
out.println(cl.getName());
%>
I get the following output:
xobject.ITSSContactManagement.ITSSContactRequest
and I can access the object via reflection:
<%
Object r = request.getAttribute("contacts");               
Class cl = r.getClass();
out.println(cl.getName());     
Method getGeneralContacts = cl.getMethod("getGeneralContacts", null);               
Object rv = getGeneralContacts.invoke(r);
%>
and access the rv variable accordingly.
However, if I try and cast the variable directly:
<%
Object r = request.getAttribute("contacts");
Class cl = r.getClass();               
out.println(cl.getName());
xobject.ITSSContactManagement.ITSSContactRequest rq = (xobject.ITSSContactManagement.ITSSContactRequest)r;
%>
I get the following error message:
"The task could not be successfully executed. Reason: 'fuego.web.execution.exception.InternalForwardException: UnExpected error during internal forward process.'.
See log file for more information [Error code: workspace-1258985548580] "
The same error occurs if I try and import the object via
<%@ page import="xobject.ITSSContactManagement.ITSSContactRequest" %>
Thanks for any help.

Similar Messages

  • What's the difference between global variables and instance variables?

    hi im just a biginner,
    but what is the difference between these two?
    both i declare them above the constructor right.
    and both can access by any method in the class but my teacher said
    global variables are not permitted in java....
    but i don't know what that means....and i got started to confuse these two types,,
    im confusing.......
    and why my teacher said declaring global variables is not permitted,,,,,,
    why.....

    instance variables are kindof like Global variables. I'm not surprised you are confused.
    The difference is not in how they are declared, but rather in how they are used.
    There are two different "styles" of programming
    - procedural programming.
    - object oriented programming.
    Global variables are a term from Procedural programming.
    In this style of programming, you have only one class, and one "main" procedure. You only create one instance of the class, and then "run" it.
    There is one thread of control, which goes through various methods/procedures to accomplish your task.
    In this style of programming instance variables ARE "global" variables. They are accessible to all methods. There is only one instance of the class, and thus only one instance of the variables.
    Global variables are "bad" BECAUSE you can change them in any method you like. Even from places that shouldn't have to. Also if you use the same name as a global variable and a local variable, you can cause great trouble. This can lead to very subtle bugs, as the procedures interact in ways you don't expect.
    The preferred method in procedural programming is to pass the values as parameters to the methods, and only refer to the parameters, and local variables. This means that you can track exactly what your method is doing, and what it affects. It makes it simpler to understand. If you use global variables in your methods, it becomes harder to understand.
    So when are instance variables not global variables?
    When you are actually using the class as an Object, rather than just a program to run. If you are creating multiple instances of an object, all with different values for their instance variables, then they are not global variables. For instance you declare a Person object with an attribute "firstname". Your "main" program then creates many instances of the Person object, each with their own "firstname"
    I guess at the end of all this, it comes down to definitions.
    Certainly you can write procedural code in java. You can treat your instance variables, for all intents and purposes like global variables.
    I can only think to show a sort of example
    public class Test1
       User[] users;
       public void printUsers(){
         // loop through and print all the users
         // uses a global variable
          for(int i=0; i<users.length; i++){
            users.printUser();
    public void printUsers(User[] users){
    // preferred method - pass it the info it needs to do the job
    for(int i=0; i<users.length; i++){
    users[i].printUser();
    public Test1(){
    User u1 = new User("Tom", 20);
    User u2 = new User("Dick", 42);
    User u3 = new User("Harry", 69);
    users = new User[3];
    users[0] = u1;
    users[1] = u2;
    users[2] = u3;
    printUsers();
    printUsers(users);
    public static void main(String[] args)
    new Test1();
    class User{
    String firstName;
    int age;
    public User(String name, int age){
    this.firstName = name;
    this.age = age;
    public void printUser(){
    // here they are used as instance variables and not global variables
    System.out.println(firstName + " Age: " + age);
    Shit thats a lot of typing, and I'm not even sure I've explained it any good.
    Hope you can make some sense out of this drivel.
    Cheers,
    evnafets

  • Classes, and constructors and instance variables . . . oh my!

    wow, I am really struggling with the stuff we are doing in class for the last few days. I am going to post our assignment and point out specific things I don't understand. I don't understand some of the syntax and the overall logical flow of how parameters get passed back and forth, etc. I have been over our book and class examples and I am still confused.
    Here is one part of the assignment:
    "Create two instances of the MyDate class named begDate and endDate, by using the MyDate constructor after having prompted the user
    3 times for each date for values of a valid month, day, and year."
    Q: how do I create two instances using the constructor?
    (from our assignment) "Within the MyDate class:
         Include three private int variables, named month, day, and year.
         Include a constructor that sets (sets them to what?!) the values of month, day, and year."
    here is what I have:
    public class MyDate {
         private int month, day, year;
         public MyDate (int month, int day, int year){
              month = 0;
              day = 0;
              year = 0;
         }//MyDate Constructor(from our assignment) "Create two instances of the MyDate class named begDate and endDate, by using the MyDate constructor after having prompted the user 3 times for each date for values of a valid month, day, and year."
    and here is what I have in the executable class (it isn't much because I already have an error; it says I can't convert String to MyDate):
    public static void main(String[] args) {
              MyDate begDate = JOptionPane.showInputDialog("beg. month?");
         }I guess I don't know how to use the constructor correctly. Sorry, but I have tried to make this as clear as possible.

    I will give you a start:
    public static void main(String[] args) {
              MyDate begDate new MyDate(JOptionPane.showInputDialog("beg. month?"), JOptionPane.showInputDialog("beg. day?"), JOptionPane.showInputDialog("beg. year?"));
    public class MyDate {
         private int month, day, year;
         public MyDate (int month, int day, int year){
              this.month = month;
              this.day = day;
              this.year = year;
         }//MyDate Constructor
    /code]
    Haven't tested it, maybe made some type mismatches, but at leasy try this one                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Debugging JSPs and inspecting variables

    I've got the debugger running in a jsp, the breakpoints trigger but I can't inspect/watch/view any variables - it just prints up a question mark. This makes the debugger a bit pointless.
    I used to be able to see them, and I've looked all through the project properties - run debug settings but nothing stands out. I'm putting the breakpoint in the .jsp file - I've tried it in the _java file and it doesn't trigger.
    I'm on jdeveloper 10.1.3.1.0.3984 /windows xp sp2/jdk 1.5
    Anyone know how to get this back working? It works fine in normal java files

    Same problem I've been hoping for an answer to in my thread at http://technet.oracle.com:89/ubb/Forum2/HTML/006620.html -- I'd really like to see someone from Oracle comment on this as these problems developing jsps in JDeveloper are a huge problem. That's what's keeping me using JBuilder right now.

  • Business parameter and project variables

    I want to know if Business parameter can be used in place of a prpject variable. My understanding is project variables require an alter command on the DB script during deployment and it is limited to 150 for 1 engine. Hence we dont want to use them. Also wanted to know where are business variables stored in the DB schema. Is there any place where we can get the Engine DB and Directory DB model with relationships and attribute details so that I can understand the system better

    I should have been clearer. A business parameter is not used to store information about a specific instance flowing through the life of a process. They are used as "constants" (quotes around this are explained in my thread above) that can be changed by business owners. They are different than project and instance variables in that:
    1) Business Parameters are global - this means that their value is the same for all processes running on the Engine (e.g. if MIN_CREDIT_SCORE is set to 650 by a business owner, then all instances in all processes that use this know it's value is 650). Both project and instance variable values are unique to each individual work item instance running on a specific process on an Engine.
    2) Business Parameters are infrequently changed and if a business owner changes them to another value, all instances running on the Engine will see the new value.
    3) The global value of business parameters are stored in the Directory Service database. Project and instance variables are stored in the Engine's database.
    4) Business Parameters are not something that you would want to run a BAM report on since their values are global and not specific to a particular work item instance. Again, it's better to think of them as constants. They're not going to help you with BAM reporting.
    Hope this helps,
    Dan

  • Xcode debugger not showing my instance variables!!

    I hate asking questions like this.
    I set a breakpoint in an IBAction method 'pushed:' inside FooViewController.  At runtime I pressed a GUI button and processing stopped in pushed:.
    In the data-viewing pane of xcode, I see
    {code}
    self = (FooViewController *) 0x... etc.
    {code}
    Indented under this is
    {code}
    UIViewController = (UIViewController) { ...
    {code}
    Nowhere do I see any of my instance variables!!
    Now, they were synthesized from properties, but that doesn't matter, does it?
    The code that proceeds to set some instance variables runs fine.
    Why isn't xcode displaying self's instance vars?
    Thanks,
    Chap

    Yes, yours looks like I was expecting mine to look.
    Note that viewDidLoad (below) does work correctly, producing the expected results in the simulator!
    Hangman3ViewController.h:
    @interface Hangman3ViewController : UIViewController {
    @property (         nonatomic )           NSInteger  wordLength;
    @property ( retain, nonatomic )           NSString  *alphabet;
    @property (         nonatomic )           unichar    guess;
    @property (         nonatomic )           NSInteger  guessNo;
    @property ( retain, nonatomic )           NSMutableString *board;
    @property ( retain, nonatomic ) IBOutlet  UILabel   *boardLabel;
    @property ( retain, nonatomic ) IBOutlet  UILabel   *guessNumberLabel;
    @property ( retain, nonatomic ) IBOutlet  NSArray   *keyboardButtons;
    - (IBAction)letter:(id)sender;
    - (void)showBoard;
    @end
    and, Hangman3ViewController.m:
    #import "Hangman3ViewController.h"
    @implementation Hangman3ViewController
    @synthesize wordLength       = _wordLength;  // preprocessor command to gen getter/setter and instance variable
    @synthesize boardLabel       = _boardLabel;  // preprocessor command to gen getter/setter and instance variable
    @synthesize guessNumberLabel = _guessNumberLabel;  // Guess #n
    @synthesize keyboardButtons  = _keyboardButtons;   // array of buttons
    @synthesize alphabet         = _alphabet;    // A-Z unichars
    @synthesize guess            = _guess;       // unichar
    @synthesize guessNo          = _guessNo;     // int
    @synthesize board            = _board;
    - (IBAction)letter:(id)sender
                Get letter from sender - driven when key button is pressed.
                The button's tag is an int from 0-25, identifying what letter of the alphabet it is.
                Extract that unichar from ALPHABET as 'guess'.  Then, disable the button,
                which has been defined to have its text turn white (invisible) when disabled.
        UIButton *button = (UIButton *)sender;
        self.guess = [self.alphabet characterAtIndex: button.tag];
        NSLog(@"Received keystroke: %C", self.guess);
        [button setEnabled:NO];
    - (void)showBoard
        self.boardLabel.text = self.board;
        self.guessNumberLabel.text = [NSString stringWithFormat:@"Guess #%d", self.guessNo];
    - (void)dealloc
        [_boardLabel release];
        [_guessNumberLabel release];
        [_keyboardButtons release];
        [super dealloc];
    - (void)didReceiveMemoryWarning
        // Releases the view if it doesn't have a superview.
        [super didReceiveMemoryWarning];
        // Release any cached data, images, etc that aren't in use.
    #pragma mark - View lifecycle
    // Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
    - (void)viewDidLoad
        NSLog(@"Hello from viewDidLoad");
        [super viewDidLoad];
        self.alphabet   = @"ABCDEFGHIJKLMNOPQRSTUVWXYZ"; // unichar string
        self.wordLength = 7;  // temp - will be set from flipside later on
        self.guessNo    = 1;
        [self.board setString:@"_______"]; // actually dynamic based on wordLength
        self.board = @"_______";
        [self showBoard];
    - (void)viewDidUnload
        [super viewDidUnload];
        // Release any retained subviews of the main view.
        // e.g. self.myOutlet = nil;
    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
        // Return YES for supported orientations
        return (interfaceOrientation == UIInterfaceOrientationPortrait);
    @end

  • How to use an BPM Instance Variable in JSP page

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

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

  • Using multiple instance variables or BPM objects in a single JSP

    In my screenflow, for an user activity, I've selected a BPM object variable for my JSP and using this BPM object variable within the JSP to display or accept values related to this BPM object.
    But in certain circumstances, I need access to some of the instance variables defined in my screenflow (which are not members of the BPM object), and to get these variable values displayed in my JSP. I don't want to overload my BPM object with all these instances as they do not logically fit as members in this BPM object.
    For example, if I need to capture and display the logged in user name across the JSPs in my web application, then how can I do that without specifying this user variable in all of my BPM objects.
    Is there any extensibility in using more than one BPM object variables in my JSPs? Why is it that a single BPM object variable is tied to a JSP? Or am I missing something else here?

    I'm with the same problem!

  • Parsing XML and Storing values in instance variable

    hi,
    i'm new to XML.
    here i'm trying to parse an XML and store their element data to the instance variable.
    in my main method i'm tried to print the instance variable. but it shows "" (ie it print nothing ).
    i know the reason, its becas of the the endElement() event generated and it invokes the characters() and assigns "" to the instance variable.
    my main perspective is to store the element data in instance variable.
    thanks in advance.
    praks
    import java.io.*;
    import java.net.*;
    import java.util.*;
    import javax.xml.parsers.*;
    import org.xml.sax.*;
    import org.xml.sax.helpers.*;
    public class mysax extends DefaultHandler
         String ctelement;
         CharArrayWriter contents;
         String vname1,vrcbreg1,vaddress1,vcountry1,vtelephone1,vfax1;
         String vname,vrcbreg,vaddress,vcountry,vtelephone,vfax;
         public mysax()
              vname1 = null;
              vrcbreg1 = null;
              vaddress1 = null;
              vcountry1 = null;
              vtelephone1 = null;
              vfax1 = null;
              contents= new CharArrayWriter();
         public void doparse(String url) throws Exception
              SAXParserFactory spf = SAXParserFactory.newInstance();
    SAXParser sp = spf.newSAXParser();
    ParserAdapter pa = new ParserAdapter(sp.getParser());
    pa.setContentHandler(this);
    pa.parse(url);          
         public void startElement(String namespace,String localName,String qName,Attributes atts)
              ctelement = localName;     
         public void endElement(String uri,String localName,String qName) throws SAXException
         public void characters(char[] ch,int start, int length) throws SAXException
              try
                   if(ctelement.equals("name"))
                        vname = new String (ch,start,length);
                        System.out.println("The method "+vname1);
              }catch (Exception e)
                   System.out.println("The exception "+e);
         public static void main(String args[])
              try
              mysax ms = new mysax();
              ms.doparse(args[0]);
              System.out.println("the contents name "+ms.vname1);
              catch(Exception e)
                   System.out.println("this is exception at main" +e);
    my XML looks like
    <coyprofile_result>
    <company>     
    <name>abcTech</name>
    <rcbreg>123456789</rcbreg>
    <address>Singapore</address>
    <country>sg</country>
    <telephone>123456</telephone>
    <fax>123155</fax>
    </company>
    </coyprofile_result>

    I believe that the problem has to do with the value you assign to ctelement. You are assigning the value of localName to ctElement, however for the element: <name>...</name> the localname is empty string i.e. "", but qName equals "name". Because you are assigning empty string to ctElement, when you do the comparison in characters of ctElement to "name" it will always be false. So in startElement change it to ctElement = qName; Try it and see if it works. I have produced similar programs and it works for me.
    Hope this helps.

  • How to change value of instance variable and local variable at run time?

    As we can change value at run time using debug mode of Eclipse. I want to do this by using a standalone prgram from where I can change the value of a variable at runtime.
    Suppose I have a class, say employee like -
    class employee {
    public String name;
    employee(String name){
    this.name = name;
    public int showSalary(){
    int salary = 10000;
    return salary;
    public String showName()
    return name;
    i want to change the value of instance variable "name" and local variable "salary" from a stand alone program?
    My standalone program will not use employee class; i mean not creating any instance or extending it. This is being used by any other calss in project.
    Can someone tell me how to change these value?
    Please help
    Regards,
    Sujeet Sharma

    This is the tutorial You should interest in. According to 'name' field of the class, it's value can be change with reflection. I'm not sure if local variable ('salary') can be changed - rather not.

  • About "method", "instance variable" and "constructor"

    Does a method need to be initialise?? if yes, how to write the code?
    for example,is it:
    public String mymethod( String args[]); ?
    public double mymethod2 (); ?
    what is the meaning of "instance variable" and "constructor"?
    Please help.....THANKS!

    Previously posted to this OP:
    Read the Java Tutorial: Learning the Java Language.
    http://java.sun.com/docs/books/tutorial/java/index.html
    � {�                                                                                                                                                                                                                                                                                                   

  • How can I pass a variable between JSP and Role Form

    I need to pass a variable from (a copy of) applicationmodify.jsp to the IDM Role Form so that the variable is available within the Role Form at display. We've tried getAttribute and setAttribute modifying both the Role Form and the applicationmodify JSP and can get the form to the role form but not accessible but have had no other success. Has anyone had any success in doing this? Any suggestions would be appreciated.

    if by _root level you mean you're loading something into
    _level0 you can't won't be able to use the localconnection. the
    sharedobject is your only option.

  • Inheritance and private instance variables

    I've been reading a Java book. It says you should normally make your instance variables private and use getter/setter methods on them, but if you create a superclass, you have to make those variables public (or default?) to inherit them in the subclasses, right? And you can't redefine the variables as private in the subclass, can you?
    I'm a little confused on this point. Thanks for any light anyone could shed on this.
    =====
    Nevermind...I think I figured it out!
    Message was edited by:
    NovaKane

    Thanks to both of you for your responses. I think I've pretty much done what you did, Anan, in this little test program.
    public class Animal
       private String name=null;
       public void setName(String n)
          name=n;
       public String getName()
         return name;
       public void makeSound()
    public class Dog extends Animal
       public void makeSound()
          if (getName() !=null)
             System.out.println(getName()+" says, \"Bow Wow!\"");
          else
             System.out.println("I don't have a name...but \"Bow Wow!\"");
    public class Cat extends Animal
       public void makeSound()
          if (getName() != null)
             System.out.println(getName()+" says, \"Meow!\"");
          else
             System.out.println("I have no name...but, \"Meow!\"");
    import java.util.*;
    public class Test
       public static void main(String[] vars)
            ArrayList<Animal> animals = new ArrayList<Animal>();
            Animal d = new Dog();
            Animal c = new Cat();
            d.setName("Fido");
            c.setName("Fluffy");
            animals.add(d);
            animals.add(c);
            for (Animal a : animals)
                a.makeSound();
    }The "name" instance variable is private, but I can get at it through the getter/setter methods of the superclass, which are public. I should NOT be able to say something like...
    d.name="Fido";Right?

  • Read China content in JSP and store in Java variable

    Hi All ,
    I have created China language content(BinaryType) using weblogic admin console.
    And I am trying to get the content and to store in a Java Variable .
    Pls suggest me how to read other language content and to store in java variable for manipulation.
    Srinivas
    I am using following lines of code to get content
    <utility:forEachInArray array="<%=newsID%>" id="node" type="com.bea.content.Node">
    INodeManager nodeManager =     ContentManagerFactory.getNodeManager();
         java.io.InputStream is =     nodeManager.getStream(new ContentContext(), node.getId(),
    "News-Content");
    when I am using inputstream "is" to read the china content , its displaying garbage values.

    Hi Rajeev,
    My Content consist of following properties
    News-Author      String
    News-Content      Binary
    News-Id           String
    "News-Content" is Binary Type .I am creating data for this property using Content Editor.
    My data consists of 3 lines of text+image
    data will be:
    author is srinivas
    created on 11th
    content is newscontent
    << inserted image >>
    where << inserted image >> ,is jpeg file.
    I want to read this data in the JSP and store in java variable , so that i can modify 1st two lines and updated data to be displayed in browser..
    I am able to read data , if its a simple text . But it has one image also.
    How to solve this issue.
    Srinivas

  • Servlets and their instance variables

    I understand that for every request to a servlet, a new thread handles those requests. So it's one request, one thread. But how about instance variables of a servlet class? Are they also one instance variable per thread/request or just like the servlet, one instance?

    hi, its exactly as you expect - one instance at all. all threads are working with one intance. you can indeed finetune the number of instances of a servlet using the
    <load-on-startup/>tag in the web.xml file, but its up to container if multiple thread will be using many instances.
    you can also implement the (deprecated) SingleThreadedModel interface which flags the container not to share that servlet instance to other threads. But this shall not be used in productive environments.
    so its always a good idea to put your business impleementation to another class and only use the servlets to connect your business implementation to http like
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException{
       new MyBusinessLogic().perform(request.getInputStream(), response.getOutputStream());
    }

Maybe you are looking for

  • Want to buy a home by the end of the year - do I have a chance?

    Hi everyone, I'm new to the forums, and only a "lurker" for about a week or so. There are too many factors involved to explain why, but my wife and I want to buy a house by the end of the year; so we're calling December 15 our deadline. As you read t

  • My mac's run out of memory and I can't find the culprit!

    Hi, I'm in serious need of some help! I'm sure this is simple, but I'm about to break down over it – I use my mac for everything. I've got a 200gb 2009 macbook (running iOS7), and it's told me it's run out of memory. The storage tab in 'about this ma

  • How to set up start and end dates for validity of contract account in FICAx

    Hi,   Can anyone tell me where can I set up the validitiy period for the contract account in FICA. In contract creation, I could just see the contract validity start date. I also need to know the validity end date. Please let me know the solution asa

  • Export RAW to JPEG too SMALL?

    When I export a 9.5mb RAW/NEf file to jpeg, (100% quality, 240 ppi, default, original size), the jpeg file size is around 2-3mb. If I convert the RAW/NEF file in the Nikon Editor, the jpeg version is around 6-7mb...much better. I can't give my client

  • Training classes for Administrator and Performance Tunning

    Hi All, I would like to learn more about ORACLE database so do you know any where offering the classes for Administrator and Performance Tunning in California Bay Area. THanks, JP