【问题标题】:displaying available time slots for reservation in a web application在 Web 应用程序中显示可用于预订的时间段
【发布时间】:2010-09-15 15:13:07
【问题描述】:

我正在尝试使用 JDBC 和 jSP 实现仪器预订表的搜索功能,预订由日期和该日期的时隙的序列号标识(如果时隙为 1 小时,则有是 24 个可能的序列号)和多个时隙。现在用户应该能够搜索最近的 k 个可用时间段,但我不确定我需要向用户显示什么,因为可能有大量可用时间段,我考虑在他可能会开始保留 k 个连续的时隙,直到有一个特定工具的预订的最长时间,但如果他希望在此日期之后进行预订,那么他可以在文本框中输入他的预订,但它没有听起来很直观,可以告诉用户去做,所以我一直在寻找更直观的设计。另外,我该如何告诉他某些乐器根本没有保留,所以他可以立即保留它们? (我在instruments 表和reservedInstruments 表之间使用了左外连接来包含从未保留的instrument)。如果有人对直观的设计有想法。

另外,如何才能检查显示的搜索结果以进行预订?我在我的jsp代码中拥有的是这个:

<caption>this table displays the earliest time slot after which you can make an instrument
reservation of the specified type</caption>
<tr>
<th>Instrument ID</th>
<th>date</th>
<th>sequence number</th>
<th>number of slots</th>
</tr>
 <c:forEach items="${instRecords}" var="timeSlot">
        <tr>
            <td>${timeSlot.instrId}</td>
            <td>${timeSlot.date}</td>
            <td>${timeSlot.seqNum}</td>
            <td>${timeSlot.slotsNumber}</td>
        </tr>
    </c:forEach>
</table>

在 servlet 中我有以下代码:

List<TimeSlot> reservations = dbManager.searchInstrument(instType, slotsNum);
  request.setAttribute("instRecords", reservations);
  getServletContext().getRequestDispatcher("showInstruments.jsp").forward(request, response);

我知道这很长,感谢任何花时间阅读/&或回答此问题的人。

【问题讨论】:

  • 我认为您可以更好地将这个问题重新定义为 HTML/webdesign/usability/SQL 问题,而不是 JSP/Servlet/JDBC 问题。 JSP“只是”一种可以输出HTML/CSS/JS的视图技术。 Servlet“只是”一个拦截 HTTP 请求的 API。 JDBC“只是”一个使用 SQL 与 DB 通信的信使。

标签: jsp servlets jdbc


【解决方案1】:

为什么不让用户请求一天,然后显示一个网格,其中正负三天作为纵轴,时间段作为横轴,这样您就可以显示 7 天的所有时间段,指示哪些已预订,哪些是免费的。为用户提供在日历中前进或后退的选项。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-08-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-03-27
    • 1970-01-01
    相关资源
    最近更新 更多