-
1. Re: URL Resource
hirosh101 Jul 27, 2003 6:34 PM (in response to lubbitikarson)Hello !
you've a look at http://jboss.sourceforge.net/doc-24/ch05s02.html !
There is an example.
bye
Hirosh -
2. Re: URL Resource connection http factory
hirosh101 Jul 29, 2003 4:39 AM (in response to lubbitikarson)If you use xdoclet ! You can choose this tags. Here's an
example:
Write in your EJB following tags:
...
* @ejb.resource-ref
* res-ref-name="url/fooDS"
* res-type="java.net.URL"
* res-auth="Container"
* @jboss.resource-ref
* res-ref-name="url/fooDS"
* jndi-name="java:/fooDS"
* res-url="http://www.jboss.org"
---
Xdoclet generates the in jboss.xml and ejb-jar.xml the
right xml description for the container.
After that you can use that factory from your EJB with
following detail:
...
{
Context context = new InitialContext( );
URL url = ( URL ) context.lookup( java:comp/env/url/fooDS );
URLConnection connection = ( URLConnection ) url.openConnection( );
is = connection.getInputStream( );
br = new BufferedReader( new InputStreamReader( is ) );
String line;
while ( ( line = br.readLine( ) ) != null )
{
...
}
...
regards
Hirosh