RE: FW: [jira] [Comment Edited] (WW-4815) Migrating Struts 2.3.16.3 to 2.3.32

2017-07-24 Thread Deborah White
It now goes to just a blank page.  Do I have an issue in my web.xml?

struts-prepare

org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter



MYStrutsPrepareFilter
gov.ca.doj.ems.util.MYStrutsPrepareFilter



struts-execute

org.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter


MYStrutsPrepareFilter
/*
FORWARD
REQUEST


-Original Message-
From: Yasser Zamani [mailto:yasser.zam...@live.com]
Sent: Saturday, July 22, 2017 2:18 AM
To: Struts Developers List 
Subject: Re: FW: [jira] [Comment Edited] (WW-4815) Migrating Struts 2.3.16.3 to 
2.3.32

I forgot to say about following block in MYStrutsPrepareFilter.java which is 
new and I added recently (so please copy the whole new
MYStrutsPrepareFilter.java) :

 >  if(null != actionContext) {
 >  ValueStack stack = actionContext.getValueStack();
 >  stack.setValue("#request['MYUtils']", MYUtils);
 >  }

It avoids null pointer exception.

Please reply back to me the `exception stack trace` if you encounter any.

IMPORTANT NOTE:

To keep security, your MYUtils class should return only and only necessary info 
(not less not more) in primitive types like string , boolean , int , etc as 
much as possible rather than sensitive objects.
For example, following get method wake ups currently fixed security issues:

public class MYUtils {...
public ActionContext getActionContext() {
return ActionContext.getContext();
}...}


On 7/22/2017 1:27 PM, Yasser Zamani wrote:
> Sorry! My previous code has sent via my mobile which has a few typo
> errors because of issues with copy/pase :(
>
> Now, at my PC, I tested following configuration which works well :)
>
> 1. MYStrutsPrepareFilter.java
>
> *
> package me.zamani.yasser.ww_convention.utils;
>
> import java.io.IOException;
>
> import javax.servlet.Filter;
> import javax.servlet.FilterChain;
> import javax.servlet.FilterConfig;
> import javax.servlet.ServletException; import
> javax.servlet.ServletRequest; import javax.servlet.ServletResponse;
> import javax.servlet.http.HttpServletRequest;
>
> import org.apache.struts2.StrutsStatics; import
> com.opensymphony.xwork2.ActionContext;
> import com.opensymphony.xwork2.util.ValueStack;
>
> /**
>   * @author zamani
>   *
>   */
> public class MYStrutsPrepareFilter implements Filter {
>
>   private MYUtils MYUtils;
>
>   public void init(FilterConfig filterConfig) throws ServletException {
>   MYUtils = new MYUtils();
>   }
>
>   public void doFilter(ServletRequest req, ServletResponse res,
> FilterChain chain)
>   throws IOException, ServletException {
>
>   ActionContext actionContext = ActionContext.getContext();
>   if(null != actionContext) {
>   ValueStack stack = actionContext.getValueStack();
>   stack.setValue("#request['MYUtils']", MYUtils);
>   }
>
>   chain.doFilter(req, res);
>   }
>
>   public void destroy() {
>   MYUtils = null;
>   }
>
>
>   public class MYUtils {
>   public boolean isUserInRole (String user) {
>   HttpServletRequest httpsr = ((HttpServletRequest)
> ActionContext.getContext()
>   .get(StrutsStatics.HTTP_REQUEST));
>   return httpsr.isUserInRole(user);
>   }
>   }
> }
> **
>
> 2. web.xml
>
> **
>  
>  struts2prepare
>
> org.apache.struts2.dispatcher.filter.StrutsPrepareFilter
>  
>
>  
>  MYStrutsPrepareFilter
>
> me.zamani.yasser.ww_convention.utils.MYStrutsPrepareFilter
>  
>
>  
>  struts2execute
>
> org.apache.struts2.dispatcher.filter.StrutsExecuteFilter
>  
>
>  
>  struts2prepare
>  /*
>  
>
>  
>  MYStrutsPrepareFilter
>  /*
>  
>
>  
>  struts2execute
>  /*
>  
> **
>
> 3. hello.jsp
>
> **
>  
>  you are UserAdmin
>  
>  
>  you are not UserAdmin
>  
> **
>
> Sincerely Yours,
> Yasser.
>
> On 7/22/2017 2:56 AM, Deborah White wrote:
>> And the jsp doesn't seem to like this syntax for some reason.
>>
>> -Original Message-
>> From: Yasser Zamani [mailto:yasser.zam...@live.com]
>> Sent: Friday, July 21, 2017 1:04 PM
>> To: Struts Developers List 
>> Subject: Re: FW: [jira] [Comment Edited] (WW-4815) Migrating Struts
>> 2.3.16.3 to 2.3.32
>>
>> That is just an example. For your need, in more detail, you shoul

Re: FW: [jira] [Comment Edited] (WW-4815) Migrating Struts 2.3.16.3 to 2.3.32

2017-07-24 Thread Yasser Zamani
Yes I think you should have mappings for all as following order:

  
  struts-prepare
  /*
  FORWARD
  REQUEST
  
  
  MYStrutsPrepareFilter
  /*
  FORWARD
  REQUEST
  
  
  struts-execute
  /*
  FORWARD
  REQUEST
  


On 7/24/2017 8:19 PM, Deborah White wrote:
> It now goes to just a blank page.  Do I have an issue in my web.xml?
> 
> struts-prepare
> 
> org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter
> 
>
> 
> MYStrutsPrepareFilter
> gov.ca.doj.ems.util.MYStrutsPrepareFilter
> 
>
> 
> struts-execute
> 
> org.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter
> 
> 
> MYStrutsPrepareFilter
> /*
> FORWARD
> REQUEST
> 
>
> -Original Message-
> From: Yasser Zamani [mailto:yasser.zam...@live.com]
> Sent: Saturday, July 22, 2017 2:18 AM
> To: Struts Developers List 
> Subject: Re: FW: [jira] [Comment Edited] (WW-4815) Migrating Struts 2.3.16.3 
> to 2.3.32
>
> I forgot to say about following block in MYStrutsPrepareFilter.java which is 
> new and I added recently (so please copy the whole new
> MYStrutsPrepareFilter.java) :
>
>  >  if(null != actionContext) {
>  >  ValueStack stack = actionContext.getValueStack();
>  >  stack.setValue("#request['MYUtils']", MYUtils);
>  >  }
>
> It avoids null pointer exception.
>
> Please reply back to me the `exception stack trace` if you encounter any.
>
> IMPORTANT NOTE:
>
> To keep security, your MYUtils class should return only and only necessary 
> info (not less not more) in primitive types like string , boolean , int , etc 
> as much as possible rather than sensitive objects.
> For example, following get method wake ups currently fixed security issues:
>
> public class MYUtils {...
> public ActionContext getActionContext() {
> return ActionContext.getContext();
> }...}
>
>
> On 7/22/2017 1:27 PM, Yasser Zamani wrote:
>> Sorry! My previous code has sent via my mobile which has a few typo
>> errors because of issues with copy/pase :(
>>
>> Now, at my PC, I tested following configuration which works well :)
>>
>> 1. MYStrutsPrepareFilter.java
>>
>> *
>> package me.zamani.yasser.ww_convention.utils;
>>
>> import java.io.IOException;
>>
>> import javax.servlet.Filter;
>> import javax.servlet.FilterChain;
>> import javax.servlet.FilterConfig;
>> import javax.servlet.ServletException; import
>> javax.servlet.ServletRequest; import javax.servlet.ServletResponse;
>> import javax.servlet.http.HttpServletRequest;
>>
>> import org.apache.struts2.StrutsStatics; import
>> com.opensymphony.xwork2.ActionContext;
>> import com.opensymphony.xwork2.util.ValueStack;
>>
>> /**
>>   * @author zamani
>>   *
>>   */
>> public class MYStrutsPrepareFilter implements Filter {
>>
>>   private MYUtils MYUtils;
>>
>>   public void init(FilterConfig filterConfig) throws ServletException {
>>   MYUtils = new MYUtils();
>>   }
>>
>>   public void doFilter(ServletRequest req, ServletResponse res,
>> FilterChain chain)
>>   throws IOException, ServletException {
>>
>>   ActionContext actionContext = ActionContext.getContext();
>>   if(null != actionContext) {
>>   ValueStack stack = actionContext.getValueStack();
>>   stack.setValue("#request['MYUtils']", MYUtils);
>>   }
>>
>>   chain.doFilter(req, res);
>>   }
>>
>>   public void destroy() {
>>   MYUtils = null;
>>   }
>>
>>
>>   public class MYUtils {
>>   public boolean isUserInRole (String user) {
>>   HttpServletRequest httpsr = ((HttpServletRequest)
>> ActionContext.getContext()
>>   .get(StrutsStatics.HTTP_REQUEST));
>>   return httpsr.isUserInRole(user);
>>   }
>>   }
>> }
>> **
>>
>> 2. web.xml
>>
>> **
>>  
>>  struts2prepare
>>
>> org.apache.struts2.dispatcher.filter.StrutsPrepareFilter
>>  
>>
>>  
>>  MYStrutsPrepareFilter
>>
>> me.zamani.yasser.ww_convention.utils.MYStrutsPrepareFilter
>>  
>>
>>  
>>  struts2execute
>>
>> org.apache.struts2.dispatcher.filter.StrutsExecuteFilter
>>  
>>
>>  
>>  struts2prepare
>>  /*
>>  
>>
>>  
>>  MYStrutsPrepareFilter
>>  /*
>>  
>>
>>  
>>  struts2execute
>>  /*
>>  
>> **
>>
>> 3. hello.jsp
>>
>> **
>>  
>>  you are U

[GitHub] struts pull request #150: WW-4819 fixed commons-collections groupId in depen...

2017-07-24 Thread sdutry
GitHub user sdutry opened a pull request:

https://github.com/apache/struts/pull/150

WW-4819 fixed commons-collections groupId in dependency management



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/sdutry/struts WW-4819

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/struts/pull/150.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #150


commit 06c858386760687e276bb5bd310996ad633990a2
Author: Stefaan Dutry 
Date:   2017-07-24T21:19:58Z

WW-4819 fixed commons-collections groupId in dependency management




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] struts issue #150: WW-4819 fixed commons-collections groupId in dependency m...

2017-07-24 Thread lukaszlenart
Github user lukaszlenart commented on the issue:

https://github.com/apache/struts/pull/150
  
👍 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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



[GitHub] struts pull request #150: WW-4819 fixed commons-collections groupId in depen...

2017-07-24 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/struts/pull/150


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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