|
|||||||||||||||||||
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover | |||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
WMLEngine.java | - | 80% | 75% | 77.8% |
|
1 |
// Copyright 2004, 2005 The Apache Software Foundation
|
|
2 |
//
|
|
3 |
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4 |
// you may not use this file except in compliance with the License.
|
|
5 |
// You may obtain a copy of the License at
|
|
6 |
//
|
|
7 |
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8 |
//
|
|
9 |
// Unless required by applicable law or agreed to in writing, software
|
|
10 |
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11 |
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12 |
// See the License for the specific language governing permissions and
|
|
13 |
// limitations under the License.
|
|
14 |
|
|
15 |
package org.apache.tapestry.wml;
|
|
16 |
|
|
17 |
import org.apache.tapestry.IRequestCycle;
|
|
18 |
import org.apache.tapestry.Tapestry;
|
|
19 |
import org.apache.tapestry.engine.BaseEngine;
|
|
20 |
import org.apache.tapestry.error.ErrorMessages;
|
|
21 |
|
|
22 |
/**
|
|
23 |
* Subclass of {@link BaseEngine}used for WML applications to change the Exception, StaleLink and
|
|
24 |
* StaleSession pages.
|
|
25 |
*
|
|
26 |
* @author David Solis
|
|
27 |
* @since 3.0
|
|
28 |
*/
|
|
29 |
|
|
30 |
public class WMLEngine extends BaseEngine |
|
31 |
{ |
|
32 | 3 |
protected void activateExceptionPage(IRequestCycle cycle, Throwable cause) |
33 |
{ |
|
34 | 3 |
super.activateExceptionPage(cycle, cause);
|
35 |
|
|
36 |
// Sometimes the exception page isn't enough
|
|
37 | 3 |
reportException(ErrorMessages.unableToProcessClientRequest(cause), cause); |
38 |
} |
|
39 |
|
|
40 |
/** @since 3.0 * */
|
|
41 |
|
|
42 | 0 |
protected String getExceptionPageName()
|
43 |
{ |
|
44 | 0 |
return EXCEPTION_PAGE;
|
45 |
} |
|
46 |
|
|
47 |
/** @since 3.0 * */
|
|
48 |
|
|
49 | 1 |
protected String getStaleLinkPageName()
|
50 |
{ |
|
51 | 1 |
return STALE_LINK_PAGE;
|
52 |
} |
|
53 |
|
|
54 |
/** @since 3.0 * */
|
|
55 |
|
|
56 | 3 |
protected String getStaleSessionPageName()
|
57 |
{ |
|
58 | 3 |
return STALE_SESSION_PAGE;
|
59 |
} |
|
60 |
|
|
61 |
/**
|
|
62 |
* The name of the page used for reporting exceptions.
|
|
63 |
*/
|
|
64 |
private static final String EXCEPTION_PAGE = "WMLException"; |
|
65 |
|
|
66 |
/**
|
|
67 |
* The name of the page used for reporting stale links.
|
|
68 |
*/
|
|
69 |
|
|
70 |
private static final String STALE_LINK_PAGE = "WMLStaleLink"; |
|
71 |
|
|
72 |
/**
|
|
73 |
* The name of the page used for reporting state sessions.
|
|
74 |
*/
|
|
75 |
|
|
76 |
private static final String STALE_SESSION_PAGE = "WMLStaleSession"; |
|
77 |
} |
|