मैं जेएसएफ 1.1 का उपयोग कर रहा हूं।बैकिंग बीन के अंदर से प्रबंधित बीन नाम कैसे प्राप्त करें?
<managed-bean>
<managed-bean-name>beanInstance1</managed-bean-name>
<managed-bean-class>com.paquete.BeanMyBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
मैं अपने सेम के अंदर प्रबंधित सेम नाम beanInstance1
मिल चाहते हैं: मैं अपने faces-config.xml
फ़ाइल में निम्न है। यह मेरा सेम है:
package com.paquete;
public class BeanMyBean {
String atribute1;
public BeanMyBean() {
System.out.println("managed-bean-class="+this.getClass().getName());
System.out.println("managed-bean-name="+????????????????????????);
// How Can I get the "beanInstance1" literal from here??
}
// setters and getters
}
मुझे पता है कि मिल com.paquete.BeanMyBean
शाब्दिक (this.getClass().getName()
) और BeanMyBean
(this.getClass().getSimpleName()
), लेकिन मैं कैसे मिलता है एक प्रबंधित नाम (बीन के कहने) पता नहीं है।
मैं beanInstance1
मूल्य कैसे प्राप्त कर सकता हूं?
आपका स्वागत है। चूंकि आप यहां नए हैं, कृपया उत्तर को स्वीकार करने के लिए भूल जाएं, जिसने समस्या को हल करने में मदद की है (अधिकांश), http://meta.stackexchange.com/questions/5234/how-does-accepting-an -answer काम/5235 # 5235 – BalusC