file upload and unicode
Hello, I try use filter, but always get this error: 09:38:52,076 ERROR [Digester] Parse Error at line 65 column -1: Element web-app does not allow filter here. org.xml.sax.SAXParseException: Element web-app does not allow filter here. at org.apache.crimson.parser.Parser2.error(Parser2.java:3160) My server is Tomcat 4.1.12 I want add filter from: http://www.anassina.com/struts/i18n/i18n.html I have problem with file upload and unicode and will hope that this solve my problem. Now I use my RequestProcessor, but it not solve problem with file upload and unicode. This code I use in RequestProcessor: try { request.setCharacterEncoding(UTF-8) ; } catch(java.io.UnsupportedEncodingException e) { System.out.println(e); } Could I hope, what filter will solve my problem with file upload and unicode and why I get this error? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: file upload and unicode
Yes, I know. And my web.xml have exactly this declaration. But problem is same. Chck your dtd. It should be !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; The web-app_2_2 does not allow filters. Hth, Tib - 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]
Re: file upload and unicode
part of web.xml: ?xml version=1.0? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app filter filter-nameSet Character Encoding/filter-name filter-classfilters.SetCharacterEncodingFilter/filter-class init-param param-nameencoding/param-name param-valueUTF-8/param-value /init-param /filter filter-mapping filter-nameSet Character Encoding/filter-name servlet-nameaction/servlet-name /filter-mapping !-- Standard Action Servlet Configuration (with debugging) -- servlet skip Yes, I know. And my web.xml have exactly this declaration. But problem is same. And the order of tags are preserved according to this DTD? Some containers require this as well others not. !ELEMENT web-app (icon?, display-name?, description?, distributable?, context-param*, filter*, filter-mapping*, listener*, servlet*, servlet-mapping*, session-config?, mime-mapping*, welcome-file-list?, error-page*, taglib*, resource-env-ref*, resource-ref*, security-constraint*, login-config?, security-role*, env-entry*, ejb-ref*, ejb-local-ref*) Tib - 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]
Re: file upload and unicode
Sorry, you was right. I lift filter declaration above all and have good depoyment. And now I have unicode and file upload. Thank you very much. Hello, I try use filter, but always get this error: 09:38:52,076 ERROR [Digester] Parse Error at line 65 column -1: Element What is on 65th line of your web.xml? Tib - 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]
Re: get data to Collection
Hello, 1. write set and get methods in Form bean for a Collection Flag. I have this methods 2. In the jsp write the following code logic:equal name=NameOfForm property=collectionFlag value=true on top of the iterate tag. I don't understant this code. What does it do? I used this code, but ineffectibely: logic:iterate id=daiktas name=access scope=session indexId=testid logic:equal name=daiktas property=read value=true html:multibox property=read name = daiktas bean:write name = daiktas property=read/ /html:multibox bean:write name = daiktas property=read/ bean:write name=testid/ /logic:equal /logic:iterate Must I set inside Collection or something...? - Original Message - From: neelima mahesh [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, January 30, 2003 12:21 AM Subject: Re: get data to Collection Hi, Please try this. When u set collection to Form Bean in Action Bean, u can determine the size of the collection. Depending on the collection size u can set a Flag value true/false.. 1. write set and get methods in Form bean for a Collection Flag. 2. In the jsp write the following code logic:equal name=NameOfForm property=collectionFlag value=true on top of the iterate tag. Which solves ur problem Thanks Mahesh! Kafka [EMAIL PROTECTED] wrote:Hello, I think, this problem many times was solve here, but I don't find particular answer. How I can use Form class, if I don't know how many are rows? Must I use Collection? Maybe I can see example, because I can not find decision. Now my jsp: Form.class private Collection read = new ArrayList(); //skip public void setRead(Collection read) { this.read.addAll(read); } public Collection getRead() { return this.read ; } public void reset(ActionMapping mapping, HttpServletRequest request) { //skip others params read.clear(); } but I get error: description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request. exception javax.servlet.ServletException: BeanUtils.populate at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:988) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: get data to Collection
I try this, but ineffectively... I get follow error. Maybe I can get example, where I can see how implement Collection and multicheck... error: javax.servlet.ServletException: BeanUtils.populate at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:988) - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, January 30, 2003 12:29 AM Subject: RE: get data to Collection public void reset(ActionMapping mapping, HttpServletRequest request) { read = new ArrayList(); //skip others params } Regards, PQ This Guy Thinks He Knows Everything This Guy Thinks He Knows What He Is Doing -Original Message- From: Kafka [mailto:[EMAIL PROTECTED]] Sent: January 29, 2003 5:02 PM To: Struts Users Mailing List Subject: get data to Collection Hello, I think, this problem many times was solve here, but I don't find particular answer. How I can use Form class, if I don't know how many are rows? Must I use Collection? Maybe I can see example, because I can not find decision. Now my jsp: logic:notEmpty name=access logic:iterate id=daiktas name=access scope=session html:multibox property=read name = daiktas bean:write name = daiktas property=read/ /html:multibox bean:write name = daiktas property=read/ /logic:iterate /logic:notEmpty Form.class private Collection read = new ArrayList(); //skip public void setRead(Collection read) { this.read.addAll(read); } public Collection getRead() { return this.read ; } public void reset(ActionMapping mapping, HttpServletRequest request) { //skip others params read.clear(); } but I get error: description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request. exception javax.servlet.ServletException: BeanUtils.populate at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:988) - 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]
get data to Collection
Hello, I think, this problem many times was solve here, but I don't find particular answer. How I can use Form class, if I don't know how many are rows? Must I use Collection? Maybe I can see example, because I can not find decision. Now my jsp: logic:notEmpty name=access logic:iterate id=daiktas name=access scope=session html:multibox property=read name = daiktas bean:write name = daiktas property=read/ /html:multibox bean:write name = daiktas property=read/ /logic:iterate /logic:notEmpty Form.class private Collection read = new ArrayList(); //skip public void setRead(Collection read) { this.read.addAll(read); } public Collection getRead() { return this.read ; } public void reset(ActionMapping mapping, HttpServletRequest request) { //skip others params read.clear(); } but I get error: description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request. exception javax.servlet.ServletException: BeanUtils.populate at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:988) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts Validator changing the key in the validator.xml
Was wondering if there is a way to access a unique string to display for a required error in the javascript function under validator-rules.xml. Right now the following happens: If in the validator.xml file I specify the arg0 key=regform.firstname.displayname it is used by both the required and mask javascript functions to display a canned error like Firstname is invalid. Firstname required. How can I differentiate these. For instance I would like to say.. Firstname in invalid because only upper and lower case letters are allowed. In the Application resources properties currently I have {0} is invalid for my errors.invalid tag. What I would like to have is {0} is invalid because {1} but I don't know how to define the {1} in the validation.xml and validation-rules.xml. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Struts Validator changing the key in the validator.xml
Thanks Dave! -Original Message- From: David Winterfeldt [mailto:[EMAIL PROTECTED]] Sent: Monday, March 11, 2002 11:21 AM To: Struts Users Mailing List Subject: Re: Struts Validator changing the key in the validator.xml There are some examples here. http://home.earthlink.net/~dwinterfeldt/overview.html#i18n In the Application resources properties currently I have {0} is invalid for my errors.invalid tag. What I would like to have is {0} is invalid because {1} but I don't know how to define the {1} in the validation.xml and validation-rules.xml. field property=lastName depends=required,mask arg0 key=registrationForm.lastname.displayname/ arg1 name=mask key=registrationForm.lastname.becauseMessage/ var var-namemask/var-name var-value^[a-zA-Z]*$/var-value /var /field or you can override the default message: field property=lastName depends=required,mask msg name=mask key=registrationForm.lastname.maskmsg/ arg0 key=registrationForm.lastname.displayname/ var var-namemask/var-name var-value^[a-zA-Z]*$/var-value /var /field David --- Ben Kafka [EMAIL PROTECTED] wrote: Was wondering if there is a way to access a unique string to display for a required error in the javascript function under validator-rules.xml. Right now the following happens: If in the validator.xml file I specify the arg0 key=regform.firstname.displayname it is used by both the required and mask javascript functions to display a canned error like Firstname is invalid. Firstname required. How can I differentiate these. For instance I would like to say.. Firstname in invalid because only upper and lower case letters are allowed. In the Application resources properties currently I have {0} is invalid for my errors.invalid tag. What I would like to have is {0} is invalid because {1} but I don't know how to define the {1} in the validation.xml and validation-rules.xml. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? Try FREE Yahoo! Mail - the world's greatest free email! http://mail.yahoo.com/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Struts Validator - mulitple forms on one page
Hi, Would like to know if I can validate using js with multiple forms in one file. Currently I'm having a problem. When I use validator:javascript formName=myForm1 / and validator:javascript formName=myForm2 / only the last one specified works. The other form gives me a javascript error. Is there anyway around this? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Struts Validator Questions
Hi, I started using the struts validator package about a week ago and have the following questions: 1 - How do I get the validator to validate a required field for a selection box? My selection is on an integer property. I noticed in the validator-rules.xml file it is checking for type select-one. What type is a html:select? I tried replacing select-one with select but it still doesn't find it. 2 - Cannot get the two password comparison example working. I put in the code specified under ~dwinterfeldt. Was wondering if anyone has gotten this working. The only difference I can see in my code and the example was that I am using StrutsValidatorUtil.getActionError instead of ValidatorUtil.getActionError (the latter the compiler complained about no such method signature). Was wondering if there was a javascript method also that could be included. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Struts Validator Questions
Hi, Was able to fix the first problem by going into the js and checking for select-one and value=0. Regarding the 2nd issue, I have specified the class where I put the method in the valiation-xml e.g. my clasname=com.mypackagename.ui.RegistrationForm and I have a method there called validateTwoFields(Object bean,ValidatorAction va,... just like yours. The only difference is that in errors.add() I have errors.add(field.getKey,StrutsValidatorUtil.getActionError(.) and you have errors.add(field.getKey.ValidatorUtil.getActionError(. I am compiling and running okay, but it never gets to this routine. (Thanks for your help by the way) Ben -Original Message- From: David Winterfeldt [mailto:[EMAIL PROTECTED]] Sent: Friday, March 01, 2002 11:57 AM To: Struts Users Mailing List Subject: Re: Struts Validator Questions --- Ben Kafka [EMAIL PROTECTED] wrote: Hi, I started using the struts validator package about a week ago and have the following questions: 1 - How do I get the validator to validate a required field for a selection box? My selection is on an integer property. I noticed in the validator-rules.xml file it is checking for type select-one. What type is a html:select? I tried replacing select-one with select but it still doesn't find it. The select-one is the correct type in Javascript for an html:select tag. I'm not sure what is in your select list, but if it is an integer how can you check that it is blank (zero length string) or null? You could use the range method to see if it falls in a range or write your own. 2 - Cannot get the two password comparison example working. I put in the code specified under ~dwinterfeldt. Was wondering if anyone has gotten this working. The only difference I can see in my code and the example was that I am using StrutsValidatorUtil.getActionError instead of ValidatorUtil.getActionError (the latter the compiler complained about no such method signature). Was wondering if there was a javascript method also that could be included. No error messages? Everything works on the same principle. Does the validator definition in the xml have the same method and class defined as where the validation method actually is (no types)? You can make a Javascript method to match if you want to. You can follow one of the examples to see how to make a generic Javascript method. You have access to the error message and the variables you've defined in the Javascript. David -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? Yahoo! Greetings - Send FREE e-cards for every occasion! http://greetings.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
jbuilder jsp and struts tags
Was wondering if anyone has been able to set break points in jbuilder6 for struts tags when debugging jsp. I can set a breakpoint on a regular jsp tag but not in a struts one e.g. html:text -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]