什么是glass.xml替代context.xml [英] What is the glassfish alternative to context.xml

查看:102
本文介绍了什么是glass.xml替代context.xml的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我习惯于在 context.xml 中配置web应用程序,包括jdbc resorces和应用程序配置参数。



<我们曾经将它存储在 context.xml中

code>文件如下:

 < Resource 
url =jdbc:mysql:// localhost :3306 / db?useUnicode = true& amp; characterEncoding = utf8
username =username
name =jdbc / db
password =secret
auth = 容器
driverClassName =com.mysql.jdbc.Driver
maxActive =5maxIdle =2maxWait =10000
removeAbandoned =true
type =javax.sql.DataSource
/>

< Parameter name =application.urlvalue =http:// localhost:8080 / News /override =false/>
<参数名称=smtp.servervalue =smtp.example.comoverride =false/>
<参数名称=smtp.portvalue =25override =false/>
<参数名称=smtp.from.addressvalue =admin@example.comoverride =false/>
<参数名称=smtp.from.namevalue =网站管理员override =false/>
< Parameter name =list.namevalue =DEVoverride =false/>
< Parameter name =temporary.foldervalue =/ tmpoverride =false/>
< Parameter name =authentication.typevalue =LDAPoverride =false/>


解决方案

原来的答案是没有其他选择在tomcat中的context.xml。



事实证明,该元素是一个tomcat特定的东西,通常不受其他应用服务器支持,如glassfish。



据我所知,除了通过GUI或命令行界面手动配置数据库资源之外,似乎没有简单/明智的选择。


I am used to configuring web application in context.xml, including jdbc resorces, and application configuration parameters.

Under glassfish, what is considered the standard place to store application configuration information?

We used to store it in the context.xml file as follows:

<Resource
url="jdbc:mysql://localhost:3306/db?useUnicode=true&amp;characterEncoding=utf8"
username="username"
name="jdbc/db"
password="secret"
auth="Container"
driverClassName="com.mysql.jdbc.Driver"
maxActive="5" maxIdle="2" maxWait="10000"
removeAbandoned="true"
type="javax.sql.DataSource"
/>

<Parameter name="application.url" value="http://localhost:8080/News/" override="false"/>
<Parameter name="smtp.server" value="smtp.example.com" override="false"/>
<Parameter name="smtp.port" value="25" override="false"/>
<Parameter name="smtp.from.address" value="admin@example.com" override="false"/>
<Parameter name="smtp.from.name" value="Site administrator" override="false"/>
<Parameter name="list.name" value="DEV" override="false"/>
<Parameter name="temporary.folder" value="/tmp" override="false"/>
<Parameter name="authentication.type" value="LDAP" override="false"/>

解决方案

Turns out the answer is there is no alternative to the section in tomcats context.xml.

It turns out that the element is a tomcat specific thing generally not supported by other app servers such as glassfish.

As far as I can tell there seems to be no simple/sensible alternative apart from manually configuring database resources through either GUI or command line interfaces.

这篇关于什么是glass.xml替代context.xml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