Uploaded image for project: 'Struts 1'
  1. Struts 1
  2. STR-202

Beta 2 updates to html:link tag appear to be causing a ClassCastException

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 1.0 Beta 2
    • Fix Version/s: 1.0.0
    • Component/s: Core
    • Labels:
      None
    • Environment:
      Operating System: All
      Platform: PC
    • Bugzilla Id:
      1891

      Description

      Using struts.jar from beta 1.0, the following renders correctly:
      <html:link page="/listShipments.kr" name="LAST_SEARCH" scope="session">return
      to search results</html:link>

      Using struts.jar from beta 2.0, the same jsp code, throws:
      java.lang.ClassCastException: java.lang.Integer
      at org.apache.struts.util.RequestUtils.computeURL(RequestUtils.java:380)
      at org.apache.struts.taglib.html.LinkTag.doStartTag(LinkTag.java:338)
      at WEB_0002dINF.jsp...etc...

      ---------------------------------------

      LAST_SEARCH is a HashMap produced by my ActionForm (SearchForm) and stored in
      the user session, by my Action (SearchAction).

      ===== SearchAction (extends Action) =====
      // Called from SearchAction.perform(....)
      private void storeLastSearch(SearchForm sf, HttpServletRequest req) {
      HttpSession session= req.getSession();
      session.setAttribute("LAST_SEARCH", sf.getCurr());
      }

      ===== SearchForm (extends ActionForm) =====
      public Map getCurr() {
      Map curr= new HashMap();
      curr.put("inOutbound", inOutbound);
      curr.put("location",location);
      curr.put("errorCode",errorCode);
      curr.put("mbol",mbol);
      curr.put("status",status);
      curr.put("sourceSystem", sourceSystem);
      curr.put("fromDate",fromDate);
      curr.put("toDate",toDate);
      curr.put("orderBy", orderBy);
      curr.put("count", count);
      curr.put("startIndex", startIndex);
      return curr;
      }
      private String inOutbound,
      location,
      errorCode,
      mbol,
      status,
      sourceSystem
      fromDate,
      toDate,
      orderBy,
      submit,
      query;

      private Integer count = new Integer(5);
      private Integer startIndex = new Integer(0);

        Attachments

          Activity

            People

            • Assignee:
              craigmcc Craig R. McClanahan
              Reporter:
              levicook@hotmail.com Levi Cook
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: