[GitHub] struts issue #125: Immutable context
Github user asfgit commented on the issue: https://github.com/apache/struts/pull/125 Can one of the admins verify this patch? --- 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 #125: Immutable context
Github user yasserzamani commented on the issue: https://github.com/apache/struts/pull/125 @aleksandr-m , not me but my workmate has used it as an ID for each jsp. I do not know his work details but in general, he then uses this ID to decide where he should place the result after an AJAX call. For example a parent jsp that have div1, div2 and div3 calls an AJAX then if result was from '/APP/jsp/customer/error.jsp' the it puts the result in div3, if result was from '/APP/jsp/customer/payment.jsp' the it puts the result in div1, if result was from '/APP/jsp/customer/free.jsp' the it puts the result in div2. --- 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 #125: Immutable context
Github user aleksandr-m commented on the issue: https://github.com/apache/struts/pull/125 Spoted same `#context['com.opensymphony.xwork2.dispatcher.HttpServletRequest']` expression [here](https://stackoverflow.com/q/44291034/1700321). @yasserzamani What do you use it for? --- 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 #125: Immutable context
Github user yasserzamani commented on the issue: https://github.com/apache/struts/pull/125 Below is my new design which may be helpful as an example for whom is affected. Those are about access to `%{#context['com.opensymphony.xwork2.dispatcher.HttpServletRequest'].requestURI}`. I wrote following Filter which operates after struts-prepare but before struts-execute. It supplies an utility into request scope: ``` package 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; @Override public void init(FilterConfig filterConfig) throws ServletException { MYUtils = new MYUtils(); } @Override public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException { ValueStack stack = ActionContext.getContext().getValueStack(); stack.setValue("#request['MYUtils']", MYUtils); chain.doFilter(req, res); } @Override public void destroy() { MYUtils = null; } public class MYUtils { public String getRequestURI() { HttpServletRequest httpsr = ((HttpServletRequest) ActionContext.getContext() .get(StrutsStatics.HTTP_REQUEST)); return httpsr.getRequestURI(); } } } ``` Then `"#request['MYUtils'].requestURI"` can be used in jsp, instead. --- 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 #125: Immutable context
Github user cnenning commented on the issue: https://github.com/apache/struts/pull/125 Sounds like a very good idea! A short check showed that my apps are not affected ð --- 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