Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the glassfish alternative to context.xml

Tags:

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="[email protected]" 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"/>
like image 643
corydoras Avatar asked Nov 06 '09 00:11

corydoras


1 Answers

It sounds like you want "glassfish-resources.xml". You can create JDBC and database pool resources, JavaMail resources, etc there.

http://javahowto.blogspot.com/2011/02/sample-glassfish-resourcesxml.html

like image 161
ringerc Avatar answered Oct 16 '22 01:10

ringerc