Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
梦中观雨
cat
提交
4e097240
C
cat
项目概览
梦中观雨
/
cat
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
cat
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4e097240
编写于
1月 11, 2012
作者:
F
Frankie Wu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
make cat-home a war project
上级
43f48d32
变更
22
显示空白变更内容
内联
并排
Showing
22 changed file
with
867 addition
and
6 deletion
+867
-6
cat-consumer/pom.xml
cat-consumer/pom.xml
+1
-0
cat-consumer/src/test/resources/com/dianping/cat/message/consumer/failure/FailureAnalyzerStoreTest.xml
...cat/message/consumer/failure/FailureAnalyzerStoreTest.xml
+3
-3
cat-home/pom.xml
cat-home/pom.xml
+75
-3
cat-home/src/main/java/com/dianping/cat/configuration/ComponentsConfigurator.java
...om/dianping/cat/configuration/ComponentsConfigurator.java
+24
-0
cat-home/src/main/java/com/dianping/cat/report/ReportContext.java
.../src/main/java/com/dianping/cat/report/ReportContext.java
+10
-0
cat-home/src/main/java/com/dianping/cat/report/ReportModule.java
...e/src/main/java/com/dianping/cat/report/ReportModule.java
+15
-0
cat-home/src/main/java/com/dianping/cat/report/ReportPage.java
...ome/src/main/java/com/dianping/cat/report/ReportPage.java
+59
-0
cat-home/src/main/java/com/dianping/cat/report/page/home/Action.java
...c/main/java/com/dianping/cat/report/page/home/Action.java
+26
-0
cat-home/src/main/java/com/dianping/cat/report/page/home/Context.java
.../main/java/com/dianping/cat/report/page/home/Context.java
+7
-0
cat-home/src/main/java/com/dianping/cat/report/page/home/Handler.java
.../main/java/com/dianping/cat/report/page/home/Handler.java
+34
-0
cat-home/src/main/java/com/dianping/cat/report/page/home/JspFile.java
.../main/java/com/dianping/cat/report/page/home/JspFile.java
+17
-0
cat-home/src/main/java/com/dianping/cat/report/page/home/JspViewer.java
...ain/java/com/dianping/cat/report/page/home/JspViewer.java
+18
-0
cat-home/src/main/java/com/dianping/cat/report/page/home/Model.java
...rc/main/java/com/dianping/cat/report/page/home/Model.java
+15
-0
cat-home/src/main/java/com/dianping/cat/report/page/home/Payload.java
.../main/java/com/dianping/cat/report/page/home/Payload.java
+36
-0
cat-home/src/main/resources/META-INF/plexus/components.xml
cat-home/src/main/resources/META-INF/plexus/components.xml
+30
-0
cat-home/src/main/resources/META-INF/wizard/webapp/manifest.xml
...me/src/main/resources/META-INF/wizard/webapp/manifest.xml
+5
-0
cat-home/src/main/resources/META-INF/wizard/webapp/wizard.xml
...home/src/main/resources/META-INF/wizard/webapp/wizard.xml
+7
-0
cat-home/src/main/webapp/WEB-INF/webres.tld
cat-home/src/main/webapp/WEB-INF/webres.tld
+265
-0
cat-home/src/main/webapp/jsp/report/home.jsp
cat-home/src/main/webapp/jsp/report/home.jsp
+6
-0
cat-home/src/test/java/com/dianping/cat/AllTests.java
cat-home/src/test/java/com/dianping/cat/AllTests.java
+15
-0
cat-home/src/test/java/com/dianping/cat/SimpleServer.java
cat-home/src/test/java/com/dianping/cat/SimpleServer.java
+144
-0
pom.xml
pom.xml
+55
-0
未找到文件。
cat-consumer/pom.xml
浏览文件 @
4e097240
...
@@ -27,6 +27,7 @@
...
@@ -27,6 +27,7 @@
<groupId>
com.google.code.gson
</groupId>
<groupId>
com.google.code.gson
</groupId>
<artifactId>
gson
</artifactId>
<artifactId>
gson
</artifactId>
<version>
1.6
</version>
<version>
1.6
</version>
<scope>
test
</scope>
</dependency>
</dependency>
</dependencies>
</dependencies>
<build>
<build>
...
...
cat-consumer/src/test/resources/com/dianping/cat/message/consumer/failure/FailureAnalyzerStoreTest.xml
浏览文件 @
4e097240
<plexus>
<plexus>
<components>
<components>
<component>
<component>
<role>
com.dianping.cat.message.consumer.
model.
failure.FailureReportAnalyzer
</role>
<role>
com.dianping.cat.message.consumer.failure.FailureReportAnalyzer
</role>
<implementation>
com.dianping.cat.message.consumer.
model.
failure.FailureReportAnalyzer
</implementation>
<implementation>
com.dianping.cat.message.consumer.failure.FailureReportAnalyzer
</implementation>
<instantiation-strategy>
per-lookup
</instantiation-strategy>
<instantiation-strategy>
per-lookup
</instantiation-strategy>
<configuration>
<configuration>
<reportPath>
./target/report/failure/
</reportPath>
<reportPath>
./target/report/failure/
</reportPath>
</configuration>
</configuration>
<requirements>
<requirements>
<requirement>
<requirement>
<role>
com.dianping.cat.message.consumer.
model.
failure.FailureReportAnalyzer$Handler
</role>
<role>
com.dianping.cat.message.consumer.failure.FailureReportAnalyzer$Handler
</role>
<role-hints>
<role-hints>
<role-hint>
failure
</role-hint>
<role-hint>
failure
</role-hint>
<role-hint>
long-url
</role-hint>
<role-hint>
long-url
</role-hint>
...
...
cat-home/pom.xml
浏览文件 @
4e097240
...
@@ -9,14 +9,86 @@
...
@@ -9,14 +9,86 @@
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
cat-home
</artifactId>
<artifactId>
cat-home
</artifactId>
<name>
CAT Home
</name>
<name>
CAT Home
</name>
<packaging>
war
</packaging>
<dependencies>
<dependencies>
<dependency>
<dependency>
<groupId>
junit
</groupId>
<groupId>
com.site.app
</groupId>
<artifactId>
junit
</artifactId>
<artifactId>
app-core
</artifactId>
</dependency>
<dependency>
<groupId>
com.site.dal
</groupId>
<artifactId>
dal-jdbc
</artifactId>
</dependency>
<dependency>
<groupId>
com.site.common
</groupId>
<artifactId>
web-framework
</artifactId>
</dependency>
<dependency>
<groupId>
com.ebay.webres
</groupId>
<artifactId>
WebResServer
</artifactId>
</dependency>
<dependency>
<groupId>
com.site.wdbc
</groupId>
<artifactId>
wdbc-http-client
</artifactId>
<version>
1.0.0
</version>
</dependency>
<dependency>
<groupId>
javax.servlet
</groupId>
<artifactId>
servlet-api
</artifactId>
<scope>
provided
</scope>
</dependency>
<dependency>
<groupId>
org.mortbay.jetty
</groupId>
<artifactId>
jsp-2.1
</artifactId>
<scope>
runtime
</scope>
</dependency>
<dependency>
<groupId>
mysql
</groupId>
<artifactId>
mysql-connector-java
</artifactId>
<scope>
runtime
</scope>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.site.common
</groupId>
<groupId>
com.site.common
</groupId>
<artifactId>
lookup
</artifactId>
<artifactId>
test-framework
</artifactId>
<scope>
test
</scope>
</dependency>
</dependency>
</dependencies>
</dependencies>
<build>
<finalName>
cat
</finalName>
<resources>
<resource>
<directory>
${basedir}/src/main/resources
</directory>
<filtering>
true
</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-war-plugin
</artifactId>
<configuration>
<webResources>
<resource>
<directory>
src/main/resources
</directory>
<filtering>
true
</filtering>
<targetPath>
WEB-INF/classes
</targetPath>
</resource>
<resource>
<directory>
src/main/webapp
</directory>
<filtering>
true
</filtering>
<includes>
<include>
WEB-INF/web.xml
</include>
</includes>
</resource>
</webResources>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<jdbc.driver>
com.mysql.jdbc.Driver
</jdbc.driver>
<jdbc.url>
jdbc:mysql://tech-wuqim.dianpingoa.com:3306/garden
</jdbc.url>
<jdbc.user>
root
</jdbc.user>
<jdbc.password>
Passw0rd
</jdbc.password>
<jdbc.connectionProperties>
<![CDATA[useUnicode=true&autoReconnect=true]]>
</jdbc.connectionProperties>
</properties>
</project>
</project>
cat-home/src/main/java/com/dianping/cat/configuration/ComponentsConfigurator.java
0 → 100644
浏览文件 @
4e097240
package
com.dianping.cat.configuration
;
import
java.util.ArrayList
;
import
java.util.List
;
import
com.dianping.cat.report.ReportModule
;
import
com.site.lookup.configuration.Component
;
import
com.site.web.configuration.AbstractWebComponentsConfigurator
;
public
class
ComponentsConfigurator
extends
AbstractWebComponentsConfigurator
{
@Override
@SuppressWarnings
(
"unchecked"
)
public
List
<
Component
>
defineComponents
()
{
List
<
Component
>
all
=
new
ArrayList
<
Component
>();
defineModuleRegistry
(
all
,
ReportModule
.
class
,
ReportModule
.
class
);
return
all
;
}
public
static
void
main
(
String
[]
args
)
{
generatePlexusComponentsXmlFile
(
new
ComponentsConfigurator
());
}
}
cat-home/src/main/java/com/dianping/cat/report/ReportContext.java
0 → 100644
浏览文件 @
4e097240
package
com.dianping.cat.report
;
import
com.site.web.mvc.Action
;
import
com.site.web.mvc.ActionContext
;
import
com.site.web.mvc.ActionPayload
;
import
com.site.web.mvc.Page
;
public
class
ReportContext
<
T
extends
ActionPayload
<?
extends
Page
,
?
extends
Action
>>
extends
ActionContext
<
T
>
{
}
cat-home/src/main/java/com/dianping/cat/report/ReportModule.java
0 → 100644
浏览文件 @
4e097240
package
com.dianping.cat.report
;
import
com.site.web.mvc.AbstractModule
;
import
com.site.web.mvc.annotation.ModuleMeta
;
import
com.site.web.mvc.annotation.ModulePagesMeta
;
@ModuleMeta
(
name
=
"r"
,
defaultInboundAction
=
"home"
,
defaultTransition
=
"default"
,
defaultErrorAction
=
"default"
)
@ModulePagesMeta
({
com
.
dianping
.
cat
.
report
.
page
.
home
.
Handler
.
class
,
})
public
class
ReportModule
extends
AbstractModule
{
}
cat-home/src/main/java/com/dianping/cat/report/ReportPage.java
0 → 100644
浏览文件 @
4e097240
package
com.dianping.cat.report
;
import
com.site.web.mvc.Page
;
import
com.site.web.mvc.annotation.ModuleMeta
;
public
enum
ReportPage
implements
Page
{
HOME
(
"home"
,
"Home"
,
true
),
;
private
String
m_name
;
private
String
m_description
;
private
boolean
m_realPage
;
private
ReportPage
(
String
name
,
String
description
,
boolean
realPage
)
{
m_name
=
name
;
m_description
=
description
;
m_realPage
=
realPage
;
}
public
static
ReportPage
getByName
(
String
name
,
ReportPage
defaultPage
)
{
for
(
ReportPage
action
:
ReportPage
.
values
())
{
if
(
action
.
getName
().
equals
(
name
))
{
return
action
;
}
}
return
defaultPage
;
}
public
String
getName
()
{
return
m_name
;
}
public
String
getDescription
()
{
return
m_description
;
}
public
String
getModuleName
()
{
ModuleMeta
meta
=
ReportModule
.
class
.
getAnnotation
(
ModuleMeta
.
class
);
if
(
meta
!=
null
)
{
return
meta
.
name
();
}
else
{
return
null
;
}
}
public
boolean
isRealPage
()
{
return
m_realPage
;
}
public
ReportPage
[]
getValues
()
{
return
ReportPage
.
values
();
}
}
cat-home/src/main/java/com/dianping/cat/report/page/home/Action.java
0 → 100644
浏览文件 @
4e097240
package
com.dianping.cat.report.page.home
;
public
enum
Action
implements
com
.
site
.
web
.
mvc
.
Action
{
VIEW
(
"view"
);
private
String
m_name
;
private
Action
(
String
name
)
{
m_name
=
name
;
}
public
static
Action
getByName
(
String
name
,
Action
defaultAction
)
{
for
(
Action
action
:
Action
.
values
())
{
if
(
action
.
getName
().
equals
(
name
))
{
return
action
;
}
}
return
defaultAction
;
}
@Override
public
String
getName
()
{
return
m_name
;
}
}
cat-home/src/main/java/com/dianping/cat/report/page/home/Context.java
0 → 100644
浏览文件 @
4e097240
package
com.dianping.cat.report.page.home
;
import
com.dianping.cat.report.ReportContext
;
public
class
Context
extends
ReportContext
<
Payload
>
{
}
cat-home/src/main/java/com/dianping/cat/report/page/home/Handler.java
0 → 100644
浏览文件 @
4e097240
package
com.dianping.cat.report.page.home
;
import
java.io.IOException
;
import
javax.servlet.ServletException
;
import
com.dianping.cat.report.ReportPage
;
import
com.site.lookup.annotation.Inject
;
import
com.site.web.mvc.PageHandler
;
import
com.site.web.mvc.annotation.InboundActionMeta
;
import
com.site.web.mvc.annotation.OutboundActionMeta
;
import
com.site.web.mvc.annotation.PayloadMeta
;
public
class
Handler
implements
PageHandler
<
Context
>
{
@Inject
private
JspViewer
m_jspViewer
;
@Override
@PayloadMeta
(
Payload
.
class
)
@InboundActionMeta
(
name
=
"home"
)
public
void
handleInbound
(
Context
ctx
)
throws
ServletException
,
IOException
{
// display only, no action here
}
@Override
@OutboundActionMeta
(
name
=
"home"
)
public
void
handleOutbound
(
Context
ctx
)
throws
ServletException
,
IOException
{
Model
model
=
new
Model
(
ctx
);
model
.
setAction
(
Action
.
VIEW
);
model
.
setPage
(
ReportPage
.
HOME
);
m_jspViewer
.
view
(
ctx
,
model
);
}
}
cat-home/src/main/java/com/dianping/cat/report/page/home/JspFile.java
0 → 100644
浏览文件 @
4e097240
package
com.dianping.cat.report.page.home
;
public
enum
JspFile
{
VIEW
(
"/jsp/report/home.jsp"
),
;
private
String
m_path
;
private
JspFile
(
String
path
)
{
m_path
=
path
;
}
public
String
getPath
()
{
return
m_path
;
}
}
cat-home/src/main/java/com/dianping/cat/report/page/home/JspViewer.java
0 → 100644
浏览文件 @
4e097240
package
com.dianping.cat.report.page.home
;
import
com.dianping.cat.report.ReportPage
;
import
com.site.web.mvc.view.BaseJspViewer
;
public
class
JspViewer
extends
BaseJspViewer
<
ReportPage
,
Action
,
Context
,
Model
>
{
@Override
protected
String
getJspFilePath
(
Context
ctx
,
Model
model
)
{
Action
action
=
model
.
getAction
();
switch
(
action
)
{
case
VIEW:
return
JspFile
.
VIEW
.
getPath
();
}
throw
new
RuntimeException
(
"Unknown action: "
+
action
);
}
}
cat-home/src/main/java/com/dianping/cat/report/page/home/Model.java
0 → 100644
浏览文件 @
4e097240
package
com.dianping.cat.report.page.home
;
import
com.dianping.cat.report.ReportPage
;
import
com.site.web.mvc.ViewModel
;
public
class
Model
extends
ViewModel
<
ReportPage
,
Action
,
Context
>
{
public
Model
(
Context
ctx
)
{
super
(
ctx
);
}
@Override
public
Action
getDefaultAction
()
{
return
Action
.
VIEW
;
}
}
cat-home/src/main/java/com/dianping/cat/report/page/home/Payload.java
0 → 100644
浏览文件 @
4e097240
package
com.dianping.cat.report.page.home
;
import
com.dianping.cat.report.ReportPage
;
import
com.site.web.mvc.ActionContext
;
import
com.site.web.mvc.ActionPayload
;
import
com.site.web.mvc.payload.annotation.FieldMeta
;
public
class
Payload
implements
ActionPayload
<
ReportPage
,
Action
>
{
private
ReportPage
m_page
;
@FieldMeta
(
"op"
)
private
Action
m_action
;
public
void
setAction
(
Action
action
)
{
m_action
=
action
;
}
@Override
public
Action
getAction
()
{
return
m_action
;
}
@Override
public
ReportPage
getPage
()
{
return
m_page
;
}
@Override
public
void
setPage
(
String
page
)
{
m_page
=
ReportPage
.
getByName
(
page
,
ReportPage
.
HOME
);
}
@Override
public
void
validate
(
ActionContext
<?>
ctx
)
{
}
}
cat-home/src/main/resources/META-INF/plexus/components.xml
0 → 100644
浏览文件 @
4e097240
<plexus>
<components>
<component>
<role>
com.site.web.mvc.model.ModuleRegistry
</role>
<implementation>
com.site.web.mvc.model.ModuleRegistry
</implementation>
<configuration>
<modules>
<module
default=
"true"
>
com.dianping.cat.report.ReportModule
</module>
</modules>
</configuration>
</component>
<component>
<role>
com.dianping.cat.report.ReportModule
</role>
<implementation>
com.dianping.cat.report.ReportModule
</implementation>
</component>
<component>
<role>
com.dianping.cat.report.page.home.Handler
</role>
<implementation>
com.dianping.cat.report.page.home.Handler
</implementation>
<requirements>
<requirement>
<role>
com.dianping.cat.report.page.home.JspViewer
</role>
</requirement>
</requirements>
</component>
<component>
<role>
com.dianping.cat.report.page.home.JspViewer
</role>
<implementation>
com.dianping.cat.report.page.home.JspViewer
</implementation>
</component>
</components>
</plexus>
cat-home/src/main/resources/META-INF/wizard/webapp/manifest.xml
0 → 100644
浏览文件 @
4e097240
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<file
path=
"wizard.xml"
/>
</manifest>
cat-home/src/main/resources/META-INF/wizard/webapp/wizard.xml
0 → 100644
浏览文件 @
4e097240
<?xml version="1.0" encoding="UTF-8"?>
<wizard
package=
"com.dianping.cat"
webres=
"false"
>
<module
name=
"report"
path=
"r"
>
<page
name=
"home"
description=
"Home"
default=
"true"
/>
</module>
</wizard>
cat-home/src/main/webapp/WEB-INF/webres.tld
0 → 100644
浏览文件 @
4e097240
<taglib xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd">
<description>JSP standard tag library for V4 resources</description>
<tlib-version>1.0</tlib-version>
<short-name>res</short-name>
<uri>http://www.ebay.com/webres</uri>
<tag>
<description><![CDATA[jsSlot Resource Tag]]></description>
<name>jsSlot</name>
<tag-class>com.ebay.webres.taglib.basic.JsSlotTagHandler</tag-class>
<body-content>JSP</body-content>
<attribute>
<description><![CDATA[Identify whether the link URL is secure or not.]]></description>
<name>secure</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>boolean</type>
</attribute>
<attribute>
<description><![CDATA[The reference id for JsSlot.]]></description>
<name>id</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
</attribute>
<attribute>
<description><![CDATA[Customized tag render type]]></description>
<name>renderType</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
</attribute>
<dynamic-attributes>true</dynamic-attributes>
</tag>
<tag>
<description><![CDATA[Resource Bean Tag to define resource bean variable as bootstrap]]></description>
<name>bean</name>
<tag-class>com.ebay.webres.taglib.basic.BeanTagHandler</tag-class>
<body-content>JSP</body-content>
<attribute>
<description><![CDATA[A valid id for Bean.]]></description>
<name>id</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
</attribute>
<dynamic-attributes>false</dynamic-attributes>
</tag>
<tag>
<description><![CDATA[useCss Resource Tag]]></description>
<name>useCss</name>
<tag-class>com.ebay.webres.taglib.basic.UseCssTagHandler</tag-class>
<body-content>JSP</body-content>
<attribute>
<description><![CDATA[Set the css value with EL or a css ref.]]></description>
<name>value</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.Object</type>
</attribute>
<attribute>
<description><![CDATA[Identify whether the link URL is secure or not.]]></description>
<name>secure</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>boolean</type>
</attribute>
<attribute>
<description><![CDATA[The reference id for Css.]]></description>
<name>id</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
</attribute>
<attribute>
<description><![CDATA[Customized tag render type]]></description>
<name>renderType</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
</attribute>
<attribute>
<description><![CDATA[Target placement for this css resource to render]]></description>
<name>target</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
</attribute>
<dynamic-attributes>true</dynamic-attributes>
</tag>
<tag>
<description><![CDATA[Resource token tag for page resources]]></description>
<name>token</name>
<tag-class>com.ebay.webres.taglib.basic.TokenTagHandler</tag-class>
<body-content>JSP</body-content>
<attribute>
<description><![CDATA[Customized tag render type]]></description>
<name>renderType</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
</attribute>
<attribute>
<description><![CDATA[Token type of resource: js, css]]></description>
<name>type</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
</attribute>
<dynamic-attributes>false</dynamic-attributes>
</tag>
<tag>
<description><![CDATA[Set tag to define a page attribute with id as name]]></description>
<name>set</name>
<tag-class>com.ebay.webres.taglib.basic.SetTagHandler</tag-class>
<body-content>JSP</body-content>
<attribute>
<description><![CDATA[The value]]></description>
<name>value</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.Object</type>
</attribute>
<attribute>
<description><![CDATA[The name.]]></description>
<name>id</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
</attribute>
<dynamic-attributes>false</dynamic-attributes>
</tag>
<tag>
<description><![CDATA[useJs Resource Tag]]></description>
<name>useJs</name>
<tag-class>com.ebay.webres.taglib.basic.UseJsTagHandler</tag-class>
<body-content>JSP</body-content>
<attribute>
<description><![CDATA[Set the js value with EL or a js ref.]]></description>
<name>value</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.Object</type>
</attribute>
<attribute>
<description><![CDATA[Identify whether the link URL is secure or not.]]></description>
<name>secure</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>boolean</type>
</attribute>
<attribute>
<description><![CDATA[The reference id for Js.]]></description>
<name>id</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
</attribute>
<attribute>
<description><![CDATA[Customized tag render type]]></description>
<name>renderType</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
</attribute>
<attribute>
<description><![CDATA[Target placement for this js resource to render]]></description>
<name>target</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
</attribute>
<dynamic-attributes>true</dynamic-attributes>
</tag>
<tag>
<description><![CDATA[Link Resource Tag]]></description>
<name>link</name>
<tag-class>com.ebay.webres.taglib.basic.LinkTagHandler</tag-class>
<body-content>JSP</body-content>
<attribute>
<description><![CDATA[The value for link, could be a expression or a link ref.]]></description>
<name>value</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.Object</type>
</attribute>
<attribute>
<description><![CDATA[Identify whether the link URL is secure or not.]]></description>
<name>secure</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>boolean</type>
</attribute>
<attribute>
<description><![CDATA[Customized tag render type]]></description>
<name>renderType</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
</attribute>
<dynamic-attributes>true</dynamic-attributes>
</tag>
<tag>
<description><![CDATA[Image Resource Tag]]></description>
<name>img</name>
<tag-class>com.ebay.webres.taglib.basic.ImageTagHandler</tag-class>
<body-content>JSP</body-content>
<attribute>
<description><![CDATA[The value for image, could be a expression or a image path.]]></description>
<name>value</name>
<required>true</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.Object</type>
</attribute>
<attribute>
<description><![CDATA[Identify whether the image URL is secure or not.]]></description>
<name>secure</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>boolean</type>
</attribute>
<attribute>
<description><![CDATA[The reference id for img.]]></description>
<name>id</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
</attribute>
<attribute>
<description><![CDATA[Customized tag render type]]></description>
<name>renderType</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
</attribute>
<dynamic-attributes>true</dynamic-attributes>
</tag>
<tag>
<description><![CDATA[cssSlot Resource Tag]]></description>
<name>cssSlot</name>
<tag-class>com.ebay.webres.taglib.basic.CssSlotTagHandler</tag-class>
<body-content>JSP</body-content>
<attribute>
<description><![CDATA[Identify whether the link URL is secure or not.]]></description>
<name>secure</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>boolean</type>
</attribute>
<attribute>
<description><![CDATA[The reference id for CssSlot.]]></description>
<name>id</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
</attribute>
<attribute>
<description><![CDATA[Customized tag render type]]></description>
<name>renderType</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
</attribute>
<dynamic-attributes>true</dynamic-attributes>
</tag>
</taglib>
cat-home/src/main/webapp/jsp/report/home.jsp
0 → 100644
浏览文件 @
4e097240
<%@ page
contentType=
"text/html; charset=utf-8"
%>
<jsp:useBean
id=
"ctx"
type=
"com.dianping.cat.report.page.home.Context"
scope=
"request"
/>
<jsp:useBean
id=
"payload"
type=
"com.dianping.cat.report.page.home.Payload"
scope=
"request"
/>
<jsp:useBean
id=
"model"
type=
"com.dianping.cat.report.page.home.Model"
scope=
"request"
/>
View of home page under report
\ No newline at end of file
cat-home/src/test/java/com/dianping/cat/AllTests.java
0 → 100644
浏览文件 @
4e097240
package
com.dianping.cat
;
import
org.junit.runner.RunWith
;
import
org.junit.runners.Suite
;
import
org.junit.runners.Suite.SuiteClasses
;
@RunWith
(
Suite
.
class
)
@SuiteClasses
({
// add test classes here
})
public
class
AllTests
{
}
cat-home/src/test/java/com/dianping/cat/SimpleServer.java
0 → 100644
浏览文件 @
4e097240
package
com.dianping.cat
;
import
java.io.File
;
import
java.net.URL
;
import
org.codehaus.plexus.PlexusContainer
;
import
org.junit.AfterClass
;
import
org.junit.BeforeClass
;
import
org.junit.Test
;
import
org.mortbay.jetty.Handler
;
import
org.mortbay.jetty.servlet.Context
;
import
org.mortbay.jetty.servlet.ServletHolder
;
import
org.mortbay.servlet.GzipFilter
;
import
com.ebay.webres.server.support.SimpleServerSupport
;
import
com.ebay.webres.taglib.support.JettyTestSupport
;
import
com.site.lookup.ComponentTestCase
;
import
com.site.test.browser.BrowserManager
;
import
com.site.web.MVC
;
public
class
SimpleServer
extends
SimpleServerSupport
{
private
static
ComponentAdaptor
s_adaptor
=
new
ComponentAdaptor
();
private
static
MVC
s_mvc
=
new
MVC
();
@AfterClass
public
static
void
afterClass
()
throws
Exception
{
JettyTestSupport
.
shutdownServer
();
}
@BeforeClass
public
static
void
beforeClass
()
throws
Exception
{
JettyTestSupport
.
startServer
(
new
SimpleServer
());
}
@Override
protected
File
getWarRoot
()
{
return
new
File
(
"src/main/webapp"
);
}
public
static
void
main
(
String
[]
args
)
throws
Exception
{
SimpleServer
server
=
new
SimpleServer
();
SimpleServer
.
beforeClass
();
try
{
server
.
before
();
server
.
startServer
();
server
.
after
();
}
finally
{
SimpleServer
.
shutdownServer
();
}
}
@Override
public
void
after
()
{
super
.
after
();
s_adaptor
.
after
();
}
@Override
public
void
before
()
{
s_adaptor
.
setServerPort
(
getServerPort
());
s_adaptor
.
before
();
s_mvc
.
setContainer
(
s_adaptor
.
getContainer
());
super
.
before
();
}
@Override
protected
void
postConfigure
(
Context
ctx
)
{
ctx
.
addServlet
(
new
ServletHolder
(
s_mvc
),
"/r/*"
);
ctx
.
addFilter
(
GzipFilter
.
class
,
"/r/*"
,
Handler
.
ALL
);
super
.
postConfigure
(
ctx
);
}
@Override
protected
String
getContextPath
()
{
return
"/cat"
;
}
@Override
protected
int
getServerPort
()
{
return
2281
;
}
@Test
public
void
startServer
()
throws
Exception
{
// s_adaptor.display("/cat/r");
System
.
out
.
println
(
String
.
format
(
"[%s] Press any key to stop server ... "
,
getTimestamp
()));
System
.
in
.
read
();
}
static
class
ComponentAdaptor
extends
ComponentTestCase
{
private
int
m_serverPort
;
public
void
after
()
{
try
{
super
.
tearDown
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
public
void
before
()
{
try
{
super
.
setUp
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
@Override
public
PlexusContainer
getContainer
()
{
return
super
.
getContainer
();
}
public
void
setServerPort
(
int
serverPort
)
{
m_serverPort
=
serverPort
;
}
public
void
display
(
String
requestUri
)
throws
Exception
{
StringBuilder
sb
=
new
StringBuilder
(
256
);
BrowserManager
manager
=
lookup
(
BrowserManager
.
class
);
sb
.
append
(
"http://localhost:"
).
append
(
m_serverPort
).
append
(
requestUri
);
try
{
manager
.
display
(
new
URL
(
sb
.
toString
()));
}
finally
{
release
(
manager
);
}
}
@Override
public
<
T
>
T
lookup
(
Class
<
T
>
role
)
throws
Exception
{
return
super
.
lookup
(
role
);
}
@Override
public
<
T
>
T
lookup
(
Class
<
T
>
role
,
Object
roleHint
)
throws
Exception
{
return
super
.
lookup
(
role
,
roleHint
);
}
}
}
pom.xml
浏览文件 @
4e097240
...
@@ -40,6 +40,61 @@
...
@@ -40,6 +40,61 @@
<artifactId>
plexus-container-default
</artifactId>
<artifactId>
plexus-container-default
</artifactId>
<version>
1.0-alpha-47
</version>
<version>
1.0-alpha-47
</version>
</dependency>
</dependency>
<dependency>
<groupId>
com.site.common
</groupId>
<artifactId>
test-framework
</artifactId>
<version>
1.0.0
</version>
</dependency>
<dependency>
<groupId>
com.site.common
</groupId>
<artifactId>
web-framework
</artifactId>
<version>
1.0.0
</version>
</dependency>
<dependency>
<groupId>
com.ebay.webres
</groupId>
<artifactId>
WebResServer
</artifactId>
<version>
1.1.15
</version>
</dependency>
<dependency>
<groupId>
com.site.dal
</groupId>
<artifactId>
dal-jdbc
</artifactId>
<version>
1.0.0
</version>
</dependency>
<dependency>
<groupId>
com.site.app
</groupId>
<artifactId>
app-core
</artifactId>
<version>
1.0.0
</version>
</dependency>
<dependency>
<groupId>
org.mortbay.jetty
</groupId>
<artifactId>
jetty
</artifactId>
<version>
6.1.9
</version>
</dependency>
<dependency>
<groupId>
org.mortbay.jetty
</groupId>
<artifactId>
jetty-util
</artifactId>
<version>
6.1.9
</version>
</dependency>
<dependency>
<groupId>
org.mortbay.jetty
</groupId>
<artifactId>
jsp-2.1
</artifactId>
<version>
6.1.9
</version>
</dependency>
<dependency>
<groupId>
javax.servlet
</groupId>
<artifactId>
servlet-api
</artifactId>
<version>
2.5
</version>
</dependency>
<dependency>
<groupId>
javax.servlet.jsp
</groupId>
<artifactId>
jsp-api
</artifactId>
<version>
2.1
</version>
</dependency>
<dependency>
<groupId>
mysql
</groupId>
<artifactId>
mysql-connector-java
</artifactId>
<version>
5.1.12
</version>
</dependency>
<dependency>
<dependency>
<groupId>
org.jboss.netty
</groupId>
<groupId>
org.jboss.netty
</groupId>
<artifactId>
netty
</artifactId>
<artifactId>
netty
</artifactId>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录