stateless

EJB3 Stateless Bean is always null in REST-WebService (Glassfish3, EJB3, Stateless Bean,)

断了今生、忘了曾经 提交于 2019-12-24 05:58:53
问题 I hope you can help me with this: I have a WebProject created with Eclipse as a dynamic web project, running on a Glassfish3 Server. I’m using EJB 3.0 to create a stateless Façade(@stateless Annotation) that implements my business logic: @Stateless public class Facade { public void test(){ System.out.println("test hat geklappt!!"); } } Additionally I’m using a RESTRessource to offer my REST WS that uses my EJB with (@EJB Annotation) the business logic: @RequestScoped @Path("/prescriptions")

Is there a way using ASP.NET to always run some server side code when a user leaves a page?

流过昼夜 提交于 2019-12-24 03:10:55
问题 I was wondering if there is any way to always run some server side code when a user leaves a page in ASP.NET. The page Unload event is no good because that doesn't get called if someone clicks on a link. Ideally I'd also like the code to run even if the user closes the browser. I suspect what I'm asking isn't possible, but it doesn't hurt to ask 回答1: Problem is, HTTP is a stateless protocol, so when the page has finished being served, you wont know if the user is still on the page or not. The

How to make stateless web applications? Especially with Spring MVC?

不羁岁月 提交于 2019-12-21 21:56:51
问题 The stateless web application seems promising. How to make one? Especially with Spring WebMvc? Any guidelines? Here are a few things on my mind: Avoid creating session Use a centralized storage for state info and share that among web application instances. ADD 1 I think it is not a question of whether to keep state info or not. State info is always necessary if you want to do something useful. It is actually a question where/how to keep the state info. This article is useful. It mentioned in

Differences : @SessionScoped vs @Stateful and @ApplicationScoped vs @Singleton [closed]

梦想与她 提交于 2019-12-18 13:08:31
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 3 years ago . I would like to know, what are the principal differences between : javax.enterprise.context.SessionScoped and javax.ejb.Stateful javax.enterprise.context.ApplicationScoped and javax.ejb.Singleton I know that a @SessionScoped and a @Stateful allows to create a new instance for each

thread safe, stateless design using Spring

对着背影说爱祢 提交于 2019-12-18 11:43:19
问题 I have assumed that if instance variables are managed by spring IOC, and are singletons that the desgin can be called stateless and threadsafe.This type of desgin could consequently be scaled to clustered servers. Am I correct in my assumptions,outlined below ? @Repository("myDao") public class MyDao implements Dao { @Autowired private JdbcTemplate jdbcTemplate; @Value("${sqlFoo}") private String foo; @Override public Integer getMyInt(String str) { return jdbcTemplate.queryForInt(foo, str); }

How do I make my Web Application stateless yet still do something useful?

给你一囗甜甜゛ 提交于 2019-12-17 18:38:03
问题 I've seen this advice... ideally the web should follow the REST principle and be completely stateless. Therefore a single URL should identify a single resource, without having to keep the navigation history of each user. ...and I read the Wikipedia page http://en.wikipedia.org/wiki/REST and it really sounds good, but I don't get how to actually implement it. I'm working in ASP .NET Webforms NOT MVC. For example, in the application I am about to build - I need my user to Login before I allow

How to get user info directly at JPA level in rest api

最后都变了- 提交于 2019-12-13 03:57:17
问题 I am using REST api with JPA, and getting the user information in the header section . For audit purpose need to save the user detail with each request. How to directly get the user info at JPA level (@Prepersist and @PreUpdate hooks) from rest header. I don't want to pass the details though service layer Is there any generic way to do it ? Note-I am not using spring. Thanks in advance. 回答1: I had the similar problem with spring framework. Following idea may help you. Create AppContext using

EJB stateless - Private members initialisation

牧云@^-^@ 提交于 2019-12-12 17:04:45
问题 I'm new to EJB and I'm facing my first problem. I'm trying to use an @Schedule method contained in a Stateless EJB. I'd like this method to use a private member variable which would be set at bean creation: Here's a short example: @Singleton @LocalBean @Startup public class Starter { @PostActivate private void postActivate() { ScheduleEJB scheduleEjb = new ScheduleEJB("Hello"); } } And the schedule bean: @Stateless @LocalBean public class ScheduleEJB { private String message; public

Optimized http service invocation with in azure service fabric

不羁岁月 提交于 2019-12-12 03:39:10
问题 I have 2 applications (A1 and A2) hosted in azure service fabric, each application with its own stateless reliable micro-service (S1 and S2). The app A1 depends on S1 and app A2 depends on S2. In addition, S2 service depends on S1. Both S2 and S1 are owin hosted REST api services. When the request for A2 ends up in S2, I need to make a call from S2 to S1. I am trying to figure out the optimized way of doing this. 1) Should I use HttpClient in S2 to call S1? How do I get the resolution for S1

Why is using jhipster oauth2 stateful, and how to implement it?

最后都变了- 提交于 2019-12-11 17:59:08
问题 Using Jhipster (monolith, oauth2, with registry) forces our users to log-in every once in a while. After searching a bit, we assume that it's because we have multiple instances of our monolith and sometimes the users get routed to different instances. So I have 2 questions: Why does Jhipster implement oauth2 in a stateful way? How should we handle this, assuming we're staying with the current configuration? 来源: https://stackoverflow.com/questions/54169816/why-is-using-jhipster-oauth2-stateful