Re: [S2] ExecuteAndWait Interceptor // Only re-submit token parameters on refresh?

2018-04-21 Thread Yasser Zamani


On 4/21/2018 3:05 PM, Martin Gainty wrote:
> i could'nt find it in servlet-api spec?
> 
> https://tomcat.apache.org/tomcat-8.0-doc/servletapi/javax/servlet/http/HttpServletResponse.html
> 
> HttpServletResponse (Servlet 3.1 API Documentation 
> ...
> tomcat.apache.org
> Extends the ServletResponse interface to provide HTTP-specific functionality 
> in sending a response. For example, it has methods to access HTTP headers and 
> cookies. The servlet container creates an HttpServletResponse object and 
> passes it as an argument to the servlet's service methods (doGet, doPost, 
> etc).
> 
> i did find sendLocalRedirect method in ATG Dynamo HttpServletResponse
> https://docs.oracle.com/cd/E23095_01/Platform.93/ATGProgGuide/html/s0803httpservletresponse01.html
> HttpServletResponse - 
> Oracle
> docs.oracle.com
> Set Response Codes. The response code for a request is a numeric value that 
> represents the status of the response. For example, 200 represents a 
> successful response, 404 represents a file not found, and so on.
> 
> 
> 
> 
> i didnt know struts2 supported ATG Dynamo sendLocalRedirect

I found something at [1]. Following is it's copied answer:

"For the redirected request to come back and attach to the same session,
it needs a session ID, usually carried in a JSESSIONID (or another name)
cookie or in the URL as a parameter.

This cookie or URL parameter should be added by the servlet container
and you should not have to add it yourself.

If you do not see the cookie in your browser, and you are not attaching
the JSESSIONID to the URL, then it is creating a new session with each
request, and not attaching to the same session."

Regards.

[1] https://stackoverflow.com/a/13462878/1362623

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: [S2] ExecuteAndWait Interceptor // Only re-submit token parameters on refresh?

2018-04-21 Thread Martin Gainty
Hi Yassir

i could'nt find it in servlet-api spec?

https://tomcat.apache.org/tomcat-8.0-doc/servletapi/javax/servlet/http/HttpServletResponse.html

HttpServletResponse (Servlet 3.1 API Documentation 
...
tomcat.apache.org
Extends the ServletResponse interface to provide HTTP-specific functionality in 
sending a response. For example, it has methods to access HTTP headers and 
cookies. The servlet container creates an HttpServletResponse object and passes 
it as an argument to the servlet's service methods (doGet, doPost, etc).

i did find sendLocalRedirect method in ATG Dynamo HttpServletResponse
https://docs.oracle.com/cd/E23095_01/Platform.93/ATGProgGuide/html/s0803httpservletresponse01.html
HttpServletResponse - 
Oracle
docs.oracle.com
Set Response Codes. The response code for a request is a numeric value that 
represents the status of the response. For example, 200 represents a successful 
response, 404 represents a file not found, and so on.




i didnt know struts2 supported ATG Dynamo sendLocalRedirect

Thanks for the clarification


Regards

Martin Gainty
__




From: Yasser Zamani  on behalf of Yasser Zamani 

Sent: Wednesday, April 18, 2018 2:57 AM
To: user@struts.apache.org
Subject: Re: [S2] ExecuteAndWait Interceptor // Only re-submit token parameters 
on refresh?



On 4/18/2018 1:21 AM, Martin Gainty wrote:
> MG>AFAIK a redirect terminates the old session and creates a new session

I think redirect to same domain:ip in same browser tab page should keep
session.

> MG>a better alternative is to implement ChainingInterceptor with  type="chain"> e.g.

As Struts uses action name for the key of the background process saved
into session, I think chain doesn't work for this requirement.

Regards.

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Re: Struts2 login action class seems to be reused

2018-04-21 Thread Yasser Zamani


On 4/19/2018 4:39 PM, Prasanth Pasala wrote:
> There is a index.jsp which is defined as default page in web.xml it just 
> forwards the request to Login.action. There is no chaining of actions in 
> struts itself. We do have a LoginFilter which verifies
> if a user is logged in.
> 

So maybe there is a bug with chain interceptor! Could you please use
following code in your action setUsername method (save it's log in a
private string field in your action). Then print it when your action
data are not consistent with request params.

String log = "";
ActionInvocation invocation= ActionContext.getActionInvocation();
ValueStack stack = invocation.getStack();
CompoundRoot root = stack.getRoot();
log += "Root Size: " + root.size();
Result result = invocation.getResult();
log += "\r\nResult: " + result;
List list = new ArrayList(root);
list.remove(0);
Collections.reverse(list);
for (Object object : list) {
log += "\r\nObject: " + object;
}
this.log = log; //saves for possible future use

Thanks!