<%Date date2 = new Date();
    Timestamp ts2 = new Timestamp(date2.getTime());
    String str="test";
 %>
    <s:label name="todo.todotime" value="<%=ts2 %>"></s:label><%=ts2 %></td>为什么会错?
<s:date 标签怎么得到当前的时间,并设置name=todo.todotime"

解决方案 »

  1.   

          <s:form name="form1" action="todo" namespace="/admin" theme="simple">
        <table>
        <tr>
        <td>时间:</td>
        <td>    <%Date date2 = new Date();
        Timestamp ts2 = new Timestamp(date2.getTime());
     %>
     <label name="todo.todotime"><%=ts2 %></label>
       </td>action.java里的代码:
    public String todo() throws Exception{
    /* Date date2 = new Date();
            Timestamp ts2 = new Timestamp(date2.getTime());
    todo.setTodotime(ts2);*/
    todoService.save(todo);
    return SUCCESS;
    }为什么todo.todotime还是空的?
      

  2.   

    label是表单元素吗.?  LZ在说笑吧.!
    不是表单元素的控件的值怎么能提到过去呢.?  
      

  3.   

    换个表单的UI标签把值传过去, 就ok了.!