How to use session messages ?

Hi Friends,
As we know , when any auth error during login , we setup message
Like " INVALID LOGIN" or "AUTH FAIL" but this message remains until
we login another time.
If is there any way, when message is displayed and if we refresh message
is removed out. ( just like we use it on cakePHP ). called Flash messages.
How do I achieve in java / jsp ??
Any Help appreciated....

Then, like I said, put that message into the request scope instead. That way, on a new request (like a refresh or reload), that message will not be available, it will only ever be displayed once.
If you absolutely must put it into the session scope, then you can manually remove it once you're done display it so that it won't be available next time.
It depends on what logic you're employing to display this message but I think the above suggestions should do what you need.
People on the forum help others voluntarily, it's not their job.
Help them help you.
Learn how to ask questions first: http://www.catb.org/~esr/faqs/smart-questions.html
----------------------------------------------------------------

Similar Messages

  • 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

  • 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

  • How to use fault message for error handling.

    HI
    Anybody has an idea about how we use fault messages to handle errors in XI
    Thanks
    Debraj

    Hi,
    Refer this link. This pdf file has descriptions about fault message types and how to use it.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/4cdfc390-0201-0010-2197-da4ada09f281
    Regards,
    Uma

  • How to use PO message type to output 'Form' as PDF file

    Dear experts,
      I am working for a topic of how to use PO message type to output 'Form' as 'PDF file', and save to external file system automatically.
      Any one familiar to this topic, please kindly give me some guide, thank you!
    Regards,
    Joyce

    Hi,
       Go through the program RSTXPDFT4 (Converting SAPscript (OTF) or ABAP List Spool Job to PDF), you will get some idea.  Using this program you can convert spool into PDF file.
    -Alpesh

  • How to use session tracking

    i am making shopping mall project .
    ist page conatins list of product avaiale
    2nd page contains list of manufacturuer avaible
    problem:-
    i want to display on 3rd page the product seleted by user in 1st page
    i used session tracking concept.but problem is the value is coming null in third page
    please tell me how to solve my problem

    If it is like a shopping cart, I suggest you to look for a good shopping cart examples available plenty online.
    But if its just about keeping session variables and using them the following works.
    Test with a simple example. Have three jsp files like a.jsp, b.jsp and c.jsp.
    put the following in a.jsp
    <% session.setAttribute("Mobile","Nokia");%>
    <%=session.getAttribute("Mobile")%>
    <a href="b.jsp">Go to B.jsp</a>Print the value of session variable - <%=session.getAttribute("Mobile")%> in b.jsp and c.jsp
    And in b.jsp have a link to c.jsp and so on. Once you set a session variable, it lives as long as your session doesnt expire.
    Try it. and also look for more session tracking examples online.
    Message was edited by:
    passion_for_java

  • How to use session cookie property of System object?

    Hi all,
    I have searched all over the SDN but didnt get anything relevent so here i am posting my query...
    My scenario is as follows:
    I have created a KM document iview that launches an HTML page, on click of button of HTML page a VC iview is launched. On this iview i have a button that hits BI query.
    PS: A system object is created for the connectivity bet portal and backend BI server.
    PS: i have configured SSO between portal and backend.
    Now when i click on button on iview that fetches the data from backend, i am asked for authentication pop-up, although i have configured SSO why i am asked to enter UID and PWD again??
    In system object there is a property named
    <b>"session cookie = MYSAPSSO2"</b>
    So should i use this property so that cookie will get transfered from one session to other session when i click button on iview??
    If yes then HOW??
    Is there any other setting remained in Visual Admin?? or Backend or portal?
    What could be the missing??
    PS: User id are same on portal & backend.
    Any help will be highly appreciated...
    Regards,
    Ameya
    Thanks in advance
    Message was edited by:
            Ameya Pimpalgaonkar
    null
    Message was edited by:
            Ameya Pimpalgaonkar

    Hi Ameya,
    I do not know the exact answer.However you should look for something called JSESSION ID.
    Have a look at the thread:
    Re: Problems Using Application Integrator for BSP Application
    Reg SSO Logon Tickets and Browser sessions
    How to use jsessionid while making HTTP calls??
    Hope you find something which can help you.
    Regards
    Atul Shrivastava

  • How to use Session scope in jsp page

    Hello, I have login form, where user provides username and password. Then click on submit, it will forward to validation.jsp. Where it will check in database make sure username and password exit. Now i can also retrive accountid of perticular user. I want to put that username and accountid in session scope. so all other pages can use that username and accountid. How can i do that. I'm new at this, so please provide me example too. Here is my code for login.jsp and validation.jsp..
    Validation.jsp
    <%@ page import="java.util.*" %>
    <%@ page import="java.sql.*" %>
    //String name = request.getParameter( "username" );//
    //session.setAttribute( "accountID",accountID );//
    <%
    String connURL = "jdbc:oracle:thin:@orca.csc.ncsu.edu:1521:ORCL";
         Connection conn = null;
         Statement stmt = null;
         ResultSet rs = null;
    Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
    conn = DriverManager.getConnection(connURL, "vapatel","pjdas");
    stmt = conn.createStatement();
    String user=request.getParameter("userName");
    String password=request.getParameter("password");
    boolean entrance=false;
    stmt.excuteQuery("SELECT AccountID From Password WHERE USERNAME='"+user+"'");
    rs = stmt.executeQuery("SELECT * FROM Password WHERE USERNAME='"+user+"' AND PASSWORD='"+password+"'");
    while(rs.next()){
    String dbUser = rs.getString("USERNAME");
    String dbPassword= rs.getString("PASSWORD");
    if ((user.equals(dbUser)) && (password.equals(dbPassword))){
    entrance=true;
    if (entrance==true){%>
    <jsp:forward page="form.jsp"/>
    <%}
    else{%>
    <jsp:forward page="login.jsp"/>
    <%}
    %>

    hi,
    to put something into session scope in a jsp page use:
    session.setAttribute("counter", Integer.toString(5));to retrieve is from a jsp page use:
    String counterAttribute = (String)session.getAttribute("counter");

  • How to use session variable in JSP function  & How to use both JSP  Servlet

    Hi,
    I am new to JSP and servlets
    Still I am devloping a website in JSP. I am not mixing JSP with servlets, but I do create Java files for bean, logic and database works.
    I try to keep the hard coding part out of JSP.
    I dont how to use both JSP and Servlets in combination.
    Hence If needed I write some functions in JSP.
    but it gives me error
    +<%! public void abc()+
    +{+
    int intUserId = Integer.valueOf((Integer) session.getAttribute("MySession_UserID"));
    +}+
    +%>+
    Saying cannot find symbol session
    1) So can u please tell how can I access session variables within JSP function
    2) And also give me some links/tutorials about useing both JSP and Servlets in combination.
    Thanks
    Venkat

    The application architecture when you use Servlets and JSP in a standard MVC pattern is explained here (under the heading "Integrating Servlets and JSP Pages") and here ...

  • How to use the message class CL_BSP_MESSAGES in the event handler?

    Hiii,
    I need to use the message class CL_BSP_MESSAGES in the even handler, because I need to use the Condition co_cancel_event_prefix to prevent saving in the method
    global_messages->add_message(
                                            condition = co_cancel_event_prefix
                                            message   = TEXT-010
                                            severity  = cl_bsp_messages=>co_severity_error ).
                                            dummy     = ME->COMPONENT_ID ).
    Can anybody explain me how to use this method?
    Kind Regards,
    John

    solved

  • How to use instant messaging

    how can i use instant messaging with other iphone just like blackberry messaging

    At this time, there is no instant messenger application as Wright explained. Apple has not devouted to adding an instant messenger system nor widgets to the iOS, except by SMS and FaceTime.
    You can download many instant messenger programs in use for the iPhone. Most of which are free. There are also group messenger programs that you can record your instant messengers within.
    Palringo, eBuddy, Skype, AOL, Yahoo, MSN, Google, and many more keywords can be used on the App Store.

  • How to use Session Broker ? (Where to add Session Broker Code)

    Hi all,
    My requirement is, I have to use two different database session in one Top Link.
    I know it can be done using Session Broker, but where actually I need to add that code ? I am using JDeveloper 10.1.2.0.0(Build 1811) as i need to implement this in a BPEL process. Is it possible use Session Broker with this version , if so how to do that ?
    Thanks in advance,
    Anant.

    Hello Anant,
    Not sure what code you are refering to. Using a SessionBroker is similar to how you would use a regular session, and can be configured using sessions.xml or through java code. If you are using java code, you would do this where ever you first acquire the sessionbroker and login.
    Please refer to the docs on what it is and how it is used:
    http://download-west.oracle.com/docs/cd/B25221_04/web.1013/b13593/sesun007.htm#CACGDDHE
    The docs are for TopLink 10.1.3, and though I think TopLink 10.1.2 (9.0.4.5) is what ships with Jdev 10.1.2, they should still apply.
    Best Regards,
    Chris

  • 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

  • How to use h:message to display HTML code in message from property file

    I am using <h:message for="somecomponentid"/> to display the error message for a validator attached to a component and the error message which resides in message property file contains HTML elements like <br> and
    The HTML doesnt get displayed properly and the code <br> etc is displayed instead.
    Is there a method to get h:message to display HTML elements correcly.
    [I know there is an h:outputFormat which has an escape parameter to allow HTML to be rendered correcly but it has no for parameter to specify the component id whose validation error message I want to display]
    eg.
    <h:message for="somecomponentid"/>
    to display from errormessages.properties
    com.somecompany.thevalidationerrormessage=You have an error<br> Please click here to return to homepage

    Hello Ivan,
    Fortunately I have just recently found a solution to my problem by using code by a developer who had already had this problem in the past and who provided a patch on the Apache MyFaces jira site.
    See following link for the solution I downloaded and then used :
    http://issues.apache.org/jira/browse/MYFACES-155
    I believe they are intending to eventually release this in a future release of MyFaces extensions on this site.
    I used the escape attribute on the tag to allow 'escaped' html code in error messages to be used.
    Hope it solves your problem too..
    Suhel

  • How To use External Message To Send IDOC From XI To R/3

    we need to split one source message to several IDOC To
    R/3,But Standard Imported r/3 idoc contains only one idoc per message,so we export the standart idoc to a
    xsd file and change it to a  multi "IDOC" segment structure and import back to xi again,after that,we create a message interface use the imported
    message type and use it to send IDOC to r/3 via idoc adapter,but at the "call atapter" step it gernarate a
    error:"Unable to interpret IDoc interface MI_IDOC_IN".
    what we should pay attention to when use external message
    to send idoc to r/3?
    (when use the imported idoc message to send  single idoc per message,it is no probelm)
    thx

    The way this works is:
    1. In your Message Mapping use the External WSDL defintion that you loaded after tweaking the "IDOC" Occurance.
    2. Then in your INTERFACE MAPPING use the orginal IDOC Name that you imported from R/3.
    3. Use the original IDOC Name in Integration Builder too.
    This should work.
    Thanks
    Ashish

