This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Replace a deprecated getResources() in a servlet init

 
Renato Losio
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
vidya sagar
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hope this helps

Deprecated List and alternatives
 
Renato Losio
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How about this

ResourceBundle rs = ResourceBundle.getBundle(String)
 
Darshan Shroff
Greenhorn
Posts: 12
Java Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Renato,

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

Regards,
Darshan Shroff
shroffdarshan@gmail.com
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic