Hi,
Try not to have anything in your constructor, leave it empty. And try using the
full package name in your ResourceBundle.getBundle.
i.e. rb = ResourceBundle.getBundle("intl.Configuration");
I think for beans you should leave the constructor empty or don't specify at
all. Correct me if I am wrong.
regards
Ee Ming
---------------------------------------- Message History
----------------------------------------
From: [EMAIL PROTECTED] on 11/01/99 11:16 AM GMT
Please respond to [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
cc:
Subject: Is it possible to use a ResourceBundle in the Bean ?
Hi,
I have been trying to use a ResourceBundle in my Bean class. The
code is simple but I always get the following ServletException:
javax.servlet.ServletException: Cannot create bean of class intl.IntlText
The code I have for the bean is as follows:
// SOF
import java.util.ResourceBundle;
public class IntlText {
private ResourceBundle rb = null;
public IntlText() {
rb = ResourceBundle.getBundle("Configuration");
}
public String getTitle() {
return rb.getString("nokpi.title");
}
}
// EOF
The JSP:
<!-- SOF -->
<HTML>
<jsp:useBean id="it" scope="session" class="IntlText" />
<HEAD>
<TITLE>
<jsp:getProperty name="it" property="Title"/>
</TITLE>
</HEAD>
<BODY>
</BODY>
</HTML>
<!-- EOF -->
I have the Configuration.properties file located in the root of the
WebServer. I have also tried putting it in the same dir as the class
but it still doesn't work.
Any ideas anyone ?
Thanks,
-John K
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html