<%-- * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. --%> <%@page import="openbook.server.OpenBookService"%> <%@page import="openbook.domain.Book"%> <%@page import="javax.servlet.http.HttpServletRequest"%> <%@include file="header.jsp"%>

Criteria Query & Form-based Search

This is a typical search form in a web page. The user fills in one or more fields about a Book, clicks Search and a set of Books matching the user criteria appear on the web page.

More about Criteria Query can be found here.
<%! public static String getParameter(HttpServletRequest request, String param) { return getParameter(request, param, true); } public static String getParameter(HttpServletRequest request, String param, boolean replaceNull) { String value = request.getParameter(param); return replaceNull ? (value == null ? "" : value) : value; } %> <% OpenBookService service = (OpenBookService)session.getAttribute(KEY_SERVICE); if (service == null) { %> <% } %>
Fill in the details for a book you are searching for.
Title :

Author:

Price from : to

Search Tips:
  1. You can leave one, more or all fields empty.
  2. OpenBooks database currently contains <%= service.count(Book.class) %> books.
  3. Book titles are Book-1, Book-2, Book-3,...
  4. Author names are Author-1, Author-2, Author-3,...
  5. Both Book and Author names accept wildcard characters.
    For example, an underscore like Book-3_ will match any single character to return Book-31, Book-32, Book-33 ...
<%@include file="footer.jsp"%>