bacoAlunos
ENGSOFT2019
BlueGrey
calm
Elegant
Català-Valencià - Catalan
中文 - Chinese (Simplified)
中文 - Chinese (Traditional)
Česky - Czech
Dansk - Danish
Nederlands - Dutch
English - English
Suomi - Finnish
Français - French
Deutsch - German
עברית - Hebrew
हिंदी - Hindi
Magyar - Hungarian
Bahasa Indonesia - Indonesian
Italiano - Italian
日本語 - Japanese
한국어 - Korean
मराठी - Marathi
Norsk - Norwegian
Polski - Polish
Português - Portuguese
Português - Portuguese (Brazil)
Русский - Russian
Slovenčina - Slovak
Slovenščina - Slovenian
Español - Spanish
Svenska - Swedish
Türkçe - Turkish
Oëzbekcha - Uzbek
Subversion Repositories
bacoAlunos
(root)
/
impl
/
src
/
java
/
pt
/
estgp
/
estgweb
/
web
/
tags
/
PageUrlStatTag.java
@ 18
- Rev
Rev
Blame
|
Compare with Previous
|
Last modification
|
View Log
|
RSS feed
package
pt.estgp.estgweb.web.tags
;
import
org.apache.log4j.Logger
;
import
org.apache.commons.httpclient.util.URIUtil
;
import
org.apache.commons.httpclient.URIException
;
import
javax.servlet.jsp.tagext.BodyTagSupport
;
import
javax.servlet.jsp.JspException
;
import
javax.servlet.jsp.JspWriter
;
import
javax.servlet.http.HttpServletRequest
;
import
pt.estgp.estgweb.domain.UserSessionImpl
;
import
pt.estgp.estgweb.Globals
;
import
pt.estgp.estgweb.web.filters.UrlStatFilter
;
public
class
PageUrlStatTag
extends
BodyTagSupport
{
private
static
final
1.
5
.0/docs/api/java/util/logging/Logger.html">
Logger
logger =
1.
5
.0/docs/api/java/util/logging/Logger.html">
Logger
.
getLogger
(
PageUrlStatTag.
class
)
;
private
1.
5
.0/docs/api/java/lang/String.html">
String
attributes
;
public
1.
5
.0/docs/api/java/lang/String.html">
String
getAttributes
(
)
{
return
attributes
;
}
public
void
setAttributes
(
1.
5
.0/docs/api/java/lang/String.html">
String
attributes
)
{
this
.
attributes
= attributes
;
}
public
int
doStartTag
(
)
throws
JspException
{
return
EVAL_BODY_TAG
;
}
public
int
doEndTag
(
)
throws
JspException
{
HttpServletRequest hrequest =
(
HttpServletRequest
)
pageContext.
getRequest
(
)
;
1.
5
.0/docs/api/java/lang/String.html">
String
relativePath =
(
1.
5
.0/docs/api/java/lang/String.html">
String
)
hrequest.
getAttribute
(
Globals.
ACTUAL_RELATIVE_PATH
)
;
for
(
1.
5
.0/docs/api/java/lang/String.html">
String
ignore: UrlStatFilter.
ignorePrefixs
)
{
if
(
relativePath.
startsWith
(
ignore
)
)
{
return
EVAL_PAGE
;
}
}
try
{
if
(
attributes ==
null
)
attributes =
""
;
1.
5
.0/docs/api/java/lang/String.html">
String
url =
"<a "
+ attributes +
" href=
\"
"
+ hrequest.
getContextPath
(
)
+
"/urlstat/startUrlStat.do?relativePaths[0].value="
+ URIUtil.
encodePath
(
relativePath,
"ISO-8859-1"
)
+
"
\"
>"
;
1.
5
.0/docs/api/java/lang/String.html">
String
endUrl =
"</a>"
;
1.
5
.0/docs/api/java/lang/String.html">
String
toPage = bodyContent.
getString
(
)
.
trim
(
)
;
JspWriter writer = pageContext.
getOut
(
)
;
try
{
writer.
write
(
url + toPage + endUrl
)
;
}
catch
(
1.
5
.0/docs/api/java/lang/Exception.html">
Exception
e
)
{
logger.
error
(
e,e
)
;
throw
new
JspException
(
e
)
;
}
}
catch
(
1.
5
.0/docs/api/javax/print/URIException.html">
URIException
e
)
{
logger.
error
(
e,e
)
;
throw
new
JspException
(
e
)
;
}
// Continue processing this page
return
EVAL_PAGE
;
}
}