|
1 |
| package photospace.web.tags; |
|
2 |
| |
|
3 |
| import java.io.*; |
|
4 |
| import java.util.*; |
|
5 |
| import javax.servlet.jsp.*; |
|
6 |
| import javax.servlet.jsp.jstl.core.*; |
|
7 |
| import photospace.*; |
|
8 |
| import photospace.search.*; |
|
9 |
| |
|
10 |
| public class FieldsTag |
|
11 |
| extends LoopTagSupport |
|
12 |
| { |
|
13 |
| private Iterator fields; |
|
14 |
| |
|
15 |
0
| public void prepare() throws JspTagException
|
|
16 |
| { |
|
17 |
0
| Searcher searcher = (Searcher) Application.searcher();
|
|
18 |
0
| try
|
|
19 |
| { |
|
20 |
0
| fields = searcher.getFieldNames().iterator();
|
|
21 |
| } |
|
22 |
| catch (IOException e) |
|
23 |
| { |
|
24 |
0
| throw new JspTagException(e);
|
|
25 |
| } |
|
26 |
| } |
|
27 |
| |
|
28 |
0
| public boolean hasNext()
|
|
29 |
| { |
|
30 |
0
| if (fields == null) return false;
|
|
31 |
0
| return fields.hasNext();
|
|
32 |
| } |
|
33 |
| |
|
34 |
0
| public Object next()
|
|
35 |
| { |
|
36 |
0
| return fields.next();
|
|
37 |
| } |
|
38 |
| |
|
39 |
| } |