Thanks Niall,<html:errors property="logstime"/> works well. But I find another question,first look at my application.properties file: errors.footer= errors.header= errors.abc.required=This is a test
In my jsp,use follows statement <html:text property="abc" /><html:errors name="abc"/> If errors is not empty,it will should the error message "This is a test" My question is when I run it,it can show the error message "This is a test",but the message is not showing in the line with the same line of <html:text property="abc" />,I guess the reason is <html:errors name="abc"/> shows not only errors.abc,but shows errors.header and errors.footer,so the <html:text property="abc" /> and <html:errors name="abc"/> will not show in the same line,if I delete errors.footer and errors.header from application.properties, application.properties only contain a single line,like follows errors.abc.required=This is a test When I run <html:text property="abc" /><html:errors name="abc"/>,it will show: the content of <html:text property="abc"> null This is a test null How to make the show of <html:errors name="abc"/> is in the same line of the show of <html:text property="abc" /> and only show <html:errors name="abc"/> without errors.header and errors.footer? Thanks in advance On 2/24/06, Niall Pemberton <[EMAIL PROTECTED]> wrote: > > You should be using the "property" attribute (as you had in your first > post) > to do what you want... > > > http://www.niallp.pwp.blueyonder.co.uk/HelpTagsErrorsAndMessages.html#section5 > > ...not the "name" attribute - that does a different job... > > > http://www.niallp.pwp.blueyonder.co.uk/HelpTagsErrorsAndMessages.html#section4 > > In your first post you indicated that you were using the old (pre 1.0) > struts-form.tld. > > <%@ taglib uri="/WEB-INF/struts-form.tld" prefix="html" %> > > ... change that to use the html taglib tld: > > <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %> > > then there shouldn't be any problem with the "property" attribute. If > you're > using a pre 1.0 version of struts I highly recommend you upgrade. > > Niall > > ----- Original Message ----- > From: "red phoenix" <[EMAIL PROTECTED]> > Sent: Friday, February 24, 2006 12:46 AM > > > I changed following code > if ((abc != null) && (abc.length() > 10)) > > > but when the content of text abc is '123',it's length isn't equals 10,so > it > should raise error,but it don't show any error! > If I use <html:errors/> instead of <html:errors name="abc"/>,I can get > right > value. Why <html:errors> works well,and <html:errors name="abc"/> don't > work. I am puzzled with it. > > > On 2/23/06, Dave Newton <[EMAIL PROTECTED]> wrote: > > > > red phoenix wrote: > > > I modify my code,like follows,this time it don't show any error,but > when > > the > > > content of text abc is '123',it's length isn't equals 10,so it should > > raise > > > error,but it don't show any error! Why? > > > > > Most likely because in your code you check to see if its length is > > greater than 10. > > >> if ((abc != null) && (abc.length() > 0)) { > > >> > > I could be wrong. > > > > Dave > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >