My favorites
▼
|
Sign in
guestbook-example-appengine-full-text-search
Example App Engine project that uses self merge joins to do some basic full text search
Project Home
Downloads
Wiki
Issues
Source
Checkout
Browse
Changes
Source path:
svn
/
trunk
/
guestbook
/
war
/
guestbook.jsp
‹r3
r30
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.util.List" %>
<%@ page import="javax.jdo.PersistenceManager" %>
<%@ page import="com.google.appengine.api.users.User" %>
<%@ page import="com.google.appengine.api.users.UserService" %>
<%@ page import="com.google.appengine.api.users.UserServiceFactory" %>
<%@ page import="guestbook.GuestBookEntry" %>
<%@ page import="guestbook.PMF" %>
<%@page import="java.util.Date"%><html>
<head>
<title>Searchable Google App Engine Guestbook Example</title>
</head>
<body>
<form action="/search.jsp" method="get">
<input name="search"></input>
<input type="submit" value="Search" />
</form>
<%
UserService userService = UserServiceFactory.getUserService();
User user = userService.getCurrentUser();
PersistenceManager pm = PMF.get().getPersistenceManager();
String guestBookEntryParameter = request.getParameter("entry");
if (guestBookEntryParameter != null) {
Date date = new Date();
GuestBookEntry guestBookEntry = new GuestBookEntry(guestBookEntryParameter);
pm.makePersistent(guestBookEntry);
}
%>
<%
String query = "select from " + GuestBookEntry.class.getName() + " range 0,5";
List<GuestBookEntry> guestBookEntries = (List<GuestBookEntry>) pm.newQuery(query).execute();
if (guestBookEntries.isEmpty()) {
%>
<p>The guestbook has no messages.</p>
<%
} else {
for (GuestBookEntry g : guestBookEntries) {
%>
<blockquote><%= g.getContent() %></blockquote>
<%
}
}
pm.close();
%>
<form action="/guestbook.jsp" method="post">
<div><textarea name="entry" rows="3" cols="60"></textarea></div>
<div><input type="submit" value="Post guestbook entry" /></div>
</form>
<p>
Example project <a href="http://code.google.com/p/guestbook-example-appengine-full-text-search/">guestbook-example-appengine-full-text-search</a>.
</p>
</body>
</html>
Show details
Hide details
Change log
r23
by raphael.andre.bauer on Apr 7, 2010
Diff
[No log message]
Go to:
...src/guestbook/SearchJanitor.java
...rated/datastore-indexes-auto.xml
...ok/war/WEB-INF/appengine-web.xml
...nk/guestbook/war/WEB-INF/classes
/trunk/guestbook/war/guestbook.jsp
/trunk/guestbook/war/search.jsp
Project members,
sign in
to write a code review
Older revisions
r3
by raphael.andre.bauer on Apr 7, 2010
Diff
initial checkin
All revisions of this file
File info
Size: 2114 bytes, 73 lines
View raw file
File properties
svn:mime-type
text/plain
Powered by
Google Project Hosting