简体   繁体   English

在Websphere中访问URL的自定义属性

[英]Access custom properties for URLs in Websphere

We have created a URL in websphere(V7) and created the custom properties. 我们已经在websphere(V7)中创建了URL,并创建了自定义属性。

Steps to create the custom property 创建自定义属性的步骤

Websphere Admin console => Resources => URL => URLs Then click on the created URL and then created the custom property. Websphere管理控制台=>资源=> URL => URLs然后单击创建的URL,然后创建定制属性。

Now we want to access this custom property from java EE application. 现在,我们要从Java EE应用程序访问此自定义属性。

Can any body suggest any way to access the custom properties from java EE application? 任何机构都可以建议通过Java EE应用程序访问自定义属性的任何方法吗?

URL custom properties cannot be accessed from an application. URL定制属性无法从应用程序访问。 All resource types can have custom properties that give hints to the product on how it should manage the resource. 所有资源类型都可以具有自定义属性,这些属性可以向产品提示如何管理资源。 That said, I'm not aware of any customizations for URL resources, but the console panel exists in case one gets added in the future (for example, if an APAR would require the addition of a custom property to change default behavior). 就是说,我不知道对URL资源的任何自定义,但是控制台面板存在,以防将来添加(例如,如果APAR需要添加自定义属性来更改默认行为)。

When you create a URL Resource you also set a JNDI name for the resource. 创建URL资源时,您还需要为资源设置一个JNDI名称。

You can then get the URL by making a jndi lookup: 然后,您可以通过执行jndi查找来获取URL:

InitialContext initCtx = new InitialContext();
URL url = (java.net.URL) initCtx.lookup("my/url/resource");

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM