Jsf issue using session attributes

I have a JSF issue where I can't seem to get session attributes to be stored as initial values on my inputText field below. I've tried 2 things: (1) reading session attributes in my locrateForm bean, and then use getter method to get them to the jsp form ( I read the session attributes in the getter - I know it's a no-no, but I'm desparate)...
(2) reading session attributes in my jsp and storing them to the inputText fields.
Both times, I can successfully read the session attributes, but I can't get it stored in the inputText below....Pls provide this new jsf user some direction...thanks in advance...
Also....I thought the below EL would auto-invoke the getter method in the "locrateForm" Bean to get the initial value, but it's not...my books don't explain this well...
<h:inputText id="locrateDest" value="#{locrateForm.locrate.locrateDest}" >
</h:inputText>

Can you show us the snippit of your faces-config.xml for locrateForm and the snippit of the Java implementation that involves locrate and locrateDest?

Similar Messages

  • Issue Using Boolean Attribute in Decision Tables Conditions

    I'm using Oracle BPM Suite 11g 11.1.1.4.0 for my application. In my business rules, I need to use the nillable boolean attribute in Decision Table conditions, so I import java.lang.Boolean class in the Java Facts, I append .booleanValue() to the condition. I validate the rule, it's ok. Then I deploy my application to server, when I test the my process, i encounter a error:
    <bpelFault><faultType>0</faultType><operationErroredFault xmlns="http://xmlns.oracle.com/LoanApprovalRules/LoanApprovalRules_DecisionService_1"><part name="payload"><errorInfo xmlns="http://xmlns.oracle.com/LoanApprovalRules/LoanApprovalRules_DecisionService_1"><errorMessage>The class 'com.oracle.xmlns.bpm.bpmobject.data.loaninfoobject.LoanInfoObjectType' has no member named 'hasAssets'. at line 6 column 3 in main</errorMessage></errorInfo></part></operationErroredFault></bpelFault>
    HasAssets is Bool type. If I remove java.lang.Boolean in Java Fact, and remove conditions of hasAssets, the process run perfectly.
    Can you help me?
    Thanks.

    I'm using Oracle BPM Suite 11g 11.1.1.4.0 for my application. In my business rules, I need to use the nillable boolean attribute in Decision Table conditions, so I import java.lang.Boolean class in the Java Facts, I append .booleanValue() to the condition. I validate the rule, it's ok. Then I deploy my application to server, when I test the my process, i encounter a error:
    <bpelFault><faultType>0</faultType><operationErroredFault xmlns="http://xmlns.oracle.com/LoanApprovalRules/LoanApprovalRules_DecisionService_1"><part name="payload"><errorInfo xmlns="http://xmlns.oracle.com/LoanApprovalRules/LoanApprovalRules_DecisionService_1"><errorMessage>The class 'com.oracle.xmlns.bpm.bpmobject.data.loaninfoobject.LoanInfoObjectType' has no member named 'hasAssets'. at line 6 column 3 in main</errorMessage></errorInfo></part></operationErroredFault></bpelFault>
    HasAssets is Bool type. If I remove java.lang.Boolean in Java Fact, and remove conditions of hasAssets, the process run perfectly.
    Can you help me?
    Thanks.

  • Policy Evaluation using session attributes condition

    Hi Guys,
    I have custom policies defined in Access Manager for several resources to be protected. What i am trying to achieve is When policy evaluation happens to calculate the resources based on the ldaproles for a user entry, I need few session properties to be applied which are defined under "conditions" in the policy setup . I need to figure out how would set these users AM session properties from the client application. Any inputs would be of great help.
    Thanking in advance.
    Akeel M Sayyad.

    Anyways, I figured it out. You can do it using SSOTokenManager.

  • Use request attributes in JSF

    Is there a way we can pass data from one form bean to the other using request attributes insted of session attributes?
    I am able to work with session attributes using
    HttpSession mySession = (HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(true); and setting attributes to it, but getting null pointers(occassionally) when I retrieve the atribute and work with it.
    getSession(false) isnt helping either.
    Looks like facesServlet is creating a new request when it forwards to next page. Any idea on how to get the Faces Servlet do something like request despatcher forward, for navigation so I can work with request attributes?
    Appreciate your input.

    Can I have just one backing bean and use it for all jsps in the app? App has 4 flows from home page and mutiple jsps in each flow. Each jsp has multiple form fields. Is that OK?
    Any way to passing data/objects between different backing beans - other than using session attributes? I had similar problems working on Struts app as well.

  • JSF 1.2 Session Timeout Issue

    I am using using:
    JSF- Sun RI (1.2)
    Websphere (6.1)
    Facelets (1.?)
    RichFaces (3.3.2)
    I am having an issue with session timeouts that shows up in two different ways:
    Scenario 1) the client makes an ajax call after the session has timed out
    Scenario 2) the client makes a standard request after the session has timed out - navigating to a new page
    I seem to be able to address one or the other, but I can't seem to find a solution that fixes both scenarios.
    For Scenario 1, I have the client-side A4J.AJAX.onExpired function defined and that is currently working for session timeouts that are discovered via an ajax request.
    However, if I start making changes to try and address the other scenario, it seems to break the A4J javascript function.
    For Scenario 2, I have tried a number of suggestions that I've found online:
    1) I've tried to configure the error page in web.xml:
    <error-page>
         <exception-type>javax.faces.application.ViewExpiredException</exception-type>
         <location>/timeout.jsf</location>
    </error-page>
    However, anything I seem to try around this solution still winds up with a ViewExpiredException. I've tried to have timeout.jsf redirect to the login page and I get a ViewExpiredException on the login page when the redirect happens. I've tried to just render a timeout page with a link the user can click on to go to the login page and that fails as well.
    2) I've tried the phase listener and had little success too.
    3) I tried a NavigationHandler
    One thing I did have working, I believe, was with the phase listener approach, but I had a difficult time displaying a session timed out message upon redirect, but not the first time the user visited the page.
    I'm relatively new to JSF and probably don't understand the app life cycle well enough, I guess, but is there a solution that addresses all of these issues:
    1) works for AJAX calls
    2) works for actual navigation
    3) sends the user back to the login page with some indication as to "why", but gracefully handles the first visit to the login page (or a logout)
    Thanks for any suggestions you can offer.

    Sorry, but I have to disagree. Loading JavaScript at the beginning of your page would only make the page load slower (and "ruin" the user's experience when they see the page being loaded steadily) and also cause unforeseen issues than to leave it at the bottom of your page.
    Big companies like Google (1999), Yahoo (2000), Oracle (2001) and many others are doing the opposite to what you have said. Look at the way they load their JavaScripts and you'll see.
    It's also good practice to zip your content from the server before sending it to the client's web browser to increase performance. Of course, this will depend on whether your web browser supports methods such as gzip, deflate, etc... and whether you use HTTP or HTTPS.
    Lastly, another bad practice I often see Java programmers do is write the following all over the places:
    setString, setInt, setDouble, etcInstead of using an existing feature of Java to do the same in one procedure, as in:
    public static void setParameters(PreparedStatement preparedStatement, Object... values)
       throws SQLException
       for (int i = 0; i < values.length; i++) {
          preparedStatement.setObject(i + 1, values);
    Then just call *setParameters* whenever you need it instead of writing multiple setString, setInt, etc statements everywhere...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Javascript to JSP question...Can javascript function set session attributes

    hello,
    i have a web app that, on one of its pages, displays "tabbed pane" as an image map at the top (a la amazon.com). my problem is this: each "logical" page contains separate forms that all use the same javabean. in other words, imagine that the tabs represent an account maintenance web ui for an on-line record store. the first tab might be labeled "General," the second "Contact info," the third "Shipping Info." Each uses the same account bean and displays portions of its properties relevant to the tab at hand. what i want to do is allow a user to enter the account maintenance ui, update info on the first tab, click on tab two and have the request with the changes sent to a processing jsp. yet, since each "tab" is actually a separate URL to another page, how do i get the updated info on the first tabe without adding some sort of "SAVE" button on each tab. ive considered using javascript, but dont know how to get the request params out of the first tab whn i click on another tab. is it possible to include an "onClick" function in each URL that "grabs" the updated form fields off the preceeding tab? can a javacript function set session attributes in jsp?

    hello there,
    wow, you've created one big mammy-jammy tool.
    first, javascript cannot access, set values to the session, without having to post to another JSP. javascript is great for manipulating objects, layers, form values, etc.
    you have 2 issues [if i understand correctly]:
    1) you need to able to save user info for a specific tab without having to reloading the page.
    ---you can create a form for EACH of your tabs and POST all the information to a hidden IFRAME or LAYER for NN4. that hidden IFRAME / LAYER will load a JSP page which with all the parameters you posted to it. or you can build a FRAMESET and target that document["frame-name"].src with that same JSP.
    2) handling when the SAVE INFO action should happen: hence some javascript event handler: onMouseOver, onClick, etc
    ---i don't know the dynamics of your tabs, but if store which tab was clicked on last, then if the user clicks on some other tab, javascript can submit that FORM to a JSP [see condition above]
    you have an interesting tool. can i see?
    i hope i wasn't too confusing, but your problem is sooo interesting. =)
    -WJP

  • How to use session object in jsp

    hi all
    marry christmas
    can anyone plz tell me how to use session obect in jsp
    rachna
    Message was edited by:
    rachna_arora82

    hi rachna,
    JSP has a default(implicit) session object...... use the getSession(true) method on the session object and then going u can either get or set attributes depending on the requirement
    That was in general and now with the issue u have got..... what u can do is that the u can create session for every user who logs in and when he/she tries to login again then u can probably check for the existing session object in the JSP and perform the logic as required..... any clarifications plzzzzzzz let me know
    Thanks n Regards
    Naveen M
    Message was edited by:
    Novice_inJAVA
    Message was edited by:
    Novice_inJAVA

  • Java.lang.NullPointerException: IWSHttpSession: Session attribute name or v

    Hi ,
    I could deploy Web module (war) file on iPlanet 6.0 sp7. But when I try to run the app in the browser, I get the following error :
    Has anyone come across this same issue?
    Thanks.
    Peter
    p.s. I do not have this issue with Sun One 7.0 Ap Server.
    Start of Server Log
    [30/Jun/2004:09:59:15] info ( 1540): successful server startup
    [30/Jun/2004:09:59:15] info ( 1540): iPlanet-WebServer-Enterprise/6.0SP8 B04/20/2004 07:13
    [30/Jun/2004:09:59:15] info ( 1540): Installing a new configuration
    [30/Jun/2004:09:59:15] info ( 1540): [LS ls1] http://gutierc, port 90 ready to accept requests
    [30/Jun/2004:09:59:15] info ( 1540): A new configuration was successfully installed
    [30/Jun/2004:09:59:15] info ( 1540): Internal error: unable to create JVM
    [30/Jun/2004:09:59:15] failure ( 1540): Failure to load JVM (check your JRE)
    [30/Jun/2004:09:59:15] failure ( 1540): Late initialization failed: Error running init function(late) NSServletLateInit: unknown error
    [30/Jun/2004:09:59:15] info ( 1540):  Suspend Httpd Service
    [30/Jun/2004:10:04:29] info (  508): successful server startup
    [30/Jun/2004:10:04:29] info (  508): iPlanet-WebServer-Enterprise/6.0SP8 B04/20/2004 07:13
    [30/Jun/2004:10:04:29] info (  508): Installing a new configuration
    [30/Jun/2004:10:04:30] info (  508): [LS ls1] http://gutierc, port 90 ready to accept requests
    [30/Jun/2004:10:04:30] info (  508): A new configuration was successfully installed
    [30/Jun/2004:10:04:32] info (  508): Using the Java HotSpot(TM) Server VM v1.3.1_12 from Sun Microsystems Inc.
    [30/Jun/2004:10:04:32] info (  508): Java VM classpath: c:/program1/sun/iPlanet/Servers/plugins/servlets/examples/legacy/beans.10/SDKBeans10.jar;c:/program1/sun/iPlanet/Servers/bin/https/jar/NSServletLayer.jar;c:/program1/sun/iPlanet/Servers/bin/https/jar/NSJavaUtil.jar;c:/program1/sun/iPlanet/Servers/bin/https/jar/AdminNativeUtil.jar;c:/program1/sun/iPlanet/Servers/bin/https/jar/NSJavaMiscUtil.jar;c:/program1/sun/iPlanet/Servers/bin/https/jar/servlet.jar;c:/program1/sun/iPlanet/Servers/bin/https/jar/servlet-2.3-filters-api.jar;c:/program1/sun/iPlanet/Servers/bin/https/jar/jsp092.jar;c:/program1/sun/iPlanet/Servers/bin/https/jar/jaxp.jar;c:/program1/sun/iPlanet/Servers/bin/https/jar/crimson.jar;c:/program1/sun/iPlanet/Servers/bin/https/jar/xalan.jar;c:/program1/sun/iPlanet/Servers/bin/https/jar/jspengine.jar;
    [30/Jun/2004:10:04:32] info (  508): Loading IWSSessionManager by default.
    [30/Jun/2004:10:04:32] info (  508): IWSSessionManager: Maximum number of sessions is 1000
    [30/Jun/2004:10:04:33] info (  508): Successfully initialized web application environment (web-apps.xml) for virtual server (https-gutierc)
    [30/Jun/2004:10:40:36] warning (  508): for host 172.20.37.58 trying to GET /AFOWeb/start.do, send-file reports: can't find c:/program1/sun/iPlanet/Servers/docs-90/AFOWeb/start.do (File not found)
    [30/Jun/2004:12:18:51] info (  508):  Suspend Httpd Service
    [30/Jun/2004:12:18:52] info (  508): vs(https-gutierc)Closing the web applications
    [30/Jun/2004:12:19:03] info ( 1848): successful server startup
    [30/Jun/2004:12:19:03] info ( 1848): iPlanet-WebServer-Enterprise/6.0SP8 B04/20/2004 07:13
    [30/Jun/2004:12:19:03] info ( 1848): Installing a new configuration
    [30/Jun/2004:12:19:03] info ( 1848): [LS ls1] http://gutierc, port 90 ready to accept requests
    [30/Jun/2004:12:19:03] info ( 1848): A new configuration was successfully installed
    [30/Jun/2004:12:19:04] info ( 1848): Using the Java HotSpot(TM) Server VM v1.3.1_12 from Sun Microsystems Inc.
    [30/Jun/2004:12:19:04] info ( 1848): Java VM classpath: c:/program1/sun/iPlanet/Servers/plugins/servlets/examples/legacy/beans.10/SDKBeans10.jar;c:/program1/sun/iPlanet/Servers/bin/https/jar/NSServletLayer.jar;c:/program1/sun/iPlanet/Servers/bin/https/jar/NSJavaUtil.jar;c:/program1/sun/iPlanet/Servers/bin/https/jar/AdminNativeUtil.jar;c:/program1/sun/iPlanet/Servers/bin/https/jar/NSJavaMiscUtil.jar;c:/program1/sun/iPlanet/Servers/bin/https/jar/servlet.jar;c:/program1/sun/iPlanet/Servers/bin/https/jar/servlet-2.3-filters-api.jar;c:/program1/sun/iPlanet/Servers/bin/https/jar/jsp092.jar;c:/program1/sun/iPlanet/Servers/bin/https/jar/jaxp.jar;c:/program1/sun/iPlanet/Servers/bin/https/jar/crimson.jar;c:/program1/sun/iPlanet/Servers/bin/https/jar/xalan.jar;c:/program1/sun/iPlanet/Servers/bin/https/jar/jspengine.jar;
    [30/Jun/2004:12:19:04] warning ( 1848): msg_badAlias
    [30/Jun/2004:12:19:04] info ( 1848): Loading IWSSessionManager by default.
    [30/Jun/2004:12:19:04] info ( 1848): IWSSessionManager: Maximum number of sessions is 1000
    [30/Jun/2004:12:19:05] info ( 1848): Adding web application (/AFOWeb) at (C:/Program1/sun/iPlanet/Servers/docs-90/AFOWeb)
    [30/Jun/2004:12:19:06] info ( 1848): Loading IWSSessionManager by default.
    [30/Jun/2004:12:19:06] info ( 1848): IWSSessionManager: Maximum number of sessions is 1000
    [30/Jun/2004:12:19:12] info ( 1848): vs(https-gutierc)servlet 'action' class = 'org.apache.struts.action.ActionServlet' loaded in context = '/AFOWeb'
    [30/Jun/2004:12:19:12] info ( 1848): action: init
    [30/Jun/2004:12:19:21] info ( 1848): Successfully initialized web application environment (web-apps.xml) for virtual server (https-gutierc)
    [30/Jun/2004:12:20:58] failure ( 1848): Internal error: servlet service function had thrown ServletException (uri=/AFOWeb/start.do): javax.servlet.ServletException: IWSHttpSession: Session attribute name or value is null, stack: javax.servlet.ServletException: IWSHttpSession: Session attribute name or value is null
         at org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:545)
         at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:486)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
         at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.iplanet.server.http.servlet.NSServletRunner.invokeServletService(NSServletRunner.java:937)
         at com.iplanet.server.http.servlet.WebApplication.service(WebApplication.java:1071)
         at com.iplanet.server.http.servlet.NSServletRunner.ServiceWebApp(NSServletRunner.java:999)
    , root cause: java.lang.NullPointerException: IWSHttpSession: Session attribute name or value is null
         at com.iplanet.server.http.session.IWSHttpSession.setAttribute(IWSHttpSession.java:494)
         at com.infinity.imaging.afo.presentation.action.DoStartAction.execute(DoStartAction.java:45)
         at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
         at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.iplanet.server.http.servlet.NSServletRunner.invokeServletService(NSServletRunner.java:937)
         at com.iplanet.server.http.servlet.WebApplication.service(WebApplication.java:1071)
         at com.iplanet.server.http.servlet.NSServletRunner.ServiceWebApp(NSServletRunner.java:999)

    I am not sure if this solved the problem.
    But now, I am using Sun One Web Server 6.1 sp1.
    You can download it from
    http://wwws.sun.com/software/download/products/4000635d.html
    Try using this and see if the problem gets resolved.
    Peter.

  • How to revieve all Session Attributes

    Is it possible to display all session attributes in a JSF page?
    I have tried like this:
    <%session.getAttribute("something")%>
    But "something" is null, although I know, something must be in this attribute!
    Thx for help!

    I would be very pleased, if somebody could give me an example or a good internet page where I can find an example how to use an enumerator in an jsf page!
    THX!

  • Cant able to get the output while using session scope

    Hi
    I am using jdeveloper 11.1.1.5
    As i posted in the previous post i had made some changes still i am not getting proper output
    These are steps that i had followed for developing login page
    1.I had created a TaskFlow in adfc-config.xml such that if the login is success it navigates to the other page pls verfiy the link
    http://www.4shared.com/photo/5PNrf1hd/E028_2.html
    2.I had also changed the scope to session in adfc-config.xml
    http://www.4shared.com/photo/HtVVOw_B/E029.html
    3.This was my Welcome.jspx code
    <?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:h="http://java.sun.com/jsf/html"
              xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
      <jsp:directive.page contentType="text/html;charset=UTF-8"/>
      <f:view>
        <af:document id="d1" binding="#{sessionScope.backing_welcome.d1}">
          <af:form id="f1" binding="#{sessionScope.backing_welcome.f1}">
            <af:inputText label="UserName" binding="#{backing_welcome.it1}"
                          id="it1" value="#{sessionScope.backing_welcome.auser}"/>
            <af:inputText label="Password" binding="#{backing_welcome.it2}"
                          id="it2"
                          value="#{sessionScope.backing_welcome.apassword}"/>
            <af:commandButton text="Login"
                              binding="#{backing_welcome.cb1}" id="cb1"
                              action="#{backing_welcome.cb9_action}"/>
          </af:form>
        </af:document>
      </f:view>
      <!--oracle-jdev-comment:auto-binding-backing-bean-name:backing_welcome-->
    </jsp:root>3.This was my welcome.java backing bean for welcome.jspx page
        public String getAuser() {
            return auser;
        public void setApassword(String apassword) {
            this.apassword = apassword;
        public String getApassword() {
            return apassword;
        public String cb9_action() {
            String returnStr="error";
            System.out.println("Inside loginBtn_action");
            BindingContainer bindings = getBindings();
            OperationBinding operationBinding = bindings.getOperationBinding("checkLoginCredentials1");
            operationBinding.getParamsMap().put("p_user", auser);
            operationBinding.getParamsMap().put("p_pwd", apassword);
        operationBinding.execute();
        Object result = operationBinding.execute();
        if (!operationBinding.getErrors().isEmpty()) {
            returnStr= "success";
        System.out.println("returnStr= " + returnStr);
               return returnStr;
        }While i run my program no output is displayed!! No logs also been recorded!!
    Could any body pls help me!!

    thank you jhon!
    If i am not using any binding i m getting error as
    javax.el.PropertyNotFoundException: Target Unreachable, 'backing_welcome' returned nullI had used this jspx code
    <?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:h="http://java.sun.com/jsf/html"
              xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
      <jsp:directive.page contentType="text/html;charset=UTF-8"/>
      <f:view>
        <af:document id="d1" >
          <af:form id="f1" >
            <af:inputText label="UserName"
                          id="it1" value="#{sessionScope.backing_welcome.auser}"/>
            <af:inputText label="Password"
                          id="it2"
                          value="#{sessionScope.backing_welcome.apassword}"/>
            <af:commandButton text="Login"
                               id="cb1"
                              action="#{sessionScope.backing_welcome.cb9_action}"/>
          </af:form>
        </af:document>
      </f:view>
      <!--oracle-jdev-comment:auto-binding-backing-bean-name:backing_welcome-->
    </jsp:root>Give me some guide how to use session scope!! Since i read all the documents i m not getting any proper output

  • How to set session attributes in a bean?

    How do I set a session attribute in a server-side bean?
    I'm not sure if I asked the question the right way. What I meant is, while it's easy to set session attributes in a JSP page (session.setAttribute("sessionname", "sessionvalue")), I'd want to set such an attribute within a server-side bean defined in this web application. But what is the syntax for doing it?

    Here a simple bean that stores something in the session and retrieves something from it.
    import javax.servlet.http.HttpSession;
    public class TestBean {
      private String value;
      public void doSomething(HttpSession session, int a, int b) {
        if (a+b > 0) {
          session.setAttribute("ab",Boolean.TRUE);
        } else {
          session.setAttribute("ab",Boolean.FALSE);
      public void init(HttpSession session) {
        if (session != null) {
          Boolean b = (Boolean)session.getAttribute("ab");
          if (b == Boolean.TRUE) {
            value = "a + b is greater than zero";
          } else {
            value = "a + b is not greater than zero";
        } else {
          value = "no session";
      public String getValue() {
        return value;
    }In your JSP, use something along the lines of :
    <%
      TestBean bean = new TestBean();
      bean.init(session);
      bean.doSomething(session,1,2);
    %>If your bean only lives during one request, you can pass the session to the constructor, which stores it in a private variable. This saves passing the session each time.
    Hope this helps,
    --Arnout                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to use session in webservice?

    In C#, can use session variable in a webservice object.
    How to use session in Java webservice?
    Who can give me a example?
    Thanks a lot

    Did I use session in a wrong way?No, you are using the session correctly. The code looks fine.
    Check
    - your spelling of the attribute names - obviously they must match
    - the ids of the sessions you get both times: session.getId(). If they have different ids, then most probably the session is being lost somewhere.
    There are a number of reasons to lose a session. If you close the browser, invalidate the session in code, or lose the cookie recording the id. This happens when you change from https to http, so a session can be lost that way.
    The session is normally maintained by session cookies. If you close your browser you lose the cookie. If you have disabled cookies on your machine then it also might not work.
    In cases such as that you should be using the method response.encodeURL() to maintain the session for you in any hyperlinks you produce. Struts normally handles that for you though if necessary.
    Hope this helps,
    evnafets

  • Can you use Crystal Reports on a webpage without having to use session?

    In all of the examples I have seen it shows using the session to store the reportdocument object between postbacks.  That means that clicking the page buttons fires a postback.  Other reporting tools such as PDF, ActiveReports, and others do not have to do this.  Is this a limitation of Crystal and a COM backend or is it just a common sample and not the only option? 
    How do you get paging to work without having to use session and do postbacks?  AJAX, Javascript, converting to a PDF, etc. would all be possible ways to not require a postback.
    My problem is that I am using SQL Server to store the session and the reportdocument object is not serializeable.  I have been told I can buy Crystal Report Server for $5000 and this will work.  But in reality I can buy other reporting tool for $500 or convert them to SQL Reporting and it will work as well.  So I am trying to be reasonable and figure out what I need to do.  That seems like a bit much to need a whole server application to serve the reports just to turn on paging for a couple of simple reports.  I'm hoping there is a way to not use session to get paging to work. 
    I have consider pushing the report into viewstate and not session.  But I would rather not push it into either.  Is this a valid option? 
    What is the typical way to handle this sort of thing?  Do you really have to push it into session to get the CrystalReportViewer control to page on an ASPX page.  What other options are there?   
    Any suggestions, thoughts, or ideas would be very much appreciated.  This is causing enough of a problem where the company is asking me to look at alternatives if we cannot solve this. 
    Best regards,
    Jon

    Acrobat doesnu2019t cause postbacks when paging because the acrobat reader installed locally, so its viewing is in a client-side control.  I imagine the same thing is the case for ActiveReports (some sort of client-side activex control installed). 
    If the winform viewer was used on in your web page, then you wouldnu2019t get postbacks either, but then you'd need Crystal Reports runtime on the client to view in that control. And placing a winviewer in a web page give me shivers...
    So, to avoid  using session, recreate the reportdocument and re-load the report on postbacks.
    As Surabh mentioned, you can serialize the report but you will have to use teh InProc RAS. There is an issue thought; you start to get load errors and otehr errors after viewing 3 reports. I belive this has been reported to R&D for a fix  comment, but I do not have and ETA at this time. The code for the InProc RAS SDK would be as follows:
               If Not IsPostBack Then
                Dim rpt As New CrystalDecisions.CrystalReports.Engine.ReportDocument
                Dim boReportClientDocument As CrystalDecisions.ReportAppServer.ClientDoc.ISCDReportClientDocument
                '           rpt.ReportAppServer = "Inproc:multithreaded"
                rpt.Load("c:inetpubwwwroot     estSerializeInprocRASEmployee Profile.rpt",
               OpenReportMethod.OpenReportByTempCopy)
                boReportClientDocument = rpt.ReportClientDocument
                Dim x As String = boReportClientDocument.DataDefController.Database.Tables(0).Name
                '     boReportClientDocument.DatabaseController.logon("sa", "admin")
                Dim convertUtil As New CrystalDecisions.ReportAppServer.Utilities.Conversion()
                Dim serializedDoc As String
                serializedDoc = convertUtil.ToString(rpt.ReportClientDocument)
                Session.Add("SerializedDoc", serializedDoc)
                'ViewState.Add("SerializedDoc", serializedDoc)
                Response.Write("The document has been serialized.")
                CrystalReportViewer1.ReportSource = boReportClientDocument.ReportSource
            Else
                Label1.Visible = False
                Button1.Visible = False
                Dim x As String
                x = ViewState("SerializedDoc").ToString()
                Dim deSerializedDoc As ISCDReportClientDocument
                Dim convertUtil As New Conversion
                deSerializedDoc = convertUtil.ToReportClientDocument(Session("SerializedDoc").ToString())
                'deSerializedDoc = convertUtil.ToReportClientDocument(ViewState("SerializedDoc").ToString())
                CrystalReportViewer1.ReportSource = deSerializedDoc
                Response.Write("You are viewing a de-Serialized report" & "<BR>")
                Response.Write(ViewState("SerializedDoc").ToString())
            End If
    [1542991 - How to serialize the ReportClientDocument using the RAS .NET SDK?|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bi/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333533343332333933393331%7D.do]
    - Ludek
    Edited by: Ludek Uher on Dec 9, 2011 11:16 AM

  • How to use session in Struts

    Hello, there:
    It's a simple question.
    I have a web app which has a login page, in its action class I create an object, user, and save it into session by using request.getSession(true).setAttribute("user", user).
    In another action class, I want to use the info of user then I use request.getSession(true).getAttribute("user"); however, the returned object is NULL. Did I use session in a wrong way?
    Thanks,
    Sway

    Did I use session in a wrong way?No, you are using the session correctly. The code looks fine.
    Check
    - your spelling of the attribute names - obviously they must match
    - the ids of the sessions you get both times: session.getId(). If they have different ids, then most probably the session is being lost somewhere.
    There are a number of reasons to lose a session. If you close the browser, invalidate the session in code, or lose the cookie recording the id. This happens when you change from https to http, so a session can be lost that way.
    The session is normally maintained by session cookies. If you close your browser you lose the cookie. If you have disabled cookies on your machine then it also might not work.
    In cases such as that you should be using the method response.encodeURL() to maintain the session for you in any hyperlinks you produce. Struts normally handles that for you though if necessary.
    Hope this helps,
    evnafets

  • Error in committing data while using dynamic attributes

    Hi,
    Module: Performance Management
    Page: Give Final Ratings: Main Appraiser
    Here, I have used dynamic attributes to show the competency name without segments.
    I have added this attribute through controller and i passed value to this attribute in the same ProcessRequest method.
    But, when the manager tries to complete the appraisal for his employee by pressing the continue button in the above mentioned page, the following exception is throwing.
    "This competence already exists within the assessment."
    Is this dynamic attribute will be the problem for this?
    can any one please tell me?
    Thanks in advance,
    SAN

    Hi,
    If you added the column from Extended Controller. It should be a transient attribute to the VO and I think it should not create any issues.
    Error "This competence already exists within the assessment." looks like from an FND Message , You can try to debug this issue by finding the FND Message Name corresponding to the error and search the Message Name in the seeded code.
    -Idris

Maybe you are looking for