Passing structure vars

I'm working on an authentication page and I'm setting user
variables inside a structure. When I use a structure to set user
variables and redirect to a landing page, the structure data does
not persist. When I use sessions for each user variable, the
structure persists. I'd prefer to use a structure, but what am I
missing here? How do I get the structure to persist?

Put the structure into the session so it persists
<cfscript>
session.piuser = structNew();
session.piuser.authenticated = 1;
session.piuser.username = auth_user.displayname;
</cfscript>
For any variable to exist from one request to another it must
be in one
of the persistent scopes. Whether the variable is simple or
complex,
you must place it into the session, application or server
scope for it
to be available on future requests.
The one issue to this is that the cookie and client scopes do
not allow
complex variables without translation. But that is not often
an issue.
But when it arises, WDDX can be used to good effect.

Similar Messages

  • Passing Structures

    How can I pass structures across C and Java, while calling native methods. e.g I've to pass myStruct from C to Java or vice versa
    struct myStruct
    long along;
    char* astring;
    short ashort;
    is there any possible way of doin' it or Native Methods support only intrinsic data types as arguments (intrinsic data types like int, short etc etc).

    Of course, there is a way. You should, however, decide on where to keep the main copy of your instance within C as struct or with an analogously constructed Java class.
    If you choose to hold your main copy as C struct, you also have to define a Java class, which does not contain these fields but only wraps the C struct with appropriate getters and setters. These are native methods called by Java to access the struct members. One field is still required in your Java class, which somehow holds the native pointer to the struct of a particular instance. A long or int will do on most platforms.
    The other approach is to hold all the data within the Java object. Only define native methods for operations you cannot perform in Java. Those native methods construct the C struct at runtime to pass this copy to the native functions that require it. If the native functions your are trying to call only take fields of this struct as arguments, the wrapping JNI method even becomes simpler. In any case, do not forget to copy modified values back into the Java instance.
    http://java.sun.com/docs/books/tutorial/native1.1/index.html
    http://java.sun.com/docs/books/tutorial/native1.1/implementing/field.html

  • How can I pass a var value between MovieClips?

    New week, new question.
    I haven't been able to find the answer to this: I'm working with a var defined in the main timeline var score:int; , wich I use in 10 different movie clips using var score = MovieClip(this.root).score;
    Everything works perfect on the first MovieClip, but when the next one plays score does not keep the value assigned in the previous MovieClip therefore the score is lost.
    The clips are questions and they are place on the main time line in different frames and main time line actions layer which only contains this:
    stop();
    var score:int;
    nextQuestion.addEventListener(MouseEvent.CLICK, newQuestion);
    function newQuestion(evt:MouseEvent):void {
        nextFrame();
    covers each frame with every different MovieClip.
    What I need to know is how to make that value pass to the next Movie Clip?

    Hi Ned,
    I had defined the score var in the time line but to add the score from each question (MovieClips) I have to call it to the each MovieClip and I assume that whe I call the score var in the second MovieClip will keep the score from the first, but is not the case:
    This is the time line actions layer:
    stop();
    var score:int;
    nextQuestion.addEventListener(MouseEvent.CLICK, newQuestion);
    function newQuestion(evt:MouseEvent):void {
        nextFrame();
    and this is the code from the first question (MovieClip)(all the questions will have the same code except for some specific things like the value that each answer adds to the score and stuff like that)
    stop();
    var score = MovieClip(this.root).score;
    var answersArray:Array = new Array();
    var strikeCount:int;
    var sucessCount:int;
    var messageBox:TextField = new TextField();
    messageBox.text = "" + score;
    addChild(messageBox);
    messageBox.textColor = 0xFF0000;
    messageBox.width = 200;
    messageBox.height =100;
    messageBox.x = 285.5;
    messageBox.y = -32.9;
    this.strikeOne.visible = false;
    this.strikeTwo.visible = false;
    this.strikeThree.visible = false;
    this.flipQ1One.visible = false;
    this.flipQ1Two.visible = false;
    this.flipQ1Three.visible = false;
    this.flipQ1Four.visible = false;
    function answListener(evt_obj:Event){
    if((strikeCount >=3) || (sucessCount ==4)) { nextFrame();
    }else if (answersArray.indexOf(answ_input.text) < 0){
        if(answ_input.text == "5"){
        score = score + 61;
        messageBox.text = ""+ score;
        this.flipQ1One.visible = true, flipQ1One.play();
        sucessCount = sucessCount +1;
        answersArray.push(answ_input.text);
        answ_input.text = "";
        else if (answ_input.text == "3"){
        score = score + 25;
        messageBox.text = ""+ score;
        this.flipQ1Two.visible = true, flipQ1Two.play();
        sucessCount = sucessCount +1;
        answersArray.push(answ_input.text);
        answ_input.text = "";
        else if (answ_input.text == "4"){
        score = score + 8;
        messageBox.text = ""+ score;
        this.flipQ1Three.visible = true, flipQ1Three.play();
        sucessCount = sucessCount +1;
        answersArray.push(answ_input.text);
        answ_input.text = "";
        else if (answ_input.text == "2"){
        score = score + 3;
        messageBox.text = ""+ score;
        this.flipQ1Four.visible = true, flipQ1Four.play();
        sucessCount = sucessCount +1;
        answersArray.push(answ_input.text);
        answ_input.text = "";
        else {answ_input.text = "";
              strikeCount = strikeCount + 1;}
    answ_input.addEventListener("enter", answListener);
    function strikesListener (evt_obj:Event) {
            if ((strikeCount == 1) && (answ_input.text != "5", "4" , "3" , "2")) {this.strikeOne.visible = true;
            else if ((strikeCount == 2) && (answ_input.text != "5", "4" , "3" , "2")) {this.strikeTwo.visible = true;
            else if ((strikeCount == 3) && (answ_input.text != "5", "4" , "3" , "2")) {this.strikeThree.visible = true;
            else {}
    answ_input.addEventListener("enter", strikesListener)

  • Pass structure or array into a custom tag?

    Is it possible to pass a CF structure or array to a custom
    tag (C++/MFC) as an argument? Is it possible to create a CF array
    or structure *from* a custom tag?

    Passing a structure out is as easy as using a period in the
    variable name in your SetVariable() call.
    For example,
    pRequest->SetVariable ("SPP_zResults.bHadErroredPts", "0");
    pRequest->SetVariable ("SPP_zResults.dMax",
    "3.14159265");
    Passing a struct in may be just as easy, I haven't ever
    needed to try it.
    Let us know if it works.

  • Pass structure, internal table from workitem to BSP

    Hi All,
    I have a requirement where a BSP application is to be called from the workitem.
    How can i pass a structure or an internal table from the workitem to the BSP application?

    In the BSP application mark the check box AUTO  on the PAGE ATTRIBUTES tab and this makes the value available in the displayed URL of the BSP application.
    the documention mentation provided by SAP regarding this option is
    A page attribute marked as automatic is automatically supplied with a value from the calling URL or the navigation from another page. However there must exist a parameter of the same name with value in the URL or navigation interface.
    here your navigation interface  is WF_EXTSRV that you have already defined make the parameter as Exporting and when you get the URL read the URL and by using the OFFSET concept you can read the value of the element that you want in the BSP application

  • Pass Structured table into dynamic table parameter in public method

    Ladies and Gentlemen,
    I have a requiremet to pass (1 at a time) any number of tables into a reuseable method in a custom class.  The Method code is as follows:
    method CREATE_OUTBOUND_FILE.
    * Importing VALUE( IV_PATHNAME )  TYPE PATHEXTERN File Destination
    * Importing VALUE( IT_FILE_RECORD ) TYPE REF TO DATA  Table with Output
    * Importing VALUE( IV_RECORD_STRUCTURE )  TYPE STRING OPTIONAL  Record Structure
    * Importing VALUE( IV_DELIMITER )     TYPE STRING     File Delimiter
    * Exporting VALUE( EV_RECORD_CNT )  TYPE STRING Record Count
      Data:
            ls_line_cnt(6) type n,
            lt_data_struc  type zty_ddic_struc_T,
            ls_string      type string.
      field-SYMBOLS: <fs_string> type any.
    * Open Dataset for outputting file details
      Open dataset iv_pathname for output in text mode encoding default.
      Assign ls_string to <fs_string> CASTING TYPE (iv_record_structure).
      loop at it_file_record into <fs_string>.
        transfer <fs_string> to iv_pathname.
        Add 1 to ls_line_cnt.
        clear <fs_string>.
      endloop.
      ev_record_cnt = ls_line_cnt.
    where IV_PATHNAME = output destination & filename
                IT_FILE_REC     = data table
                IV_RECORD_STRUCTURE = is ddic structure definition for the data table
                IV_DELIMITER = file delimiter, in this case, let's say it's C (for CSV)
         and EV_RECORD_CNT is a count of numbe of records processed.
    Lets say, for example, I wish to load data from table SFLIGHT into the method when program A is executed.  Then another time I wish to excute Program B which is passing in data of table  SFLCONN2.  I hope that by using the "type ref to data" defintion, I can pass the table contents through. Is this true?
    Secondly, I'm getting a syntax error saying that "IT_FILE_RECORD" is not defined as a table (and therefore can't be looped at), and therefore can't be read.  How can I access the data in this table in preparation for output.
    Any assistance or thoughts would be greatly appreciated.
    Regards,
    Steve

    Hi Stephen ,
    Graham already gve part of the solution.
    If you declare
    Importing VALUE( IT_FILE_RECORD ) TYPE REF TO DATA
    it does not make sense to declare to pass by VALUE because you will not change this refernce in the method. Calling this method, you must pass a refefernce.
    data:
      lr_ref type ref to data.
    get reference of <your itab here> into lr_ref.
    CREATE_OUTBOUND_FILE( ...IT_FILE_RECORD = lr_ref ... )
    In the method, it goes as graham explained.
    Anyway, I would declare the table parameter as
    Importing IT_FILE_RECORD TYPE TABLE
    The your code could work, but you will have troube with any non-character fields in the tables.
    Regards,
    Clemens

  • Pass structure of values for Job submit

    Hi,
    I need sytax to submit a job
    Right now I am using this code to send 4 parameters.
    I need to send these 4 in a structure.
    <b>submit Ztestjob USER sy-uname
          via job p_jobnm
          number p_jobcount
          with afko-rsnum eq afko-rsnum
          with aufnr_d eq aufnr_d
          with sernr_d eq sernr_d
          with  p_lmnga eq  p_lmnga
          AND RETURN.</b>
    So I have to pass a structure of values into the BGprogram through a submit and do a couple of loops in the BGPROGRAM.
    I need the syntax for submit .
    I also need to know how to catch the structure with values in the BGPROGRAM.
    Anyone please answer ASAP
    Message was edited by:
            ramana peddu
    Message was edited by:
            ramana peddu
    Message was edited by:
            ramana peddu
    Message was edited by:
            ramana peddu

    Hi,
    If want to pass an internal table...
    Then create a dummy select-options...
    And then pass the values in the select-options..
    Then in the submitted program you can use the select-options internal table..
    Thanks,
    Naren

  • Passing structure to smart forms

    Hi experts,
    Can we pass more than one structure  to smart form .  If it is possible pls let me know the procedure...
    Thanks.

    you can pass any number of structure in smartform defined as importing parameter in function module.
    But you have to define that struture of similar type  in se11.
    then write in form interface like:;
    itab1 like ziitab1.
    where zitab1 structure which is similar type to itab1 defined using se11.

  • Newbie: Passing Structures between DLLs via Java

    A fairly high level question for you good people:
    I have two DLLs. The first DLL is called by Java via JNI, and needs to return something akin to a C Structure (say an int, a double and a string for simplicity).
    My Java code does not need to do anything with this data, except pass it to a second DLL for more processing (the second DLL for example needs to do something with just the double and the string).
    My question is, is this sort of thing practical to do using JNI (I have the DLLs already but can easily add the JNIEXPORT etc functions) ?
    (I have used JNI for a passing single values and arrays back and forth, but nothing with anything akin to structures).
    Many thanks in advance.
    Dave

    My Java code does not need to do anything with this
    data, except pass it to a second DLL for more
    processing (the second DLL for example needs to do
    something with just the double and the string).
    My question is, is this sort of thing practical to do
    using JNI (I have the DLLs already but can easily add
    the JNIEXPORT etc functions) ?
    Somewhere in memory a hunk is reserved for this. Your code does it or some external piece does.
    You have a pointer to that.
    It is very important that the memory does NOT go away until you tell it to.
    You cast the pointer to a long and return that to java. Your java piece keeps track of that.
    It passes the long off to the other dll. That dll casts it back to what is needed (a pointer) and uses it.
    If the second dll disposes of the pointer then you are done. If not then you must dispose of the pointer.
    If you want to keep it then you should add a 'destroy()' method in java that frees the pointer (native call) appropriately. This is also one of the few time where using finalize is probably appropriate as well.

  • Passing Form Vars to a CFC

    I am trying to pass Form variables to a CFC. Yes, the CFC
    works being called from Flex, with no arguments, but being new to
    Flex I am not sure how to post the values in the form fields back
    to the CFC. So my questions are:
    1) how do you reference form variables. They are all enclosed
    in a form tag, and then by form item tags, I have a variety of
    types of inputs
    2) How do you pass that information to the cfc? Currently I
    am using this code: getSearch.getSearch.send({values:vals});
    In an attempt to pass an array full of values to the CFC.
    Any help would be great!
    Thanks,
    Rob

    I know exactly where you are coming from...LOL..
    I was there too. Here is what you can do to make it easy on
    you.
    You wrap them in an object.... It is as simple as that.
    say that you have multiple form items.
    if you are using a data typed object ( I recommend it) you
    would do something like this to pass form data to a cfc
    // This creates a data typed object called object.
    var obj:AS01Phone = new AS01Phone;
    //Populate the data typed object with your form data
    obj.UserID = Number(userid);
    obj.PhoneType = String(_phoneType.selectedItem.KeyValue);
    obj.DialCode = Number(_dialCode.selectedItem.DialCode);
    // Now send it to the cfc for processing
    // [RemoteObject.method(object);]
    roPhone.save(obj);

  • Pass sendAndLoad var to _root

    I have an app that has been getting the username of a user
    into a simpleConnect for a chat application by passing it in via
    the embed params, but this creates a security issue and would like
    to pass it in using sendAndLoad.
    Currently the username value is set simply by using: var
    username=_root.username, because it's passed in via a php page with
    that variable in the embed params. Like this:
    <embed src="member.swf?username=<?php echo
    $row_getMemberData['username']; ?>
    The ID in this example is hardcoded but would be passed in
    the same way that I'm currently passing in the username:
    member_id = 10762;
    mid = _root.member_id;
    var send:LoadVars = new LoadVars;
    var receive:LoadVars = new LoadVars;
    send.mid = mid;
    receive.onLoad = function(){
    _root.username=this.username;
    send.sendAndLoad("
    http://urltomyphppage.php",receive,"POST");
    trace(username);
    stop();
    That trace comes up undefined. I can trace it from within the
    function, but I need to make it available to the main timeline so
    the simpleConnect can pick it up....
    As always any help at all would be greatly appreciated!!!
    JAH

    I am sorry, but I fail to see what it is that you are trying to do
    <div id="list" spry:region="dsContratto">
              <!--- region ---> 
              <tr spry:repeat="pv" spry:even="even" spry:odd="odd"> 
                  <a href="javascript:open({contratto_id},'sost')">OpenModal</a> 
              </tr> 
    </div>
    I can see that this opens a separate window, but how does the following relate to the above?
    function open(id, action) { 
        open modal and linked-region
    function funcObserverLinkedRegion(notificationState, notifier, data) { 
        how a can get value of "action" var?
    Spry.Data.Region.addObserver("detail", funcObserverLinkedRegion); 
    Gramps

  • Pass structure in URL

    Hi,
    I have a problem, I need pass a structure to start a process of the workflow throug a url. I tried
    http://ebsapdev01:50000/webdynpro/dispatcher/sap.com/cafeugpuiinst/AInstantiation?process.template.id=E6493830EAE911DC82590019B9EEDB34&userName=&ContentType=&IdRole=&Application_Name=1111111111&JobFunctionName.2=111111&Application_Name=22222222JobFunctionName.2=222222222&process.autostart=t&Size=&&I_USER=&NameApp=&Name=&Company_Name=&email_address=&Content=
    I repeat the parameters &Application_Name= and &JobFunctionName.2=, but not worked.
    Thanks
    Ivo

    Hi Shyam,
    I wrote following udf to create url at runtime,but even though i was able to ping the oanda application but it was not accepting the query which was there in url begining with ?fxmlrequest=..... so it was giving an error in moni as "Please specify the client id" while if i open same url through Internet explorer it was fetching the data and was giving required output.I was passing date as input parameter (a) in my udf.
    //write your code here
    String s1,s2,url;
    MappingTrace trace;
    trace = container.getTrace();
    s1 = "http://www.oanda.com/cgi-bin/fxml/fxml?fxmlrequest=<convert><client_id>ABC</client_id><expr>USD</expr><exch>GBP</exch><date>";
    s2 = "</date></convert>";
    url = s1 + a + s2;
    trace.addInfo(url);
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey parmValue;
         // TargetURL
         parmValue = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/HTTP", "TargetURL");
         conf.put(parmValue, url);
    return "";

  • Passing structures to VB

    I want to pass a structure to my VB application. I'm not sure how to define the method signature in the VB app. For now, I have declared it as:
    Public Sub setPatientExamData(sPatientData As Object)This turns into a IDispatch ** in the C++ code:
          virtual /* [id] */ HRESULT STDMETHODCALLTYPE setPatientExamData(
                /* [out][in] */ IDispatch __RPC_FAR *__RPC_FAR *sPatientData) = 0;My structure is defined as:
       struct PatientData
         BSTR procSchedID;
         BSTR patientName;
       }In the C++ code:
       PatientData m_PatData;
        populate the m_PatData
            PatientData *x = &m_PatData;
           dispatch->setPatientExamData((IDispatch **)&x);This doesn't seem to work on the other side but I'm not sure if it's because this code is incorrect or the VB code is.
    What I would really like to do is have the VB signature look like:
    Public Sub setPatientExamData(sPatientData As PatientData)and define the PatientData structure on the VB side equivalent to the the structure on the Java side. I can not seem to compile the idl (to generate the .c and h files) for the Java .h file without getting an error.
    Perhaps this is even being posted to the wrong forum....

    > Perhaps this is even being posted to the wrong forum....
    Yes, this part of your project is just generic C++-to-VB, or maybe just C++-to-COM, not involving JNI.
    If your overall goal is just to call from Java into VB/COM, then there are some 3rd party products available for that. too Search the archive of this forum.
    -slj-

  • Passing session var

    I'm trying to assign session. var to domain names. E.G
    (mydomainname.com) and (somthingdiff.com)
    so if user went to mydomainname.com then went to
    somthingdiff.com this would contain the same session.var.

    I don't think you can do that. You are ending a session on
    mydominname.com and starting a new one on somthingdiff.com. Pass
    your variable in the URL.

  • Passing JavaScript Var ---- to java method....URGENT...PLEASE ...HELP

    I am doing a simple java Servlet example...
    I have value that is assigned in a one of the javascript function().
    Below i have the function where i get the columnValue....
    i want to use that value in the doPost method in my Servlet1 class...
    Can someone please tell me how i can do this...
    function getGridValue(oColumn) {
         var oRow;
         var oCell;
         var lIdx;
         var columnValue;
         try {
              lArrayLength = GridArrays.length;
              if (lArrayLength < 1) {
                   return false;
              for (lLoop=0; lLoop<lArrayLength; lLoop++) {
                   oRow = GridArrays[lLoop];
                   oCell = oRow[0];
                   columnValue = oRow[oColumn];
                   if (oCell.SortVal == 1) {
                        alert(columnValue.SortVal);
                        break;
                        return true;     
         catch(exception){
              if(exception.description == null){
                   alert("GridSerVal: " + exception.message);
              else{
                   alert("GridSetVal: " + exception.description);
    Servlet1 class
    public void doPost(HttpServletRequest request, HttpServletResponse res)
    throws IOException, ServletException
    String xParameterName = null;
    String xParameterValue = null;
    PrintWriter out = res.getWriter();
    PolicyInformation policyInformation = null;
    Enumeration e = request.getParameterNames();
    while (e.hasMoreElements()) {
    xParameterName = (String) e.nextElement();
    xParameterValue = request.getParameter(xParameterName);
    if ((xParameterValue.trim().length() !=0 )){
    if(xParameterName.compareTo("firstnameTextfield")==0){
    else if(xParameterName.compareTo("lastnameTextfield")==0){
    else if(xParameterName.compareTo("policynumberTextfield")==0){
    StringBuffer outstring = new StringBuffer();
    outstring.append(createScript.policyReCreateSearchForm(xParameterValue));
    outstring.append(createScript.setTopPart());
    outstring.append(createScript.getHeader());
    Vector policyInformationVector1 = getPolicyInformation(res, xParameterValue);
    Iterator iter = policyInformationVector1.iterator();
    PolicyInformation aPolicyInformation = null;
    while(iter.hasNext()){
    Object[] data = new String[policyInformationVector1.size()];
    for (int ii=0; ii < data.length; ii++){
    int rowNum = ii + 1;
    aPolicyInformation = (PolicyInformation) iter.next();
    f = aPolicyInformation.getFirstName();
    l = aPolicyInformation.getLastName();
    d = aPolicyInformation.getDOB();
    s = aPolicyInformation.getSSN();
    p = aPolicyInformation.getPolicyNumber();
    m = aPolicyInformation.getMiddleName();
    pid = aPolicyInformation.getPid();
    outstring.append(createScript.setRowValue(f,m,l,p,pid,d,s,rowNum));
    outstring.append(createScript.setRowValue1());
    outstring.append(createScript.getBottom());
    out.println(outstring.toString());
    else if(xParameterName.compareTo("ssnTextfield")==0){
    THis is where i want to get the value from the javascript and use that value to run a query...
    // checks if the ViewSubmitButton is submitted....
    if(xParameterName.compareTo("viewSubmitButton") == 0){
    } // end of while(e.hasMoreElements())

    I'm not quite sure what your problem is specifically, but at first glance I can tell you that you can't access the response object until you are done with your request object. Make sure you do everything you want to do with the request object and then when you are done make your call to res.getWriter() and send your output.

Maybe you are looking for

  • My Apple TV is reading " There was a problem connecting to the network" error - 3906

    I have reset all network components and the Apple TV.  I first set up Apple TV and it worked beautifully.  The next time I turned it on it gave me the error message.  I have tried reconnecting to the netwrk multiple times.  I have my laptop and my ip

  • Mapping issue with repeating segments

    Hi, Our system creates EDI messages and have a date part which looks like below: <DTM> <DTM01> <DTM0101>2</DTM0101> <DTM0102>201409241200</DTM0102> <DTM0103>203</DTM0103> </DTM01> <DTM01> <DTM0101>137</DTM0101> <DTM0102>201409221200</DTM0102> <DTM010

  • FB60 past entry screen problem

    Hai experts, i done FB60 bdc program ,in uploading time fastentry screen it shows 7 rows, after 7 rows here condition trigered ,add items program working properely,but other system the fast entry has 10 rows, and one show 6 rows, the program not work

  • How do you hide Save as PDF options (title, author, etc.)?

    The Print as PDF dialog has options for author, title, etc. I never use these and for me this area is just wasted space in the dialog window. Is there any way to hide this area so the file browser area is larger? Does Lion have these options and are

  • Do multiple bindings still causing issues for PowerPivot workbook in SharePoint 2013

    Do multiple bindings still causing issues for PowerPivot workbook in SharePoint 2013 as they did in SP2010? Here is the link about 2010 issue : http://support.microsoft.com/kb/2712071