Setting & Retrieving Session Variables

Hi,
I’m new at session variables and having trouble
understanding the basics.
I have a form with two dropdowns. I want to store the
selections from both in session variables. Then pass those to
another page where I want to display the selected values in my
headline such as “You searched for [value1] and [value2]." I
can’t get this to work right. I’ve gone through DW Help
and tutorials and still can’t figure it out.
Any help would be much appreciated.
DW CS3, ASP and Access
Thanks,

> I?m new at session variables and having trouble
understanding the basics.
>
> I have a form with two dropdowns. I want to store the
selections from both
> in
> session variables. Then pass those to another page where
I want to display
> the
> selected values in my headline such as ?You searched for
[value1] and
> [value2]." I can?t get this to work right. I?ve gone
through DW Help and
> tutorials and still can?t figure it out.
>
> Any help would be much appreciated.
>
> DW CS3, ASP and Access
On your form action page, put this in:
<%
Session("varOne") = Request.Form("dropdown1")
Session("varTwo") = Request.Form("dropdown2")
%>
To write the sessions to the page, put this:
You searched for <%=varOne%> and <%=varTwo%>.

Similar Messages

  • How to retrieve sessions variables in JSP

    hi,
    I am trying to retrieve session variable from servlet to JSP.
    In the servlet i am retrieving employeenames from database and storing them in a ArrayList variable then i am setting this variable into the session.
    When retrieving the session in the jsp it displays as [empname1, empname2].
    Please help how to retrieve them
    Thanks in Advance,
    sha

    At the servlet:
    ArrayList<String> employeeNames = new ArrayList<String>();
    employeenames.add(blahBlahblah);
    session.setAttribute("eNames", employeeNames);
    At the JSP:
    ArrayList<String> names = (ArrayList<String>) session.getAttribute("eNames");
    for (String nom : names) {
    do something with the name stored in String variable nom...
    }

  • Can I set a Session Variable from a Dashboard Prompt, using values that are

    Hi All
    Trying to set a Session Variable to an integer value, by letting users select a text value from the drop-down list on a Dashboard Prompt. The goal is to set the input parameter to the IndexCol function, but to provide the end users with a text description of what they are setting.
    Select Value Set Variable Value
    My 0
    My Team 1
    My Companies 2
    My Teams Companies 3
    Any suggestions on how to accomplish this? Certainly we could populate the drop-down from a data source, however I don't see how to populate a variable with something other than the values on the screen.
    The IndexCol function is referenced in a Filter in Answers, and I'm thinking to populate a Session variable using the (Presentation) variable value set from the prompt. But how to do this? I see a reference to a function NQSSetSessionValue(), but cannot find documentation on how it works.
    Any clue will be greatly appreciated.
    Thanks

    Hi kishore..
    Looks like the link u have sent uses advanced SQL tab to set session variables. I want to know if I can use "set variable NQ_SESSION.myvar= @something" in the "SQL results" -while creating a dashboard prompt-.
    Purpose: I want the session variable to be set based on whatever report that im currently in.
    And i dont want to use presentation variables because im using a reset button in my page.
    My reset script resets presentation variables and NOT session variables.
    Thanks in advance
    Loy

  • How to set a session variable

    Hi,
    I would like to know how to set a session variable for the following purpose.
    At the top of my application I have a "Welcome <username>" I'd like it instead to have "Welcome <firstname> <lastname>".
    So the concept would be after the user logs in succesfully this session variable is dynamically set so it can be displayed.

    Hi Scott,
    I realize that I can set items etc in pages. The case I'm referring to is a reference in a template. My template has a "Welcome <user name>" ... so the code looks like "Welcome &APP_USER." Anyway to make it say "Welcome first_name last_name" in the template? Note I'll have to get the first/last names from a query
    Thanks,
    Marty

  • How set a SESSION variable?

    How set a SESSION variable?
    There is a standard object where could do this?
    Thx in advance Roberto.

    >I'm not at all sure that you CAN change the portal language in the way that you want.
    >Perhaps you should repost this question in the portal forum.
    No i manage the language of WebDynpro myself, with tables from R3.
    I wanna do only a thing like HTTP SESSION variable from the WEB.
    I could do it, using java function of servlet, but i don't wanna use third packege out of WebDynpro FRAMEWORK.
    The isn't an OBJECT CLASS STANDARD od WebDynpro that do that?
    I wanna PERMANENT variable from a WebDynpro to another.
    It is an implicit variable passage.
    No one did something of similar?
    Bye
    Message was edited by: giovanni angerame

  • Can someone tell me why this is not setting the session variable?

    first page
    <?php
    // script1.php
    session_start();
    echo "<form action=\"script2.php\" method=\"post\"
    name=\"name1\">";
    echo "Your name: <input name=\"name\" type=\"text\"
    size=\"20\" value=\"\">  ";
    echo "<input name=\"submit\" type=\"submit\"
    value=\"Submit\">";
    echo "</form>";
    ?>
    second page
    <?php
    // script2.php
    session_start();
    echo('Hello, ' . $_SESSION['name1']);
    ?>

    jlw12689 wrote:
    > second page
    >
    > <?php
    > // script2.php
    > session_start();
    > echo('Hello, ' . $_SESSION['name1']);
    > ?>
    You need to set the session variable first.
    <?php
    session_start();
    if (isset($_POST['name1'])) $_SESSION['name1'] =
    $_POST['name1'];
    echo 'Hello, ' . $_SESSION['name1'];
    ?>
    By the way, using echo to create your form on page one is a
    complete
    waste of time. Just use an ordinary HTML form - a lot less
    typing, and a
    lot more efficient.
    David Powers
    Adobe Community Expert
    Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
    http://foundationphp.com/

  • Problem retrieving Session variables in Flex from Coldfusion

    For about a year I've been using a cfc that allows me to remote call from within Flex to retrieve session-level variables.  I much prefer this to using FlashVars because with the remote call the session values don't show up in the page source.
    This was working fine when I was using an Application.cfm file to manage my Coldfusion pages.  However when I switched to using an Application.cfc file, the cfc stopped working.  Neither the cfc or the cfm file contain any code to manage these session variables (they are set in other pages), so the only real difference seems to be changing from Application.cfm to Application.cfc.
    Any thoughts why?  Thanks.

    Ok, this is resolved.
    The problem seems to have been related to the scope of Application.cfc and Application.cfm.  The directory which contained the cfc files had an Application.cfm controlling the session, while the directory with the pages that included the flex swf files had an Application.cfc file.  Apparently these two don't talk to each other.
    The solution is to use either Application.cfc or Application.cfm files, but not to mix them.  In other words, use either -- but be consistent.

  • How to get and set a session variable from backing bean?

    Hi im using Jdev 11.1.1.2.0 and i need to set and get a session variable from backing Bean.
    Any idea?

    the class :
    package arq.resources;
    import javax.faces.context.FacesContext;
    import javax.servlet.http.HttpSession;
    public class SesionSigef {
    public FacesContext context;
    public HttpSession session;
    public SesionSigef() {
    super();
    context = FacesContext.getCurrentInstance();
    session = (HttpSession)(context.getExternalContext().getSession(true));
    public Object getVariableSesion(String atributo){
    return session.getAttribute(atributo);
    public void setVariableSesion(String atributo,Object valor){
    session.setAttribute(atributo, valor);
    the example of use :
    SesionSigef se = new SesionSigef();
    DatosRec da = new DatosRec();
    da.setDocumentoCip("Aprobar");
    se.setVariableSesion("DatosRec", da);
    thanks
    Joaquin

  • 'In Between' Date Prompt to set Session Variables???

    Hi
    Im very new to OBIEE and was hoping someone could help me. I have a date prompt using the 'in between' operator based on a date column.
    I am trying to set up a table in the Physical layer of the RPD using a stored proc (EXEC sp_name). The stored proc takes 2 input paramaters - a start data and an end date. These dates i would like to come from the in between prompt. I have set up the physical table structure to receive the results of the request.
    I looked at setting a session variable but it is asking me to insert sql to set the value and i dont want to hit the database outside of the stored proc. Also, even if i have session variables i cant see how to set them to the values in the prompt when using the 'In Between' operator.
    Im really very confused and i have been searching the net and the documentation for any clue.
    Any help would be appreciated
    Thanks

    In between operator doesn't support presentation variable..
    so break this into is into two prompts...and use equal to operator, then you can use them as request variables which will in turn override your session variables.
    in the report use operator between and use these variables in the filter..

  • Set Session Variable

    Hello,
    Anyone know how to set a session variable from data entered within a messageTextInput field from a uix page within a JHeadstart application?
    I tried to trigger an event to write the session but was unsuccessful.
    Any ideas?
    -Jeff

    Jeff,
    We do not support UIX events, because they are part of the UIX Controller. We use the Oracle9iAS MVC Framework (or Struts in next release) as the Controller.
    So, if you want to put a value of a messageTextInput on the session, you need to write a custom process that does this. Note that the MVC Framework provides an abstraction called the InfoTable around the Session object.
    In chapter 2 of the JHeadstart User Guide, section "Writing a Custom Process" you can find more information on reading and writing information from/to the InfoTable.
    Steven Davelaar,
    JHeadstart Team.

  • How to get the session variable value in JSF

    Hi
    This is Subbus, I'm new for JSF framewrok, i was set the session scope for my LoginBean in faces-config.xml file..
    <managed-bean-name>login</managed-bean-name>
    <managed-bean-class>LoginBean</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope> like that...
    So all parameter in LoginBean are set in session right ?... for example i used userId is the Parameter...
    Now i need to get the the userId parameter from that session in my another JSP page.. how i get that ?..
    Already i tried
    session.getAtrribute("userId");
    session.getValue("userId");
    but it retrieve only "null" value.. could u please help me.. it's very urgent one..
    By
    Subbus

    Where i use that..is it in jsp or backend bean...
    simply i use the following code in one backend bean and try to get the value from there bean in the front of jsp page...
    in LogoutBean inside
    public String getUserID()
         Object sessionAttribute = null;
         FacesContext facescontext=FacesContext.getCurrentInstance();
         ExternalContext externalcontext=facescontext.getExternalContext();
         Map sessionMap=externalcontext.getSessionMap();
         if(sessionMap != null)
         sessionAttribute = sessionMap.get("userId");
         System.out.println("Session value is...."+(String)sessionAttribute);
         return (String)sessionAttribute;
         return "fail";
    JSP Page
    <jsp:useBean id="logs" scope="session" class="logs.LogoutBean" />
    System.out.println("SS value is ...."+logs.getUserID());
    but again it retrieve only null value.. could u please tell me first how to set the session variable in JSF.. i did faces-config only.. is it correct or not..
    By
    Subbus

  • Null session variable

    Ok, i have a problem which is really annoying me and i have been stuck on for a while. I am developing a website for my brothers company and am really stuck for time for the launch date. I developed a website last year which worked fine and i am re using the code from that. I am setting a session variable "sessEmail" when the user logs in and want to retrieve it when they go to add a produt to their cart. Here is my code
    String Email = request.getParameter("txtEmail");
    String Password = request.getParameter("txtPassword");
    session.setAttribute("sessEmail",Email);
    Object o = session.getAttribute("sessEmail");
    String s = o.toString();
    out.print(s);
    I am just printing out the "sessEmail" to make sure it is working. It works fine when i try and retrieve the session variable on the same page were i set it but on a seperate page it wont work. It is returning a null pointer exception because the session variable has no value. It is occuring when i try to convert an object to a string.
    Any help would be much appreciated as i am stuck for time.
    Cheers

    Ok the first question to be asked is why it is null?
    The most obvious answer is that you have cookies disabled, and are not using URL rewriting.
    To retain the session, the server issues a "Session Cookie" with your jsessionid in it. If you have cookies switched off on your browser, it won't retain the session.
    To confirm this print out session.getId() on your pages. If it continually changes, you aren't keeping your session. If it remains the same, you HAVE got a session, and need to check why you are putting a null value there.
    To retain session, you need to run every link/url that gets printed to your page through the method response.encodeURL() which will add on the session id manually if cookies are not supported.
    Hope this helps,
    evnafets

  • Struts-JSP : how to use session variable?

    Hi,
    i'm new to both struts and JSP and have a doubt here -
    I'm creating a web application in which a user logs in.
    I need to access this user's userid (id name with which he logs in) in my action classes. how can i do this ?
    please help !
    Thanks in advance,
    susen

    // set session variable
    session.setAttribute("value","hello world");
    // retrieve session variable
    HttpSession session = request.getSession(false);
    String variable = (String) session.getAttribute("value");
    variable will have "hello world"
    Edited by: abel on May 12, 2008 4:52 AM

  • Accessing session variable in Flex.

    Hi All,
       I'm using RemoteObjects for accessing data and using Spring BlazeDS. How to retrieve 'session' variable values in Flex?
       Main application which is calling different .mxml files. It first invokes login(login.mxml) page with successful user credentials it will display home(home.mxml) page and I have search(search.mxml) pages.
        In case user session timeouts then I'd like to send user request to login page for login.(say user is in search page and where he left for 30 minutes, after then when user clicks anything on search page, it should redisplay login page because session timeout is set to (25 minutes).  How to do this Felx??
       Thanks in advance.
    Regards,
    Sharath.

    More detail solution will be found in the help.
    Look for the following string in your local help (in flex builder): Communicating with the Wrapper.
    You will probably find that you have to do something like the following:
    a) call from flex to the wrapper page javascript function.  (this would be a polling operation, run on a timer event (say) once every minute.
    b) the javascript function you call conducts an Ajax call to determine the current session state.
    Note that the above will likely keep your session state alive.
    Another possibility is to pass in the value of your session timeout via a FlashVars variable.
    Again, in a timer function run every minute, invcrement a local counter.
    When local counter equals session passed in, then you might assume that the session has timed out.
    IHTH.
    Cheers

  • Session Variable in PL/SQL

    hi All,
    I want to set a session variable in Web PL/Sql or PL/Sql procedure
    & i want to retrieve in ProcessFormRequest() in my controller...
    Can it be done in some ways ???
    Please help....

    Hi,
    I am trying to get the parameter from pg1(OAPage) to pg2(web pl/sql page) but i can't do it ...
    The link OAPage is :OA_HTML/OA.jsp?_rc=HR_P_RATE_TOP_SS&_ri=800&OAFunc=HR_NEWHIRE_SS&_ti=713401982&retainAM=Y&addBreadCrumb=N&dialogAction=NEXT&oapc=11...
    here i need to pass _ti, retainAM and other parameters to web pl/sql procedure.
    i can't decalare a procedure staring ti like procedure(ti varchar2) coz while executing i am getting error... if i do with this procedure(ti varchar2) i am unable to get _ti parameter in web pl/sql.
    i can get the value of ti from the table(ICXTransactions,icx_sessions) but this is not the feasible to do.
    what is the expansion of parameter &oapc and &oas...
    Please Help....

Maybe you are looking for

  • Tips for increasing fetching performance?

    Hello, I'm doing some select queries from odp.net against my oracle database. first i do maybe: select id, ... from table1 where id in some_collection. then I might do select id, ... from table2 where id in some_collection and id2 in some_other_colle

  • How to create editable PDF template for XML Publisher reports

    Hi, I have got a requirement to have some editable fields in one report whose output is in PDF format. I tried looking and saw this can be done using the XML Publisher report and using PDF template. But I got only Adobe Acrobat Reader and it does not

  • Adding objects to a Map

    Hi all I have created a program that add objects to a Map Code below shows the method used when added public String add(int bookNumber, String title, String releaseYear, String author) Book book = new Book(bookNumber, title, releaseYear, author); if

  • Related to purchasing group

    hi all, how we create a purchasing group and what we have to define in purchasing group and also please tell me what is the relation between purchasing group and purchasing organization............

  • How to uninstall java plugin without removing JRE completely

    how to uninstall java plugin without removing JRE completely. Hope someonce can help, all the documentation ive seen till now shows how to uninstall the Java plugin by completely removing the JRE. Also if you install JRE 1.4.1_01 and do not choose to