Hey ,
I would say so. Try to look it up. So from your bean code you would
say...
URL url = (URL)ctx.lookup("java:comp/env/MyURL");
(ProperCast)url.openConnection();
... blah blah
And yes you should be able to read files from local system, unless you
tighten server.policy permissions.
Vlada
On Mon, 16 Apr 2001 [EMAIL PROTECTED] wrote:
>
>
> After some source code reading I have gotten to the following
> conclusion. To use URL, do this.
>
> In ejb-jar:
>
> <resource-ref>
> <res-ref-name>MyURL</res-ref-name>
> <res-type>java.net.URL</res-type>
> <res-auth>Container</res-auth>
> </resource-ref>
>
> In jboss.xml
>
> <resource-managers>
>
> <resource-manager>
> <res-name>urlref</res-name>
> <res-url>http://some.website.org/page.html</res-url>
> </resource-manager>
>
> </resource-managers>
>
> In bean entry:
>
> <resource-ref>
> <res-ref-name>MyURL</res-ref-name>
> <resource-name>urlref</resource-name>
> </resource-ref>
>
>
> Does this seem to be correct?
>
> If I also get it right from the J2EE spec it should be possible to use
> file: as protocol and thereby get readonly access to files in the
> filesystem.
>
> Is this also correct?
>
> //Peter
>
> On 12 Apr, [EMAIL PROTECTED] wrote:
> > Hey,
> >
> > It is there as far as I know. Just declare resource ref to url as in
> > tutorial you refer to.
> >
> > Vladimir
> >
> > On Thu, 12 Apr 2001, Peter Antman wrote:
> >
> >> Hi,
> >> is there any support in JBoss yet to get access to an URL via JNDI (like
> >> the JavaMail support), as shown in the J2EE tutorial:
> >>
> >> try {
> >> context = new InitialContext();
> >> url = (URL)context.lookup("java:comp/env/url/MyURL");
> >> connection = (HttpURLConnection)url.openConnection();
> >> responseCode = connection.getResponseCode();
> >> } catch (Exception ex) {
> >> throw new EJBException(ex.getMessage());
> >> }
> >>
> >> Have I missed it, or is it not there?
> >>
> >> Should we not have it?
> >>
> >> Anyone hade any thought about this? It does not seem that hard to
> >> implement.
> >>
> >> //Peter
> >>
> >
> >
> > _______________________________________________
> > JBoss-user mailing list
> > [EMAIL PROTECTED]
> > http://lists.sourceforge.net/lists/listinfo/jboss-user
>
>
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user