Questions tagged [application-scope]

Use this tag for questions related to an application's scope, that determines which of its resources are available to other parts of the system.

Each application has an application scope that determines which of its resources are available to other parts of the system. Application scoping ensures that one application does not impact another application. You can specify what parts of the application other applications can access by setting application access settings.

Source: Application Scope

is used for questions that discuss how to affect/manipulate/etc. the application scope.

18 questions
14
votes
2 answers

Is there application Scope in spring?

I saw 'application' scope in the following blog. Is it…
Shakthi
  • 826
  • 3
  • 15
  • 33
9
votes
1 answer

Utility methods in application scoped bean

Do you think it is a good idea to put all widely used utility methods in an application scoped bean? In the current implementation of the application I'm working on, all utility methods (manipulating with Strings, cookies, checking url, checking…
ontime
  • 113
  • 2
  • 7
6
votes
1 answer

Concurrency of @ApplicationScoped JSF managed beans

I'm using Mojarra 2.2.12 and in our project we've got a few @ApplicationScoped beans. For instance: @ManagedBean @ApplicationScoped public class AppScopedBean{ private int commonValueForClients; //GET, SET public void evalNew(){ …
St.Antario
  • 26,175
  • 41
  • 130
  • 318
2
votes
1 answer

If I save variable in session scope, is it visible in application scope?

I did the following getJspContext().setAttribute("authUser", user, PageContext.SESSION_SCOPE);` In my LoginServlet and the following User currentUser = (User) getJspContext().getAttribute("authUser", PageContext.APPLICATION_SCOPE); In the other…
user13555090
2
votes
0 answers

How to get a JSF application scoped bean from webservice?

I have a jsf 2.0 application without Spring and I have implemented a cache as application scope which should be accessed from a Rest service. Now I would like to call the rest webservice which should check the cache, but when I want access it, it is…
ak4784
  • 33
  • 4
2
votes
2 answers

How to call an ArrayList stored in applicationScope from another class

I want to call an ArrayList stored in applicationScope from another class I have a class, something like this that stores a bounch of data in a public variable names AL_data, the method getAllData just store the data in AL_data public class…
Thomas Adrian
  • 3,543
  • 6
  • 32
  • 62
2
votes
1 answer

JSF is creating two instances of an ApplicationScoped bean

I have two managed beans which both have an @ApplicationScope annotation: Storage.java: @ManagedBean(eager = true) @ApplicationScoped public class Storage { private static final Logger LOGGER = LoggerFactory.getLogger(Storage.class); …
BetaRide
  • 16,207
  • 29
  • 99
  • 177
1
vote
0 answers

How make an object that's shared across the entire application in play framework (1.x)?

I want to make one instance of an object across the entire Play Application. I don't think static will work because Play uses many classloaders to load the same class many times (I confirmed this with a heap analysis). Is there something like…
Don Rhummy
  • 24,730
  • 42
  • 175
  • 330
1
vote
1 answer

DI with CDI and 3rd party class: avoid constructor doing business logic called multiple times for each proxy construction

I'm relativly new to EE / CDI for DI so maybe one of you could provide me with some tips for my problem: I've got a 3rd party class which I would like to inject into other beans. In spring just needs some declaration and it's done. Using cdi…
1
vote
1 answer

@Injected @ManagedBean gets reinitialized despite of @ApplicationScoped annotation

I am writing a simple JSF application for converting currencies. There is a Rates class which holds the data, Currencies class for managing requests and Manage class for adding new currencies. My problem is: I want the currencies to be persisted as…
Broccoli
  • 1,249
  • 1
  • 13
  • 19
1
vote
1 answer

Should I store application-scope variable inside a file in PHP?

I want store a variable shared between sessions (application-scope): It is not user session-specific (so I can't put it in $_SESSION[]). It is a long term storage (so I can't use APC - Alternative PHP Cache). So, I use a file do store the variable…
MatM
  • 128
  • 5
0
votes
0 answers

Kotlin ClassCastException when returning null

I am using the Quarkus framework and have an ApplicationScoped bean that implements an interface with a method with the signature of loadRatingByUserIdAndVehicleId(userId: Long, vehicleId: Long): Rating?. The implementation of the method for the…
0
votes
1 answer

How to add Refresh trigger to a class which is annotated with @ApplicationScope

Right now I have an InitialReferenceLoaderImpl which is annotated by @ApplicationScope and the function is annotated by @PostConstruct, in this class I'm loading my Application Properties from the SQL table, but the problem is, If users change…
0
votes
1 answer

ApplicationScope and REST calls

I have a project where the client (a Java stateful bean) will make a REST call to another bean (let's call it RequestBean) to perform a function and return a Response. Part of that function requires a call to a vendor's SOAP service. That service…
Tom T
  • 263
  • 1
  • 2
  • 11
0
votes
0 answers

Removing Attributes on ServletContext (Application Scope) in Tomcat manually

Hi Stackoverflow peeps, I'm just wondering if there are way to remove application scope attributes in your web app. I know how to delete it in a code way, like using this: ServletContext application =…
msagala25
  • 1,806
  • 2
  • 17
  • 24
1
2