struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Duan Qiang" <qd...@ilog.com.sg>
Subject Using ResourceBundle's subclass in Struts
Date Mon, 14 Jul 2003 07:26:19 GMT
Hi, 

I posted a question but seems nobody replied. Anyone tried to define a subclass of ResourceBundle
and use it in Struts?

For a standalone program, it's straightforward to use sel-defined resourcebundle classes,
for example,

public class MyResourceBundle extends ResourceBundle
{
    public Object handleGetObject()
    ...
    public Enumeration getKeys()
}

//use the subclass
ResourceBundle bundle = ResourceBundle.getBundle("MyResourceBundle");

However, when I specify the resource name as "MyResourceBundle", Struts can not find the message
bundle although my class MyResourceBundle is on classpath.

It's possible to replace <bean:message> tag using my own methods, however, the action
controller I uses is an instance of DispatchAction, which will match a method name with the
message bundle key, for example, "button.next" matches to the function "doNext" and so on.


So I can could totally avoid using struts message functionaliity, or how I can use my own
ResourceBundle?

THx,

Regards,

dq
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message