Re: Weird form! No data to action but all seems ok. Others work!
Thanks, David. This solve the problem. Do you help me a lot. Thanks. Em Thursday 23 October 2003 22:53, Karr, David escreveu: > It might be your property names. They appear to begin with multiple > uppercase letters. Try changing them to begin with at least two lowercase > letters, and make your setters/getters uppercase the first character of the > property name part. > > -Original Message- > From: Jim Bruno Goldberg [mailto:[EMAIL PROTECTED] > Sent: Thursday, October 23, 2003 3:18 AM > To: [EMAIL PROTECTED] > Subject: Weird form! No data to action but all seems ok. Others work! > > > > Hi, All! > > I am having some kind of weird problem. > I have 54738276256347 jsp forms working ok, but one is not woirking. This > "not working form" is just like the others, I revised that 324 times > But it does not work and the others work. :((( > I am expend 2 days now trying to determine the problem, but unsucessfull. > > :(( > > I discover somethings: > - The form object is instanciated on JSP loading and again when JSP is > submitted > - The JSP fields are not copyed to form object fields (that is the > problem!!!) > - The request have a non filled form object > - Text fields does not work, too. :(( > - The JSP is rendered property. > - The validation method on form object is executed, but none of the > setters. > > : > > PLEASE!! I really need some help. > Thanks for all. > > > The struts-config.xml > have:-- > > > > > > > name="SellReportForm" scope="request" input="/sell/forms/report.jsp"> > > > End of > file--- > > > The Form > Page:-- >--- <%@ page language="java" %> > > <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %> > <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %> > <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %> > > > > > > > > > > > > > > > Relatorios: > > > Pontos de Negócios: > > > Natureza: > > Todas > > > > > > Tipo: > > Todas > > > > > Grupo: > > Todas > > > > > Especie: > > Todas > > > > > Categoria: > > Todas > > > > > > Ordenação: > > > > > > > > > > > End of > file--- > > > The Form > Object: >- /* > * Created on 16/10/2003 > * > * To change the template for this generated file go to > * Window - Preferences - Java - Code Generation - Code and Comments */ > package athena.form.sell; > > import java.sql.Date; > > > import javax.servlet.http.HttpServletRequest; > > import org.apache.struts.action.ActionForm; > import org.apache.struts.action.ActionErrors; > import org.apache.struts.action.ActionError; > import org.apache.struts.action.ActionMapping; > > import org.apache.struts.validator.ValidatorForm; > > import org.apache.commons.logging.*; > > /** > * @author Jim Bruno Goldberg > * > * MD5 Serviços Internet (C) 2003 (R) All right reserved > */ > public class ReportForm extends ActionForm { > > int order; > > long btype; > long bespecie; > long bcategory; > long bnature; > long bgroup; > > Log log=LogFactory.getLog("SellReportForm"); > > /* CONSTRUCTORS */ > public ReportForm() { > } > > > /* GETTERS */ > public long getBPType() { > log.info("Type returned:"+btype); > return btype; > } > public long getBPEspecie() { > log.info("Especie returned:"+bespecie); > return bespecie; > } > public long getBPCategory() { > log.info("Category
Weird form! No data to action but all seems ok. Others work!
Hi, All! I am having some kind of weird problem. I have 54738276256347 jsp forms working ok, but one is not woirking. This "not working form" is just like the others, I revised that 324 times But it does not work and the others work. :((( I am expend 2 days now trying to determine the problem, but unsucessfull. :(( I discover somethings: - The form object is instanciated on JSP loading and again when JSP is submitted - The JSP fields are not copyed to form object fields (that is the problem!!!) - The request have a non filled form object - Text fields does not work, too. :(( - The JSP is rendered property. - The validation method on form object is executed, but none of the setters. : PLEASE!! I really need some help. Thanks for all. The struts-config.xml have:-- End of file--- The Form Page:- <%@ page language="java" %> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %> <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %> Relatorios: Pontos de Negócios: Natureza: Todas Tipo: Todas Grupo: Todas Especie: Todas Categoria: Todas Ordenação: End of file--- The Form Object:- /* * Created on 16/10/2003 * * To change the template for this generated file go to * Window - Preferences - Java - Code Generation - Code and Comments */ package athena.form.sell; import java.sql.Date; import javax.servlet.http.HttpServletRequest; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionErrors; import org.apache.struts.action.ActionError; import org.apache.struts.action.ActionMapping; import org.apache.struts.validator.ValidatorForm; import org.apache.commons.logging.*; /** * @author Jim Bruno Goldberg * * MD5 Serviços Internet (C) 2003 (R) All right reserved */ public class ReportForm extends ActionForm { int order; long btype; long bespecie; long bcategory; long bnature; long bgroup; Log log=LogFactory.getLog("SellReportForm"); /* CONSTRUCTORS */ public ReportForm() { } /* GETTERS */ public long getBPType() { log.info("Type returned:"+btype); return btype; } public long getBPEspecie() { log.info("Especie returned:"+bespecie); return bespecie; } public long getBPCategory() { log.info("Category returned:"+bcategory); return bcategory; } public long getBPNature() { log.info("Nature returned:"+bnature); return bnature; } public long getBPGroup() { log.info("Group returned:"+bgroup); return bgroup; } public int getOrder() { log.info("Order returned:"+order); return order; } /* SETTERS */ public void setPBType(long a) { log.info("Type set to "+a); btype = a; } public void setPBNature(long a) { log.info("Nature set to "+a); bnature = a; } public void setPBGroup(long a) { log.info("Group set to "+a); bgroup = a; } public void setPBEspecie(long a) { log.info("Especie set to "+a); bespecie = a; } public void setOrder(int a) { log.info("Order set to "+a); order=a; } THE FOLLOW METHOD is EXECUTED FINE/ public ActionErrors validate( ActionMapping mapping, Ht
Object-=>Form-=>Object
Hi, Folks! Can anyone help me with a ActionForm object mapping? I have a ActionForm with a method setInside(InsideObject a) and I want o map this object to a SelectBox on a form is JSP (...) I must maintain the setInside(InsideObject a) in ActionForm because this is generated with Xdoclet. My question is: how this object is mapped to JSP Select field? How can I populate the field to it work? Thanks for any help or docs to read. -- CUL8R,[]s Jim Bruno Goldberg http://www.md5.com.br - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ValidatorForm and validation.xml
My action-mapping is the follows: Is that right, isn't? Thanks for help. "Raible, Matt" wrote: > > Make sure you have validate="true" on your action-mapping. > > -----Original Message- > From: Jim Bruno Goldberg [mailto:[EMAIL PROTECTED] > Sent: Tuesday, July 29, 2003 4:14 PM > To: [EMAIL PROTECTED] > Subject: ValidatorForm and validation.xml > > Hi, folks. > > I am trying to use validation.xml, but it does not working. > Some info: > > my struts-config.xml: > > (...) > type="adama.sell.PersonEspecieForm"/> > (...) > > property="pathnames" > value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/> > > (...) > > my validation.xml: > (...) > > > > property="name" > depends="required"/> > > > > (...) > > my Form Class: > (...) > public class PersonEspecieForm > extendsorg.apache.struts.validator.ValidatorForm > implements java.io.Serializable > { > protected long oid; > protected java.lang.String descr; > protected java.lang.String name; > protected java.util.List all; > > /** Construtor vazio padrão */ > public PersonEspecieForm() {} > > public long getOid() > { > return this.oid; > } > > public void setOid( long oid ) > { > this.oid = oid; > } > > public java.lang.String getName() > { > return this.name; > } > > public void setName( java.lang.String descr ) > { > this.name = descr; > } > > (...some getters, setters, but no validate method...) > > } > > There are something wrong, but I try find it all day and nothing. Can > anyone (please) help me? > The struts just ignorate de validation.xml configuration. > Thanks Everybody. > > -- > CUL8R,[]s > Jim Bruno Goldberg > http://www.md5.com.br > > --------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] -- CUL8R,[]s Jim Bruno Goldberg http://www.md5.com.br - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ValidatorForm and validation.xml
Ok, but I do that. My jsp page: (...) <!-- <html:javascript formName="PersonEspecieForm" /> --> (...) (...) But I trying to validate it on server-side, before. : ..and does not work. Thanks meanwhile;) Suzette Daniel wrote: > > You just missed the last 2 steps, you need to call the javascript on submit > so the validation can be done and include the javascript validation. > > Example: > 1- > onsubmit="return validateModelInfoForm(this)"> > > 2- > > Suzette H. Daniel > -Original Message- > From: Raible, Matt [mailto:[EMAIL PROTECTED] > Sent: Tuesday, July 29, 2003 6:07 PM > To: 'Struts Users Mailing List' > Subject: RE: ValidatorForm and validation.xml > > Make sure you have validate="true" on your action-mapping. > > -Original Message- > From: Jim Bruno Goldberg [mailto:[EMAIL PROTECTED] > Sent: Tuesday, July 29, 2003 4:14 PM > To: [EMAIL PROTECTED] > Subject: ValidatorForm and validation.xml > > Hi, folks. > > I am trying to use validation.xml, but it does not working. Some > info: > > my struts-config.xml: > > (...) > > (...) > > property="pathnames" > value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/> > > (...) > > my validation.xml: > (...) > > > > property="name" > depends="required"/> > > > > (...) > > my Form Class: > (...) > public class PersonEspecieForm > extendsorg.apache.struts.validator.ValidatorForm > implements java.io.Serializable > { > protected long oid; > protected java.lang.String descr; > protected java.lang.String name; > protected java.util.List all; > > /** Construtor vazio padrão */ > public PersonEspecieForm() {} > > public long getOid() > { > return this.oid; > } > > public void setOid( long oid ) > { > this.oid = oid; > } > > public java.lang.String getName() > { > return this.name; > } > > public void setName( java.lang.String descr ) > { > this.name = descr; > } > > (...some getters, setters, but no validate method...) > > } > > There are something wrong, but I try find it all day and nothing. Can anyone > (please) help me? The struts just ignorate de validation.xml > configuration. > Thanks Everybody. > > -- > CUL8R,[]s > Jim Bruno Goldberg > http://www.md5.com.br > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] -- CUL8R,[]s Jim Bruno Goldberg http://www.md5.com.br - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
ValidatorForm and validation.xml
Hi, folks. I am trying to use validation.xml, but it does not working. Some info: my struts-config.xml: (...) (...) (...) my validation.xml: (...) (...) my Form Class: (...) public class PersonEspecieForm extendsorg.apache.struts.validator.ValidatorForm implements java.io.Serializable { protected long oid; protected java.lang.String descr; protected java.lang.String name; protected java.util.List all; /** Construtor vazio padrão */ public PersonEspecieForm() {} public long getOid() { return this.oid; } public void setOid( long oid ) { this.oid = oid; } public java.lang.String getName() { return this.name; } public void setName( java.lang.String descr ) { this.name = descr; } (...some getters, setters, but no validate method...) } There are something wrong, but I try find it all day and nothing. Can anyone (please) help me? The struts just ignorate de validation.xml configuration. Thanks Everybody. -- CUL8R,[]s Jim Bruno Goldberg http://www.md5.com.br - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DataSource
I try this code, but I dont work because I don known where is dataSource. Can someone a .java complete (with imports)? Thanks a lot. Gemes Tibor wrote: > > 2002. november 27. 12:49 dátummal Jim Bruno Goldberg ezt írtad: > > Hi, people! > > > > Someone can send me a example class with DataSource access > > defined on > > struts-config? How can I do this? I don find any examples on struts > > files.. Thanks again. > > Reading the docs? > > http://jakarta.apache.org/struts/userGuide/building_model.html#databases > > Tib > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- CUL8R,[]s Jim Bruno Goldberg http://www.prosites.com.br -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
Re: validate() is working !!!!! Thanks Patrice!
Thanks a lot, Patrice. It works now! Now I need to solve another question: how can I define the form name on form without use name="TheForm" on ? I need this to use a link likes [Submit]. Do you know how to solve that? Anyone kowns? Thanks a lot, again! Patrice wrote: > > I suppose that's because you have declared a name in your tag > that is not corresponds to those on the struts-config.xml file. > The attributes "type" and "name" of the tag are deprecated in > Struts 1.1. > > Try to replace: > > > with: > > > Regards > Patrice > > - Original Message - > From: "Jim Bruno Goldberg" <[EMAIL PROTECTED]> > To: "Struts Users Mailing List" <[EMAIL PROTECTED]> > Sent: Wednesday, November 27, 2002 5:36 PM > Subject: validate() almost working. > > > My code is aslmost working > > Validation and messages are ok. Now I need to solve one more > > problem > > When these validate function returns some errors, and forward back to > > form,jsp, the fields are empty. Follow I put the code, the page and the > > struts-config. Whats wrong? > > > > struts-config BEGIN- > > > > > > > > > path="/UserForm" > > type="UserFormAction" > > name="UserForm" > > scope="request" > > input="/groups/user_form.jsp"> > > > > > > > > struts-config END- > > > > Jsp BEGIN- > > > > > > > > Usename: > > Password: > > Retype: > > [Cancela] > href='javascript:TheForm.submit();'>[Adiciona] > > > > > > > > Jsp END--- > > > > > > > > Code BEGIN > > public ActionErrors validate(ActionMapping mapping, HttpServletRequest > > request) { > > > > ActionErrors errors = new ActionErrors(); > > > > servlet.log("Validating UserForm"); > > > > if ((username == null) || (username.length() < 1)) > > errors.add("username", new > > ActionError("errors.nousername")); > > > > if ((password == null) || (password.length() < 1)) > >errors.add("password", new > > ActionError("errors.nopassword")); > > > > > > if ( !password.equals(again)) > >errors.add("passwordagain",new > > ActionError("errors.passwordnotmatch")); > > > > return errors; > > > > > > } > > > > > > Code END-- > > > > Patrice wrote: > > > > > > I don't see anything wrong... > > > All I know is that empty String is returned when the key on an > ActionError > > > is not present in the default application resource files (defined in > > > web.xml). > > > > Yes. I make some confusion and has 2 application.properties on the > > structure. Thanks for the tip. > > > > > Best regards > > > Patrice > > > > > > - Original Message - > > > From: "Jim Bruno Goldberg" <[EMAIL PROTECTED]> > > > To: "Struts Users Mailing List" <[EMAIL PROTECTED]> > > > Sent: Wednesday, November 27, 2002 12:44 PM > > > Subject: Re: perform() or execute()? (Mistery) > > > > > > > > > > > I check that an all is ok. > > > > On the truth, the method is executed and the variables checked, the > > > > errors "listed" on the original form , but they is empty strings > > > > (?!?!?!?!) I just dont understand > > > > > > > > Patrice wrote: > > > > > > > > > > Perhaps I miss something, but I don't see any problem in your code. > > > > > Check that form implement ActionForm (and not ValidatorForm) to > execute > > > > > correctly the validate() method. > > > > > Check also that you don't forget the tag on your JSP. > > > > > > > &g
validate() almost working.....
My code is aslmost working Validation and messages are ok. Now I need to solve one more problem When these validate function returns some errors, and forward back to form,jsp, the fields are empty. Follow I put the code, the page and the struts-config. Whats wrong? struts-config BEGIN- struts-config END- Jsp BEGIN- Usename: Password: Retype: [Cancela] [Adiciona] Jsp END--- Code BEGIN public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { ActionErrors errors = new ActionErrors(); servlet.log("Validating UserForm"); if ((username == null) || (username.length() < 1)) errors.add("username", new ActionError("errors.nousername")); if ((password == null) || (password.length() < 1)) errors.add("password", new ActionError("errors.nopassword")); if ( !password.equals(again)) errors.add("passwordagain",new ActionError("errors.passwordnotmatch")); return errors; } Code END-- Patrice wrote: > > I don't see anything wrong... > All I know is that empty String is returned when the key on an ActionError > is not present in the default application resource files (defined in > web.xml). Yes. I make some confusion and has 2 application.properties on the structure. Thanks for the tip. > Best regards > Patrice > > - Original Message - > From: "Jim Bruno Goldberg" <[EMAIL PROTECTED]> > To: "Struts Users Mailing List" <[EMAIL PROTECTED]> > Sent: Wednesday, November 27, 2002 12:44 PM > Subject: Re: perform() or execute()? (Mistery) > > > > > I check that an all is ok. > > On the truth, the method is executed and the variables checked, the > > errors "listed" on the original form , but they is empty strings > > (?!?!?!?!) I just dont understand > > > > Patrice wrote: > > > > > > Perhaps I miss something, but I don't see any problem in your code. > > > Check that form implement ActionForm (and not ValidatorForm) to execute > > > correctly the validate() method. > > > Check also that you don't forget the tag on your JSP. > > > > > > Hope it helps > > > Patrice > > > > > > - Original Message - > > > From: "Jim Bruno Goldberg" <[EMAIL PROTECTED]> > > > To: "Struts Users Mailing List" <[EMAIL PROTECTED]> > > > Sent: Tuesday, November 26, 2002 9:40 PM > > > Subject: Re: perform() or execute()? > > > > > > > > > > > I try it again, from the beginning and now this works. I don know what > > > > I do before but I am happy now. Thanks for David and Patrice to help > me. > > > > Now I have a new (and diferent) problem. I construct the follow > > > > validate() in a ActionForm class: > > > > > > > > > > > > CODE BEGIN--- > > > > > > > > public ActionErrors validate(ActionMapping mapping, HttpServletRequest > > > > request) { > > > > > > > > ActionErrors errors = new ActionErrors(); > > > > > > > > if ((username == null) || (username.length() < 1)) > > > > errors.add("username", new ActionError("errors.nousername")); > > > > > > > > if ((password == null) || (username.length() < 1)) > > > > errors.add("password", new > > > > ActionError("errors.nopassword")); > > > > > > > > if ( !password.equals(again)) > > > > errors.add("passwordagain",new > > > > ActionError("errors.passwordnotmatch")); > > > > > > > > return errors; > > > > } > > > > > > > > CODE > END > > > > > > > > ...and I have the follow entrys on my message resource file: > > > > > > > > FILE BEGIN > > > > (application.properties)---
DataSource
Hi, people! Someone can send me a example class with DataSource access defined on struts-config? How can I do this? I don find any examples on struts files.. Thanks again. -- CUL8R,[]s Jim Bruno Goldberg http://www.prosites.com.br -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
Re: perform() or execute()? (Mistery)
I check that an all is ok. On the truth, the method is executed and the variables checked, the errors "listed" on the original form , but they is empty strings (?!?!?!?!) I just dont understand Patrice wrote: > > Perhaps I miss something, but I don't see any problem in your code. > Check that form implement ActionForm (and not ValidatorForm) to execute > correctly the validate() method. > Check also that you don't forget the tag on your JSP. > > Hope it helps > Patrice > > - Original Message - > From: "Jim Bruno Goldberg" <[EMAIL PROTECTED]> > To: "Struts Users Mailing List" <[EMAIL PROTECTED]> > Sent: Tuesday, November 26, 2002 9:40 PM > Subject: Re: perform() or execute()? > > > > > I try it again, from the beginning and now this works. I don know what > > I do before but I am happy now. Thanks for David and Patrice to help me. > > Now I have a new (and diferent) problem. I construct the follow > > validate() in a ActionForm class: > > > > > > CODE BEGIN--- > > > > public ActionErrors validate(ActionMapping mapping, HttpServletRequest > > request) { > > > > ActionErrors errors = new ActionErrors(); > > > > if ((username == null) || (username.length() < 1)) > > errors.add("username", new ActionError("errors.nousername")); > > > > if ((password == null) || (username.length() < 1)) > > errors.add("password", new > > ActionError("errors.nopassword")); > > > > if ( !password.equals(again)) > > errors.add("passwordagain",new > > ActionError("errors.passwordnotmatch")); > > > > return errors; > > } > > > > CODE END > > > > ...and I have the follow entrys on my message resource file: > > > > FILE BEGIN > > (application.properties)-- > > > > # -- standard errors -- > > errors.nousername=O campo username deve ser preenchido > > errors.nopassword=O campo senha deve ser preenchido > > errors.passwordnotmatch=As senhas digitadas devem ser iguais > > errors.header= > > errors.prefix= > > errors.suffix= > > errors.footer= > > # -- validator -- > > errors.invalid={0} is invalid. > > errors.maxlength={0} can not be greater than {1} characters. > > errors.minlength={0} can not be less than {1} characters. > > -- > > > > The behavior on form looks like OK, but the messages (inside the > > and ) are empty. No errors, behavior ok but empty Strings. > > Please, can someone help to me again? Thanks a lot. > > > > > > > > Patrice wrote: > > > > > > - Original Message - > > > From: "Jim Bruno Goldberg" <[EMAIL PROTECTED]> > > > To: <[EMAIL PROTECTED]> > > > Sent: Tuesday, November 26, 2002 6:27 PM > > > Subject: perform() or execute()? > > > > > > > Hi, people! > > > > > > > > I am trying to develop a little system in struts for 3 weeks now and I > > > > can't solve some (very basic) problems. I try read the documentations, > > > > but some I can resolve anyway. Please, I need some help! > > > > My questions: > > > > > > > > 1. When I try to use the execute() in a Action, the method is nota > > > > called. When I try with perform() works fine, but I known this is > > > > deprecaced. (I try struts 1.0.2 and now struts 1.1 - same result). > > > > > > The method has been deprecated since struts 1.1: so it can't work in > struts > > > 1.0.2 > > > > > > > 2. I try to prepopulate a form (request scope) and does not works. I > > > > try to set: request.setAttribute("myfield","myvalue"), and nothing. > > > > > > To populate a form from an action, you need to cast the ActionForm > passed as > > > parameter to the perform (or execute) method of your action and then, > set > > > the different properties to the appropriate values: > > > for example: > > > > > > MyForm myForm = (MyForm) form; > > > myForm.setMyField("myValue"); > > > > > > > 3. To prepopulate a Form, I must to call a Action, prepopulate a bean > > > > and then call a Form? That
Re: perform() or execute()?
I try it again, from the beginning and now this works. I don know what I do before but I am happy now. Thanks for David and Patrice to help me. Now I have a new (and diferent) problem. I construct the follow validate() in a ActionForm class: CODE BEGIN--- public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { ActionErrors errors = new ActionErrors(); if ((username == null) || (username.length() < 1)) errors.add("username", new ActionError("errors.nousername")); if ((password == null) || (username.length() < 1)) errors.add("password", new ActionError("errors.nopassword")); if ( !password.equals(again)) errors.add("passwordagain",new ActionError("errors.passwordnotmatch")); return errors; } CODE END ...and I have the follow entrys on my message resource file: FILE BEGIN (application.properties)-- # -- standard errors -- errors.nousername=O campo username deve ser preenchido errors.nopassword=O campo senha deve ser preenchido errors.passwordnotmatch=As senhas digitadas devem ser iguais errors.header= errors.prefix= errors.suffix= errors.footer= # -- validator -- errors.invalid={0} is invalid. errors.maxlength={0} can not be greater than {1} characters. errors.minlength={0} can not be less than {1} characters. -- The behavior on form looks like OK, but the messages (inside the and ) are empty. No errors, behavior ok but empty Strings. Please, can someone help to me again? Thanks a lot. Patrice wrote: > > - Original Message - > From: "Jim Bruno Goldberg" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Tuesday, November 26, 2002 6:27 PM > Subject: perform() or execute()? > > > Hi, people! > > > > I am trying to develop a little system in struts for 3 weeks now and I > > can't solve some (very basic) problems. I try read the documentations, > > but some I can resolve anyway. Please, I need some help! > > My questions: > > > > 1. When I try to use the execute() in a Action, the method is nota > > called. When I try with perform() works fine, but I known this is > > deprecaced. (I try struts 1.0.2 and now struts 1.1 - same result). > > The method has been deprecated since struts 1.1: so it can't work in struts > 1.0.2 > > > 2. I try to prepopulate a form (request scope) and does not works. I > > try to set: request.setAttribute("myfield","myvalue"), and nothing. > > To populate a form from an action, you need to cast the ActionForm passed as > parameter to the perform (or execute) method of your action and then, set > the different properties to the appropriate values: > for example: > > MyForm myForm = (MyForm) form; > myForm.setMyField("myValue"); > > > 3. To prepopulate a Form, I must to call a Action, prepopulate a bean > > and then call a Form? That right? > > I don't know what you mean with "call a Form". > You just need to set the properties of the form with the values you want > Then, the taglib will display the values in the field of the form, on your > JSP. > > > > > Please, I need some help. Thanks to all. > > > > Hope it helps > Patrice > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- CUL8R,[]s Jim Bruno Goldberg http://www.prosites.com.br -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
perform() or execute()?
Hi, people! I am trying to develop a little system in struts for 3 weeks now and I can't solve some (very basic) problems. I try read the documentations, but some I can resolve anyway. Please, I need some help! My questions: 1. When I try to use the execute() in a Action, the method is nota called. When I try with perform() works fine, but I known this is deprecaced. (I try struts 1.0.2 and now struts 1.1 - same result). 2. I try to prepopulate a form (request scope) and does not works. I try to set: request.setAttribute("myfield","myvalue"), and nothing. 3. To prepopulate a Form, I must to call a Action, prepopulate a bean and then call a Form? That right? Please, I need some help. Thanks to all. -- CUL8R,[]s Jim Bruno Goldberg http://www.prosites.com.br -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
Re: Tomcat+Apache+Struts Problem
At 18:32 20/04/01 +0200, you wrote: >The problem is in your Java version. Struts needs Java 1.2 or later to run. > >Jean-Noel Thanks. I will install the new JDK. CUL8R,[]s Jim Bruno Goldberg <[EMAIL PROTECTED]>
Tomcat+Apache+Struts Problem
I people. I am still with my struts problem. I try to copy the struts-test on webapps tomcat's dir but it does not work. My set variables: TOMCAT_HOME=/usr/local/tomcat PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/usr/X11R6/bin:/usr/local/jdk1.1.8/bin:/root/bin JAVA_HOME=/usr/local/jdk1.1.8 If I just put the *.war on webapps dir: darkness# ./startup.sh Using classpath: /usr/local/tomcat/classes:.:/usr/local/tomcat/lib/ant.jar:/usr/local/tomcat/lib/jasper.jar:/usr/local/tomcat/lib/mysql_comp.jar:/usr/local/tomcat/lib/mysql_uncomp.jar:/usr/local/tomcat/lib/servlet.jar:/usr/local/tomcat/lib/webserver.jar:/usr/local/tomcat/lib/xml.jar:/usr/local/jdk1.1.8/lib darkness# Starting tomcat. Check logs/tomcat.log for error messages java.lang.NoClassDefFoundError darkness# ... and tomcat shutdown. If I move the struts.jar into the classes dir: darkness# cd ../webapps/struts-test/WEB-INF/lib/ darkness# mv struts.jar ../classes/ darkness# cd /usr/local/tomcat/bin/ darkness# ./startup.sh Using classpath: /usr/local/tomcat/classes:.:/usr/local/tomcat/lib/ant.jar:/usr/local/tomcat/lib/jasper.jar:/usr/local/tomcat/lib/mysql_comp.jar:/usr/local/tomcat/lib/mysql_uncomp.jar:/usr/local/tomcat/lib/servlet.jar:/usr/local/tomcat/lib/webserver.jar:/usr/local/tomcat/lib/xml.jar:/usr/local/jdk1.1.8/lib darkness# Starting tomcat. Check logs/tomcat.log for error messages cannot load servlet name: action darkness# ...and tomcat still running. I can access the http://hostname/struts-test: STRUTS Test Pages BEAN Tags · · · · · · · · · · · · · · · · HTML Tags · · · · · · Scalar Setters LOGIC Tags · · Comparison Tags · · Iterate Tag · · Match Tags · · Presence Tags ...but when I try to follow some link, I got: Error: 500 Location: /struts-test/html-select.jsp Internal Servlet Error: org.apache.jasper.JasperException: Unable to load class org.apache.struts.taglib.html.HtmlTag at org.apache.jasper.compiler.TagBeginGenerator.init(TagBeginGenerator.java:121) at org.apache.jasper.compiler.JspParseEventListener$GeneratorWrapper.init(JspParseEventListener.java:718) at org.apache.jasper.compiler.JspParseEventListener.addGenerator(JspParseEventListener.java:132) at org.apache.jasper.compiler.JspParseEventListener.handleTagBegin(JspParseEventListener.java:869) at org.apache.jasper.compiler.DelegatingListener.handleTagBegin(DelegatingListener.java:194) at org.apache.jasper.compiler.Parser$Tag.accept(Parser.java:822) at org.apache.jasper.compiler.Parser.parse(Parser.java:1073) at org.apache.jasper.compiler.Parser.parse(Parser.java:1038) at org.apache.jasper.compiler.Parser.parse(Parser.java:1034) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:182) at org.apache.jasper.runtime.JspServlet.loadJSP(JspServlet.java:413) at org.apache.jasper.runtime.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:149) at org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.java:161) at org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:261) at org.apache.jasper.runtime.JspServlet.service(JspServlet.java:369) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java:503) at org.apache.tomcat.core.ContextManager.service(ContextManager.java:559) at org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnection(Ajp12ConnectionHandler.java:156) at org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java:338) at java.lang.Thread.run(Thread.java) Please, I need some help. CUL8R,[]s Jim Bruno Goldberg <[EMAIL PROTECTED]>
Tomcat+Apache Struts problem
I am already with problems with struts on apache+tomcat configuration, but now I discover new facts: - The problem is related with the WEB_INF/web.xml file. The struts.har file isn't found if is on WEB-INF/lib. I must move it to WEB-INF/classes - I must modify the server.xml file? If I don't modify it, Tomcat doesn't create a tomcat-apache.conf with all the applications Some idea? CUL8R,[]s Jim Bruno Goldberg <[EMAIL PROTECTED]>
Re: Newbie Question - Troubles Running Struts on Tomcat
At 16:24 18/04/01 -0400, you wrote: >You probably * don't * want to copy anything over from Struts except for >the WARs. > >Having the struts.jar on your classpath while running your container is >problematic (since it is also loaded from the WAR). > >< >http://jakarta.apache.org:8080/jyve-faq/Turbine/screen/DisplayQuestionAnswer/action/SetAll/project_id/2/faq_id/36/topic_id/203/question_id/776 > > I try it, but doesn't work: darkness# /usr/local/tomcat/bin/startup.sh Guessing TOMCAT_HOME from tomcat.sh to /usr/local/tomcat/bin/.. Setting TOMCAT_HOME to /usr/local/tomcat/bin/.. Using classpath: /usr/local/tomcat/bin/../classes:.:/usr/local/tomcat/bin/../lib/ant.jar:/usr/local/tomcat/bin/../lib/jasper.jar:/usr/local/tomcat/bin/../lib/mysql_comp.jar:/usr/local/tomcat/bin/../lib/mysql_uncomp.jar:/usr/local/tomcat/bin/../lib/servlet.jar:/usr/local/tomcat/bin/../lib/webserver.jar:/usr/local/tomcat/bin/../lib/xml.jar darkness# Starting tomcat. Check logs/tomcat.log for error messages java.lang.NoClassDefFoundError darkness# I delete all struts.jar on structure. :((( Any idea? Thanks again. >Jim Bruno Goldberg wrote: > > > > Hi, people! > > > > I am beginning in JSPs, Tomcat and Struts now: please, be > pacient. ;) > > What I do: > > Copy *.war files from struts distribuition into webapps > > tomcat directory > > Copy * from struts .\lib dir into tomcat .\lib dir > > Modify server.xml from tomcat to comunicate with apache. > > and try this: CUL8R,[]s Jim Bruno Goldberg <[EMAIL PROTECTED]>
Newbie Question - Troubles Running Struts on Tomcat
Hi, people! I am beginning in JSPs, Tomcat and Struts now: please, be pacient. ;) What I do: Copy *.war files from struts distribuition into webapps tomcat directory Copy * from struts .\lib dir into tomcat .\lib dir Modify server.xml from tomcat to comunicate with apache. and try this: darkness# ../bin/startup.sh Guessing TOMCAT_HOME from tomcat.sh to ../bin/.. Setting TOMCAT_HOME to ../bin/.. Using classpath: ../bin/../classes:.:../bin/../lib/ant.jar:../bin/../lib/jasper.jar:../bin/../lib/mysql_comp.jar:../bin/../lib/mysql_uncomp.jar:../bin/../lib/servlet.jar:../bin/../lib/struts-bean.tld:../bin/../lib/struts-config_1_0.dtd:../bin/../lib/struts-form.tld:../bin/../lib/struts-html.tld:../bin/../lib/struts-logic.tld:../bin/../lib/struts-template.tld:../bin/../lib/struts.jar:../bin/../lib/struts.tld:../bin/../lib/web-app_2_2.dtd:../bin/../lib/web-app_2_3.dtd:../bin/../lib/webserver.jar:../bin/../lib/xml.jar darkness# Starting tomcat. Check logs/tomcat.log for error messages java.lang.NoClassDefFoundError: java/util/Map at org.apache.struts.action.ActionServlet.(ActionServlet.java:236) at org.apache.tomcat.core.ServletWrapper.initServlet(ServletWrapper.java:298) at org.apache.tomcat.core.ServletWrapper.loadServlet(ServletWrapper.java:276) at org.apache.tomcat.context.LoadOnStartupInterceptor.contextInit(LoadOnStartupInterceptor.java:132) at org.apache.tomcat.core.ContextManager.initContext(ContextManager.java:227) at org.apache.tomcat.core.ContextManager.init(ContextManager.java:201) at org.apache.tomcat.startup.Tomcat.execute(Tomcat.java:156) at org.apache.tomcat.startup.Tomcat.main(Tomcat.java:163) darkness# ? Doesn't works. I am missed something. Can anyone send me some lights? I didn't found a troubleshotting in no place Thanks for any help CUL8R,[]s Jim Bruno Goldberg <[EMAIL PROTECTED]>