|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.github.drinkjava2.jwebbox.WebBox
public class WebBox
JWebBox is a small layout tool used in java server pages(JSP) projects, playing the same role like Apache Tiles and SiteMesh, no XML file, no Tags, simple(only 1 java file), can be used to support whole site's layout or only few page components.
| Nested Class Summary | |
|---|---|
static class |
WebBox.Show
This is a custom TagLib for JSP and also can be used in FreeMaker |
static class |
WebBox.WebBoxException
A runtime exception caused by WebBox |
| Field Summary | |
|---|---|
static String |
JWEBBOX_ID
|
| Constructor Summary | |
|---|---|
WebBox()
|
|
WebBox(String page)
Create a WebBox |
|
| Method Summary | ||
|---|---|---|
static
|
getAttribute(javax.servlet.jsp.PageContext pageContext,
String attributeName)
Get an attribute from current page's WebBox instance |
|
|
getAttribute(String key)
Get attribute from current WebBox instance |
|
Map<String,Object> |
getAttributeMap()
Get the attribute map of WebBox instance |
|
static WebBox |
getBox(javax.servlet.jsp.PageContext pageContext)
Get current pageContext's WebBox instance |
|
WebBox |
getFatherWebBox()
Set the father page's WebBox instance |
|
String |
getName()
get the name of the WebBox instance |
|
String |
getPage()
Get the page |
|
Object |
getPrepareBean()
Get the prepare bean instance |
|
String |
getPrepareBeanMethod()
Get the prepare bean method name |
|
String |
getPrepareStaticMethod()
Get the Prepare static method name |
|
String |
getPrepareURL()
Get the prepare URL |
|
String |
getText()
Get the Text |
|
static boolean |
isEmptyStr(String str)
Check if String null or empty |
|
void |
prepareOnly(javax.servlet.jsp.PageContext pageContext)
Prepare data, only but do not output text and do not show page |
|
WebBox |
setAttribute(String key,
Object value)
Set attribute for current WebBox instance |
|
WebBox |
setAttributeMap(Map<String,Object> attributeMap)
Set the attribute map for WebBox instance |
|
void |
setFatherWebBox(WebBox fatherWebBox)
Get the father page's WebBox instance |
|
WebBox |
setName(String name)
Set the name of the WebBox instance |
|
WebBox |
setPage(String page)
Set a JSP page or URL |
|
WebBox |
setPrepareBean(Object prepareBean)
Set a prepare bean which has a prepare method |
|
WebBox |
setPrepareBeanMethod(String prepareBeanMethod)
Set the bean prepare method name |
|
WebBox |
setPrepareStaticMethod(String prepareStaticMethod)
Set a prepare static method |
|
WebBox |
setPrepareURL(String prepareURL)
Set prepare URL, this URL be called after prepare methods but before show page |
|
WebBox |
setText(String text)
Set the text String |
|
void |
show(javax.servlet.jsp.PageContext pageContext)
Prepare data and out put text include page if have |
|
static void |
showAttribute(javax.servlet.jsp.PageContext pageContext,
String attributeName)
Assume the value is String or WebBox instance, show it |
|
void |
showPageOnly(javax.servlet.jsp.PageContext pageContext)
Show page only, do not call prepareStaticMethod and URL |
|
static void |
showTarget(javax.servlet.jsp.PageContext pageContext,
Object target)
Show an target object, target can be: WebBox instance or String or List of WebBox instance or String |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String JWEBBOX_ID
| Constructor Detail |
|---|
public WebBox()
public WebBox(String page)
page - The JSP or FTL or any URL, for example: "/template/abc.jsp"| Method Detail |
|---|
public static boolean isEmptyStr(String str)
public void show(javax.servlet.jsp.PageContext pageContext)
public void prepareOnly(javax.servlet.jsp.PageContext pageContext)
public void showPageOnly(javax.servlet.jsp.PageContext pageContext)
public static WebBox getBox(javax.servlet.jsp.PageContext pageContext)
public static <T> T getAttribute(javax.servlet.jsp.PageContext pageContext,
String attributeName)
public static void showAttribute(javax.servlet.jsp.PageContext pageContext,
String attributeName)
public static void showTarget(javax.servlet.jsp.PageContext pageContext,
Object target)
public WebBox setAttribute(String key,
Object value)
public <T> T getAttribute(String key)
public String getPrepareURL()
public WebBox setPrepareURL(String prepareURL)
public String getPage()
public WebBox setPage(String page)
public String getText()
public WebBox setText(String text)
public WebBox setPrepareStaticMethod(String prepareStaticMethod)
public String getPrepareStaticMethod()
public Object getPrepareBean()
public WebBox setPrepareBean(Object prepareBean)
public String getPrepareBeanMethod()
public WebBox setPrepareBeanMethod(String prepareBeanMethod)
public Map<String,Object> getAttributeMap()
public WebBox setAttributeMap(Map<String,Object> attributeMap)
public String getName()
public WebBox setName(String name)
public WebBox getFatherWebBox()
public void setFatherWebBox(WebBox fatherWebBox)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||