1. 插件简介
为了方便看到 Struts2 应用里各种配置信息,Struts2 提供了 Config Browser 插件。
主要显示信息:
- Configuration
- Contants:Struts2 中所有默认的和用户配置的常量
- Beans:Struts2 中自定义的组件 bean 和用户创建的 JavaBean
- Jars:Struts2 应用程序中的所有 Jar 包的信息
- Namespaces
- default:默认命名空间下配置的 Action 相关信息
- /config-browser:插件自己的 Action 信息,如下面访问的首页 Action:index 等
- /xxx:用户创建的命名空间及该空间下的 Action 信息
2. 插件使用方法
- 将 struts2-config-browser-plugin-2.x.xx.jar文件复制到 Struts2 应用的 WEB-INF/lib 目录下。
- 访问地址:
http://hostName:port/ContextRoot/config-browser/index.do
打开 Config Browser 插件首页。
说明:
- hostName:主机名 / IP,如 localhost / 127.0.0.1
- port:端口号,如 8080
- ContextRoot:应用程序的发布名称
- /config-browser:为该插件访问的 namespace,不能修改
- index.do:可省略,默认就是访问此 Action,其中,后缀名根据个人的 Struts2 配置而定