Maybe you are looking for

  • Error while syncing with iTunes 8.0.1

    I get an error at the end while syncing, during photo uploads. It cancels out saying iPhone can't be synced. I've quit, restarted, reinstalled and nothing helps. Anyone experiencing the same?

  • What's wrong with my iPod 5?

    I put my ipod to charge and the apple sign showed up and everyhting. It kept turning on and then off, and after it did that many times it showed the low battery sign. My iPod did this many times and it didnt go to my lock screen. So after waiting for

  • Email Notification to Approver - PCR Approval Process

    Hi, We are in the process of implementing PCR Approval using MSS . And as per requirement , we are supposed to send email notification to the Approver Outlook mail box - as and when the Appoval work item is delivered to the Approver's UWL. By adding

  • An error occurred during the installation of itunes 10.5

    an error occurred during the installation 'policy 8.0. Microsoft. VC80.CRT.type="win32-policy". version="8.0.50727.6195".publicKey Token="1fc8b3b9a1e18e3b". processorArchitecture="x86". Please refer to help and support for more information. Please he

  • Data src Financial Reporting studio

    Hi i'm a BO guy and new to hyperion. My doubt is if i have a fact table and a couple of dimensions as oracle data structures,can i create a connection to oracle and import tables to create a report in Frinancial reporting studio ? will it work this w