can you change the bean id to something different than the property name.
and check again.


Regards,
---------------------------------------------------------
Girish Naik
Mobile:-+91-09740091638
girish.n...@gmail.com
Henny Youngman<http://www.brainyquote.com/quotes/authors/h/henny_youngman.html>
- "I told the doctor I broke my leg in two places. He told me to quit
going
to those places."

On Sun, Jun 21, 2009 at 10:24 AM, Sam Wun <swun2...@gmail.com> wrote:

> Opps. I commented out the taglibs in a jsp file.
> Added back in, now got antoehr problem with the getters:
>
> 14:48:04,429 ERROR [PortletRequestDispatcherImpl:316]
> org.apache.jasper.JasperException: javax.servlet.ServletException:
> javax.servlet.jsp.JspException: No getter method for property: "ship
> ping_address" of bean: "OrderForm"
> org.apache.jasper.JasperException: javax.servlet.ServletException:
> javax.servlet.jsp.JspException: No getter method for property:
> "shipping_address" of bean: "OrderForm"
>        at
> org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:522)
>        at
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:398)
>        at
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
>        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
>        at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>
> I have the getters/setters in this java file.
> Here are the relevant files:
>
> 1/ order.jsp:
> <%@ include file="/html/portlet/onlinepayment_portlet/init.jsp" %>
>
> <bean:define id="shipping_address" name="OrderForm"
> property="shipping_address" type="java.lang.String" />
>
> <logic:messagesPresent>
>        <span class="es-error">
>        <bean:message key="error.shipping_address.invalid"/>
>        </span>
> </logic:messagesPresent>
>
> <!--
> <p align=right>
>   <a href="<portlet:renderURL portletMode="help" />">Help</a>
> </p>
> -->
> <p align=centre>
> <html:form action="/onlinepayment_portlet/order" method="post"
> focus="shipping_address">
>
> <table class="stats">
> <tr>
>   <th><bean:message key="form.shipping_address"/></th>
>  <th><html:text name="OrderForm" property="shipping_address" size="50"
> /></th>
> <tr>
>  <th><bean:message key="form.billilng_address"/></th>
>    <th><html:text name="OrderForm" property="billing_address" size="50"
> /></th>
> </tr>
> <tr>
>  <th><bean:message key="form.email_address"/></th>
>     <th><html:text name="OrderForm" property="email_address" size="50"
> /></th>
> </tr>
> <tr valign=top>
>  <th><bean:message key="form.firstname"/></th>
>     <th><html:textarea name="OrderForm" property="firstname"
> rows="12" cols="50" /></th>
> </tr>
> <tr valign=top>
>  <th><bean:message key="form.lastname"/></th>
>     <th><html:textarea name="OrderForm" property="lastname" rows="12"
> cols="50" /></th>
> </tr>
>
> </table>
> </p>
>
> <p align=left>
>   <html:submit><bean:message key="button.submit"/></html:submit>
>   </html:form>
> </p>
>
> 2/ OrderForm.java:
> package com.ip6networks.onlinepayment.portlet;
>
> import javax.servlet.http.HttpServletRequest;
>
> import org.apache.struts.action.ActionErrors;
> import org.apache.struts.action.ActionForm;
> import org.apache.struts.action.ActionMapping;
> import org.apache.struts.action.ActionMessage;
>
> /**
>  * Search query entry form.
>  *
>  * @struts.form name="OrderForm"
>  */
> public class OrderForm extends ActionForm{
>    private String firstname="";
>    private String lastname="";
>    private String email_address="";
>    private String phone_number="";
>    private String shipping_address="";
>    private String billing_address="";
>    /**
>     * Sets the query attribute of the OrderForm object
>     *
>     * @struts.validator type="required" msgkey="error.firstname.required"
>     * @struts.validator type="required" msgkey="error.lastname.required"
>     * @struts.validator type="required"
> msgkey="error.email_address.required"
>     * @struts.validator type="required"
> msgkey="error.phone_number.required"
>     * @struts.validator type="required"
> msgkey="error.shipping_address.required"
>     * @struts.validator type="required"
> msgkey="error.billing_address.required"
>     */
>    public void setFirstName(String fn){
>        this.firstname = fn;
>    }
>    public String getFirstName(){
>        return this.firstname;
>    }
>    public void setLastName(String ln){
>        this.lastname = ln;
>    }
>    public String getLastName(){
>        return this.lastname;
>    }
>    public void setEmailAddress(String email){
>        this.email_address = email;
>    }
>    public String getEmailAddress(){
>        return this.email_address;
>    }
>    public void setShippingAddress(String shipping) {
>        this.shipping_address = shipping;
>    }
>    public String getShippingAddress(){
>        return this.shipping_address;
>    }
>    public void setBillingAddress(String billing) {
>        this.billing_address = billing;
>    }
>    public String getBillingAddress(){
>        return this.billing_address;
>    }
>    public void setPhoneNumber(String ph) {
>        this.phone_number = ph;
>    }
>    public String getPhoneNumber(){
>        return this.phone_number;
>    }
>
>    public void reset(ActionMapping mapping, HttpServletRequest req) {
>        this.firstname="";
>        this.lastname="";
>        this.phone_number="";
>        this.email_address="";
>        this.shipping_address="";
>        this.billing_address="";
>    }
>
> ...
> }
>
> I have already defined a set of getters/setters methods, I don't
> understand why it still complained.
> Is a problem in my path setting, thus it can't find my OrderForm.class?
>
> Thanks
>
> On Sun, Jun 21, 2009 at 6:13 AM, Dave Newton<newton.d...@yahoo.com> wrote:
> > Did you un-comment the taglib directives?
> >
> > Sam Wun wrote:
> >>
> >> Hi,
> >>
> >> Thanks for the instruction. It works after removed the struts-bean
> >> lines in web.xml and the lines in jsp files.
> >> But now I can't display message from the struts tags as shown below:
> >> The message "This is Order page!!" is shown in my portlet page, the
> >> rest of struts tagged message are not shown.
> >>
> >> in order.jsp file:
> >>
> >> <%@ include file="/html/portlet/onlinepayment_portlet/init.jsp" %>
> >>
> >> <bean:define id="shipping_address" name="OrderForm"
> >> property="shipping_address" type="java.lang.String" />
> >>
> >> <logic:messagesPresent>
> >>        <span class="es-error">
> >>        <bean:message key="error.shipping_address.invalid"/>
> >>        </span>
> >> </logic:messagesPresent>
> >>
> >> <!--
> >> <p align=right>
> >>   <a href="<portlet:renderURL portletMode="help" />">Help</a>
> >> </p>
> >> -->
> >> <p align=centre>
> >> <html:form action="/onlinepayment_portlet/order" method="post"
> >> focus="shipping_address">
> >>
> >> <table class="stats">
> >> <tr>
> >>  <th><p>This is Order page!!</p></th>
> >>  <th><bean:message key="form.shipping_address"/></th>
> >>  <th><html:text name="OrderForm" property="shipping_address" size="50"
> >> /></th>
> >> <tr>
> >>  <th><bean:message key="form.billilng_address"/></th>
> >>    <th><html:text name="OrderForm" property="billing_address" size="50"
> >> /></th>
> >> </tr>
> >> <tr>
> >>  <th><bean:message key="form.email_address"/></th>
> >>     <th><html:text name="OrderForm" property="email_address" size="50"
> >> /></th>
> >> </tr>
> >> <tr valign=top>
> >>  <th><bean:message key="form.firstname"/></th>
> >>     <th><html:textarea name="OrderForm" property="firstname"
> >> rows="12" cols="50" /></th>
> >> </tr>
> >> <tr valign=top>
> >>  <th><bean:message key="form.lastname"/></th>
> >>     <th><html:textarea name="OrderForm" property="lastname" rows="12"
> >> cols="50" /></th>
> >> </tr>
> >>
> >> </table>
> >> </p>
> >>
> >> <p align=left>
> >>   <html:submit><bean:message key="button.submit"/></html:submit>
> >>   </html:form>
> >> </p>
> >>
> >> In the path of
> >>
> /usr/liferay-portal-5.2.3/tomcat-6.0.18/webapps/online-payment-5.2.3.1/WEB-INF/classes/resource:
> >> I have a file application.properties:
> >> ##
> >> ## Custom errors
> >> ##
> >> error.shipping_address.invalid=Shipping address is required.
> >> error.name.required=Please enter your name.
> >> error.name.invalid=Invalid input in Name field.
> >> error.emailaddr.required=Please enter your email address.
> >> error.emailaddr.invalid=Invalid input for email address.
> >> error.comment.required=Please enter your inquiry.
> >> error.comment.invalid=Please fill in all fields. Email field must be a
> >> valid email address.
> >>
> >> ##
> >> ## Custom labels and Messages
> >> ##
> >> form.firstname=First Name *
> >> form.lastname=Lasat Name *
> >> form.shipping_address=Shipping Address *
> >> form.billing_address=Billing Address *
> >> form.email_address=Email Address*
> >> button.submit=Submit
> >>
> >> These messages are supposed mapped into the order.jsp file in run
> >> time. But nothing is shown on the webpage at the moment, except the
> >> message in <p></p> html tags.
> >>
> >> That has happened here? Any idea?
> >>
> >> Thanks again.
> >>
> >>
> >>
> >> On Sun, Jun 21, 2009 at 2:44 AM, Girish Naik<girish.n...@gmail.com>
> wrote:
> >>>
> >>> as you dont have the files in WEB-INF can you remove the mapping in
> >>> web.xml
> >>> and run again?
> >>>
> >>>
> >>> Regards,
> >>> ---------------------------------------------------------
> >>> Girish Naik
> >>> Mobile:-+91-09740091638
> >>> girish.n...@gmail.com
> >>> George
> >>> Carlin<http://www.brainyquote.com/quotes/authors/g/george_carlin.html>
> >>> - "Electricity is really just organized lightning."
> >>>
> >>> On Sat, Jun 20, 2009 at 8:57 PM, Sam Wun <swun2...@gmail.com> wrote:
> >>>
> >>>> thanks for the response.
> >>>> I moved the following taglib lines into the /** ***/ area in the jsp
> >>>> file, and the recompile/deploy with ant. It still give me the same
> >>>> errors.
> >>>>
> >>>> Here is the jsp file load the tld files:
> >>>> <%
> >>>> /**
> >>>> <%@ taglib uri="http://java.sun.com/portlet_2_0"; prefix="portlet" %>
> >>>> <%@ taglib uri="http://struts.apache.org/tags-bean"; prefix="bean" %>
> >>>> <%@ taglib uri="http://struts.apache.org/tags-html"; prefix="html" %>
> >>>> <%@ taglib uri="http://struts.apache.org/tags-logic"; prefix="logic"
> %>
> >>>>  */
> >>>> %>
> >>>>
> >>>> <%@ page import="javax.portlet.PortletRequest" %>
> >>>> <%@ page import="javax.portlet.PortletSession" %>
> >>>>
> >>>> <portlet:defineObjects />
> >>>>
> >>>> <style type="text/css">
> >>>>  <%@ include file="/css/style.css" %>
> >>>> </style>
> >>>>
> >>>>
> >>>> here is the errors again:
> >>>> 01:23:47,290 INFO  [PluginPackageUtil:1347] Checking for available
> >>>> updates
> >>>> 01:23:47,293 INFO  [PluginPackageUtil:1391] Finished checking for
> >>>> available updates in 3 ms
> >>>> 01:23:54,476 ERROR [PortletRequestDispatcherImpl:316]
> >>>> org.apache.jasper.JasperException:
> >>>> /html/portlet/onlinepayment_portlet/order.jsp(1,1) File
> >>>> "/WEB-INF/tld/struts-bean.tld" not found
> >>>> org.apache.jasper.JasperException:
> >>>> /html/portlet/onlinepayment_portlet/order.jsp(1,1) File
> >>>> "/WEB-INF/tld/struts-bean.tld" not found
> >>>>       at
> >>>>
> >>>>
> org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
> >>>>       at
> >>>>
> >>>>
> org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
> >>>>        at
> >>>>
> >>>>
> org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:88)
> >>>>       at
> >>>>
> >>>>
> org.apache.jasper.compiler.Parser.processIncludeDirective(Parser.java:345)
> >>>>       at
> >>>>
> org.apache.jasper.compiler.Parser.parseIncludeDirective(Parser.java:378)
> >>>>       at
> >>>> org.apache.jasper.compiler.Parser.parseDirective(Parser.java:486)
> >>>>       at
> >>>> org.apache.jasper.compiler.Parser.parseElements(Parser.java:1444)
> >>>>
> >>>>
> >>>>
> >>>> On Sun, Jun 21, 2009 at 1:10 AM, Girish Naik<girish.n...@gmail.com>
> >>>> wrote:
> >>>>>
> >>>>> I would sugest you to remove the taglib configuration in ur web.xml.
> As
> >>>>
> >>>> it
> >>>>>
> >>>>> is matching the uri and trying to load from the local file.
> >>>>>
> >>>>> In my previous application i had given :
> >>>>> <%@ taglib uri="http://struts.apache.org/tags-bean"; prefix="bean" %>
> >>>>>
> >>>>> in my jsp header and
> >>>>> <taglib>
> >>>>>       <taglib-uri>/tags/struts-bean</taglib-uri>
> >>>>>       <taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
> >>>>>   </taglib>
> >>>>> in web.xml
> >>>>> And they are working fine.
> >>>>>
> >>>>> So either you can give :
> >>>>> <%@ taglib uri="http://struts.apache.org/tags-bean"; prefix="bean" %>
> >>>>>
> >>>>>  or (if u have a local tag lib)
> >>>>>
> >>>>> <%@ taglib uri="/tags/struts-bean" prefix="bean" %>
> >>>>>
> >>>>>
> >>>>> Regards,
> >>>>> ---------------------------------------------------------
> >>>>> Girish Naik
> >>>>> Mobile:-+91-09740091638
> >>>>> girish.n...@gmail.com
> >>>>> Fran Lebowitz<
> >>>>
> >>>> http://www.brainyquote.com/quotes/authors/f/fran_lebowitz.html>
> >>>>>
> >>>>> - "Life is something to do when you can't get to sleep."
> >>>>>
> >>>>> On Sat, Jun 20, 2009 at 7:42 PM, Sam Wun <swun2...@gmail.com> wrote:
> >>>>>
> >>>>>> Dear all,
> >>>>>>
> >>>>>> Can anyone tell me what is wrong with the following errors:
> >>>>>>
> >>>>>> ....
> >>>>>>
> >>>>>> 00:05:59,378 ERROR [PortletRequestDispatcherImpl:316]
> >>>>>> org.apache.jasper.JasperException:
> >>>>>> /html/portlet/onlinepayment_portlet/order.jsp(1,1) File
> >>>>>> "/WEB-INF/tld/struts-bean.tld" not found
> >>>>>> org.apache.jasper.JasperException:
> >>>>>> /html/portlet/onlinepayment_portlet/order.jsp(1,1) File
> >>>>>> "/WEB-INF/tld/struts-bean.tld" not found
> >>>>>>       at
> >>>>>>
> >>>>
> >>>>
> org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
> >>>>>>
> >>>>>>       at
> >>>>>>
> >>>>
> >>>>
> org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
> >>>>>>
> >>>>>> ...
> >>>>>>
> >>>>>> I have already defined tag-libs in my web.xml file:
> >>>>>>       <taglib>
> >>>>>>               <taglib-uri>http://struts.apache.org/tags-bean
> >>>>
> >>>> </taglib-uri>
> >>>>>>
> >>>>>>  <taglib-location>/WEB-INF/tld/struts-bean.tld</taglib-location>
> >>>>>>       </taglib>
> >>>>>>
> >>>>>> of course struts-bean.tld is not in my WEB-INF/tld directory, but I
> >>>>>> expect it will pick up the file from the lib path like the other
> >>>>>> sample does.
> >>>>>> I am sure most of you don't have this file in your project
> directory.
> >>>>>>
> >>>>>> This is the init.jsp file that is included in the order.jsp file:
> >>>>>>
> >>>>>> <%@ taglib uri="http://java.sun.com/portlet_2_0"; prefix="portlet"
> %>
> >>>>>> <%@ taglib uri="http://struts.apache.org/tags-bean"; prefix="bean"
> %>
> >>>>>> <%@ taglib uri="http://struts.apache.org/tags-html"; prefix="html"
> %>
> >>>>>> <%@ taglib uri="http://struts.apache.org/tags-logic"; prefix="logic"
> %>
> >>>>>>
> >>>>>> <%@ page import="javax.portlet.PortletRequest" %>
> >>>>>> <%@ page import="javax.portlet.PortletSession" %>
> >>>>>>
> >>>>>>
> >>>>>> Any idea?
> >>>>>> Your help is very much appreciated.
> >>>>>> Thanks
> >>>>>>
> >>>>>>
> ---------------------------------------------------------------------
> >>>>>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> >>>>>> For additional commands, e-mail: user-h...@struts.apache.org
> >>>>>>
> >>>>>>
> >>>> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> >>>> For additional commands, e-mail: user-h...@struts.apache.org
> >>>>
> >>>>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> >> For additional commands, e-mail: user-h...@struts.apache.org
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> > For additional commands, e-mail: user-h...@struts.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

Reply via email to