01: /**
02: * Copyright 2006-2007 Webmedia Group Ltd.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: **/package org.araneaframework.example.blank;
16:
17: import org.apache.commons.lang.exception.ExceptionUtils;
18: import org.araneaframework.OutputData;
19: import org.araneaframework.http.util.ServletUtil;
20: import org.araneaframework.uilib.core.BaseMenuWidget;
21: import org.araneaframework.uilib.core.MenuItem;
22:
23: public class MenuWidget extends BaseMenuWidget {
24: public MenuWidget() throws Exception {
25: super (null);
26: }
27:
28: protected MenuItem buildMenu() throws Exception {
29: MenuItem result = new MenuItem();
30: result.addMenuItem(new MenuItem("#Blank1", BlankWidget.class));
31: result.addMenuItem(new MenuItem("#Blank2", BlankWidget.class));
32: result.addMenuItem(new MenuItem("#Exceptions happen",
33: ExceptionWidget.class));
34:
35: return result;
36: }
37:
38: protected void renderExceptionHandler(OutputData output, Exception e)
39: throws Exception {
40: if (ExceptionUtils.getRootCause(e) != null) {
41: putViewDataOnce("rootStackTrace", ExceptionUtils
42: .getFullStackTrace(ExceptionUtils.getRootCause(e)));
43: }
44: putViewDataOnce("fullStackTrace", ExceptionUtils
45: .getFullStackTrace(e));
46:
47: ServletUtil.include("/WEB-INF/jsp/menuError.jsp", this, output);
48: }
49: }
|