Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

public static interface for application variables

 
E Robb
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Im not sure if this is the correct design approach. But here goes.

I have a public class GlobalActionSupport extends ActionSupport which is implemented by every other action so I have sort of a global action going on. If I want to implement mail I use a class called public class WebMail extends GlobalActionSupport

That being said I have noticed in my design that I use application variables in almost every page so I wanted to alter GlobalActionSupport with a public static interface so I dont have to call and import ActionContext into every action I need it.

This is what I tried to implement.




On the line that has String changeCadence( app.get("KEY_ENTITYID") ); eclipse says "Syntax error on tokens, AnnotationName expected instead" any ideas why?

Does this approach seem OK? instead of calling ActionContext.getContext() in every Action that I need an application variable?

Thanks,
Earl

 
Mohana Rao Sv
Ranch Hand
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use applicationAware interceptor.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic