Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Genesys PGR
Genesys Backend
Commits
45836576
Commit
45836576
authored
Jan 15, 2014
by
Matija Obreza
Browse files
Added sitemesh <content> block extractor
parent
399e4046
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/genesys2/sitemesh3/ContentTagRuleBundle.java
0 → 100644
View file @
45836576
package
org.genesys2.sitemesh3
;
import
org.sitemesh.SiteMeshContext
;
import
org.sitemesh.content.ContentProperty
;
import
org.sitemesh.content.tagrules.TagRuleBundle
;
import
org.sitemesh.content.tagrules.html.ContentBlockExtractingRule
;
import
org.sitemesh.tagprocessor.State
;
/**
* Add only the "content" block extractor
*/
public
class
ContentTagRuleBundle
implements
TagRuleBundle
{
public
void
install
(
State
defaultState
,
ContentProperty
contentProperty
,
SiteMeshContext
siteMeshContext
)
{
// <content> blocks
defaultState
.
addRule
(
"content"
,
new
ContentBlockExtractingRule
(
contentProperty
.
getChild
(
"page"
)));
}
public
void
cleanUp
(
State
defaultState
,
ContentProperty
contentProperty
,
SiteMeshContext
siteMeshContext
)
{
// No op.
}
}
\ No newline at end of file
src/main/webapp/WEB-INF/sitemesh3.xml
View file @
45836576
<?xml version="1.0" encoding="UTF-8"?>
<sitemesh>
<mime-type>
text/html
</mime-type>
<content-processor>
<tag-rule-bundle
class=
"org.genesys2.sitemesh3.ContentTagRuleBundle"
/>
</content-processor>
<mime-type>
text/html
</mime-type>
<mapping
path=
"/welcome"
decorator=
"/WEB-INF/decorator/entry.jsp"
/>
<mapping
path=
"/*"
decorator=
"/WEB-INF/decorator/main.jsp"
/>
<mapping
path=
"/html/*"
exclude=
"true"
/>
<mapping
path=
"*/ajax/*"
exclude=
"true"
/>
</sitemesh>
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment