Questions tagged [requestcontext]
93 questions
1
vote
0 answers
Spring boot requestcontextholder with completableFuture.supplyAsync
I am developing an Api using spring boot. I need to call a dependent service asynchronously.
I have an interceptor which uses RequestContextHolder from spring to get the httpservletrequest. But as the calls to dependent service is happening…

ging
- 219
- 7
- 20
1
vote
1 answer
AWS API Gateway - Is there a way to append metadata to the connection session, so it propagates to disconnect when that is triggered?
So I need to build a WebSocket API for my org. The requirements from the business are pretty typical websocket pattern stuff except for one detail:
This websocket api will be used by different teams in our org, and each team needs its own separate…

gspetsnaz
- 41
- 3
1
vote
1 answer
Accessing request context object in rails router
I need to create a few dynamic routes in my rails router in the following way:
Rails.application.routes.draw do
account = Account.find_by(
subdomain: request.subdomain,
domain: request.domain
)
EditableField.where(account_id:…

David Geismar
- 3,152
- 6
- 41
- 80
1
vote
1 answer
Java Spring Request becomes inactive before async method is finished
I have a Java Spring Service with a RestController that calls an async method:
@RestController
public class SomeController {
@Autowired
//this is the service that contains the async-method
OtherService otherService;
@GetMapping
public…

Juliette
- 966
- 16
- 35
1
vote
2 answers
micronaut @RequestScope - not creating bean per incoming http-request
I have a class the following class as RequestScope bean:
@RequestScope
class RequestContext {
private String requestId;
private String traceId;
private String authorisedId;
private String routeName;
// few more fields
@Inject…

Sreerag
- 1,381
- 3
- 11
- 16
1
vote
2 answers
Parse MVC route custom file extension from RequestContext
I have set up two custom extensions to enable MVC in IIS6.
So the site can be accessed with a URL of either something like...
mysite/mycontroller.europe/myaction
or like...
mysite/mycontroller.america/myaction
What is the most robust way of finding…

fearofawhackplanet
- 52,166
- 53
- 160
- 253
1
vote
1 answer
How can I send server-side events from Flask while accessing the request context?
I am trying to use Flask to send a stream of events to a front-end client as documented in this question. This works fine if I don't access anything in the request context, but fails as soon as I do.
Here's an example to demonstrate.
from time…

Kris Harper
- 5,672
- 8
- 51
- 96
1
vote
1 answer
ServiceStack MQ: how to populate data in RequestContext
I'm developing a JWT-based multi-tenancy system using ServiceStack. The JWT token contains shard information, and I use JwtAuthProvider to translate the JWT token to session object following instructions at…

giangnn
- 405
- 1
- 5
- 13
1
vote
1 answer
Accessing RequestContext from with my MembershipProvider
Is there an easier/better way to access the RequestContext from within a custom Membership Provider than the following (and further, will this method even work):
private static RequestContext GetRequestContext()
{
HttpContextBase…

Scott Baker
- 10,013
- 17
- 56
- 102
1
vote
2 answers
does the `context_instance=RequestContext(request)` use cookies in django
when i change the homepage view:
def home(request):
return render_to_response('homepage.html')
to
def home(request):
return render_to_response('homepage.html',context_instance=RequestContext(request))
the user who login my site will always…

zjm1126
- 34,604
- 53
- 121
- 166
1
vote
2 answers
How to execute javascript function which uses the callback parameters on the server/client side?
I use a JSF 2.2, a Primefaces 6.0 and a CDI. One of my page includes a script which has got two javascript functions (one of them create a chart, second of them supply new data to the chart) and a simple form which works as a filter. I've cut my…

Robert
- 762
- 2
- 10
- 23
1
vote
2 answers
Pass variable from bean to primefaces page
Another Primefaces Newbie here.
I want to pass data from a bean to XHTML page for use in javascript. Let me make it clear that the primefaces XHTML page does not have components so a normal binding like "#{bean.property}" is not in my…

Elton
- 23
- 1
- 3
1
vote
1 answer
Accessing HttpServletRequest request in child thread
I have a web application, in which i am using ScheduledThreadPoolExecutor to schedule some logic to be executed later (maybe after original web request is over). Is it possible to access/use HttpServletRequest of original request inside child thread…

Gaurav Singh
- 287
- 6
- 19
1
vote
1 answer
How to setThreadContextInheritable(true) via xml on Spring's dispatcherportlet and dispatcherservlet
I want to make the current request available to child threads without passing on the original request as method parameters through several layers. The application runs both as a servlet and as a portlet.
Normally, DispatcherServlet and…

dschulten
- 2,994
- 1
- 27
- 44
1
vote
2 answers
Accessing variables in setting.py from templates with Django 1.4
I'd like to load the site name in a template using:
{{ SITE_NAME }}
In setting.py I have:
SITE_NAME = "MySite"
and
from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS as TCP
TEMPLATE_CONTEXT_PROCESSORS = TCP + (
…

tompreston
- 630
- 7
- 24