zoukankan      html  css  js  c++  java
  • javax.servlet.jsp.JspException: No getter method for property

    javax.servlet.jsp.JspException: No getter method for property getAvailableAddres
    sRequest.resellerId of bean org.apache.struts.taglib.html.BEAN
        at org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:968)
    

    struts-config.xml:

    <form-beans>
            <form-bean name="getAvailableAddress" type="com.wisor.talktalk.model.GetAvailableAddress" />
            <form-bean name="provideRequest" type="com.wisor.talktalk.common.talktalkbean.RequestActionForm" />
        </form-beans>
    
        <action-mappings>
            <action path="/ttTestJsp" type="com.wisor.talktalk.controller.TestJsp" 
                name="getAvailableAddress" 
                scope="session" 
                validate="false" 
                unknown="false">
                <forward name="init" path="/WEB-INF/talk/preorderView/getAvailableAddress.jsp"/>
            </action>
        </action-mappings>
    

    JSP Page:

    <html:form action="/ttTestJsp.do?task=getResponse" styleClass="form">
            <fieldset>
                <label class="inline label" for="reseller_id"><fmt:message
                        key="label.field.resellerId" />:</label>
                <html:text
                    property="getAvailableAddressRequest.resellerId"
                    styleClass="mandatory" readonly="readonly"></html:text>
            </fieldset>
        <html:submit value="GetAddress"/>
        </html:form>
    

    FormBean Main:

        public class GetAvailableAddress extends ActionForm{
        private GetAvailableAddressRequest getAvailableAddressRequest;
    
        public void intilize(){
            getAvailableAddressRequest = new GetAvailableAddressRequest();
        }
    
    
        public GetAvailableAddressRequest getGetAvailableAddressRequest(){
            return this.getAvailableAddressRequest;
        }
        public void setGetAvailableAddressRequest(GetAvailableAddressRequest getAvailableAddressRequest){
            this.getAvailableAddressRequest = getAvailableAddressRequest;
        }
    }
    
    child Form Bean:
    
        public class GetAvailableAddressRequest implements Serializable{
    
    
        private String resellerId;
        public String getResellerID(){
            return this.resellerId;
        }
        public void setResellerID(String resellerId){
            this.resellerId = resellerId;
        }
         }
    

    Action Class:

    public class TestJsp extends Action {
    Logger logger = Logger.getLogger(this.getClass());
    @Override
    public ActionForward execute( ActionMapping map, ActionForm actionForm,
            HttpServletRequest request, HttpServletResponse response) throws Exception{
    ActionForward forward = null;
            GetAvailableAddress form = (GetAvailableAddress) actionForm;
    form.intilize();
    forward = map.findForward("init");
            return forward;
    }}
    
  • 相关阅读:
    python3与Excel的完美结合
    Python3连接MySQL
    Jmeter用BeanShell Sampler调用java写的jar包进行MD5加密
    Jmeter 接口测试之MD5加密函数(函数助手篇)
    ubuntu16.04安装python3
    解释Crypto模块怎么就这么"皮"?No module named "Crypto"
    python3 django 安装
    未授权访问的缺陷原理的一种可能性
    一篇RPO漏洞挖掘文章翻译加深理解。
    漏洞挖掘技巧之利用javascript:
  • 原文地址:https://www.cnblogs.com/zhuzhuxuan/p/5560209.html
Copyright © 2011-2022 走看看