Return-Path: X-Original-To: apmail-struts-issues-archive@minotaur.apache.org Delivered-To: apmail-struts-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B498410946 for ; Wed, 25 Sep 2013 06:12:18 +0000 (UTC) Received: (qmail 32364 invoked by uid 500); 25 Sep 2013 06:12:17 -0000 Delivered-To: apmail-struts-issues-archive@struts.apache.org Received: (qmail 32289 invoked by uid 500); 25 Sep 2013 06:12:10 -0000 Mailing-List: contact issues-help@struts.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@struts.apache.org Delivered-To: mailing list issues@struts.apache.org Received: (qmail 32277 invoked by uid 99); 25 Sep 2013 06:12:04 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Sep 2013 06:12:04 +0000 Date: Wed, 25 Sep 2013 06:12:04 +0000 (UTC) From: "Lukasz Lenart (JIRA)" To: issues@struts.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (WW-4194) Using findValue() for value stack to retrieve component parameters always returns not-null object for any parameter name MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/WW-4194?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13777188#comment-13777188 ] Lukasz Lenart commented on WW-4194: ----------------------------------- I have got that: {{NULL NOT NULL}} - on Jetty > Using findValue() for value stack to retrieve component parameters always returns not-null object for any parameter name > ------------------------------------------------------------------------------------------------------------------------ > > Key: WW-4194 > URL: https://issues.apache.org/jira/browse/WW-4194 > Project: Struts 2 > Issue Type: Bug > Affects Versions: 2.3.15.1 > Reporter: Sergey Tychina > Assignee: Bruce Phillips > Fix For: 2.3.17 > > Attachments: Component_Tag_Struts2_Mvn.zip > > > Calling valueStack.findValue("parameter.ANY_STRING") in a component returns not-null value even if there were no parameters passed to the component. > Example: > {code:title=TestAction.java|borderStyle=solid} > import com.opensymphony.xwork2.ActionSupport; > import org.apache.struts2.interceptor.ServletRequestAware; > import javax.servlet.http.HttpServletRequest; > /** > * @author Sergey Tychina > */ > public class TestAction extends ActionSupport implements ServletRequestAware { > private HttpServletRequest request; > public String execute() { > return SUCCESS; > } > @Override > public void setServletRequest(HttpServletRequest request) { > this.request = request; > } > } > {code} > {code:title=testaction.jsp (mapped for success result for the TestAction)|borderStyle=solid} > <%@ taglib prefix="s" uri="/struts-tags" %> > > > > {code} > {code:title=testcomponent.jsp|borderStyle=solid} > <%@ page import="com.opensymphony.xwork2.util.ValueStack" %> > <%@ page import="org.apache.struts2.ServletActionContext" %> > <% > ValueStack valueStack = (ValueStack) request.getAttribute(ServletActionContext.STRUTS_VALUESTACK_KEY); > Object foundValue = valueStack.findValue("parameters.ANY_PARAM_NAME"); > %> > <%=foundValue == null ? "NULL" : "NOT NULL"%> > {code} > This component will always print "NOT NULL" to the screen. > Thanks, > Sergey. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira