Meaningless Drivel is fun!*
The moose likes Struts and the fly likes Replace a deprecated getResources() in a servlet init Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Replace a deprecated getResources() in a servlet init" Watch "Replace a deprecated getResources() in a servlet init" New topic
Author

Replace a deprecated getResources() in a servlet init

Renato Losio
Ranch Hand

Joined: Nov 23, 2005
Posts: 99
Hello.

I need to fix the following line of code, in the init() method of a class that extends ActionServlet.

WebAppPool.put(companyId, Globals.MESSAGES_KEY, getResources());

getResources() is deprecated so I need to find a different way to get the MessageResources. I can't simply get them from the request as I don't have the request in the init(). Any other way?

Thanks,

Renato


Renato Losio - www.arsenio.it - renatoweb@arsenio.it
vidya sagar
Ranch Hand

Joined: Mar 02, 2005
Posts: 580
Hope this helps

Deprecated List and alternatives
Renato Losio
Ranch Hand

Joined: Nov 23, 2005
Posts: 99
No.

org.apache.struts.action.ActionServlet.getResources()

Actions should call Action.getResources(HttpServletRequest) instead of this method, in order to retrieve the resources for the current module

That's actually my problem. I don't have a HttpServletRequest available in the init(). Any other option?

Cheers,

Renato
vidya sagar
Ranch Hand

Joined: Mar 02, 2005
Posts: 580
How about this

ResourceBundle rs = ResourceBundle.getBundle(String)
Darshan Shroff
Greenhorn

Joined: Nov 25, 2009
Posts: 12

Hi Renato,

I am facing with the exact same problem.
Any solution on the same.

Regards,
Darshan Shroff
shroffdarshan@gmail.com
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Replace a deprecated getResources() in a servlet init