Suppose I have a static method in a class like so:
public static String getSomething(HttpServletRequest request)
Which, in the method, calls request.getHeader("headerName") and request.getParameter("parameterName").
Also, In a Struts 2 Action , I make a call to this function within execute():
private String theString;
public String execute() throws Exception {
theString = TheClass.getSomething(ServletActionContext.getRequest());
....
....
}
Assuming I make no modifications to the request objection in my static getSomething(request) function, is this thread safe? I'm guessing yes, since from what I understand the HttpServletRequest object in an action is thread local, but I'm not 100% sure.