Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Incomplete
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      this is using indexof instead of endsWith of String
      public static boolean endsWith(String input, String substring)
      {
      if (input == null)
      input = "";
      if (substring == null)
      substring = "";
      int index = input.indexOf(substring);
      if (index == -1)
      return false;
      if (index == 0 && substring.length() == 0)
      return true;
      return (index == input.length() - substring.length());
      }

        Activity

        Hide
        kchung added a comment -

        Which specific part of JSTL is not working? Please also include a test case.

        Show
        kchung added a comment - Which specific part of JSTL is not working? Please also include a test case.
        Hide
        rmmaheshwari added a comment -

        <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>

        <c:set var="some" value="abcdef"/>
        $

        {fn:endsWith(some, 'ef')}

        try this one

        Show
        rmmaheshwari added a comment - <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%> <c:set var="some" value="abcdef"/> $ {fn:endsWith(some, 'ef')} try this one
        Hide
        kchung added a comment -

        This test fails not because endsWith is not working, but because the tag prefix c is not declared. Adding a

        <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

        fixed the problem.

        Show
        kchung added a comment - This test fails not because endsWith is not working, but because the tag prefix c is not declared. Adding a <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> fixed the problem.

          People

          • Assignee:
            Unassigned
            Reporter:
            rmmaheshwari
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: