44 System.out.println("queryString:" + queryString);
45 System.out.println("hits:" + hits.getLength());
46 for (int i = 0; i < hits.length(); i++) {
47 Product hit = (Product) hits.data(i);
48 list.add(hit);
49 }
50
51 return list;
52 }
53
54 public CompassTemplate getCompassTemplate() {
55 return compassTemplate;
56 }
57
58 }
/compass1/src/paoding-dic-home.properties
paoding.dic.home=C:/paoding/dic
paoding.dic.detector.interval=60
/compass1/src/struts.xml
1 < xml version="1.0" encoding="UTF-8" >
2 3 "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
4 "http://struts.apache.org/dtds/struts-2.0.dtd">
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/compass1/WebRoot/product/input.jsp
1 <%@ page language="java" contentType="text/html; charset=UTF-8"
2 pageEncoding="UTF-8"%>
3 <%@ taglib prefix="s" uri="/struts-tags"%>
4 http://www.w3.org/TR/html4/loose.dtd">
5
6
7
8
9
10
11
12
13
14
15
16
| 添加商品名称 | ||||||||||
| 23 24 25
53 |
57
58
59
60
/compass1/WebRoot/product/insertOk.jsp
1 <%@ page language="java" contentType="text/html; charset=UTF-8"
2 pageEncoding="UTF-8"%>
3 http://www.w3.org/TR/html4/loose.dtd">
4
5
6
7
8
9
10 添加商品成功!
11
12
13
/compass1/WebRoot/product/search.jsp
1 <%@ page language="java" contentType="text/html; charset=UTF-8"
2 pageEncoding="UTF-8"%>
3 <%@taglib prefix="s" uri="/struts-tags" %>
4
5 http://www.w3.org/TR/html4/loose.dtd">
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/compass1/WebRoot/product/searchResults.jsp
1 <%@ page language="java" contentType="text/html; charset=UTF-8"
2 import="java.util.List"
3 pageEncoding="UTF-8"%>
4 <%@taglib prefix="s" uri="/struts-tags" %>
5
6 http://www.w3.org/TR/html4/loose.dtd">
7
8
9
10
11
12
13 <%
14
15 if(((List)request.getAttribute("searchresults")).size()==0){
16 %>
17 no results found.
18 <%} %>
19
20
23 24 | 26 27 | 29 30 | 32 33 |
37
38
39
/compass1/WebRoot/WEB-INF/applicationContext-compass.xml
1 < xml version="1.0" encoding="UTF-8" >
2
3
4 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5 xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"
6 default-lazy-init="true">
7
8
9
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
32
33
34
35
36 org.compass.spring.transaction.SpringSyncTransactionFactory
37
38
39
40
41
42
43
44
45
46
48
49
50
51
52
53
54
55