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&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"/>
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With