Are session-scoped beans singleton

Hi all, I miss something in the bean lifecycle within JSF. Assume that a page action navigates toward another page, linked to a session-scoped bean: this is created for the duration of this session. Then a button leads back to the original page, so that another action will lead to another page with its associated bean. Is this a new bean or the previous one ?
This question is linked to the topic of bean dependencies through managed properties: it works fine, but since a bean is declared per class and not per instance, I miss the overall instantiation philosophy.

Once the bean is created the first time in session, it will not be created again (until the session dies and you attempt to access the bean again of course).
So in your scenario, the first time you access the page the bean gets created. When you go back and then go forward to the page again, a new bean is not created. The originally created one is re-used. Which means the constructor is not called again.
CowKing

Similar Messages

  • Add FacesMessage to FacesContext in an session scoped bean HOWTO?

    I have an simple question. How can I add an FacesMessage to the FacesContext in a session scoped bean.
    This code works fine for request scoped beans.
    String message = "Some message";          
    FacesMessage curentMessage = new FacesMessage(message, message);
    curentMessage.setSeverity(FacesMessage.SEVERITY_ERROR); //Mark as ERROR
    context.addMessage(�userForm�, curentMessage);          When I change bean scope to "session" I am getting java.lang.IllegalStateException at the last line when adding message to context.
    Thanks:
    -- Nermin

    I have an simple question. How can I add an
    FacesMessage to the FacesContext in a session scoped
    bean.
    This code works fine for request scoped beans.
    String message = "Some message";          
    FacesMessage curentMessage = new FacesMessage(message,
    message);
    curentMessage.setSeverity(FacesMessage.SEVERITY_ERROR);
    //Mark as ERROR
    context.addMessage(�userForm�, curentMessage);          When I change bean scope to "session" I am getting
    java.lang.IllegalStateException at the last line when
    adding message to context.
    Thanks:
    -- NerminHow do you get "context"? If you are storing it as an instance variable of the bean, then you
    should expect to get an exception. The FacesContext is scoped only to one request. Instead
    of storing it in the bean, use FacesContext.getCurrentInstance() each time you need to use it.

  • Using Query String Parameters with Session Scoped bean

    I would like to pass query string parameters from a product page (user clicks on a specific product commandLink) that is request scope to a details page that is session scoped.
    The problem is that the session scoped page only handles the first request. If you view the details of a product and then navigate back to the product page and choose another product ... the details page will not handle the new query string parameters and display the details for the first product chosen.
    Is there a way to make the session scoped bean recognize the query string parameters past the first request?

    I was able to replicate this problem with a very simple app that performs a redirection... just like the real app. Here's the simple app that I put together:
    From request scope page:
    <f:view>
             <h:form>
               <h:commandButton value="Link 1" action="#{reqbean.Link1}"/>
               <br/><br/>
              <h:commandButton value="Link 2" action="#{reqbean.Link2}"/>
            </h:form>
           </f:view>
    From request scope bean:
    public String Link1() throws IOException
        // Add event code here...
        //redirect the user
        FacesContext.getCurrentInstance().getExternalContext().redirect("untitled2.jspx?p=1");
        return null;
      public String Link2() throws IOException
        // Add event code here...
        //redirect the user
        FacesContext.getCurrentInstance().getExternalContext().redirect("untitled2.jspx?p=2");
        return null;
      }At this point... I put a println in the constructor of the session scoped bean because this is where I want to get the query string params. The constructor only gets called the first time a redirect is performed.

  • NullPointerException When trying to Get Session Scoped Bean data in another ManagedBean

    hello
    i wont to access to some data in my session scoped bean from a request bean so when i try to get this data all i get is 
    com.sun.faces.mgbean.ManagedBeanCreationException: An error occurred performing resource injection
    on managed bean «discussionlaoder»
    in the end of the exception there is
    Caused by: java.lang.NullPointerException at Hiber.discussionlaoder.init(discussionlaoder.java:35)
    this is my code:
    1-the request scoped bean
    @ManagedBean
    @RequestScoped
    public class discussionlaoder {
      private MyadmninHelper halper;
    @ManagedProperty(value="#{serviceBean}")
         private ServicesBean  serviceBean;
        @PostConstruct
        public void init() {
          halper=getServiceBean().getHalper();  // line 35
    //seter and geter code
    2-the sesions scoped bean
    @ManagedBean (eager=true)
    @SessionScoped
    public class ServicesBean {
        private MyadmninHelper halper;
    //seter and geter code
    am using glassfish server 3.1
    thank's for help

    What you need to do is fix all those typos in your code, then you don't have to override names.
    - the proper Java class name is DiscussionLoader, not discussionlaoder (fix english typo also)
    - if you want to inject a class named ServicesBean, then also call the property the same.
    @ManagedProperty
    public ServicesBean servicesBean;
    But what you're doing now is call the class 'ServicesBean' and then in your managed bean declaration you seem to change your mind and it should all of a sudden be 'serviceBean'. Well then rename the class so you don't have your typo anymore!

  • Spring framework - Error with session scoped Beans

    Hello guys,
    I'm trying execute my Java Application inside Netweaver Application Server, but I'm having problems with serviceBeans with scope session. Anyone have already used Spring with session scope?
    Thanks,
    Cleiton.

    After many attempt, when I declared the bean with <aop:scoped-proxy  /> it works, however it could cause performance problem. I don't need refer this bean by another singleton bean, i did a wrong configuration in order to make a work a round...
    When I run my application on tomcat server, the DWR starts perfectly the "session scope bean form IOC container", but in the WEBAS maybe it's running in other thread. Is it possible?
    Anyone had a problem like this?
    I got a detailed error with log4j,
    ERROR Application [1] org.directwebremoting.impl.DefaultCreatorManager - Error loading class for creator 'SpringCreator[CounterSpringFacade]'.
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'counterSpringFacade': Scope 'session' is not active for the current thread; consider defining a scoped proxy for this bean if you intend to refer to it from a singleton; nested exception is java.lang.IllegalStateException: No thread-bound request found: Are you referring to request attributes outside of an actual web request, or processing a request outside of the originally receiving thread? If you are actually operating within a web request and still receive this message, your code is probably running outside of DispatcherServlet/DispatcherPortlet: In this case, use RequestContextListener or RequestContextFilter to expose the current request.
         at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:312)
         at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
         at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
         at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:881)
         at org.directwebremoting.spring.SpringCreator.getInstance(SpringCreator.java:145)
         at org.directwebremoting.spring.SpringCreator.getType(SpringCreator.java:107)
    Edited by: Cleiton dos Santos Garcia on Jan 7, 2009 5:02 PM

  • When exactly are request-scoped beans evicted from memory?

    Hi,
    I have a question about request-scoped JSF-managed beans and request-scoped HibernateFilter. It seems to me that request-scoped JSF beans actually outlive an HTTP request. Here's what I mean. Let's say I have a page backed by a request-scoped bean #{myBean} which displays a dataTable. a user can click on a row to perform some operation on row data.
    I always thought the following to be true about lifecycle of JSF request-scoped bean:
    1.User makes initial page request
    -HTTP Request 1 (R1) comes in
         1. RestoreView encounters #{myBean} in page and constructs MyBean
         2. RenderResponse renders the page
    -R1 is terminated, page is displayed, myBean is evicted from memory
    2.User looks at the dataTable and clicks on a specific row (via commandLink). Now MyBean.action() is supposed to be
    executed and perform some operation on row data:
    -HTTP R2 comes in
         1.MyBean is constructed again (e.g. not using same instance as in R1). (THIS IS KEY!)
         2.myBean.action() is executed
    -R2 is terminated, myBean is again evicted from memory
    Is the above understanding correct?
    Or does myBean instance (and its' properties) remain in appserver memory between R1 and R2 and R2 actually uses the
    same instance of myBean?
    If scenario above is correct, then I have a strange problem:
    -when performing myBean.action() during R2 on rowData (which is instance of MyHibernateBean) I get a
    HibernateException stating that bean isn't associated with a Hibernate Session. This can only happen if the lifecycle of the object and its' parent myBean exceeded that of R1. That is because I have a Hibernate Servlet
    Filter that a) start a Hibernate Transaction on incoming request and b) commits it on the way out.
    Here's pseudo-code for myBean:
    public class MyBean {
        public static String HANDLE = "#{myBean}";
        //getters setters omitted
        //used as 'value' in dataTable
        private List<MyHibernateBean> dataBeans;
        //dataTable binding
        private UIData tableData;
        public MyBean() {
        public String action() {
            //read children & modify state of a hibernate bean
            MyHibernateBean dataBean = (MyHibernateBean) this.tableData.getRowData();
            HibernateUtil.getCurrentSession().refresh(dataBean); //seems necessary as dataBean instance deemed 'stale'
            dataBean.getChildCollection(); //will fail without line above
            return "toSomewhereElse";
    }

    By the way, I have an hypothesis why this does not work...
    The datatable values MUST be specified using a value binding expression. When the restoreState method for the component is called, JSF attempts to use the VB expression to get the table values. When the managed bean is not found, it creates a new (empty) one and the world ends (actually it just returns back to the original page because it cannot figure out what to do)

  • Create session scoped bean in servlet?

    I am working on a log in porgram for a jsp page using servlet.
    I need to create a bean in that servlet after user enter correct username and password, and the bean must have scope of session.
    How do I do this?
    How do I control the scope of variables in a servlet?
    thank you

    come on people! i just answered this 2 minutes ago! search the forums first! or a servlet book.
    servlet...
    Bean bean = new Bean();
    bean.setValue("value");
    request.getSession().setAttribute("bean", bean);
    jsp...
    <jsp:useBean id="bean" class="Bean" scope="session" />
    <%= bean.getValue() %>
    OR
    <%
    Bean bean = (Bean)session.getAttribute("bean");
    %>

  • Session scoped beans other than SessionBean1

    Let's say I want to provide a logout action. I can end the session by using the below in my logoutButton_action method:
    try {
    FacesContext context = FacesContext.getCurrentInstance();
    HttpSession session = (HttpSession) context.getExternalContext().getSession(false);
    session.invalidate();
    this.getExternalContext().redirect("Page1.jsp");
    } catch (Exception e) {
    log("Logout exception: " + e.getMessage());
    I would not have been able to figure out even that much if it wasn't for this forum. BUT, what about if I have other managed beans (i.e. just plain classes registered in managed-beans.xml) that have session scope, such a class to a hold a logged-in user's details during the session. How do I destroy that when the user logs out?

    {color:#333399}*hi*
    you can set any Object in ur sessionBean1 to be NULL,, by this way , ur session will hold no more data.
    {color}

  • PLZ Help: how to get value of a request scoped Bean/Attribute in JSF ?!!!

    hi,
    I noticed this part of code to retrieve session scoped beans/vars in an ActionListener or other jsf classes, but it does not work for request scoped beans/vars :( what's the problem then ? what shall i do ?
    Type var = (Type)Util.getValueBinding("myBeanInRequest")).getValue(context);
    I have also set that getPhaseId() returns UPDATE_MODEL_VALUES or APPLY_REQUEST_VALUES.
    Any comment or idea ?

    I have declared my Bean in my JSP page not in the
    faces-config.xml. Does this make any problem ? Also I
    have tried the way you told me as well, but still the
    returned attribute is null.
    P.S. My bean is declared in my JSP page this way:
    <jsp:useBean id="newSurveyVar" class="SurveyModel"
    scope="request" />
    This declaration causes the SurveyModel instance to be created in request scope when the page is rendered, but that doesn't help you when the form is submitted -- that is going to happen on the next request (so the request attribute created here goes away). Basically, <jsp:useBean> is not typically going to be useful for request scope attributes (it's ok for session or application scope, though).
    and further I have this jsf code:
    <h:command_button label="Create" commandName="create"
    action="create" >
    <f:action_listener
    r type="CreateNewSurveyActionListener"/>
    </h:command_button>
    and this is my
    CreateNewSurveyActionListener.processAction(ActionEvent
    e) {
    if (actionCommand.equals("create_the_survey")) {
    FacesContext context =
    t = FacesContext.getCurrentInstance();
    SurveyModel survey =
    y =
    (SurveyModel)(Util.getValueBinding("newSurveyVar")).get
    alue(context);
    if (survey==null) // returns true :(((
    And since I've declared my beans here there is nothing
    special declared in my faces-config.xml
    For me again it is really strange why it is not
    working !!!
    Any idea ? Because the event listener is fired in a separate request, so the one you created in the page is gone.
    This is why the managed bean creation facility was created. If your component contains a valueRef that points at the bean name (or you evaluate a ValueBinding as illustrated earlier in the responses to your question), then the bean will get instantiated during the processing of the form submit.
    Craig McClanahan

  • We should NEVER use the session back bean?

    Because the user can open a new window by right click the link, and the session scope back bean is not thread-safe.
    So we should forget it?

    Your concern makes really no sense, or you must be storing request scoped data in a session scoped bean instead of a request scoped bean, which can indeed lead to undesireable behaviour in multiple requests on the same session.

  • Oracle-ADF inlineFrame initializing view scoped bean twice

    I am facing strange issue related with af:inlineFrame component. Trying to display/render ADF page inside of af:popup within af:inlineFrame component. The weird thing is when the popup displayed; view scoped bean's @PostConstruct method called twice. That means bean is initialized twice. However it needed to be initialized once since bean is referenced from the page that is going to be displayed inside af:inlineFrame.
    Correct flow gotta be:
    Click to button openPopup() method called.
    openPopup() sets URI then opens popup.
    inlineFrame source property set as it's going to display framePage.jspx.
    JSF scans framePage.jspx code finds out there is a reference to FrameBean inside af:outputLabel
    Construct FrameBean then call @PostConstruct method.
    Call appropriate getter and render page.
    What happens in my case:
    Click to button openPopup() method called.
    openPopup() sets URI opens popup.
    inlineFrame source property set as it's going to display framePage.jspx.
    JSF scans framePage.jspx code finds out there is a reference to FrameBean inside af:outputLabel
    Construct FrameBean then call @PostConstruct method.
    Call appropriate getter and render page.
    Construct FrameBean then call @PostConstruct method.
    Call appropriate getter and render page.
    Popup located like:
    <af:popup id="mainPopup" binding="#{mainBean.mainPopup}">
    <af:dialog id="mainDialog">
      <af:inlineFrame source="#{mainBean.URI}"> </af:inlineFrame>
      </af:dialog>
    </af:popup>
    Showing popup via af:button action="#{mainBean.openPopup}":
    public void openPopup() {
    this.setURI("http://localhost:7001/app/framePage.jspx");
      RichPopup.PopupHints hints = new RichPopup.PopupHints();
    this.getMainPopup().show(hints);
    framePage.jspx:
    <?xml version='1.0' encoding='UTF-8'?> <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:f="http://java.sun.com/jsf/core" xmlns:af="http://xmlns.oracle.com/adf/faces/rich"> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <jsp:directive.page contentType="text/html;charset=UTF-8" />
    <f:view>
    <af:document title="Frame Demo" id="demoDocument">
      <af:form id="demoForm">
    <af:outputLabel value="#{frameBean.commonId}">   </af:outputLabel>
      </af:form>
      </af:document>
    </f:view>
    </jsp:root>
    FrameBean:
    @ManagedBean
    @ViewScoped
    public class FrameBean {
    private String commonId;
      @PostConstruct
      public void afterInit() {  } 
      public String getCommonId() {
    return commonId;
    public void setCommonId(String commonId) {
    this.commonId = commonId;
    Making FrameBean @SessionScoped solves this issue since bean is kept with session but I don't want to keep it within session. Also setting source property of af:inlineFrame in jspx as hardcoded not fixing the problem.

    im using ADF Essential on Glassfish 3.1 with no problem, but glassfish is heavyweight. I think Oracle ADF is not dependent to Application Server , then i tried to use my project with Tomcat 7. I deployed my application on Tomcat 7 , but im getting some exceptions.
    Not all application servers support Oracle ADF.
    Refer the certification matrix, Tomcat 7 is not listed as being supported.
    http://www.oracle.com/technetwork/developer-tools/jdev/index-091111.html

  • Session in bean

    I have a bean. At the end all variables are set to "". But anyway I need to insert it into a session before, but it seams that I can�t use sessions in bean.
    // Clear the form
    user = "";
    password = "";
    rpassword = "";
    session.setAttribute("icq", iicq);
    iicq = "";Andreas

    Or how would you add session attributes to the bean, if thats possible I do not need to use a servlet.
    package serverspy;
    import java.util.*;
    import java.util.regex.*;
    import java.sql.*;
    import serverspy.*;
    public class UpdateValidatePersonalBean {
    /*  The properties */
    Connection con = null;
    String user = "";
    String password = "";
    String rpassword = "";
    String fname = "";
    String lname = "";
    String dobyear = "";
    String dobmonth = "";
    String dobday = "";
    String country = "";
    String timezone = "";
    String mobilepfx = "";
    String mobile = "";
    String icq = "";
    String terms = "";
    String outgoing = "";
    String imobile = "";
    String iicq = "";
    int ioutgoing;
    public Connection getConnection() {
    return con;
    public void setConnection(Connection con) {
    this.con = con;
    public String getUser() {
    return user;
    public void setUser(String user) {
    this.user = user.trim();
    public String getPassword() {
    return password;
    public void setPassword(String password) {
    this.password = password.trim();
    public String getRpassword() {
    return rpassword;
    public void setRpassword(String rpassword) {
    this.rpassword = rpassword.trim();
    public String getFname() {
    return fname;
    public void setFname(String fname) {
    this.fname = fname.trim();
    public String getLname() {
    return lname;
    public void setLname(String lname) {
    this.lname = lname.trim();
    public String getDobyear() {
    return dobyear;
    public void setDobyear(String dobyear) {
    this.dobyear = dobyear.trim();
    public String getDobmonth() {
    return dobmonth;
    public void setDobmonth(String dobmonth) {
    this.dobmonth = dobmonth.trim();
    public String getDobday() {
    return dobday;
    public void setDobday(String dobday) {
    this.dobday = dobday.trim();
    public String getCountry() {
    return country;
    public void setCountry(String country) {
    this.country = country.trim();
    public String getTimezone() {
    return timezone;
    public void setTimezone(String timezone) {
    this.timezone = timezone.trim();
    public String getMobilepfx() {
    return mobilepfx;
    public void setMobilepfx(String mobilepfx) {
    this.mobilepfx = mobilepfx.trim();
    public String getMobile() {
    return mobile;
    public void setMobile(String mobile) {
    this.mobile = mobile.trim();
    public String getIcq() {
    return icq;
    public void setIcq(String icq) {
    this.icq = icq.trim();
    public String getTerms() {
    return terms;
    public void setTerms(String terms) {
    this.terms = terms.trim();
    public String getOutgoing() {
    return outgoing;
    public void setOutgoing(String outgoing) {
    this.outgoing = outgoing.trim();
    /* Errors */
    public static final Integer ERR_RPASSWORD_ENTER = new Integer(3);
    public static final Integer ERR_PASSWORD_INVALID = new Integer(4);
    public static final Integer ERR_PASSWORD_LENGTH = new Integer(5);
    public static final Integer ERR_FNAME_INVALID = new Integer(6);
    public static final Integer ERR_LNAME_INVALID = new Integer(7);
    public static final Integer ERR_DOB_INVALID = new Integer(8);
    public static final Integer ERR_COUNTRY_INVALID = new Integer(9);
    public static final Integer ERR_TIMEZONE_INVALID = new Integer(10);
    public static final Integer ERR_MOBILE_INVALID = new Integer(11);
    public static final Integer ERR_ICQ_DIGIT = new Integer(12);
    public static final Integer ERR_ICQ_INVALID = new Integer(13);
    public static final Integer ERR_TERMS_INVALID = new Integer(14);
    public static final Integer ERR_OUTGOING_INVALID = new Integer(15);
    // Holds error messages for the properties
    Map errorCodes = new HashMap();
    // Maps error codes to textual messages.
    // This map must be supplied by the object that instantiated this bean.
    Map msgMap;
    public void setErrorMessages(Map msgMap) {
    this.msgMap = msgMap;
    public String getErrorMessage(String propName) {
    Integer code = (Integer)(errorCodes.get(propName));
    if (code == null) {
    return "";
    } else if (msgMap != null) {
    String msg = (String)msgMap.get(code);
    if (msg != null) {
    return msg;
    return "Error";
    /* Form validation and processing */
    public boolean isValid() {
    // Clear all errors
    errorCodes.clear();
    // Validate email
    Pattern p = Pattern.compile("[^A-Za-z0-9\\.\\@_\\-~#]+");
    // Validate Password(s) 
    Matcher mp = p.matcher(password);
    if (mp.find()) {
    errorCodes.put("password", ERR_PASSWORD_INVALID);
    } else if (password.length() < 4) {
    errorCodes.put("password", ERR_PASSWORD_LENGTH);
    if (!password.equals(rpassword))  {
    errorCodes.put("rpassword", ERR_RPASSWORD_ENTER);
    // Validate Firstname   
    if (fname.length() == 0) {
    errorCodes.put("fname", ERR_FNAME_INVALID);
    // Validate Lastname   
    if (lname.length() == 0) {
    errorCodes.put("lname", ERR_LNAME_INVALID);
    // Validate DobYear
    try {
    int dy = Integer.parseInt(dobyear);
    } catch (NumberFormatException e) {
    errorCodes.put("dob", ERR_DOB_INVALID);
    // Validate DobMonth
    try {
    int dm = Integer.parseInt(dobmonth);
    } catch (NumberFormatException e) {
    errorCodes.put("dob", ERR_DOB_INVALID);
    // Validate DobDay
    try {
    int dd = Integer.parseInt(dobday);
    } catch (NumberFormatException e) {
    errorCodes.put("dob", ERR_DOB_INVALID);
    // Validate Country   
    if (country.length() != 2) {
    errorCodes.put("country", ERR_COUNTRY_INVALID);
    // Validate Timezone
    try {
    int tz = Integer.parseInt(timezone);
    } catch (NumberFormatException e) {
    errorCodes.put("timezone", ERR_TIMEZONE_INVALID);
    // Validate MobilePfx
    if (mobilepfx.length() == 0 && mobile.length() != 0) {
    errorCodes.put("mobile", ERR_MOBILE_INVALID);
    } else if(mobilepfx.length() != 0){
    try {
    int mpfx = Integer.parseInt(mobilepfx);
    } catch (NumberFormatException e) {
    errorCodes.put("mobile", ERR_MOBILE_INVALID);
    // Validate Mobile
    if (mobile.length() != 0) {
    try {
    int mn = Integer.parseInt(mobile);
    } catch (NumberFormatException e) {
    errorCodes.put("mobile", ERR_MOBILE_INVALID);
    // Validate Icq
    if (icq.length() >= 6) {
    try {
    int ic = Integer.parseInt(icq);
    } catch (NumberFormatException e) {
    errorCodes.put("icq", ERR_ICQ_DIGIT);
    } else if (icq.length() < 6 && icq.length() != 0) {
    errorCodes.put("icq", ERR_ICQ_INVALID);
    // Validate Terms
    if (!terms.equals("1")) {
    errorCodes.put("terms", ERR_TERMS_INVALID);
    try {
    int te = Integer.parseInt(terms);
    } catch (NumberFormatException e) {
    errorCodes.put("terms", ERR_TERMS_INVALID);
    // Validate Outgoing
    // If no errors, form is valid
    return errorCodes.size() == 0;
    public boolean process() {
    if (!isValid()) {
    return false;
    // Process form...
    serverspy.security.MD5Hash Hash;
    Hash = new serverspy.security.MD5Hash();
    try{
              String ipassword = Hash.doHash(password);
    if (icq.length() >= 6) {
              iicq = icq+"@pager.icq.com";
    } else if (icq.length() == 0) {
    iicq = "";
    if (mobile.length() != 0) {
         imobile = mobilepfx+"-"+mobile;
         } else if (mobile.length() == 0) {
    imobile = "";
              String idob =dobyear+""+dobmonth+""+dobday;
    if (outgoing.equals("on")){
         ioutgoing = 1;
    else {
         ioutgoing = 0;
    System.out.println("Outgoing: "+outgoing);
    System.out.println("Lname: "+lname);
    System.out.println("Fname: "+fname);
    System.out.println("Dob: "+idob);
    System.out.println("Country: "+country);
    System.out.println("Password: "+ipassword);
    System.out.println("Icq: "+iicq);
    System.out.println("Mobile: "+imobile);
    System.out.println("Timezone: "+timezone);
    System.out.println("Terms: "+terms);
    System.out.println("Outgoing: "+ioutgoing);
    System.out.println("User: "+user);
                   PreparedStatement pStmt = con.prepareStatement("UPDATE [USERS] SET [LastName] =?, [FirstName] =?, [Dob] =?, [Country] =?, [Password] =?, [Icq] =?, [Sms_address] =?, [TimeOffset] =?, [Terms] =?, [Outgoing] =? WHERE [Id] =?");
                   pStmt.setString(1, lname);
                   pStmt.setString(2, fname);
                   pStmt.setString(3, idob);
                   pStmt.setString(4, country);
                   pStmt.setString(5, ipassword);
                   pStmt.setString(6, iicq);
                   pStmt.setString(7, imobile);
                   pStmt.setInt(8, Integer.parseInt(timezone));
                   pStmt.setInt(9, Integer.parseInt(terms));
                   pStmt.setInt(10, Integer.parseInt(ioutgoing));
                   pStmt.setInt(11, Integer.parseInt(user));
                   pStmt.executeUpdate();
                   System.out.println("User: "+ user +" has been updated.");
         catch(Exception exp){
              System.out.println("Exception: "+ exp);
    // Clear the form
    user = "";
    password = "";
    rpassword = "";
    fname = "";
    lname = "";
    dobyear = "";
    dobmonth = "";
    dobday = "";
    country = "";
    timezone = "";
    mobilepfx = "";
    mobile = "";
    icq = "";
    terms = "";
    outgoing = "";
    imobile = "";
    iicq = "";
    errorCodes.clear();
    return true;
    }THat would be much better. But how can I set the attributes.
    Andreas

  • Resolving session scoped component in global scope component.

    Hi,
    I am implementing batch process and i am need to resolve session scoped component in global scoped component.
    In global scope component (one of the component referred by my scheduler which also in global scope as usual) and i need to resolve session scoped "/atg/epub/workflow/WorkflowView" component in my scheduler.
    I tried all possibilities but nothing worked out. I do not have access to current request, because its batch process. following ways i tried,
    1. getResolveName("/atg/epub/workflow/WorkflowView") method of GenericService which is extended by my global scope component -- This returns null.
    2. Tried to get the current request on ServletUtils to use resolveName() method on request.
    ServletUtlis.getCurrentRequest() - This returns null as expected.
    Is there any way to resolve session scoped component in global scope component. Thanks in advance.
    Edited by: 938890 on Jun 30, 2012 4:59 AM

    Try below :
    If you want to resolve the name of a Nucleus component from Java code that is not itself a Nucleus service, you must first initialize Nucleus with this construct:
    Nucleus.getGlobalNucleus().resolveName("target component")
    where target component is the name of the component you are looking up. Note that this construct works only for components with global scope.
    You can also resolve names of Nucleus components using the Java Naming and Directory Interface (JNDI). The following example shows how you can use JNDI to access the Scheduler component:
    String jndiName = "dynamo:/atg/dynamo/service/Scheduler";
    Context ctx = new javax.naming.InitialContext ();
    Scheduler s = (Scheduler) ctx.lookup (jndiName);
    reference - oracle ATG docs.
    ~ Praveer

  • Session scoped form handler

    hi all,
    what are all the session scoped form handlers in OOTB in atg
    regards
    shya

    What are Session Components in ATG OOTB
    http://www.techanuva.com/session-scoped-components-as-part-of-atg-dps/
    -RMishra
    Edited by: RMishra on Nov 21, 2012 7:26 PM

  • What are Session Components in ATG OOTB

    Hi,
    What are the Session components in ATG OOTB, as far i know Profile and ShoppingCart are the Session components.
    Please mention if any other Session components are there. we need to create the same using other framework.

    There are a lot of session scoped components. Here are just the ones found in the DAS,DPS,DSS and DCS modules
    DAS
    ===
    ./config/config/atg/dynamo/admin/context/SessionAdminContextHolder.properties:$scope=session
    ./config/config/atg/dynamo/admin/CreateWebServiceProperties.properties:$scope=session
    ./config/config/atg/dynamo/security/FormLoginSession.properties:$scope=session
    ./config/config/atg/dynamo/security/IdentityManager.properties:$scope=session
    ./config/config/atg/dynamo/security/User.properties:$scope=session
    ./config/config/atg/dynamo/security/UserFailService.properties:$scope=session
    ./config/config/atg/dynamo/service/fluoroscope/listener/SessionCachingListener.properties:$scope=session
    ./config/config/atg/dynamo/service/fluoroscope/SensorSessionData.properties:$scope=session
    ./config/config/atg/dynamo/service/transfer/xls/AssetXLSFileImportOperation.properties:$scope=session
    ./config/config/atg/dynamo/servlet/RequestLocale.properties:$scope=session
    ./config/config/atg/dynamo/servlet/sessiontracking/GlobalSessionEnumPropertyValues.properties:$scope=session
    ./config/config/atg/dynamo/servlet/sessiontracking/SessionSaver.properties:$scope=session
    ./config/config/atg/dynamo/servlet/windowscope/WindowScopeContextStorage.properties:$scope=session
    ./config/config/atg/multisite/RealmSessionTracker.properties:$scope=session
    ./config/config/atg/multisite/SiteSessionManager.properties:$scope=session
    ./config/config/atg/repository/SessionPropertyDescriptorData.properties:$scope=session
    ./config/config/atg/servlet/http/CookieBuffer.properties:$scope=session
    ./config/config/SessionConfirmationNumberHolder.properties:$scope=session
    DPS
    ===
    ./config/targeting/atg/devtools/RepositoryAgent.properties:$scope=session
    ./config/targeting/atg/devtools/SensorAgent.properties:$scope=session
    ./config/targeting/atg/devtools/TargeterAgent.properties:$scope=session
    ./config/targeting/atg/targeting/ConflictFilter.properties:$scope=session
    ./config/userprofiling/atg/devtools/UserDirectoryAgent.properties:$scope=session
    ./config/userprofiling/atg/dynamo/droplet/PasswordExpiresSoon.properties:$scope=session
    ./config/userprofiling/atg/dynamo/security/IdentityManager.properties:$scope=session
    ./config/userprofiling/atg/reporting/datacollection/userprofiling/SiteVisitRequest.properties:$scope=session
    ./config/userprofiling/atg/userprofiling/Profile.properties:$scope=session
    ./config/userprofiling/atg/userprofiling/ProfileFailService.properties:$scope=session
    ./config/userprofiling/atg/userprofiling/sso/Passport.properties:$scope=session
    DSS
    ===
    ./config/atg/devtools/ScenarioAgent.properties:$scope=session
    DCS
    ===
    ./config/atg/commerce/catalog/AdvProductSearch.properties:$scope=session
    ./config/atg/commerce/catalog/CatalogNavHistory.properties:$scope=session
    ./config/atg/commerce/catalog/CatalogSearch.properties:$scope=session
    ./config/atg/commerce/catalog/CategorySearch.properties:$scope=session
    ./config/atg/commerce/catalog/CompareSkusFormHandler.properties:$scope=session
    ./config/atg/commerce/catalog/comparison/ProductList.properties:$scope=session
    ./config/atg/commerce/catalog/comparison/TableInfo.properties:$scope=session
    ./config/atg/commerce/catalog/ProductSearch.properties:$scope=session
    ./config/atg/commerce/catalog/ProductTextSearch.properties:$scope=session
    ./config/atg/commerce/gifts/GiftlistFormHandler.properties:$scope=session
    ./config/atg/commerce/gifts/GiftlistSearch.properties:$scope=session
    ./config/atg/commerce/order/purchase/CostCenterContainerService.properties:$scope=session
    ./config/atg/commerce/order/purchase/PaymentGroupContainerService.properties:$scope=session
    ./config/atg/commerce/order/purchase/PurchaseProcessConfiguration.properties:$scope=session
    ./config/atg/commerce/order/purchase/ShippingGroupContainerService.properties:$scope=session
    ./config/atg/commerce/order/scheduled/ScheduledOrderFormHandler.properties:$scope=session
    ./config/atg/commerce/order/ShoppingCartModifierConfiguration.properties:$scope=session
    ./config/atg/commerce/pricing/CleanBeforePricingSlot.properties:$scope=session
    ./config/atg/commerce/pricing/NoCleanBeforePricingSlot.properties:$scope=session
    ./config/atg/commerce/pricing/UserPricingModels.properties:$scope=session
    ./config/atg/commerce/promotion/PromotionAnalysisModelHolder.properties:$scope=session
    ./config/atg/commerce/ShoppingCart.properties:$scope=session
    ./config/atg/commerce/util/RepeatingRequestMonitor.properties:$scope=session
    ./config/atg/devtools/CommerceAgent.properties:$scope=session
    ./config/atg/registry/Slots/RelatedItemsOfCart.properties:$scope=session
    ./config/atg/userprofiling/ProfileFailService.properties:$scope=session

Maybe you are looking for

  • Not getting all of the results from ALL_OBJECTS in Procedure

    I created the following procedure under a DBA account. The procedure selects info from ALL_OBJECTS. When I execute the procedure under this same DBA account, It does not return objects of all owners; only owners like SYSTEM, SYS, PUBLIC, and the DBA

  • *Unable to create Service Entry Sheet.*

    Hi, Iu2019m trying to create service entry sheet for a service PO but all the item level fields in ML81N screen are appearing in display mode (non-editable) also I cannot see the u201CService Selectionu201D button. So Iu2019m unable to insert/select

  • Imessage isn't working

    I had ios 5.0.1 and one morning i went on my ipad and onto imessage. It wanted me to put my apple id and password in so i did. It said 'verifing' and then it goes back to the place where you put your id and password in and it does the same thing all

  • 'in' type in my query

    can i write this type of syntax in where clause :where (id,name,sal) in(10,'xxx',2000)

  • Projects for par files

    If i want to create a some par files and also edit some par files that came from sap, should I create a project for each PAR that I am going to edit or create. what is the best practice used? If we create a project for each PAR, should we check in al