pt., 10 gru 2021 o 16:37 Krishnaraj Viswanathan <krishnaraj.viswanat...@oracle.com> napisał(a): > > Hi, > I am migrating a big project from Struts1 to Struts2. In our struts1 > project, we have extended and customised the > org.apache.struts.taglib.html.FormTag. > > Did some search and found that the > org.apache.struts2.views.jsp.ui.FormTag is the equivalent in Struts2. > > My current Struts 1 code modifies the onsubmit variable of the > FormTag by calling the setOnsubmit(), but it does that by doing a > getOnsubmit() like below. > > if (this.getOnsubmit() == null) { > this.setOnsubmit(subCmd + subCmdEnd); > } > else { > this.setOnsubmit(subCmd + this.getOnsubmit() + subCmdEnd); > } > > The Struts 2 class has the setOnsubmit(), but not the getOnsubmit(). Do we > have any other option available to read the onsubmit value?
As far as I see, onsubmit field has a protected scope so you can access the field directly. Yet, I would consider changing/extending a Freemarker template used to generate <s:form> instead - this is a proper approach in Struts 2 than playing with fields. Regards -- Łukasz + 48 606 323 122 http://www.lenart.org.pl/ --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org