MakeDate()的代码?出错的回显信息?

解决方案 »

  1.   

    public static String MakeDate()
      {
          Calendar c=Calendar.getInstance();
          Timestamp ts=new Timestamp(c.getTime().getTime());
          String curDate=String.valueOf(ts);
          curDate=curDate.substring(0,curDate.indexOf(" "));      return curDate;
      }
    回显信息:
    org.apache.jasper.JasperException: /mainFrame/MainFrame.jsp(11,28) The function getCurDate must be used with a prefix when a default namespace is not specified
    JSP页面中这样写的:
    <bean:define id="DateUtil" scope="page" type="com.jtpsoft.jsp.util.DateUtils" />
    <c:set var="CurrentDate" >${DateUtil.MakeDate()}</c:set>
      

  2.   

    还有一个问题就是
    <%
    String Ywyd = CommonVar.getRQ().substring(0, 4) + "年" + CommonVar.getRQ().substring(4) + "月";
    %>
    如果用JSTL来写该怎么写?我这样写会出错:
    <c:set var="Ywyd" >${CommonVar.RQ().substring(0, 4)}年${CommonVar.RQ().substring(4)}月</c:set>请问我该怎么写??