1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
|
19 | |
package org.apache.myfaces.taglib.core; |
20 | |
|
21 | |
import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFJspAttribute; |
22 | |
import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFJspTag; |
23 | |
import org.apache.myfaces.shared_impl.renderkit.JSFAttr; |
24 | |
import org.apache.myfaces.shared_impl.taglib.UIComponentELTagBase; |
25 | |
|
26 | |
import javax.el.ValueExpression; |
27 | |
import javax.faces.component.UIComponent; |
28 | |
import javax.faces.component.UIOutput; |
29 | |
import javax.servlet.jsp.JspException; |
30 | |
import javax.servlet.jsp.tagext.BodyContent; |
31 | |
|
32 | |
|
33 | |
|
34 | |
|
35 | |
|
36 | |
@JSFJspTag(name="f:verbatim",bodyContent="JSP") |
37 | 0 | public class VerbatimTag |
38 | |
extends UIComponentELTagBase |
39 | |
{ |
40 | |
|
41 | |
|
42 | |
public String getComponentType() |
43 | |
{ |
44 | 0 | return "javax.faces.Output"; |
45 | |
} |
46 | |
|
47 | |
public String getRendererType() |
48 | |
{ |
49 | 0 | return "javax.faces.Text"; |
50 | |
} |
51 | |
|
52 | |
|
53 | |
private ValueExpression _escape; |
54 | |
private ValueExpression _rendered; |
55 | |
|
56 | |
protected void setProperties(UIComponent component) |
57 | |
{ |
58 | 0 | super.setProperties(component); |
59 | |
|
60 | 0 | setBooleanProperty(component, JSFAttr.ESCAPE_ATTR, _escape, Boolean.FALSE); |
61 | 0 | setBooleanProperty(component, JSFAttr.RENDERED, _rendered, Boolean.TRUE); |
62 | |
|
63 | |
|
64 | 0 | component.setTransient(true); |
65 | 0 | } |
66 | |
|
67 | |
|
68 | |
|
69 | |
|
70 | |
@JSFJspAttribute( |
71 | |
rtexprvalue=true, |
72 | |
className="java.lang.Boolean") |
73 | |
public void setEscape(ValueExpression escape) |
74 | |
{ |
75 | 0 | _escape = escape; |
76 | 0 | } |
77 | |
|
78 | |
|
79 | |
|
80 | |
|
81 | |
|
82 | |
|
83 | |
@JSFJspAttribute( |
84 | |
rtexprvalue=true, |
85 | |
className="java.lang.Boolean") |
86 | |
public void setRendered(ValueExpression rendered) |
87 | |
{ |
88 | 0 | _rendered = rendered; |
89 | 0 | } |
90 | |
|
91 | |
public int doAfterBody() throws JspException |
92 | |
{ |
93 | 0 | BodyContent bodyContent = getBodyContent(); |
94 | 0 | if (bodyContent != null) |
95 | |
{ |
96 | 0 | UIOutput component = (UIOutput)getComponentInstance(); |
97 | 0 | component.setValue(bodyContent.getString()); |
98 | 0 | bodyContent.clearBody(); |
99 | |
} |
100 | 0 | return super.getDoAfterBodyValue(); |
101 | |
} |
102 | |
} |