[opencms-dev] A method into a JSP

Rafael Diaz Valdes Rafael.Diaz.Valdes at cern.ch
Wed Dec 15 12:07:04 CET 2004


Hi, list
 
 I have  to include a method into a jsp in order to make a look for all subgroups of a group, This is my method :
 
<%@ page import="com.opencms.flex.jsp.*,com.opencms.core.*, com.opencms.file.*, java.lang.*,java.util.*" %>
 
<%!
 void FindChilds( String groupName, HttpServletRequest request,
                         HttpServletResponse response){
 
    CmsJspActionElement cms = new CmsJspActionElement( pageContext, request, response );
    CmsObject         cmso  = cms.getCmsObject();
           
               Vector vector = cmso.getChild(groupName);
            int size = vector.size();
            if(size == 0){
              System.out.println("<option>" + groupName + " </option>") ;
              return;
            }else{
                int n=0;
                while(n<size){
                      CmsGroup childgroup = (CmsGroup)vector.get(n);
                      String childgroupName = childgroup.getName();
        FindChilds(childgroupName, request, response);
        n++;
         }
            return;
           }
  }
%>

But I recive this error :
 
Root cause:
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: -1 in the jsp file: null
Generated servlet error:
    [javac] Compiling 1 source file
/usr/local/jakarta-tomcat-4.1.29/work/Standalone/localhost/opencms/WEB-INF/jsp/offline/NewAlicePortal/en/Collaboration/Site_Admin/CreateWebUserForm_jsp_jsp.java:22: unreported exception com.opencms.core.CmsException; must be caught or declared to be thrown
               Vector vector = cmso.getChild(groupName);
                                            ^
1 error
 
Someone have an idea to solve this error ??.
Best Regards
 Rafael
 


More information about the opencms-dev mailing list