|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.servlet.jsp.tagext.TagSupport
jp.terasoluna.fw.web.struts.taglib.MessagesPopupTag
public class MessagesPopupTag
When 1 user operates the screen for different use cases and error message
is being poped-up at the same time, error message information for each use
case gets mixed up in session and get displayed.
Mixing up of pop-up errors generated on screen can be avoided
by combining this tag with <ts:errors>tag and <ts:messages> tag.
MessagesPopupTag
stores the
error message information, which is registered as attributes of "Request", in the session.
Pop-up screen is opened by linking MessagesPopupTag
with <ts:body>
tag.
MessagesPopupTag
is always used with
<ts:body>
tag.
MessagesPopupTag
should be
specified before <ts:body>
tag.
MessagesPopupTag
adds the script to onLoad
of JavaScript
.
In order to display the pop-up screen that displays error message information, follow the below procedure.
Please note that this tag should be placed on the transition screen after error messages are generated and
not on the screen before error messages are generated.
onLoad
event of the result screen.
MessagesPopupTag
is overwritten with
the original onLoad
event process script . This script is generated by <ts:body>
tag.
In JSP
, when there is a onLoad
tag before MessagesPopupTag
,
the script in onLoad
becomes valid when there is no error. When there is a error, the script is overwritten by the
MessagesPopupTag
settings and pop-up
screen is displayed. This screen displays the error message.
In MessagesPopupTag
, following attributes are supported.
Attribute name | Default value | Required | Execution time format | Overview |
popup |
- | true |
true |
URL which is displayed on pop-up screen.
It is the first argument of window.open() of JavaScript . |
title |
popup |
false |
true |
Title of pop-up screen that displays error. |
param |
- | false |
true |
Parameter string when pop-up screen is opened in JavaScript .
|
paramType |
- | false |
true |
It is the resource key when pop-up screen is opened
in JavaScript and parameter string is fetched from
ApplicationResources file.
|
paramFunc |
- | false |
true |
JavaScript function name that fetches parameter string
when pop-up screen is opened in JavaScript .
|
windowId |
- | false |
true |
JavaScript variable name that retains the pop-up screen which is opened.
|
There is no scripting variable set by this tag.
<ts:messagesPopup popup="/popup/errors.do" />
...
<ts:body ...>
BodyTag
,
Serialized FormField Summary | |
---|---|
private static java.lang.String |
DEFAULT_TITLE
Default title. Value is popup . |
static java.lang.String |
ON_LOAD_KEY
Key when onLoad process is stored in "request" attribute. |
private java.lang.String |
param
Parameter string when pop-up screen is opened in JavaScript .
|
private java.lang.String |
paramFunc
JavaScript function name that fetches parameter string
when pop-up screen is opened in JavaScript .
|
private java.lang.String |
popup
URL which is displayed on pop-up screen. It does not include context path. |
static java.lang.String |
POPUP_ERROR_KEY
Error information key which is passed through "request" parameter at the time of pop-up. |
static java.lang.String |
POPUP_MESSAGE_KEY
Message information key which is passed through "request" parameter at the time of pop-up. |
private static long |
serialVersionUID
Serial version ID |
private java.lang.String |
title
Title of pop-up screen that displays error information and message information. |
private java.lang.String |
windowId
JavaScript variable name that retains the pop-up screen which is opened. |
Fields inherited from class javax.servlet.jsp.tagext.TagSupport |
---|
id, pageContext |
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag |
---|
EVAL_BODY_AGAIN |
Fields inherited from interface javax.servlet.jsp.tagext.Tag |
---|
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE |
Constructor Summary | |
---|---|
MessagesPopupTag()
|
Method Summary | |
---|---|
int |
doEndTag()
Method which is called at the time of terminating tag evaluation. |
int |
doStartTag()
Method which is called at the time of starting tag evaluation. |
private java.lang.String |
getOnLoadScript(javax.servlet.http.HttpServletRequest req,
java.lang.String errorKey,
java.lang.String messageKey)
Generates script for opening thw window which is specified in onLoad attribute of <body> tag. |
private java.lang.String |
getRequestParameterKey(java.lang.String errorKey,
java.lang.String messageKey)
Creates query string of "Request" parameter based on the error message information key which is stored in session. |
void |
release()
Process at the time of releasing the tag handler. |
void |
setParam(java.lang.String value)
Sets parameter string when pop-up screen is opened in JavaScript .
|
void |
setParamFunc(java.lang.String value)
Sets return value of JavaScript function . This JavaScript function is specified
as parameter string when pop-up screen is opened in JavaScript .
|
void |
setParamType(java.lang.String value)
Fetches parameter string from ApplicationResources file
when pop-up screen is opened in JavaScript and sets the string.
|
void |
setPopup(java.lang.String value)
Sets URL which is displayed on pop-up screen. |
void |
setTitle(java.lang.String value)
Sets title of pop-up screen that displays error. |
void |
setWindowId(java.lang.String value)
Sets JavaScript variable name that retains the pop-up screen which is opened.
|
Methods inherited from class javax.servlet.jsp.tagext.TagSupport |
---|
doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
public static final java.lang.String ON_LOAD_KEY
onLoad
process is stored in "Request" attribute.
public static final java.lang.String POPUP_ERROR_KEY
public static final java.lang.String POPUP_MESSAGE_KEY
private static final java.lang.String DEFAULT_TITLE
popup
.
private java.lang.String popup
private java.lang.String title
private java.lang.String param
JavaScript
.
private java.lang.String paramFunc
JavaScript
function name that fetches
parameter string when pop-up screen is opened in JavaScript
.
private java.lang.String windowId
JavaScript
variable name that retains pop-up screen which is opened up.
Constructor Detail |
---|
public MessagesPopupTag()
Method Detail |
---|
public void setPopup(java.lang.String value)
value
- URL which is displayed on pop-up screen.public void setTitle(java.lang.String value)
value
- Titlepublic void setParam(java.lang.String value)
JavaScript
.
value
- Parameterpublic void setParamType(java.lang.String value)
ApplicationResources
file
when pop-up screen is opened in JavaScript
and sets the string.
value
- Parameterpublic void setParamFunc(java.lang.String value)
JavaScript
function.
This function is specified as parameter string when pop-up screen is opened in
JavaScript
.
value
- Parameterpublic void setWindowId(java.lang.String value)
JavaScript
variable name that retains
the pop-up screen which is opened.
value
- Variable namepublic int doStartTag() throws javax.servlet.jsp.JspException
doStartTag
in interface javax.servlet.jsp.tagext.Tag
doStartTag
in class javax.servlet.jsp.tagext.TagSupport
EVAL_BODY_INCLUDE
javax.servlet.jsp.JspException
- JSP exceptionprivate java.lang.String getOnLoadScript(javax.servlet.http.HttpServletRequest req, java.lang.String errorKey, java.lang.String messageKey)
onLoad
attribute of
<body>
tag.
req
- HTTP requesterrorKey
- Error information keymessageKey
- Message information key
private java.lang.String getRequestParameterKey(java.lang.String errorKey, java.lang.String messageKey)
errorKey
- Error information keymessageKey
- Message information key
public int doEndTag() throws javax.servlet.jsp.JspException
doEndTag
in interface javax.servlet.jsp.tagext.Tag
doEndTag
in class javax.servlet.jsp.tagext.TagSupport
EVAL_PAGE
javax.servlet.jsp.JspException
- JSP exceptionpublic void release()
release
in interface javax.servlet.jsp.tagext.Tag
release
in class javax.servlet.jsp.tagext.TagSupport
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |