Menu

#89 Remembered postoffice not restored

closed-fixed
Views (16)
5
2005-03-30
2005-03-23
No

The postoffice saved in the remember cookie isn't restored when you
go back to the login page. The username is, and the remember
button remains selected.

PostOfficeSelectTag puts "selected" on the configuration default
postoffice, so maybe the loginForm isn't available in doStartTag?

==Leonard

Discussion

  • Dieter Wimberger

    • assigned_to: nobody --> wimpi
     
  • Dieter Wimberger

    Logged In: YES
    user_id=36782

    Leonard,

    I don't think so. The form bean should be set before calling the page,
    which is also obvious from the log.
    The only two things I can think of are:
    1. We don't get a cookie or something is wrong with it.
    2. The findAttribute("loginForm") does not return the proper instance

    I will change the code and aument it with log statements, so we can trace
    the problem.

    Regards,
    Dieter

     
  • Dieter Wimberger

    • status: open --> closed-fixed
     
  • Dieter Wimberger

    Logged In: YES
    user_id=36782

    Leonard,

    I have finally traced down the problem and fixed it. It should indeed work
    properly now.
    I have to investigate why, but it seems as if the release() method of the
    Tag is not called (always) when the tag instance is reused. The fix simply
    means that now a local helper variable is used to determine the selected
    post office (instead of a member; see diff below). This seems to work
    properly and consistent.

    Regards,
    Dieter

    Index: PostOfficeSelectTag.java

    =============
    RCS file: /cvsroot/jwma/jwma-scratch/src/java/net/wimpi/webmail/mail/
    tags/PostOfficeSelectTag.java,v
    retrieving revision 1.2
    retrieving revision 1.3
    diff -r1.2 -r1.3
    35c35
    <
    ---
    > String selected = null;
    38,40c38,41
    < m_Selected = lf.getPostOffice();
    < if (m_Selected == null || m_Selected.length() == 0) {
    < m_Selected =
    ---
    > selected = lf.getPostOffice();
    > if (selected == null || selected.length() == 0) {
    > log.debug("PostOfficeSelectTag.doStartTag(): Using default post
    office.");
    > selected =
    42a44,45
    > } else {
    > selected = m_Selected;
    44c47
    < log.debug("PostOfficeSelectTag.doStartTag(): Selected post office = "
    + getSelected());
    ---
    > log.debug("PostOfficeSelectTag.doStartTag(): Selected post office = "
    + selected);
    46c49
    < pageContext.getOut().print(getPostOfficeSelect());
    ---
    > pageContext.getOut().print(getPostOfficeSelect(selected));
    55a59
    > log.debug("PostOfficeSelectTag.release()");
    59c63
    < protected String getPostOfficeSelect() {
    ---
    > protected String getPostOfficeSelect(String selected) {
    68c72
    < if (po.getIdentifier().equals(getSelected())) {
    ---
    > if (po.getIdentifier().equals(selected)) {

     

Log in to post a comment.

MongoDB Logo MongoDB