KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > nextime > ion > admin > action > section > SiteMapAction


1 package org.nextime.ion.admin.action.section;
2
3
4 import org.apache.struts.action.*;
5 import javax.servlet.http.*;
6 import javax.servlet.*;
7 import java.io.*;
8 import java.util.*;
9 import org.nextime.ion.framework.business.*;
10 import org.nextime.ion.framework.mapping.*;
11 import org.nextime.ion.framework.helper.*;
12
13
14 public class SiteMapAction extends Action {
15
16
17     public ActionForward perform(
18         ActionMapping mapping,
19         ActionForm form,
20         HttpServletRequest request,
21         HttpServletResponse response)
22         throws IOException, ServletException {
23             
24         try {
25             String JavaDoc map = "";
26             Mapping.begin();
27             if (request.getQueryString().equals("xml") ) {
28                 map = SiteMap.getXmlMap();
29             } else {
30                 map = SiteMap.getHtmlMap();
31             }
32             Mapping.rollback();
33             request.setAttribute("map",map);
34         }
35         catch( MappingException e ) {
36             Mapping.rollback();
37             throw new ServletException(e);
38         }
39     
40         return mapping.findForward("view");
41     }
42
43 }
Popular Tags