Re: Unable to see c:forEach out put
Rick Reumann wrote: It sounds like you are probably are now using a JSP2.0 container like Tomcat5 and are refering to the wrong tld. Refer to the one in the jar like: %@ taglib prefix=c uri=http://java.sun.com/jsp/jstl/core% and remove and direct pointing to the tlds you have. Yes, I am using Tomcat 5.0.28. I then downloaded beanutils from the jakarta site, replaced the jstl.jar and standard.jar, and pointed to taglibs like you said above. I have strange problem - I am able to use c:forEach etc., but the var is not getting set. If I give something like this: c:forEach begin=1 end=5 var=current c:out value=${current} / /c:forEach I get something like this: ${current} ${current} ${current} ${current} ${current} I can't figure out what seems to be the problem. Please help. TIA, Vamsee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Validating DynaBean nested beans with a custom validator.
Sorry for the outrageoulsy long-winded question. It really boiled down to this: how to get the PersonFormBean off the Object bean generically. The answer is to use PropertyUtils.getSimpleProperty(...). (BeanUtils.getProperty returns a String.) MD -Original Message- From: Kishore Senji [mailto:[EMAIL PROTECTED] Sent: 11 January 2005 18:58 To: Struts Users Mailing List Subject: Re: Validating DynaBean nested beans with a custom validator. This shoud do it. Isn't it? private static PersonFormBean getPersonFormBean(Object bean, String property) throws java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodException{ return (PersonFormBean) BeanUtils.getProperty(bean, property); } On Tue, 11 Jan 2005 11:39:53 -, Daffin, Miles (Company IT) [EMAIL PROTECTED] wrote: Dear All, I have a DynaValidatorActionForm like this: form-beans form-bean name=theFormBean type=org.apache.struts.validator.DynaValidatorActionForm form-property name=simpleProperty type=java.lang.String / form-property name=personList type=java.util.ArrayList size=0 / form-property name=newPerson type=com.plok.validator.beans.PersonFormBean/ /form-bean /form-beans When the related form is submitted the action adds the 'newPerson' to the 'personList' and replaces newPerson, on the DynaBean, with a new PersonFormBean. This all works fine. Now I want to add declarative validation for the newPerson, so only valid newPersons reach the action code that adds them to the list. The thing is that PersonFormBeans (in this example) have a start and end date (a period). The validation rules for these fields are: * start date and end date must be dates (dd/MM/) * start date must be before end date * end date must be after or equal to today * etc... So, you see, apart from the first rule, this goes beyond what can be achieved by plucking out the fields from the nested bean and using the default set of simple field validators shipped with struts (required, date etc.). (Even if you disagree that these validation requirements cannot be met in using the default validators please read on. This is just an example.) I have created a new validator that I want to handle the entire nested PersonFormBean: personValidator. validator name=personValidator classname=com.plok.validator.beans.PersonFormBeanValidator method=validatePerson methodParams=java.lang.Object, org.apache.commons.validator.ValidatorAction, org.apache.commons.validator.Field, org.apache.struts.action.ActionErrors, javax.servlet.http.HttpServletRequest msg=errors.person /validator public static boolean validatePerson(Object bean, ValidatorAction va, Field field, ActionErrors errors, HttpServletRequest request) { PersonFormBean personFormBean = somehowGetTheBloodyPersonFormBeanOffTheBean(bean); // Do the validation directly on the personFormBean. return true; } private static PersonFormBean somehowGetTheBloodyPersonFormBeanOffTheBean(Object bean) { // How do I implement this? // It has to be generic, in case I change my mind about the type of the bean, // e.g. make it a simple bean with getters and setters instead of using the DynaBean... return null; } Would you: a) grab the nested PersonFormBean from the main, parent bean and then work directly with this? If so how? Is there a utility method somewhere? b) grab individual fields from the nested bean using BeanUtils methods (or other - feel free to advise). Your thoughts/urls would be appreciated. Many thanks. -Miles Miles Daffin Morgan Stanley 20 Cabot Square | Canary Wharf | London E14 4QA | UK Tel: +44 (0) 20 767 75119 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] NOTICE: If received in error, please destroy and notify sender. Sender does not waive confidentiality or privilege, and use is prohibited. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] NOTICE: If received in error, please destroy and notify sender. Sender does not waive confidentiality or privilege, and use is prohibited. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
populate data for edit form
I'm trying to create an edit page. I think I already in the right direction, but still unable to populate data even with a direct value via action class. Please let me what's wrong here. I've spend 3 days alone with this problem. Thank you. I created two action file: - SetUpCategoryEditAction.java (this action will populate data from db to form) - CategoryEditAction.java (this action will save the data) My formbean: CategoryEditForm.java -- public class CategoryEditForm extends ValidatorForm { private String name; private String categoryId; public void setName(String s) { this.name = s; } public String getName() { return name; } public void setcategoryId(String s) { this.categoryId = s; } public String getcategoryId() { return categoryId; } } My struts-config.xml -- form-bean name=categoryEditForm type=com.strutsgen.garuda.CategoryEditForm/ action path=/setUpCategoryEditForm type=com.strutsgen.garuda.SetUpCategoryEditAction name=categoryEditForm scope=request validate=false forward name=continue path=/categoryEditForm.jsp/ /action action path=/categoryEdit type=com.strutsgen.garuda.CategoryEditAction name=categoryEditForm attribute=val_categoryEdit scope=request validate=true input=/categoryEditForm.jsp forward name=success path=/categoryEditOk.jsp/ /action SetUpCategoryEditAction.java: -- public final class SetUpCategoryEditAction extends Action { public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { CategoryEditForm categoryEditForm = (CategoryEditForm)form; categoryEditForm.setName(testing); return (mapping.findForward(continue)); } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
populate data for edit form
I'm trying to create an edit page. I think I already in the right direction, but still unable to populate data even with a direct value via action class. Please let me what's wrong here. I've spend 3 days alone with this problem. Thank you. I created two action file: - SetUpCategoryEditAction.java (this action will populate data from db to form) - CategoryEditAction.java (this action will save the data) My formbean: CategoryEditForm.java -- public class CategoryEditForm extends ValidatorForm { private String name; private String categoryId; public void setName(String s) { this.name = s; } public String getName() { return name; } public void setcategoryId(String s) { this.categoryId = s; } public String getcategoryId() { return categoryId; } } My struts-config.xml -- form-bean name=categoryEditForm type=com.strutsgen.garuda.CategoryEditForm/ action path=/setUpCategoryEditForm type=com.strutsgen.garuda.SetUpCategoryEditAction name=categoryEditForm scope=request validate=false forward name=continue path=/categoryEditForm.jsp/ /action action path=/categoryEdit type=com.strutsgen.garuda.CategoryEditAction name=categoryEditForm attribute=val_categoryEdit scope=request validate=true input=/categoryEditForm.jsp forward name=success path=/categoryEditOk.jsp/ /action SetUpCategoryEditAction.java: -- public final class SetUpCategoryEditAction extends Action { public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { CategoryEditForm categoryEditForm = (CategoryEditForm)form; categoryEditForm.setName(testing); return (mapping.findForward(continue)); } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: populate data for edit form
CategoryEditForm categoryEditForm = (CategoryEditForm)form; categoryEditForm.setName(testing); request.setAttribute(categoryEditForm, form); return (mapping.findForward(continue)); I think that will do ;) Pedro Salgado On 12/1/05 10:19 am, Dody Rachmat Wicaksono [EMAIL PROTECTED] wrote: I'm trying to create an edit page. I think I already in the right direction, but still unable to populate data even with a direct value via action class. Please let me what's wrong here. I've spend 3 days alone with this problem. Thank you. I created two action file: - SetUpCategoryEditAction.java (this action will populate data from db to form) - CategoryEditAction.java (this action will save the data) My formbean: CategoryEditForm.java -- public class CategoryEditForm extends ValidatorForm { private String name; private String categoryId; public void setName(String s) { this.name = s; } public String getName() { return name; } public void setcategoryId(String s) { this.categoryId = s; } public String getcategoryId() { return categoryId; } } My struts-config.xml -- form-bean name=categoryEditForm type=com.strutsgen.garuda.CategoryEditForm/ action path=/setUpCategoryEditForm type=com.strutsgen.garuda.SetUpCategoryEditAction name=categoryEditForm scope=request validate=false forward name=continue path=/categoryEditForm.jsp/ /action action path=/categoryEdit type=com.strutsgen.garuda.CategoryEditAction name=categoryEditForm attribute=val_categoryEdit scope=request validate=true input=/categoryEditForm.jsp forward name=success path=/categoryEditOk.jsp/ /action SetUpCategoryEditAction.java: -- public final class SetUpCategoryEditAction extends Action { public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { CategoryEditForm categoryEditForm = (CategoryEditForm)form; categoryEditForm.setName(testing); return (mapping.findForward(continue)); } } - 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: Database connection question - seeking expert opinion
oh, so mean to say automatically i get connection pool - In my servlet i am using (at least currently) normal JDBC call - which i was thinking how i can convert in to connection pool as i heard of it a lot !!! . ok, then can i use struts database method in any class ? or is it restricted to only Action class ? Can i develop some sort of common class to get the connection ? regards Manisha Amit Gupta [EMAIL PROTECTED] wrote: Hi Manisha, Struts database method uses DBCP. It offer database connection pooling. So I think struts db method is better Amit Gupta Mobile: 91-9891062552 Yahoo IM: amitguptainn MSN IM : amitguptainn -Original Message- From: Manisha Sathe [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 12, 2005 11:40 AM To: user@struts.apache.org Subject: Database connection question - seeking expert opinion I am still new to struts and even servlets. Last time when i developed servlets, i created one common class method to get the connection (with regular JDBC call). All database related parameters i stored in a constant variable file. Now in struts i found out that we can specify the datasource inside struts-config.xml. I want to know which methodology is better ? Can i continue with my existing method ? or struts database method is better ? regards Manisha __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Re: populate data for edit form
action path=/setUpCategoryEditForm type=com.strutsgen.garuda.SetUpCategoryEditAction name=categoryEditForm scope=session validate=false I think you could also try this... I think it will also work (maybe you should then switch from request.setAttribute to session.setAttribute... but I don¹t remember). Pedro Salgado - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts design for CRUD methods
I have a web based application which allows the Creation, Update, Read and Deletion of Data objects (Nothing new here). All data changes are done by calling Manager methods with Action Forms to update the relevant data e.g. new ShopManager().createOrder(createOrderForm); or new ShopManager.updateOrder(updateOrderForm); My problem is that I am having to create duplicate JSPs and actions for the create and update processes. The pages look exactly the same and hold the same values but the difference is that the update actions will pre populate the form with the existing methods and invoke the update method on the manager instead of a standard create. Even the forms are identical (The update form extends the create form but holds a reference to the data id that is to be updated). My question is: Is there a way to have one set of JSPs, Forms and actions to manage all of this. When I change a JSP I am having to maintain two pages which sounds trivial but to me shouts of bad design. The only difference between the pages is that they call different actions i.e. /order/create/stage1.do vs /order/update/stage1.do I would be interersted to know peoples thoughts. Cheers, Mark - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to detect Cancel button i pressed ?
Thanks Nicolas, finally i could get the cancel button working the way i want. regards Manisha Nicolas De Loof [EMAIL PROTECTED] wrote: Manisha Sathe a écrit : Hi Nicolas, Thanks for the response, 1)I tried this, but giving me error. Pls would u mind giving some code example ? use in your JSP (do not set property !) use isCanceled(request) in action. Is cancel was used to post the form, it will return true. 2)About exception - do u mean to say my own method common to all ? This also if u can explain with code example would be of great help. I set a global ExceptionHandler in struts config to catch all exceptions. It logs them for debug and forwards to an error page. Thanks once again, regards Manisha Nicolas De Loof wrote: You can check for cancel in actions using isCanceled(request) Struts cancel tag uses a magic value that this method will detect (formbean validation is also skipped) About exception, I used to set a global exception handler that logs exception stack and forwards to a generic error page. Nico. Manisha Sathe a écrit : I had posted it before - might hv missed the response. I want to check whether Cancel button is pressed, if yes then want to redirect it to another page Also how to handle th Exceptions. I am catching many exceptions inside my Action Handlers. what shall i do with them ? Currently just printing the error messages on System.out, but what is the good practice to handle exceptions ? Close all Resultsets/ connections and redirect to error page ? write some standard routine ? In struts-config i have given mapping to errors as global forward, but what if exceptions occur inside my common classes ? regards Manisha __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Yahoo! Mail - Find what you need with new enhanced search. Learn more. This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? All your favorites on one personal page Try My Yahoo!
RE: Struts design for CRUD methods
snip The only difference between the pages is that they call different actions i.e. /order/create/stage1.do vs /order/update/stage1.do /snip Try using DispatchAction: http://husted.com/struts/tips/002.html You can consolidate your create() and update() 'execute' methods within one action class. -Original Message- From: Mark Benussi [mailto:[EMAIL PROTECTED] Sent: 12 January 2005 09:30 To: user@struts.apache.org Subject: Struts design for CRUD methods I have a web based application which allows the Creation, Update, Read and Deletion of Data objects (Nothing new here). All data changes are done by calling Manager methods with Action Forms to update the relevant data e.g. new ShopManager().createOrder(createOrderForm); or new ShopManager.updateOrder(updateOrderForm); My problem is that I am having to create duplicate JSPs and actions for the create and update processes. The pages look exactly the same and hold the same values but the difference is that the update actions will pre populate the form with the existing methods and invoke the update method on the manager instead of a standard create. Even the forms are identical (The update form extends the create form but holds a reference to the data id that is to be updated). My question is: Is there a way to have one set of JSPs, Forms and actions to manage all of this. When I change a JSP I am having to maintain two pages which sounds trivial but to me shouts of bad design. The only difference between the pages is that they call different actions i.e. /order/create/stage1.do vs /order/update/stage1.do I would be interersted to know peoples thoughts. Cheers, Mark - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] If you are not an intended recipient of this e-mail, please notify the sender, delete it and do not read, act upon, print, disclose, copy, retain or redistribute it. Click here for important additional terms relating to this e-mail. http://www.ml.com/email_terms/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts design for CRUD methods
I share the createX and editX actions form-beans xForm (I usually use session scope because an extra special field called vo). In create action I usually have an extra field (vo) in my form-bean that I don¹t use. In edit action I must check if the vo exists (the bean that is being edited), retrieve its id and see if it matches the id given on the form and then do my work. the vo has also another important role... check if noone has changed this bean when I am updating it (if I define a lock field on my bean OJB will throw an OptmisticLockingException - I think it is a good thing... but I don¹t use it for every kind of beans (example a bean with only id and name... it makes less sense to do this)). On both actions I clean the form-bean session attribute. Using tiles definitions i reuse the jsp code (only 1 jsp file which can be used in severall tiles definitions). a viewX action populates my form-bean (with my vo) so that data is presented to the user when the user is forwarded. if you remove the vo field... you can use request scope on your form-bean, forget cleaning the session and the rest stays the same. I hope I have explained myself well. Pedro Salgado On 12/1/05 10:29 am, Mark Benussi [EMAIL PROTECTED] wrote: I have a web based application which allows the Creation, Update, Read and Deletion of Data objects (Nothing new here). All data changes are done by calling Manager methods with Action Forms to update the relevant data e.g. new ShopManager().createOrder(createOrderForm); or new ShopManager.updateOrder(updateOrderForm); My problem is that I am having to create duplicate JSPs and actions for the create and update processes. The pages look exactly the same and hold the same values but the difference is that the update actions will pre populate the form with the existing methods and invoke the update method on the manager instead of a standard create. Even the forms are identical (The update form extends the create form but holds a reference to the data id that is to be updated). My question is: Is there a way to have one set of JSPs, Forms and actions to manage all of this. When I change a JSP I am having to maintain two pages which sounds trivial but to me shouts of bad design. The only difference between the pages is that they call different actions i.e. /order/create/stage1.do vs /order/update/stage1.do I would be interersted to know peoples thoughts. Cheers, Mark - 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: Database connection question - seeking expert opinion
It would very simple to migrate application. Search through mail that I sent to you few days ago. Way to use connection pool is there. Because I m working on Perl project now so I don't have that code handy now. Amit Gupta Mobile: 91-9891062552 Yahoo IM: amitguptainn MSN IM : amitguptainn -Original Message- From: Manisha Sathe [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 12, 2005 2:56 PM To: Struts Users Mailing List Subject: RE: Database connection question - seeking expert opinion oh, so mean to say automatically i get connection pool - In my servlet i am using (at least currently) normal JDBC call - which i was thinking how i can convert in to connection pool as i heard of it a lot !!! . ok, then can i use struts database method in any class ? or is it restricted to only Action class ? Can i develop some sort of common class to get the connection ? regards Manisha Amit Gupta [EMAIL PROTECTED] wrote: Hi Manisha, Struts database method uses DBCP. It offer database connection pooling. So I think struts db method is better Amit Gupta Mobile: 91-9891062552 Yahoo IM: amitguptainn MSN IM : amitguptainn -Original Message- From: Manisha Sathe [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 12, 2005 11:40 AM To: user@struts.apache.org Subject: Database connection question - seeking expert opinion I am still new to struts and even servlets. Last time when i developed servlets, i created one common class method to get the connection (with regular JDBC call). All database related parameters i stored in a constant variable file. Now in struts i found out that we can specify the datasource inside struts-config.xml. I want to know which methodology is better ? Can i continue with my existing method ? or struts database method is better ? regards Manisha __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts design for CRUD methods
On Wed, 12 Jan 2005 09:29:34 +, Mark Benussi [EMAIL PROTECTED] wrote: My problem is that I am having to create duplicate JSPs and actions for the create and update processes. Hi, Mark, What makes you think you have to create different JSPs, Actions, etc.? You don't, but without knowing what you think, we cannot know what the problem is, because, clearly, the problem is in your understanding. I hope you don't take this wrong. I'm just trying to be helpful. Jack -- -- You can lead a horse to water but you cannot make it float on its back. ~Dakota Jack~ You can't wake a person who is pretending to be asleep. ~Native Proverb~ Each man is good in His sight. It is not necessary for eagles to be crows. ~Hunkesni (Sitting Bull), Hunkpapa Sioux~ --- This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Re: populate data for edit form
Thank you for your help, but the form still blank. I also tried using session (in struts-config.xml and session.setAttribute()) but still blank. request.setAttribute(categoryEditForm, form); Dody. CategoryEditForm categoryEditForm = (CategoryEditForm)form; categoryEditForm.setName(testing); request.setAttribute(categoryEditForm, form); return (mapping.findForward(continue)); I think that will do ;) Pedro Salgado On 12/1/05 10:19 am, Dody Rachmat Wicaksono [EMAIL PROTECTED] wrote: I'm trying to create an edit page. I think I already in the right direction, but still unable to populate data even with a direct value via action class. Please let me what's wrong here. I've spend 3 days alone with this problem. Thank you. I created two action file: - SetUpCategoryEditAction.java (this action will populate data from db to form) - CategoryEditAction.java (this action will save the data) My formbean: CategoryEditForm.java -- public class CategoryEditForm extends ValidatorForm { private String name; private String categoryId; public void setName(String s) { this.name = s; } public String getName() { return name; } public void setcategoryId(String s) { this.categoryId = s; } public String getcategoryId() { return categoryId; } } My struts-config.xml -- form-bean name=categoryEditForm type=com.strutsgen.garuda.CategoryEditForm/ action path=/setUpCategoryEditForm type=com.strutsgen.garuda.SetUpCategoryEditAction name=categoryEditForm scope=request validate=false forward name=continue path=/categoryEditForm.jsp/ /action action path=/categoryEdit type=com.strutsgen.garuda.CategoryEditAction name=categoryEditForm attribute=val_categoryEdit scope=request validate=true input=/categoryEditForm.jsp forward name=success path=/categoryEditOk.jsp/ /action SetUpCategoryEditAction.java: -- public final class SetUpCategoryEditAction extends Action { public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { CategoryEditForm categoryEditForm = (CategoryEditForm)form; categoryEditForm.setName(testing); return (mapping.findForward(continue)); } } - 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]
Re: Re: populate data for edit form
Thank you for your help, but the form still blank. I also tried using session (in struts-config.xml and session.setAttribute()) but still blank. request.setAttribute(categoryEditForm, form); Dody. CategoryEditForm categoryEditForm = (CategoryEditForm)form; categoryEditForm.setName(testing); request.setAttribute(categoryEditForm, form); return (mapping.findForward(continue)); I think that will do ;) Pedro Salgado On 12/1/05 10:19 am, Dody Rachmat Wicaksono [EMAIL PROTECTED] wrote: I'm trying to create an edit page. I think I already in the right direction, but still unable to populate data even with a direct value via action class. Please let me what's wrong here. I've spend 3 days alone with this problem. Thank you. I created two action file: - SetUpCategoryEditAction.java (this action will populate data from db to form) - CategoryEditAction.java (this action will save the data) My formbean: CategoryEditForm.java -- public class CategoryEditForm extends ValidatorForm { private String name; private String categoryId; public void setName(String s) { this.name = s; } public String getName() { return name; } public void setcategoryId(String s) { this.categoryId = s; } public String getcategoryId() { return categoryId; } } My struts-config.xml -- form-bean name=categoryEditForm type=com.strutsgen.garuda.CategoryEditForm/ action path=/setUpCategoryEditForm type=com.strutsgen.garuda.SetUpCategoryEditAction name=categoryEditForm scope=request validate=false forward name=continue path=/categoryEditForm.jsp/ /action action path=/categoryEdit type=com.strutsgen.garuda.CategoryEditAction name=categoryEditForm attribute=val_categoryEdit scope=request validate=true input=/categoryEditForm.jsp forward name=success path=/categoryEditOk.jsp/ /action SetUpCategoryEditAction.java: -- public final class SetUpCategoryEditAction extends Action { public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { CategoryEditForm categoryEditForm = (CategoryEditForm)form; categoryEditForm.setName(testing); return (mapping.findForward(continue)); } } - 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]
Re: Unable to see c:forEach out put
Hi, Vamsee, Don't you have to define what items are covered by your var? Jack snip On Wed, 12 Jan 2005 13:52:32 +0530, Vamsee Kanakala [EMAIL PROTECTED] wrote: c:forEach begin=1 end=5 var=current c:out value=${current} / /c:forEach I get something like this: ${current} ${current} ${current} ${current} ${current} /snip -- -- You can lead a horse to water but you cannot make it float on its back. ~Dakota Jack~ You can't wake a person who is pretending to be asleep. ~Native Proverb~ Each man is good in His sight. It is not necessary for eagles to be crows. ~Hunkesni (Sitting Bull), Hunkpapa Sioux~ --- This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: populate data for edit form
Doesn't the framework do the setting of this attribute, Pedro? Jack snip On Wed, 12 Jan 2005 10:23:10 +0100, Pedro Salgado [EMAIL PROTECTED] wrote: request.setAttribute(categoryEditForm, form); /snip -- -- You can lead a horse to water but you cannot make it float on its back. ~Dakota Jack~ You can't wake a person who is pretending to be asleep. ~Native Proverb~ Each man is good in His sight. It is not necessary for eagles to be crows. ~Hunkesni (Sitting Bull), Hunkpapa Sioux~ --- This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: populate data for edit form
Hello, Dody, This looks okay to me. What does your JSP page look like? Jack snip On Wed, 12 Jan 2005 16:19:43 +0700, Dody Rachmat Wicaksono [EMAIL PROTECTED] wrote: I'm trying to create an edit page. I think I already in the right direction, but still unable to populate data even with a direct value via action class. Please let me what's wrong here. I've spend 3 days alone with this problem. /snip Jack -- -- You can lead a horse to water but you cannot make it float on its back. ~Dakota Jack~ You can't wake a person who is pretending to be asleep. ~Native Proverb~ Each man is good in His sight. It is not necessary for eagles to be crows. ~Hunkesni (Sitting Bull), Hunkpapa Sioux~ --- This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
XML date validation
Hi, Using XML date validation, how do I check if the entered date is in the future or not ? Thanks --Deepak
Re: XML date validation
Author your own pluggable validator. See the Struts doc on this. I recently posted an example that you can probably use as a place to start (pasted below). Erik deepak wrote: Hi, Using XML date validation, how do I check if the entered date is in the future or not ? Thanks --Deepak Original Message Subject:Re: Hmm... i will go crazy due to validation Date: Wed, 05 Jan 2005 05:40:26 -0500 From: Erik Weber [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org References: [EMAIL PROTECTED] This is not a direct answer to any of your questions but perhaps it will spur your thinking. This is an example of using a custom (pluggable) validator that makes sure a date entry is not only a real date, but that the date is within a desired range (seemingly you are wanting to do something similar to this). I wrote this for Struts 1.1. I don't know if there is something new and improved that would be better, but it works. From validation.xml (you'll see the use of the date rule -- which uses the datePattern variable, as well as my custom dateRange rule -- which uses the minDate and maxDate variables): field property=licenseExpirationDate depends=date,dateRange arg0 key=vendor.edit.label.licenseExpirationDate/ var var-namedatePattern/var-name var-valueMM/dd//var-value /var var var-nameminDate/var-name var-value01/01/1900/var-value /var var var-namemaxDate/var-name var-value12/31/2030/var-value /var /field From validator-rules.xml: validator name=dateRange classname=ValidationUtil method=validateDateRange methodParams=java.lang.Object, org.apache.commons.validator.ValidatorAction, org.apache.commons.validator.Field, org.apache.struts.action.ActionErrors, javax.servlet.http.HttpServletRequest depends=required msg=errors.dateRange/ And finally the source of ValidationUtil: import javax.servlet.http.HttpServletRequest; import java.util.Date; import java.text.SimpleDateFormat; import org.apache.struts.action.ActionErrors; import org.apache.struts.validator.Resources; import org.apache.commons.validator.Field; import org.apache.commons.validator.ValidatorAction; import org.apache.commons.validator.ValidatorUtil; import org.apache.commons.validator.GenericValidator; public class ValidationUtil { public static final String DEFAULT_FORM_DATE_PATTERN = M/dd/; public static final Date DEFAULT_MIN_DATE = getDefaultMinDate(); public static final Date DEFAULT_MAX_DATE = getDefaultMaxDate(); public static boolean validateDateRange(Object bean, ValidatorAction va, Field field, ActionErrors errors, HttpServletRequest request) { //if we're not properly configured to parse dates, //all date validation will fail if (DEFAULT_MIN_DATE == null || DEFAULT_MAX_DATE == null) return false; try { String value = ValidatorUtil.getValueAsString(bean, field.getProperty()); Date date = getDate(value, DEFAULT_FORM_DATE_PATTERN); Date minDate = getDate(field.getVarValue(minDate), DEFAULT_FORM_DATE_PATTERN); Date maxDate = getDate(field.getVarValue(maxDate), DEFAULT_FORM_DATE_PATTERN); if (date.compareTo(minDate) 0 || date.compareTo(maxDate) 0) { errors.add(field.getKey(), Resources.getActionError(request, va, field)); return false; } return true; } catch (Exception e) { e.printStackTrace(); errors.add(field.getKey(), Resources.getActionError(request, va, field)); return false; } } protected static Date getDate(String dateString, String pattern) { Date date = null; try { SimpleDateFormat df = new SimpleDateFormat(pattern); date = df.parse(dateString); } catch (Exception e) { e.printStackTrace(); } return date; } protected static Date getDefaultMinDate() { return getDate(01/01/1900, DEFAULT_FORM_DATE_PATTERN); } protected static Date getDefaultMaxDate() { return getDate(12/31/2030, DEFAULT_FORM_DATE_PATTERN); } } Maybe you should browse the Struts wiki (wiki.apache.org/struts) for example links? Hope that helps some, Erik P.S. I never had much luck with DatePatternStrict, always wondered if it was buggy . . . But I guess others are using it successfully? Manisha Sathe wrote: I am testing struts validatior in one test program. Finally i could do some date validation for user i/p. I could get javascript pop-up if i enter it wrongly. i wanted to test server
Re: Unable to see c:forEach out put
Dakota Jack wrote: Don't you have to define what items are covered by your var? Sorry if I sound daft, but I do I have to do that? Where do I do that? TIA, -Vamsee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Javascript gibberish thrown by ValidatorForm!
Hi List, I have a strange problem - I'm trying to display a ArrayList made of LabelValueBeans. I'm trying to display them in a html:options like this: html:select property=status html:options collection=${sessionScope.status} / /html:select But, All I'm getting is a bunch of javascript gibberish (which I think, comes from validation-rules.xml or something) written across the screen. Am I missing something important here? Please help! TIA, -Vamsee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
getting tiles to work
hi, just trying to configure my application here so it can use tiles, however I have been running into some difficulties, I managed to get round them and now my result is any empty response. I redirect to my base jsp page from my Action, contents of base jsp template eReportDesktop.jsp -- %@ taglib uri=/WEB-INF/struts-tiles.tld prefix=tiles % tiles:insert page=/layouts/EreportDesktopLayout.jsp flush=true tiles:put name=header value=/WEB-INF/jspf/htmlComponents/eReportHeader.jspf / tiles:put name=customHeader value=/WEB-INF/eReports/header/eReportCustomerHeader.jsp / tiles:put name=desktopLayout value=/WEB-INF/eReports/deskTopLayout/jspf/deskTopLayout.jspf / tiles:put name=footer value=/WEB-INF/jspf/htmlComponents/eReportFooter.jspf / /tiles:insert all the tiles:put templates contain all the data to build the finished template to be returned, EreportDesktopLayout.jsp is effectively blank, am I write in thinking that all template data is flushed into EreportDesktopLayout.jsp. If not I don't understand this, interesting but I don't understand. My configuration is like so, tomcat 4.01 , struts 1.1 struts-config (I declare the pulgin) !--tiles plugin-- plug-in className=org.apache.struts.tiles.TilesPlugin set-property property=definitions-config value=/WEB-INF/struts-tiles-defs.xml/ set-property property=definitions-debug value=2/ set-property property=definitions-parser-details value=2/ set-property property=definitions-parser-validate value=true/ set-property property=moduleAware value=true/ /plug-in if I leave this attribute/element out set-property property=definitions-config value=/WEB-INF/struts-tiles-defs.xml/ it flakes, so I had to create a file struts-tiles-defs.xml, struts-tiles-defs.xml - !DOCTYPE tiles-definitions PUBLIC -//Apache Software Foundation//DTD Tiles Configuration//EN http://jakarta.apache.org/struts/dtds/tiles-config.dtd; tiles-definitions definition name=test path=/layouts/EreportDesktopLayout.jsp put name=header value=/WEB-INF/jspf/htmlComponents/eReportHeader.jspf/ put name=customHeader value=/WEB-INF/eReports/header/eReportCustomerHeader.jsp/ put name=desktopLayout value=/WEB-INF/eReports/deskTopLayout/deskTopLayout.jspf/ put name=footer value=/WEB-INF/jspf/htmlComponents/eReportFooter.jspf/ /definition /tiles-definitions I imported struts-tiles.tld into my web-inf, made reference in my deployment descriptor web.xml taglib taglib-uri/WEB-INF/struts-tiles.tld/taglib-uri taglib-location/WEB-INF/struts-tiles.tld/taglib-location /taglib my resulting template eReportDesktop.jsp returns blank, it used to be like this which worked fine, %@ include file=/WEB-INF/jspf/htmlComponents/eReportHeader.jspf % jsp:include page=/WEB-INF/eReports/header/eReportCustomerHeader.jsp / %@ include file=/WEB-INF/eReports/deskTopLayout/deskTopLayout.jspf % %@ include file=/WEB-INF/jspf/htmlComponents/eReportFooter.jspf % however I like the concept of tiles. Any ideas would be greatly appreciated, thank you.
Multiple Struts-config problem
hi all , i am implementing multiple modules in struts 1.2.4 i have two config files which i define in web.xml like init-param param-nameconfig/param-name param-value/WEB-INF/struts-config.xml/param-value /init-param init-param param-nameconfig/master/param-name param-value/WEB-INF/master/master-config.xml/param-value /init-param and in the master-config.xml i have an action defined like ... action path=/cityMaster forward=/master/cityMaster.jsp / action path=/cityAction type=master.CityMasterAddAction name=cityMasterBean scope=request validate=true input=/cityMaster.do forward name=Success path=/cityMaster.do / /action but when i try to access the from with html link .. it gives error html:link module = master action=cityActionlink/html:link The error given is : no action found /cityAction Please could tell me how to access the actions defined in modules Sachin Hegde Paradyne Infotech Limited , Mumbai 09324546711 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: getting tiles to work
Im an idiot for thinking this, am I write in thinking that all template data is flushed into EreportDesktopLayout.jsp. In the examples I have been looking at I couldn't work out where the layout page rsided and what was in it, its not fully clicked yet but getting there. my EreportDesktopLayout.jsp now looks like so, %@ taglib uri=/WEB-INF/struts-tiles.tld prefix=tiles % tiles:insert attribute=header/ tiles:insert attribute=customHeader/ tiles:insert attribute=desktopLayout/ tiles:insert attribute=footer/ im getting content returned now however my header file is not rendering my style sheet, tiles:insert attribute=header/ which is /WEB-INF/jspf/htmlComponents/eReportHeader.jspf snip %@ taglib uri=/WEB-INF/struts-html-el.tld prefix=html % %@ taglib uri=/WEB-INF/c.tld prefix=c% html head titleNeo E-Reports/title link href=html:rewrite page=/styles/neoStyles.css/ rel=stylesheet type=text/css /snip my style sheet is not getting rendered now, instead when I view source it is, link href=html:rewrite page=/styles/neoStyles.css/ rel=stylesheet type=text/css -Original Message- From: John McCosker [mailto:[EMAIL PROTECTED] Sent: 12 January 2005 12:05 To: 'Struts Users Mailing List' Subject: getting tiles to work hi, just trying to configure my application here so it can use tiles, however I have been running into some difficulties, I managed to get round them and now my result is any empty response. I redirect to my base jsp page from my Action, contents of base jsp template eReportDesktop.jsp -- %@ taglib uri=/WEB-INF/struts-tiles.tld prefix=tiles % tiles:insert page=/layouts/EreportDesktopLayout.jsp flush=true tiles:put name=header value=/WEB-INF/jspf/htmlComponents/eReportHeader.jspf / tiles:put name=customHeader value=/WEB-INF/eReports/header/eReportCustomerHeader.jsp / tiles:put name=desktopLayout value=/WEB-INF/eReports/deskTopLayout/jspf/deskTopLayout.jspf / tiles:put name=footer value=/WEB-INF/jspf/htmlComponents/eReportFooter.jspf / /tiles:insert all the tiles:put templates contain all the data to build the finished template to be returned, EreportDesktopLayout.jsp is effectively blank, am I write in thinking that all template data is flushed into EreportDesktopLayout.jsp. If not I don't understand this, interesting but I don't understand. My configuration is like so, tomcat 4.01 , struts 1.1 struts-config (I declare the pulgin) !--tiles plugin-- plug-in className=org.apache.struts.tiles.TilesPlugin set-property property=definitions-config value=/WEB-INF/struts-tiles-defs.xml/ set-property property=definitions-debug value=2/ set-property property=definitions-parser-details value=2/ set-property property=definitions-parser-validate value=true/ set-property property=moduleAware value=true/ /plug-in if I leave this attribute/element out set-property property=definitions-config value=/WEB-INF/struts-tiles-defs.xml/ it flakes, so I had to create a file struts-tiles-defs.xml, struts-tiles-defs.xml - !DOCTYPE tiles-definitions PUBLIC -//Apache Software Foundation//DTD Tiles Configuration//EN http://jakarta.apache.org/struts/dtds/tiles-config.dtd; tiles-definitions definition name=test path=/layouts/EreportDesktopLayout.jsp put name=header value=/WEB-INF/jspf/htmlComponents/eReportHeader.jspf/ put name=customHeader value=/WEB-INF/eReports/header/eReportCustomerHeader.jsp/ put name=desktopLayout value=/WEB-INF/eReports/deskTopLayout/deskTopLayout.jspf/ put name=footer value=/WEB-INF/jspf/htmlComponents/eReportFooter.jspf/ /definition /tiles-definitions I imported struts-tiles.tld into my web-inf, made reference in my deployment descriptor web.xml taglib taglib-uri/WEB-INF/struts-tiles.tld/taglib-uri taglib-location/WEB-INF/struts-tiles.tld/taglib-location /taglib my resulting template eReportDesktop.jsp returns blank, it used to be like this which worked fine, %@ include file=/WEB-INF/jspf/htmlComponents/eReportHeader.jspf % jsp:include page=/WEB-INF/eReports/header/eReportCustomerHeader.jsp / %@ include file=/WEB-INF/eReports/deskTopLayout/deskTopLayout.jspf % %@ include file=/WEB-INF/jspf/htmlComponents/eReportFooter.jspf % however I like the concept of tiles. Any ideas would be greatly appreciated, thank you.
Re: Struts design for CRUD methods
Here is a good tutorial by Rick Reumann on using struts with iBATIS that could be helpful. http://www.reumann.net/struts/ibatisLesson1.do Larry On Wed, 12 Jan 2005 02:55:50 -0800, Dakota Jack [EMAIL PROTECTED] wrote: On Wed, 12 Jan 2005 09:29:34 +, Mark Benussi [EMAIL PROTECTED] wrote: My problem is that I am having to create duplicate JSPs and actions for the create and update processes. Hi, Mark, What makes you think you have to create different JSPs, Actions, etc.? You don't, but without knowing what you think, we cannot know what the problem is, because, clearly, the problem is in your understanding. I hope you don't take this wrong. I'm just trying to be helpful. Jack -- -- You can lead a horse to water but you cannot make it float on its back. ~Dakota Jack~ You can't wake a person who is pretending to be asleep. ~Native Proverb~ Each man is good in His sight. It is not necessary for eagles to be crows. ~Hunkesni (Sitting Bull), Hunkpapa Sioux~ --- This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. - 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]
Passing Parameters to Tiles Layout
Assume a standard Tiles layout with Header, Navigation, Body, and Footer, each implemented as a JSP. In this setup, the navigation.jsp is responsible for dynamically generating the left hand navigation from an XML configuration file. For each page request, this component needs to build the navigation appropriate for that page. The body.jsp contains a parameter needed by the navigation to determine the correct navigation. What are some approaches for passing values like this from the body.jsp to the navigation.jsp? The goal is to allow web programmers to add body.jsp (or new pages) to a web site by creating and adding the page only. The page would contain the body's HTML and this navigation parameter. Assuming the appropriate navigation is already defined in the configuration file, no other configuration would be needed to add a page (i.e. struts*.xml, tiles*.xml) Thanks Allen
display tag rendering problem
Hi all I'd like to use display tags.Actually I created a decorator for the columns of a table and I use the attribute sortable for sorting them.When I load the page , It does not visualize the arrows i used for pointing the sortable link action. Pratically the arrow images I use for calling the sortable action appears just when I click on it. I use IE 5 and I'd like to know why those arrows appears just when I click on it! Please help Regards Libero ADSL: 3 mesi gratis e navighi a 1.2 Mega. E poi hai l'Adsl senza limiti a meno di 1 euro al giorno. Abbonati subito senza costi di attivazione su http://www.libero.it - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT]Hashtable Vs Hashmap, Vector Vs ArrayList
Choosing the right Collection. http://www.javapractices.com/Topic65.cjp Ashish Kulkarni [EMAIL PROTECTED] 01/11/2005 10:33 PM Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org cc Subject [OT]Hashtable Vs Hashmap, Vector Vs ArrayList Hi what is difference between Hashtable and Hashmap , also Vector and ArrayList. What are key points to consider when selecting one over the other Ashish __ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: XML date validation
At 5:04 PM +0530 1/12/05, deepak wrote: Hi, Using XML date validation, how do I check if the entered date is in the future or not ? If by XML date validation, you mean the commons-validator framework and ValidatorForm or a class derived from it, there is no built-in support for this. On the other hand, it is possible to write custom validator classes, register them by name in the config file, and then use the name as one of the values in the depends attribute of your per-form validation. Have a look at the validator-rules.xml file and the org.apache.struts.validator.FieldChecks class for some idea of how this is done. I'll admit that I don't find it extremely straightforward, but you can get pretty far by copying what comes built in to Struts. Joe Thanks --Deepak -- Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com Narrow minds are weapons made for mass destruction -The Ex - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: display tag rendering problem
Try the display tag mailing list http://sourceforge.net/mail/?group_id=73068 Paul -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 12 January 2005 14:03 To: user Subject: display tag rendering problem Hi all I'd like to use display tags.Actually I created a decorator for the columns of a table and I use the attribute sortable for sorting them.When I load the page , It does not visualize the arrows i used for pointing the sortable link action. Pratically the arrow images I use for calling the sortable action appears just when I click on it. I use IE 5 and I'd like to know why those arrows appears just when I click on it! Please help Regards Libero ADSL: 3 mesi gratis e navighi a 1.2 Mega. E poi hai l'Adsl senza limiti a meno di 1 euro al giorno. Abbonati subito senza costi di attivazione su http://www.libero.it - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Axios Email Confidentiality Footer Privileged/Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should destroy this message, and notify us immediately. If you or your employer does not consent to Internet email messages of this kind, please advise us immediately. Opinions, conclusions and other information expressed in this message are not given or endorsed by my Company or employer unless otherwise indicated by an authorised representative independent of this message. WARNING: While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted via electronic mail attachments we cannot guarantee that attachments do not contain computer virus code. You are therefore strongly advised to undertake anti virus checks prior to accessing the attachment to this electronic mail. Axios Systems Ltd grants no warranties regarding performance use or quality of any attachment and undertakes no liability for loss or damage howsoever caused. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: populate data for edit form
The problem is that you are specifying the attribute value for one of your action mappings, but not for the other. For the first (setup action), because no attribute value is set in the ActionMapping, Struts looks in the request for a bean under the form's name categoryEditForm. If it doesn't find one, it creates one and puts it there, so that by the time your Action's execute method is called, the ActionForm passed in the signature is also in the request under that attribute name. Then, when the JSP renders, the html:form tag uses its action attribute to look up the ActionMapping for the submission (/categoryEdit). This ActionMapping specifies that its form bean should be stored under the attribute name val_categoryEdit. There is nothing in the request under that name, so Struts creates a new form, which is not initialized, and uses it for prepopulating form field values. Again, if you do not specify an attribute in an action element, the value defaults to the form's name (as specified in the action's name attribute). I have never had a reason to specify attribute in the action element, but if you do, you need it to be consistent between the actions that are cooperating. Hope this helps, Joe At 4:19 PM +0700 1/12/05, Dody Rachmat Wicaksono wrote: I'm trying to create an edit page. I think I already in the right direction, but still unable to populate data even with a direct value via action class. Please let me what's wrong here. I've spend 3 days alone with this problem. Thank you. I created two action file: - SetUpCategoryEditAction.java (this action will populate data from db to form) - CategoryEditAction.java (this action will save the data) My formbean: CategoryEditForm.java -- public class CategoryEditForm extends ValidatorForm { private String name; private String categoryId; public void setName(String s) { this.name = s; } public String getName() { return name; } public void setcategoryId(String s) { this.categoryId = s; } public String getcategoryId() { return categoryId; } } My struts-config.xml -- form-bean name=categoryEditForm type=com.strutsgen.garuda.CategoryEditForm/ action path=/setUpCategoryEditForm type=com.strutsgen.garuda.SetUpCategoryEditAction name=categoryEditForm scope=request validate=false forward name=continue path=/categoryEditForm.jsp/ /action action path=/categoryEdit type=com.strutsgen.garuda.CategoryEditAction name=categoryEditForm attribute=val_categoryEdit scope=request validate=true input=/categoryEditForm.jsp forward name=success path=/categoryEditOk.jsp/ /action SetUpCategoryEditAction.java: -- public final class SetUpCategoryEditAction extends Action { public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { CategoryEditForm categoryEditForm = (CategoryEditForm)form; categoryEditForm.setName(testing); return (mapping.findForward(continue)); } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com Narrow minds are weapons made for mass destruction -The Ex - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Possible Bug: validator_1_0: msg element. key always treated as resource, never literally?
Hi, I am trying to use the mask validator as follows: msg key=A custom message. name=mask resource=false/ I expect to see 'A custom message.' when the validation fails. I get no message at all. If I add a message to my app.properties: errors.some.problem=A custom message. and then edit the validation declaration: msg key=errors.some.problem name=mask resource=false/ I get 'A custom message.' in the list of errors. NB: resource=false. If I change this to true the result does not change. If I remove the resource attribute I get the same result. It seems that the msg element is ignoring the resource attribute and always treating the key attr value as a key, hence no message when I put in the literal message. Is this a bug? -Miles Miles Daffin Morgan Stanley 20 Cabot Square | Canary Wharf | London E14 4QA | UK Tel: +44 (0) 20 767 75119 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] NOTICE: If received in error, please destroy and notify sender. Sender does not waive confidentiality or privilege, and use is prohibited.
Re: Possible Bug: validator_1_0: msg element. key always treated as resource, never literally?
Yes - Bug or Feature not implemented. http://issues.apache.org/bugzilla/show_bug.cgi?id=18169 Niall - Original Message - From: Daffin, Miles (Company IT) [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Wednesday, January 12, 2005 3:04 PM Subject: Possible Bug: validator_1_0: msg element. key always treated as resource, never literally? Hi, I am trying to use the mask validator as follows: msg key=A custom message. name=mask resource=false/ I expect to see 'A custom message.' when the validation fails. I get no message at all. If I add a message to my app.properties: errors.some.problem=A custom message. and then edit the validation declaration: msg key=errors.some.problem name=mask resource=false/ I get 'A custom message.' in the list of errors. NB: resource=false. If I change this to true the result does not change. If I remove the resource attribute I get the same result. It seems that the msg element is ignoring the resource attribute and always treating the key attr value as a key, hence no message when I put in the literal message. Is this a bug? -Miles Miles Daffin Morgan Stanley 20 Cabot Square | Canary Wharf | London E14 4QA | UK Tel: +44 (0) 20 767 75119 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] NOTICE: If received in error, please destroy and notify sender. Sender does not waive confidentiality or privilege, and use is prohibited. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
commons-chain problems
I am trying to use commons-chain on my project but I have some problems loading the chain-config.xml... does anyone setup a web application with commons-chain (ChainListener)? If I specify org.apache.commons.chain.CONFIG_ATTR on my web.xml the catalog is no longer null but it does not contain any commands. I have looked at the source code severall times and I don't know where is the problem. Help? I have appended a logger to commons-chain and commons-digester... here are the results : ** commons-chain log 15:46:17,970 - INFO org.apache.commons.chain.web.ChainListener - Initializing chain listener 15:46:18,050 - DEBUG org.apache.commons.chain.web.ChainResources - Loading chain config resource 'chain-config.xml' ** commons-digester log does not provide any information about commons-chain parse operation (?) My configuration : ** chain-config.xml (that is being copied to the WEB-INF/classes) ?xml version=1.0 encoding=UTF-8 ? catalogs catalog name=risks command name=viewRiskTypes className=package.commands.ViewRiskTypes/ /catalog /catalogs ** web.xml (Tomcat-5.0.27) context-param param-nameorg.apache.commons.chain.CONFIG_CLASS_RESOURCE/param-name param-valuechain-config.xml/param-value /context-param listener listener-class org.apache.commons.chain.web.ChainListener /listener-class /listener Pedro Salgado - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [almost OT] Struts in Practice
Also because I really like the Google style: simple, but useful and powerful. So I have been trying to make my website-- www.sportslovers.net in that way. I am not sure if I can say that mine is powerful now, but I am sure I can say it's useful, and, simple. :) t t [EMAIL PROTECTED] wrote:Thanks. I would like to get a web designer to help me. But I don't have money to do that. :( Vincent [EMAIL PROTECTED] wrote: Congrats. So this your demo site? If it is in production, you may want think about getting a web designer to help you with the layout. It kind of reminds me of a 1998 webpage. No offense intended. t t wrote: If you are a sports lover, or Struts lover, please take a look at this website: www.sportslovers.net . It's based on Struts. Have a good day! Sorry if this email bothers you. - Do you Yahoo!? Meet the all-new My Yahoo! ?Try it today! -- Plato is my friend, Aristotle is my friend, but my greatest friend is truth. - Isaac Newton - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Yahoo! Mail - Find what you need with new enhanced search. Learn more. - Do you Yahoo!? The all-new My Yahoo! What will yours do?
Re: Unable to see c:forEach out put
I guess I am daft. Must have been off last night. You don't have to when your beginning and end values are the basis for an iteration. What do you mean that you get something like this? Is it that or not? Jack On Wed, 12 Jan 2005 17:24:03 +0530, Vamsee Kanakala [EMAIL PROTECTED] wrote: Dakota Jack wrote: Don't you have to define what items are covered by your var? Sorry if I sound daft, but I do I have to do that? Where do I do that? TIA, -Vamsee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -- You can lead a horse to water but you cannot make it float on its back. ~Dakota Jack~ You can't wake a person who is pretending to be asleep. ~Native Proverb~ Each man is good in His sight. It is not necessary for eagles to be crows. ~Hunkesni (Sitting Bull), Hunkpapa Sioux~ --- This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: commons-chain problems
Well, this question is actually for the commons-chain (Jakarta Commons) mailing list. What version of chain are you using? In looking thru the javadocs, that parameter is deprecated. http://jakarta.apache.org/commons/chain/apidocs/org/apache/commons/chain/web/ChainListener.html Have you tried specifying a different context init param? For what you are doing, wouldn't org.apache.commons.chain.CONFIG_WEB_RESOURCE be the best bet? -- James Mitchell Software Engineer / Open Source Evangelist EdgeTech, Inc. 678.910.8017 AIM: jmitchtx - Original Message - From: Pedro Salgado [EMAIL PROTECTED] To: Struts Users List struts-user@jakarta.apache.org Sent: Wednesday, January 12, 2005 10:22 AM Subject: commons-chain problems I am trying to use commons-chain on my project but I have some problems loading the chain-config.xml... does anyone setup a web application with commons-chain (ChainListener)? If I specify org.apache.commons.chain.CONFIG_ATTR on my web.xml the catalog is no longer null but it does not contain any commands. I have looked at the source code severall times and I don't know where is the problem. Help? I have appended a logger to commons-chain and commons-digester... here are the results : ** commons-chain log 15:46:17,970 - INFO org.apache.commons.chain.web.ChainListener - Initializing chain listener 15:46:18,050 - DEBUG org.apache.commons.chain.web.ChainResources - Loading chain config resource 'chain-config.xml' ** commons-digester log does not provide any information about commons-chain parse operation (?) My configuration : ** chain-config.xml (that is being copied to the WEB-INF/classes) ?xml version=1.0 encoding=UTF-8 ? catalogs catalog name=risks command name=viewRiskTypes className=package.commands.ViewRiskTypes/ /catalog /catalogs ** web.xml (Tomcat-5.0.27) context-param param-nameorg.apache.commons.chain.CONFIG_CLASS_RESOURCE/param-name param-valuechain-config.xml/param-value /context-param listener listener-class org.apache.commons.chain.web.ChainListener /listener-class /listener Pedro Salgado - 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: commons-chain problems
On 12/1/05 5:06 pm, James Mitchell [EMAIL PROTECTED] wrote: Well, this question is actually for the commons-chain (Jakarta Commons) mailing list. I already sent a copy to the commons mailing list. What version of chain are you using? In looking thru the javadocs, that parameter is deprecated. 1.0. yes... but I looked at the source code and it was the only way to create a Catalog on the ServletContext (but it will have no commands at all!). not specifying it will never load a catalog. http://jakarta.apache.org/commons/chain/apidocs/org/apache/commons/chain/web/C hainListener.html Have you tried specifying a different context init param? For what you are doing, wouldn't org.apache.commons.chain.CONFIG_WEB_RESOURCE be the best bet? yes, with the following configurations: context-param param-nameorg.apache.commons.chain.CONFIG_WEB_RESOURCE/param-name param-valuechain-config.xml/param-value /context-param and context-param param-nameorg.apache.commons.chain.CONFIG_WEB_RESOURCE/param-name param-value/WEB-INF/classes/chain-config.xml/param-value /context-param the same result. what is odd is that the digester doesn't parse anything and it doesn't complain about anything either (?). Pedro Salgado -- James Mitchell Software Engineer / Open Source Evangelist EdgeTech, Inc. 678.910.8017 AIM: jmitchtx - Original Message - From: Pedro Salgado [EMAIL PROTECTED] To: Struts Users List struts-user@jakarta.apache.org Sent: Wednesday, January 12, 2005 10:22 AM Subject: commons-chain problems I am trying to use commons-chain on my project but I have some problems loading the chain-config.xml... does anyone setup a web application with commons-chain (ChainListener)? If I specify org.apache.commons.chain.CONFIG_ATTR on my web.xml the catalog is no longer null but it does not contain any commands. I have looked at the source code severall times and I don't know where is the problem. Help? I have appended a logger to commons-chain and commons-digester... here are the results : ** commons-chain log 15:46:17,970 - INFO org.apache.commons.chain.web.ChainListener - Initializing chain listener 15:46:18,050 - DEBUG org.apache.commons.chain.web.ChainResources - Loading chain config resource 'chain-config.xml' ** commons-digester log does not provide any information about commons-chain parse operation (?) My configuration : ** chain-config.xml (that is being copied to the WEB-INF/classes) ?xml version=1.0 encoding=UTF-8 ? catalogs catalog name=risks command name=viewRiskTypes className=package.commands.ViewRiskTypes/ /catalog /catalogs ** web.xml (Tomcat-5.0.27) context-param param-nameorg.apache.commons.chain.CONFIG_CLASS_RESOURCE/param-name param-valuechain-config.xml/param-value /context-param listener listener-class org.apache.commons.chain.web.ChainListener /listener-class /listener Pedro Salgado - 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]
RE: Database connection question - seeking expert opinion
-Original Message- From: Manisha Sathe [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 11, 2005 11:10 PM To: user@struts.apache.org Subject: Database connection question - seeking expert opinion I am still new to struts and even servlets. Last time when i developed servlets, i created one common class method to get the connection (with regular JDBC call). All database related parameters i stored in a constant variable file. Now in struts i found out that we can specify the datasource inside struts-config.xml. I want to know which methodology is better ? Can i continue with my existing method ? or struts database method is better ? Depends on your patterns. I use JNDI connections because my presentation layer doesn't know anything at all about my data layer. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
html:link and char encoding
Hi, Can someone explain me what's wrong in HTTP / servlet API about char encoding : I'm using html:link to build a link with parameters, whose values use french chars ('é', 'à' ...) I need to set useLocaleEncoding to get values in my servlet (that is not a struts action) using getParameterMap. If I do not set this attribute, I get values with strange strings that looks like UTF-8 sequences. Is they're no strict standard for URI encoding ? Is tomcat servlet API wrong about this ? Nico. This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: commons-chain problems
I haven't used the ChainListener, but I'm wondering if you haven't caught up with the CatalogFactory API which came in shortly before the 1.0 release of Chain. What code are you using which returns a null catalog? What I think you should be using, from what you wrote and the ChainListener javadoc, is Catalog theCatalog = CatalogFactory.getCatalog(risks); The ChainListener javadoc specifies that the org.apache.commons.chain.CONFIG_ATTR parameter is deprecated. Joe At 4:22 PM +0100 1/12/05, Pedro Salgado wrote: I am trying to use commons-chain on my project but I have some problems loading the chain-config.xml... does anyone setup a web application with commons-chain (ChainListener)? If I specify org.apache.commons.chain.CONFIG_ATTR on my web.xml the catalog is no longer null but it does not contain any commands. I have looked at the source code severall times and I don't know where is the problem. Help? I have appended a logger to commons-chain and commons-digester... here are the results : ** commons-chain log 15:46:17,970 - INFO org.apache.commons.chain.web.ChainListener - Initializing chain listener 15:46:18,050 - DEBUG org.apache.commons.chain.web.ChainResources - Loading chain config resource 'chain-config.xml' ** commons-digester log does not provide any information about commons-chain parse operation (?) My configuration : ** chain-config.xml (that is being copied to the WEB-INF/classes) ?xml version=1.0 encoding=UTF-8 ? catalogs catalog name=risks command name=viewRiskTypes className=package.commands.ViewRiskTypes/ /catalog /catalogs ** web.xml (Tomcat-5.0.27) context-param param-nameorg.apache.commons.chain.CONFIG_CLASS_RESOURCE/param-name param-valuechain-config.xml/param-value /context-param listener listener-class org.apache.commons.chain.web.ChainListener /listener-class /listener Pedro Salgado - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com Narrow minds are weapons made for mass destruction -The Ex - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Re: populate data for edit form
Here is my jsp part: html:form action=categoryEdit focus=name table tr td Category Name:/td tdhtml:text property=name//td /tr /table html:submitbean:message key=button.submit//html:submit /html:form The code above is the same with the code for insert. Perhaps I'm forgetting something here. :( Dody. Hello, Dody, This looks okay to me. What does your JSP page look like? Jack snip On Wed, 12 Jan 2005 16:19:43 +0700, Dody Rachmat Wicaksono [EMAIL PROTECTED] wrote: I'm trying to create an edit page. I think I already in the right direction, but still unable to populate data even with a direct value via action class. Please let me what's wrong here. I've spend 3 days alone with this problem. /snip Jack -- -- You can lead a horse to water but you cannot make it float on its back. ~Dakota Jack~ You can't wake a person who is pretending to be asleep. ~Native Proverb~ Each man is good in His sight. It is not necessary for eagles to be crows. ~Hunkesni (Sitting Bull), Hunkpapa Sioux~ --- This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. - 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: Re: populate data for edit form
Here is my jsp part: html:form action=categoryEdit focus=name table tr td Category Name:/td tdhtml:text property=name//td /tr /table html:submitbean:message key=button.submit//html:submit /html:form The code above is the same with the code for insert. Perhaps I'm forgetting something here. :( Dody. Hello, Dody, This looks okay to me. What does your JSP page look like? Jack snip On Wed, 12 Jan 2005 16:19:43 +0700, Dody Rachmat Wicaksono [EMAIL PROTECTED] wrote: I'm trying to create an edit page. I think I already in the right direction, but still unable to populate data even with a direct value via action class. Please let me what's wrong here. I've spend 3 days alone with this problem. /snip Jack -- -- You can lead a horse to water but you cannot make it float on its back. ~Dakota Jack~ You can't wake a person who is pretending to be asleep. ~Native Proverb~ Each man is good in His sight. It is not necessary for eagles to be crows. ~Hunkesni (Sitting Bull), Hunkpapa Sioux~ --- This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. - 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: Re: populate data for edit form
Thank you everyone. The problem is solved. Now i set the same attribute for both action. action path=/setUpCategoryEditForm type=com.strutsgen.garuda.SetUpCategoryEditAction name=categoryEditForm attribute=val_categoryEdit scope=request validate=false forward name=continue path=/categoryEditForm.jsp/ /action action path=/categoryEdit type=com.strutsgen.garuda.CategoryEditAction name=categoryEditForm attribute=val_categoryEdit scope=request validate=true input=/categoryEditForm.jsp forward name=success path=/categoryEditOk.jsp/ /action My codes in SetUpCategoryEditAction: CategoryEditForm categoryEditForm = (CategoryEditForm) form; categoryEditForm.setName(testing); request.setAttribute(categoryEditForm, form); Dody. I'll be! Never used attribute either. Thanks. Jack On Wed, 12 Jan 2005 08:19:25 -0600, Joe Germuska [EMAIL PROTECTED] wrote: The problem is that you are specifying the attribute value for one of your action mappings, but not for the other. For the first (setup action), because no attribute value is set in the ActionMapping, Struts looks in the request for a bean under the form's name categoryEditForm. If it doesn't find one, it creates one and puts it there, so that by the time your Action's execute method is called, the ActionForm passed in the signature is also in the request under that attribute name. Then, when the JSP renders, the html:form tag uses its action attribute to look up the ActionMapping for the submission (/categoryEdit). This ActionMapping specifies that its form bean should be stored under the attribute name val_categoryEdit. There is nothing in the request under that name, so Struts creates a new form, which is not initialized, and uses it for prepopulating form field values. Again, if you do not specify an attribute in an action element, the value defaults to the form's name (as specified in the action's name attribute). I have never had a reason to specify attribute in the action element, but if you do, you need it to be consistent between the actions that are cooperating. Hope this helps, Joe At 4:19 PM +0700 1/12/05, Dody Rachmat Wicaksono wrote: I'm trying to create an edit page. I think I already in the right direction, but still unable to populate data even with a direct value via action class. Please let me what's wrong here. I've spend 3 days alone with this problem. Thank you. I created two action file: - SetUpCategoryEditAction.java (this action will populate data from db to form) - CategoryEditAction.java (this action will save the data) My formbean: CategoryEditForm.java -- public class CategoryEditForm extends ValidatorForm { private String name; private String categoryId; public void setName(String s) { this.name = s; } public String getName() { return name; } public void setcategoryId(String s) { this.categoryId = s; } public String getcategoryId() { return categoryId; } } My struts-config.xml -- form-bean name=categoryEditForm type=com.strutsgen.garuda.CategoryEditForm/ action path=/setUpCategoryEditForm type=com.strutsgen.garuda.SetUpCategoryEditAction name=categoryEditForm scope=request validate=false forward name=continue path=/categoryEditForm.jsp/ /action action path=/categoryEdit type=com.strutsgen.garuda.CategoryEditAction name=categoryEditForm attribute=val_categoryEdit scope=request validate=true input=/categoryEditForm.jsp forward name=success path=/categoryEditOk.jsp/ /action SetUpCategoryEditAction.java: -- public final class SetUpCategoryEditAction extends Action { public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { CategoryEditForm categoryEditForm = (CategoryEditForm)form; categoryEditForm.setName(testing); return (mapping.findForward(continue)); } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,
Re: Re: populate data for edit form
Thank you everyone. The problem is solved. Now i set the same attribute for both action. action path=/setUpCategoryEditForm type=com.strutsgen.garuda.SetUpCategoryEditAction name=categoryEditForm attribute=val_categoryEdit scope=request validate=false forward name=continue path=/categoryEditForm.jsp/ /action action path=/categoryEdit type=com.strutsgen.garuda.CategoryEditAction name=categoryEditForm attribute=val_categoryEdit scope=request validate=true input=/categoryEditForm.jsp forward name=success path=/categoryEditOk.jsp/ /action My codes in SetUpCategoryEditAction: CategoryEditForm categoryEditForm = (CategoryEditForm) form; categoryEditForm.setName(testing); request.setAttribute(categoryEditForm, form); Dody. I'll be! Never used attribute either. Thanks. Jack On Wed, 12 Jan 2005 08:19:25 -0600, Joe Germuska [EMAIL PROTECTED] wrote: The problem is that you are specifying the attribute value for one of your action mappings, but not for the other. For the first (setup action), because no attribute value is set in the ActionMapping, Struts looks in the request for a bean under the form's name categoryEditForm. If it doesn't find one, it creates one and puts it there, so that by the time your Action's execute method is called, the ActionForm passed in the signature is also in the request under that attribute name. Then, when the JSP renders, the html:form tag uses its action attribute to look up the ActionMapping for the submission (/categoryEdit). This ActionMapping specifies that its form bean should be stored under the attribute name val_categoryEdit. There is nothing in the request under that name, so Struts creates a new form, which is not initialized, and uses it for prepopulating form field values. Again, if you do not specify an attribute in an action element, the value defaults to the form's name (as specified in the action's name attribute). I have never had a reason to specify attribute in the action element, but if you do, you need it to be consistent between the actions that are cooperating. Hope this helps, Joe At 4:19 PM +0700 1/12/05, Dody Rachmat Wicaksono wrote: I'm trying to create an edit page. I think I already in the right direction, but still unable to populate data even with a direct value via action class. Please let me what's wrong here. I've spend 3 days alone with this problem. Thank you. I created two action file: - SetUpCategoryEditAction.java (this action will populate data from db to form) - CategoryEditAction.java (this action will save the data) My formbean: CategoryEditForm.java -- public class CategoryEditForm extends ValidatorForm { private String name; private String categoryId; public void setName(String s) { this.name = s; } public String getName() { return name; } public void setcategoryId(String s) { this.categoryId = s; } public String getcategoryId() { return categoryId; } } My struts-config.xml -- form-bean name=categoryEditForm type=com.strutsgen.garuda.CategoryEditForm/ action path=/setUpCategoryEditForm type=com.strutsgen.garuda.SetUpCategoryEditAction name=categoryEditForm scope=request validate=false forward name=continue path=/categoryEditForm.jsp/ /action action path=/categoryEdit type=com.strutsgen.garuda.CategoryEditAction name=categoryEditForm attribute=val_categoryEdit scope=request validate=true input=/categoryEditForm.jsp forward name=success path=/categoryEditOk.jsp/ /action SetUpCategoryEditAction.java: -- public final class SetUpCategoryEditAction extends Action { public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { CategoryEditForm categoryEditForm = (CategoryEditForm)form; categoryEditForm.setName(testing); return (mapping.findForward(continue)); } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,
Re: Multiple Struts-config problem
The module name in the html:link should start with a / html:link module=/master action=cityActionlink/html:link On Wed, 12 Jan 2005 18:39:58 +0530, sachin [EMAIL PROTECTED] wrote: hi all , i am implementing multiple modules in struts 1.2.4 i have two config files which i define in web.xml like init-param param-nameconfig/param-name param-value/WEB-INF/struts-config.xml/param-value /init-param init-param param-nameconfig/master/param-name param-value/WEB-INF/master/master-config.xml/param-value /init-param and in the master-config.xml i have an action defined like ... action path=/cityMaster forward=/master/cityMaster.jsp / action path=/cityAction type=master.CityMasterAddAction name=cityMasterBean scope=request validate=true input=/cityMaster.do forward name=Success path=/cityMaster.do / /action but when i try to access the from with html link .. it gives error html:link module = master action=cityActionlink/html:link The error given is : no action found /cityAction Please could tell me how to access the actions defined in modules Sachin Hegde Paradyne Infotech Limited , Mumbai 09324546711 - 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]
i18n (internazionalization) tutorial need
hi all i need a good tutorial (for free) for managing internazionalization with struts. any help? regards Libero ADSL: 3 mesi gratis e navighi a 1.2 Mega. E poi hai l'Adsl senza limiti a meno di 1 euro al giorno. Abbonati subito senza costi di attivazione su http://www.libero.it - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: i18n (internazionalization) tutorial need
I use JSTL for that, you can download the spec from the JCP page; which is so well writen as a reference that it can ba a tutorial. Else buy a JSTL book. .V [EMAIL PROTECTED] wrote: hi all i need a good tutorial (for free) for managing internazionalization with struts. any help? regards Libero ADSL: 3 mesi gratis e navighi a 1.2 Mega. E poi hai l'Adsl senza limiti a meno di 1 euro al giorno. Abbonati subito senza costi di attivazione su http://www.libero.it -- RiA-SoA w/JDNC http://www.SandraSF.com forums - help develop a community My blog http://www.sandrasf.com/adminBlog - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Unable to see c:forEach out put
On Wed, 12 Jan 2005 13:52:32 +0530, Vamsee Kanakala [EMAIL PROTECTED] wrote: Rick Reumann wrote: It sounds like you are probably are now using a JSP2.0 container like Tomcat5 and are refering to the wrong tld. Refer to the one in the jar like: %@ taglib prefix=c uri=http://java.sun.com/jsp/jstl/core% and remove and direct pointing to the tlds you have. Yes, I am using Tomcat 5.0.28. I then downloaded beanutils from the jakarta site, replaced the jstl.jar and standard.jar, and pointed to taglibs like you said above. I have strange problem - I am able to use c:forEach etc., but the var is not getting set. If I give something like this: c:forEach begin=1 end=5 var=current c:out value=${current} / /c:forEach I get something like this: ${current} ${current} ${current} ${current} ${current} Well, If you use var attribute; c:forEach/ tries to assign the current element of the iteration over a collection to a variable with that name. If you don't have any collection specified by the attribute items then nothing is set to the var attribute; in other words a variable with that name doesn't exist. If you wanted to see the loop counter you could use c:forEach begin=1 end=5 varStatus=current c:out value=${current} / /c:forEach I can't figure out what seems to be the problem. Please help. TIA, Vamsee. - 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]
how to get data from http get / url?
What should i do to get the value from url? ex: http://localhost:8080/st/editForm.do?id=99 how to get the id value? Thank you in advance. Dody - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
how to get data from http get / url?
What should i do to get the value from url? ex: http://localhost:8080/st/editForm.do?id=99 how to get the id value? Thank you in advance. Dody - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re:how to get data from http get / url?
just use the getter method of your formBean. Depend on u use dynaactionform or not.If u do not ,use getId() of your formBean. regards -- Initial Header --- From : Dody Rachmat Wicaksono [EMAIL PROTECTED] To : Struts Users Mailing List user@struts.apache.org Cc : Date : Thu, 13 Jan 2005 01:42:53 +0700 Subject : how to get data from http get / url? What should i do to get the value from url? ex: http://localhost:8080/st/editForm.do?id=99 how to get the id value? Thank you in advance. Dody - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Libero ADSL: 3 mesi gratis e navighi a 1.2 Mega. E poi hai l'Adsl senza limiti a meno di 1 euro al giorno. Abbonati subito senza costi di attivazione su http://www.libero.it - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Unable to see c:forEach out put
Actually I think it's ${current.count} -Original Message- From: Kishore Senji [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 12, 2005 12:37 PM To: Struts Users Mailing List Subject: Re: Unable to see c:forEach out put On Wed, 12 Jan 2005 13:52:32 +0530, Vamsee Kanakala [EMAIL PROTECTED] wrote: Rick Reumann wrote: It sounds like you are probably are now using a JSP2.0 container like Tomcat5 and are refering to the wrong tld. Refer to the one in the jar like: %@ taglib prefix=c uri=http://java.sun.com/jsp/jstl/core% and remove and direct pointing to the tlds you have. Yes, I am using Tomcat 5.0.28. I then downloaded beanutils from the jakarta site, replaced the jstl.jar and standard.jar, and pointed to taglibs like you said above. I have strange problem - I am able to use c:forEach etc., but the var is not getting set. If I give something like this: c:forEach begin=1 end=5 var=current c:out value=${current} / /c:forEach I get something like this: ${current} ${current} ${current} ${current} ${current} Well, If you use var attribute; c:forEach/ tries to assign the current element of the iteration over a collection to a variable with that name. If you don't have any collection specified by the attribute items then nothing is set to the var attribute; in other words a variable with that name doesn't exist. If you wanted to see the loop counter you could use c:forEach begin=1 end=5 varStatus=current c:out value=${current} / /c:forEach I can't figure out what seems to be the problem. Please help. TIA, Vamsee. - 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]
RE: JSF and Struts (off topic)
Hi Leandro, I have compiled an extensive list of JSF resource on my site at: http://www.jamesholmes.com/JavaServerFaces/ You should be able to find everything you need there. James -Original Message- From: Leandro Melo [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 11, 2005 4:58 PM To: struts jakarta Subject: JSF and Struts (off topic) Hi all, I need to start up very quick with JSF for a project! Actually, I'm just gonna check it out to see if it's worth a change! Does anyone know somekinda guide From Struts to JSF?? It could be just a beginner one. Thanks. ltcmelo __ Do you Yahoo!? The all-new My Yahoo! - What will yours do? http://my.yahoo.com - 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]
Stuts forwarding does not work
I am trying to redirect from index.jsp to another page but no luck. I get this error: org.apache.jasper.JasperException: Exception forwarding for name queryInput: org.apache.jasper.JasperException at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.jboss.web.tomcat.security.JBossSecurityMgrRealm.invoke(JBossSecurityMgrRealm.java:220) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.jboss.web.tomcat.tc4.statistics.ContainerStatsValve.invoke(ContainerStatsValve.java:76) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:65) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:577) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:197) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:781) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:549) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:605) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:677) at java.lang.Thread.run(Thread.java:534) root cause javax.servlet.ServletException: Exception forwarding for name queryInput: org.apache.jasper.JasperException at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:533) at org.apache.jsp.index_jsp._jspService(index_jsp.java:60) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210) at
Re: i18n (internazionalization) tutorial need
The one that used to be mentioned most often is http://www.anassina.com/struts/i18n/i18n.html, though when I tried just now, I couldn't seem to get it to load. Try it though, and if it's still down, try again in a few hours. I've tried the instructions there before and seemed to work out okay for me (though my needs were limited to a sample app). If you can't get to it, and would want to see my sample app, let me know. Hubert --- [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: hi all i need a good tutorial (for free) for managing internazionalization with struts. any help? regards - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [Tiles] Why the text does'nt show
Vernon A few things come to mind with your below included details: 1: Where are the taglib statements in your main.jsp template? 2: To use title when you extend a master template, I'm pretty sure you MUST have a title component listed in your master template too because you are orverriding it in your landscape or water templates. Regards, David -Original Message- From: Vernon [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 12, 2005 2:02 PM To: user@struts.apache.org Subject: [Tiles] Why the text does'nt show In a project, I have the Tiles integrated with Spring. The inserted JSP files show up properly, but not text. I can't find the cause. Here is a segment of the template file html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en head meta http-equiv=Content-Type content=text/html; charset=utf-8 / link rel=stylesheet type=text/css href=css/layout.css / style type=text/css @import css/text.css; /style titletiles:insert name=title//title /head body ... In the definition file: !-- DEFAULT MAIN TEMPLATE -- definition name=template page=/WEB-INF/jsp/template/main.jsp /definition definition name=landscape extends=template put name=title value=Landscape/ put name=categoryvalue=LANDSCAPE/ put name=category_menu value=/WEB-INF/jsp/mountains/category.jsp type=page/ /definition definition name=water extends=landscape put name=sub_category_menu value=/WEB-INF/jsp/water/sub_category.jsp type=page/ /definition What is missing here? Thanks __ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 - 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: i18n (internazionalization) tutorial need
You could try our message ressource tutorial at http://www.laliluna.de/tutorials.html It is explains the use of message ressources which are the base for multi language apps. Regards Sebastian [EMAIL PROTECTED] wrote: hi all i need a good tutorial (for free) for managing internazionalization with struts. any help? regards Libero ADSL: 3 mesi gratis e navighi a 1.2 Mega. E poi hai l'Adsl senza limiti a meno di 1 euro al giorno. Abbonati subito senza costi di attivazione su http://www.libero.it - 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: Passing Parameters to Tiles Layout
Allen, You could make your action a Struts Tiles Action subclass and set a tile parameter's value manually based upon the id... For example, you could set the tile's body component to the value form.getBody() IF your page was submitted with body=somepage.jsp or something like that. If you do that, I would recommend you test that the file exists before setting the tile's body component. If you need concreted examples, check the archives under my name as I posted something like that in the last 90 days. Regards, David -Original Message- From: Tait, Allen [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 12, 2005 8:47 AM To: 'user@struts.apache.org' Subject: Passing Parameters to Tiles Layout Assume a standard Tiles layout with Header, Navigation, Body, and Footer, each implemented as a JSP. In this setup, the navigation.jsp is responsible for dynamically generating the left hand navigation from an XML configuration file. For each page request, this component needs to build the navigation appropriate for that page. The body.jsp contains a parameter needed by the navigation to determine the correct navigation. What are some approaches for passing values like this from the body.jsp to the navigation.jsp? The goal is to allow web programmers to add body.jsp (or new pages) to a web site by creating and adding the page only. The page would contain the body's HTML and this navigation parameter. Assuming the appropriate navigation is already defined in the configuration file, no other configuration would be needed to add a page (i.e. struts*.xml, tiles*.xml) Thanks Allen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [Tiles] Why the text does'nt show
Thanks for your response, David. And please see below. David G. Friedman [EMAIL PROTECTED] wrote: A few things come to mind with your below included details: 1: Where are the taglib statements in your main.jsp template? The taglib statement is there as the following: %@ taglib prefix=tiles uri=http://jakarta.apache.org/struts/tags-tiles; % Absenting of the statement will lead to miss all insertions. In this case, only inserted text is missing. 2: To use title when you extend a master template, I'm pretty sure you MUST have a title component listed in your master template too because you are orverriding it in your landscape or water templates. I don't follow above. The inheritance is the following: water - landscape - template Nothing, including the title, is overriden. -Original Message- From: Vernon [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 12, 2005 2:02 PM To: user@struts.apache.org Subject: [Tiles] Why the text does'nt show In a project, I have the Tiles integrated with Spring. The inserted JSP files show up properly, but not text. I can't find the cause. Here is a segment of the template file html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en head meta http-equiv=Content-Type content=text/html; charset=utf-8 / link rel=stylesheet type=text/css href=css/layout.css / style type=text/css @import css/text.css; /style titletiles:insert name=title//title /head body ... In the definition file: !-- DEFAULT MAIN TEMPLATE -- definition name=template page=/WEB-INF/jsp/template/main.jsp /definition definition name=landscape extends=template put name=title value=Landscape/ put name=categoryvalue=LANDSCAPE/ put name=category_menu value=/WEB-INF/jsp/mountains/category.jsp type=page/ /definition definition name=water extends=landscape put name=sub_category_menu value=/WEB-INF/jsp/water/sub_category.jsp type=page/ /definition What is missing here? Thanks __ Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. http://info.mail.yahoo.com/mail_250 - 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] __ Do you Yahoo!? The all-new My Yahoo! - What will yours do? http://my.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [Tiles] Why the text doesn't show
Vernon, The way I've always used Tiles is different from your approach. In the struts-tiles.xml definition file, my template could contain the components title, category, and category_menu with dummy values. The two tiles derived from template, i.e. landscape and water, would overload/override those fields as necessary. If you define an component named styleSheet in landscape but not in template, when the page starts displaying the master tile (i.e. template's /WEB-INF/jsp/template/main.jsp JSP), the master tile won't know about the styleSheet component you defined in the later child tile named landscape. My rule of thumb is that you define all components in the master tile(s). For any tile you extend, make sure you are only overriding previously defined components as you need them. They can initially be set to blank, i.e. , in template so nothing shows up in the JSP unless you've overridden it in the landscape or water tiles. Why? Nesting and passing components can be difficult or awkward in Tiles if you are not VERY careful.' Regards, David -Original Message- From: Vernon [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 12, 2005 3:26 PM To: Struts Users Mailing List Subject: RE: [Tiles] Why the text does'nt show Thanks for your response, David. And please see below. David G. Friedman [EMAIL PROTECTED] wrote: A few things come to mind with your below included details: 1: Where are the taglib statements in your main.jsp template? The taglib statement is there as the following: %@ taglib prefix=tiles uri=http://jakarta.apache.org/struts/tags-tiles; % Absenting of the statement will lead to miss all insertions. In this case, only inserted text is missing. 2: To use title when you extend a master template, I'm pretty sure you MUST have a title component listed in your master template too because you are orverriding it in your landscape or water templates. I don't follow above. The inheritance is the following: water - landscape - template Nothing, including the title, is overriden. -Original Message- From: Vernon [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 12, 2005 2:02 PM To: user@struts.apache.org Subject: [Tiles] Why the text does'nt show In a project, I have the Tiles integrated with Spring. The inserted JSP files show up properly, but not text. I can't find the cause. Here is a segment of the template file html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en head meta http-equiv=Content-Type content=text/html; charset=utf-8 / link rel=stylesheet type=text/css href=css/layout.css / style type=text/css @import css/text.css; /style titletiles:insert name=title//title /head body ... In the definition file: !-- DEFAULT MAIN TEMPLATE -- definition name=template page=/WEB-INF/jsp/template/main.jsp /definition definition name=landscape extends=template put name=title value=Landscape/ put name=categoryvalue=LANDSCAPE/ put name=category_menu value=/WEB-INF/jsp/mountains/category.jsp type=page/ /definition definition name=water extends=landscape put name=sub_category_menu value=/WEB-INF/jsp/water/sub_category.jsp type=page/ /definition What is missing here? Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:link and char encoding
Nicolas De Loof wrote: Can someone explain me what's wrong in HTTP / servlet API about char encoding : I'm using html:link to build a link with parameters, whose values use french chars ('', '' ...) I need to set useLocaleEncoding to get values in my servlet (that is not a struts action) using getParameterMap. If I do not set this attribute, I get values with strange strings that looks like UTF-8 sequences. Is they're no strict standard for URI encoding ? Is tomcat servlet API wrong about this ? I don't know about the specific behaviour of tomcat, but the answer to the first question is No: the only standard is us-ascii. If a browser needs to send characters that are outside us-ascii, it will always encode them in the same encoding as the page that contains the link / form. If you are doing this on the server side, just make sure you do the necessary encoding/decoding while sending and receiving so that it works! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Stuts forwarding does not work
Make sure that /pages/QueryInput.jsp exists and relavtive to context root. On Wed, 12 Jan 2005 14:40:49 -0500, Alex Kravets [EMAIL PROTECTED] wrote: I am trying to redirect from index.jsp to another page but no luck. I get this error: org.apache.jasper.JasperException: Exception forwarding for name queryInput: org.apache.jasper.JasperException at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.jboss.web.tomcat.security.JBossSecurityMgrRealm.invoke(JBossSecurityMgrRealm.java:220) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.jboss.web.tomcat.tc4.statistics.ContainerStatsValve.invoke(ContainerStatsValve.java:76) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:65) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:577) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:197) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:781) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:549) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:605) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:677) at java.lang.Thread.run(Thread.java:534) root cause javax.servlet.ServletException: Exception forwarding for name queryInput: org.apache.jasper.JasperException at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:533) at org.apache.jsp.index_jsp._jspService(index_jsp.java:60) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) at
Re: Unable to see c:forEach out put
I used: td align=left font color='red' c:forEach begin=1 end=5 var=current c:out value=${current} / /c:forEach /font /td And this worked fine, gave me: 1 2 3 4 5 in red. Jack On Wed, 12 Jan 2005 12:52:59 -0600, Abdullah Jibaly [EMAIL PROTECTED] wrote: Actually I think it's ${current.count} -Original Message- From: Kishore Senji [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 12, 2005 12:37 PM To: Struts Users Mailing List Subject: Re: Unable to see c:forEach out put On Wed, 12 Jan 2005 13:52:32 +0530, Vamsee Kanakala [EMAIL PROTECTED] wrote: Rick Reumann wrote: It sounds like you are probably are now using a JSP2.0 container like Tomcat5 and are refering to the wrong tld. Refer to the one in the jar like: %@ taglib prefix=c uri=http://java.sun.com/jsp/jstl/core% and remove and direct pointing to the tlds you have. Yes, I am using Tomcat 5.0.28. I then downloaded beanutils from the jakarta site, replaced the jstl.jar and standard.jar, and pointed to taglibs like you said above. I have strange problem - I am able to use c:forEach etc., but the var is not getting set. If I give something like this: c:forEach begin=1 end=5 var=current c:out value=${current} / /c:forEach I get something like this: ${current} ${current} ${current} ${current} ${current} Well, If you use var attribute; c:forEach/ tries to assign the current element of the iteration over a collection to a variable with that name. If you don't have any collection specified by the attribute items then nothing is set to the var attribute; in other words a variable with that name doesn't exist. If you wanted to see the loop counter you could use c:forEach begin=1 end=5 varStatus=current c:out value=${current} / /c:forEach I can't figure out what seems to be the problem. Please help. TIA, Vamsee. - 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] -- -- You can lead a horse to water but you cannot make it float on its back. ~Dakota Jack~ You can't wake a person who is pretending to be asleep. ~Native Proverb~ Each man is good in His sight. It is not necessary for eagles to be crows. ~Hunkesni (Sitting Bull), Hunkpapa Sioux~ --- This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Unable to see c:forEach out put
I had %@ taglib uri='jstl-core' prefix='c' % on the page and !-- JSTL CORE EL =-- taglib taglib-urijstl-core/taglib-uri taglib-location/WEB-INF/resource/tld/c.tld/taglib-location /taglib in web.xml. Jack On Wed, 12 Jan 2005 15:23:01 -0800, Dakota Jack [EMAIL PROTECTED] wrote: I used: td align=left font color='red' c:forEach begin=1 end=5 var=current c:out value=${current} / /c:forEach /font /td And this worked fine, gave me: 1 2 3 4 5 in red. Jack On Wed, 12 Jan 2005 12:52:59 -0600, Abdullah Jibaly [EMAIL PROTECTED] wrote: Actually I think it's ${current.count} -Original Message- From: Kishore Senji [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 12, 2005 12:37 PM To: Struts Users Mailing List Subject: Re: Unable to see c:forEach out put On Wed, 12 Jan 2005 13:52:32 +0530, Vamsee Kanakala [EMAIL PROTECTED] wrote: Rick Reumann wrote: It sounds like you are probably are now using a JSP2.0 container like Tomcat5 and are refering to the wrong tld. Refer to the one in the jar like: %@ taglib prefix=c uri=http://java.sun.com/jsp/jstl/core% and remove and direct pointing to the tlds you have. Yes, I am using Tomcat 5.0.28. I then downloaded beanutils from the jakarta site, replaced the jstl.jar and standard.jar, and pointed to taglibs like you said above. I have strange problem - I am able to use c:forEach etc., but the var is not getting set. If I give something like this: c:forEach begin=1 end=5 var=current c:out value=${current} / /c:forEach I get something like this: ${current} ${current} ${current} ${current} ${current} Well, If you use var attribute; c:forEach/ tries to assign the current element of the iteration over a collection to a variable with that name. If you don't have any collection specified by the attribute items then nothing is set to the var attribute; in other words a variable with that name doesn't exist. If you wanted to see the loop counter you could use c:forEach begin=1 end=5 varStatus=current c:out value=${current} / /c:forEach I can't figure out what seems to be the problem. Please help. TIA, Vamsee. - 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] -- -- You can lead a horse to water but you cannot make it float on its back. ~Dakota Jack~ You can't wake a person who is pretending to be asleep. ~Native Proverb~ Each man is good in His sight. It is not necessary for eagles to be crows. ~Hunkesni (Sitting Bull), Hunkpapa Sioux~ --- This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. -- -- You can lead a horse to water but you cannot make it float on its back. ~Dakota Jack~ You can't wake a person who is pretending to be asleep. ~Native Proverb~ Each man is good in His sight. It is not necessary for eagles to be crows. ~Hunkesni (Sitting Bull), Hunkpapa Sioux~ --- This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Re:how to get data from http get / url?
Thank you, it work. Dody. === At 2005-01-13, 01:46:52 you wrote: === just use the getter method of your formBean. Depend on u use dynaactionform or not.If u do not ,use getId() of your formBean. regards -- Initial Header --- From : Dody Rachmat Wicaksono [EMAIL PROTECTED] To : Struts Users Mailing List user@struts.apache.org Cc : Date : Thu, 13 Jan 2005 01:42:53 +0700 Subject : how to get data from http get / url? What should i do to get the value from url? ex: http://localhost:8080/st/editForm.do?id=99 how to get the id value? Thank you in advance. Dody - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Libero ADSL: 3 mesi gratis e navighi a 1.2 Mega. E poi hai l'Adsl senza limiti a meno di 1 euro al giorno. Abbonati subito senza costi di attivazione su http://www.libero.it - 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: Re:how to get data from http get / url?
Thank you, it work. Dody. === At 2005-01-13, 01:46:52 you wrote: === just use the getter method of your formBean. Depend on u use dynaactionform or not.If u do not ,use getId() of your formBean. regards -- Initial Header --- From : Dody Rachmat Wicaksono [EMAIL PROTECTED] To : Struts Users Mailing List user@struts.apache.org Cc : Date : Thu, 13 Jan 2005 01:42:53 +0700 Subject : how to get data from http get / url? What should i do to get the value from url? ex: http://localhost:8080/st/editForm.do?id=99 how to get the id value? Thank you in advance. Dody - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Libero ADSL: 3 mesi gratis e navighi a 1.2 Mega. E poi hai l'Adsl senza limiti a meno di 1 euro al giorno. Abbonati subito senza costi di attivazione su http://www.libero.it - 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: Unable to see c:forEach out put
By taking a peek at the source, I found that they do make an ArrayList which contains Integers from begin to end. So the acutal problem for not showing those values on the page is something else and I guess ,by looking at the first posting, you are using the runtime version of the jstl core library. The runtime version doesn't evaluate expressions. So, make sure your point to the expression tld one or try this: c:forEach begin=1 end=5 var=current c:out value='%=(String)pageContext.getAttribute(current)%'/ /c:forEach On Wed, 12 Jan 2005 15:25:03 -0800, Dakota Jack [EMAIL PROTECTED] wrote: I had %@ taglib uri='jstl-core' prefix='c' % on the page and !-- JSTL CORE EL =-- taglib taglib-urijstl-core/taglib-uri taglib-location/WEB-INF/resource/tld/c.tld/taglib-location /taglib in web.xml. Jack On Wed, 12 Jan 2005 15:23:01 -0800, Dakota Jack [EMAIL PROTECTED] wrote: I used: td align=left font color='red' c:forEach begin=1 end=5 var=current c:out value=${current} / /c:forEach /font /td And this worked fine, gave me: 1 2 3 4 5 in red. Jack On Wed, 12 Jan 2005 12:52:59 -0600, Abdullah Jibaly [EMAIL PROTECTED] wrote: Actually I think it's ${current.count} -Original Message- From: Kishore Senji [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 12, 2005 12:37 PM To: Struts Users Mailing List Subject: Re: Unable to see c:forEach out put On Wed, 12 Jan 2005 13:52:32 +0530, Vamsee Kanakala [EMAIL PROTECTED] wrote: Rick Reumann wrote: It sounds like you are probably are now using a JSP2.0 container like Tomcat5 and are refering to the wrong tld. Refer to the one in the jar like: %@ taglib prefix=c uri=http://java.sun.com/jsp/jstl/core% and remove and direct pointing to the tlds you have. Yes, I am using Tomcat 5.0.28. I then downloaded beanutils from the jakarta site, replaced the jstl.jar and standard.jar, and pointed to taglibs like you said above. I have strange problem - I am able to use c:forEach etc., but the var is not getting set. If I give something like this: c:forEach begin=1 end=5 var=current c:out value=${current} / /c:forEach I get something like this: ${current} ${current} ${current} ${current} ${current} Well, If you use var attribute; c:forEach/ tries to assign the current element of the iteration over a collection to a variable with that name. If you don't have any collection specified by the attribute items then nothing is set to the var attribute; in other words a variable with that name doesn't exist. If you wanted to see the loop counter you could use c:forEach begin=1 end=5 varStatus=current c:out value=${current} / /c:forEach I can't figure out what seems to be the problem. Please help. TIA, Vamsee. - 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] -- -- You can lead a horse to water but you cannot make it float on its back. ~Dakota Jack~ You can't wake a person who is pretending to be asleep. ~Native Proverb~ Each man is good in His sight. It is not necessary for eagles to be crows. ~Hunkesni (Sitting Bull), Hunkpapa Sioux~ --- This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. -- -- You can lead a horse to water but you cannot make it float on its back. ~Dakota Jack~ You can't wake a person who is pretending to be asleep. ~Native Proverb~ Each man is good in His sight. It is not necessary for eagles to be crows. ~Hunkesni (Sitting Bull), Hunkpapa Sioux~ --- This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this
RE: [Tiles] Why the text doesn't show
David: After I add empty strings for all insertion components in the definition xml file, nothing is changed. When you said rule of thumb, do you mean what is in the document or a hacking practice? regards, Vernon The way I've always used Tiles is different from your approach. In the struts-tiles.xml definition file, my template could contain the components title, category, and category_menu with dummy values. The two tiles derived from template, i.e. landscape and water, would overload/override those fields as necessary. If you define an component named styleSheet in landscape but not in template, when the page starts displaying the master tile (i.e. template's /WEB-INF/jsp/template/main.jsp JSP), the master tile won't know about the styleSheet component you defined in the later child tile named landscape. My rule of thumb is that you define all components in the master tile(s). For any tile you extend, make sure you are only overriding previously defined components as you need them. They can initially be set to blank, i.e. , in template so nothing shows up in the JSP unless you've overridden it in the landscape or water tiles. Why? Nesting and passing components can be difficult or awkward in Tiles if you are not VERY careful.' Regards, David -Original Message- From: Vernon [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 12, 2005 3:26 PM To: Struts Users Mailing List Subject: RE: [Tiles] Why the text does'nt show Thanks for your response, David. And please see below. David G. Friedman [EMAIL PROTECTED] wrote: A few things come to mind with your below included details: 1: Where are the taglib statements in your main.jsp template? The taglib statement is there as the following: %@ taglib prefix=tiles uri=http://jakarta.apache.org/struts/tags-tiles; % Absenting of the statement will lead to miss all insertions. In this case, only inserted text is missing. 2: To use title when you extend a master template, I'm pretty sure you MUST have a title component listed in your master template too because you are orverriding it in your landscape or water templates. I don't follow above. The inheritance is the following: water - landscape - template Nothing, including the title, is overriden. -Original Message- From: Vernon [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 12, 2005 2:02 PM To: user@struts.apache.org Subject: [Tiles] Why the text does'nt show In a project, I have the Tiles integrated with Spring. The inserted JSP files show up properly, but not text. I can't find the cause. Here is a segment of the template file html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en head meta http-equiv=Content-Type content=text/html; charset=utf-8 / link rel=stylesheet type=text/css href=css/layout.css / style type=text/css @import css/text.css; /style titletiles:insert name=title//title /head body ... In the definition file: !-- DEFAULT MAIN TEMPLATE -- definition name=template page=/WEB-INF/jsp/template/main.jsp /definition definition name=landscape extends=template put name=title value=Landscape/ put name=categoryvalue=LANDSCAPE/ put name=category_menu value=/WEB-INF/jsp/mountains/category.jsp type=page/ /definition definition name=water extends=landscape put name=sub_category_menu value=/WEB-INF/jsp/water/sub_category.jsp type=page/ /definition What is missing here? Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail - Helps protect you from nasty viruses. http://promotions.yahoo.com/new_mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Property file question
I am having property file under WEB-INF directory. I am currently storing something like title.mainmenu = Main Menu error.validation = Validation Error Can i make use of these variables inside my any normal java classes - or whether these r meant for only JSPs ? regards Manisha - Do you Yahoo!? The all-new My Yahoo! What will yours do?
Re: how to get data from http get / url?
There might be a few ways, but from my exprience.. String sid = request.getParameter(id); or editFormsform = (editForm)form; String sid = sform.getUserid(); - Original Message - From: Dody Rachmat Wicaksono [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Thursday, January 13, 2005 2:42 AM Subject: how to get data from http get / url? What should i do to get the value from url? ex: http://localhost:8080/st/editForm.do?id=99 how to get the id value? Thank you in advance. Dody - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [Tiles] Why the text doesn't show
Vernon, Have you read Tiles Advanced Features by Cedric Dumoulin? It is listed under the Struts userGuide section for Tiles, http://struts.apache.org/userGuide/dev_tiles.html with a direct URL of: http://www.lifl.fr/~dumoulin/tiles/tilesAdvancedFeatures.pdf Read all subsections under section 4.1 as it will better explain (and with examples) what I was talking about. I am unsure if this is a requirement or just something I learned through trial and error, but when I extend a definition and add a new component, I make sure to add it to every parent tile (i.e. this extended that so I add the fields to that, but that extended another so I added those same component names with some default value to another.) back up the tree of definitions. If you do not define attributes in that strict a manner, you may fine, as other posters have discovered, that some tiles' JSP pieces/pages may not be able to see your attributes, especially if your body component is a JSP that needs access to the other tile components. I'm not explaining this well but the PDF is excellent in describing tiles concepts with numerous examples. Regards, David -Original Message- From: Vernon [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 12, 2005 8:39 PM To: Struts Users Mailing List Subject: RE: [Tiles] Why the text doesn't show David: After I add empty strings for all insertion components in the definition xml file, nothing is changed. When you said rule of thumb, do you mean what is in the document or a hacking practice? regards, Vernon The way I've always used Tiles is different from your approach. In the struts-tiles.xml definition file, my template could contain the components title, category, and category_menu with dummy values. The two tiles derived from template, i.e. landscape and water, would overload/override those fields as necessary. If you define an component named styleSheet in landscape but not in template, when the page starts displaying the master tile (i.e. template's /WEB-INF/jsp/template/main.jsp JSP), the master tile won't know about the styleSheet component you defined in the later child tile named landscape. My rule of thumb is that you define all components in the master tile(s). For any tile you extend, make sure you are only overriding previously defined components as you need them. They can initially be set to blank, i.e. , in template so nothing shows up in the JSP unless you've overridden it in the landscape or water tiles. Why? Nesting and passing components can be difficult or awkward in Tiles if you are not VERY careful.' Regards, David -Original Message- From: Vernon [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 12, 2005 3:26 PM To: Struts Users Mailing List Subject: RE: [Tiles] Why the text does'nt show Thanks for your response, David. And please see below. David G. Friedman [EMAIL PROTECTED] wrote: A few things come to mind with your below included details: 1: Where are the taglib statements in your main.jsp template? The taglib statement is there as the following: %@ taglib prefix=tiles uri=http://jakarta.apache.org/struts/tags-tiles; % Absenting of the statement will lead to miss all insertions. In this case, only inserted text is missing. 2: To use title when you extend a master template, I'm pretty sure you MUST have a title component listed in your master template too because you are orverriding it in your landscape or water templates. I don't follow above. The inheritance is the following: water - landscape - template Nothing, including the title, is overriden. -Original Message- From: Vernon [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 12, 2005 2:02 PM To: user@struts.apache.org Subject: [Tiles] Why the text does'nt show In a project, I have the Tiles integrated with Spring. The inserted JSP files show up properly, but not text. I can't find the cause. Here is a segment of the template file html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en head meta http-equiv=Content-Type content=text/html; charset=utf-8 / link rel=stylesheet type=text/css href=css/layout.css / style type=text/css @import css/text.css; /style titletiles:insert name=title//title /head body ... In the definition file: !-- DEFAULT MAIN TEMPLATE -- definition name=template page=/WEB-INF/jsp/template/main.jsp /definition definition name=landscape extends=template put name=title value=Landscape/ put name=categoryvalue=LANDSCAPE/ put name=category_menu value=/WEB-INF/jsp/mountains/category.jsp type=page/ /definition definition name=water extends=landscape put name=sub_category_menu value=/WEB-INF/jsp/water/sub_category.jsp
PLZ Help with Cannot find message resources under key org.apache.struts.action.
Hi All, This is my directory structure WEB-INF i have struts-config.xml and web.xml WEB_INF classes / com / masslight / StrutsExampleClasses/ ApplicationResources.properties Name.java NameForm.java SetNameAction.java files /***Error **/ Cannot find message resources under key org.apache.struts.action.MESSAGE /***Error **/ Kindly help me out with this PS: I am using Tomcat 5.0.28, Eclipse 3.0 Struts 1.2.4. Any Help would be greatly appreciated... I can give you the trace of the log files too. Thanks in advance AS -- ___ Sign-up for Ads Free at Mail.com http://promo.mail.com/adsfreejump.htm - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Unable to see c:forEach out put
Vamsee Kanakala wrote: I have a code fragment like this: td align=left c:forEach items=${statusList} var=current c:out value=${current.name}/ /c:forEach /td Thanks guys... I solved it. Seems like it's an issue with the Tomcat 5, which supports JSP2.0, and I have to make changes to web.xml to enable EL. These posts on tomcat-user list have helped me: http://www.mail-archive.com/taglibs-user@jakarta.apache.org/msg07569.html http://www.mail-archive.com/tomcat-user@jakarta.apache.org/msg123308.html Thanks a lot! If only I could solve the Javascript gibberish problem I posted on the list... Nobody seems to have faced this before :( -Vamsee. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Property file question
Sure, but you need to create a Properties object to do it and read them in. http://java.sun.com/j2se/1.4.2/docs/api/java/util/Properties.html Larry On Wed, 12 Jan 2005 17:48:51 -0800 (PST), Manisha Sathe wrote: I am having property file under WEB-INF directory. I am currently storing something like title.mainmenu = Main Menu error.validation = Validation Error Can i make use of these variables inside my any normal java classes - or whether these r meant for only JSPs ? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Please Help with this error Cannot find message resources under key org.apache.struts.action.MESSAGE
Hi All, Do Excuse my reposting, but i cant seem to figure it out.help wud be greatly appreciated This is my directory structure WEB-INF i have struts-config.xml and web.xml WEB_INF classes / com / masslight / StrutsExampleClasses/ ApplicationResources.properties Name.java NameForm.java SetNameAction.java files /***Error **/ Cannot find message resources under key org.apache.struts.action.MESSAGE /***Error **/ Kindly help me out with this PS: I am using Tomcat 5.0.28, Eclipse 3.0 Struts 1.2.4. Any Help would be greatly appreciated... I can give you the trace of the log files too. Thanks in advance AS -- ___ Sign-up for Ads Free at Mail.com http://promo.mail.com/adsfreejump.htm - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: PLZ Help with Cannot find message resources under key org.apache.struts.action.
To your struts-config.xml, have you added an entry something like this: message-resources parameter=com.masslight.StrutsExampleClasses.ApplicationResources null=false / Regards, David -Original Message- From: Avinash Sridhar [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 12, 2005 10:01 PM To: user@struts.apache.org Subject: PLZ Help with Cannot find message resources under key org.apache.struts.action. Hi All, This is my directory structure WEB-INF i have struts-config.xml and web.xml WEB_INF classes / com / masslight / StrutsExampleClasses/ ApplicationResources.properties Name.java NameForm.java SetNameAction.java files /***Error **/ Cannot find message resources under key org.apache.struts.action.MESSAGE /***Error **/ Kindly help me out with this PS: I am using Tomcat 5.0.28, Eclipse 3.0 Struts 1.2.4. Any Help would be greatly appreciated... I can give you the trace of the log files too. Thanks in advance AS - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [almost OT] Struts in Practice
As a programmer with no design skills, one resource I've found to be helpful is Open Source Web Design: http://www.oswd.org/ There are quite a few site designs to choose from, many using CSS. They do have professional designs you can purchase if you'd like to go that direction, but I've found the free designs to be more than sufficient for my needs. HTH, Melissa On Wed, 12 Jan 2005 07:28:00 -0800 (PST), t t [EMAIL PROTECTED] wrote: Also because I really like the Google style: simple, but useful and powerful. So I have been trying to make my website-- www.sportslovers.net in that way. I am not sure if I can say that mine is powerful now, but I am sure I can say it's useful, and, simple. :) t t [EMAIL PROTECTED] wrote:Thanks. I would like to get a web designer to help me. But I don't have money to do that. :( Vincent [EMAIL PROTECTED] wrote: Congrats. So this your demo site? If it is in production, you may want think about getting a web designer to help you with the layout. It kind of reminds me of a 1998 webpage. No offense intended. t t wrote: If you are a sports lover, or Struts lover, please take a look at this website: www.sportslovers.net . It's based on Struts. Have a good day! Sorry if this email bothers you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: XML date validation
Thanks Erik. - Original Message - From: Erik Weber [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Wednesday, January 12, 2005 5:08 PM Subject: Re: XML date validation Author your own pluggable validator. See the Struts doc on this. I recently posted an example that you can probably use as a place to start (pasted below). Erik deepak wrote: Hi, Using XML date validation, how do I check if the entered date is in the future or not ? Thanks --Deepak Original Message Subject: Re: Hmm... i will go crazy due to validation Date: Wed, 05 Jan 2005 05:40:26 -0500 From: Erik Weber [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org References: [EMAIL PROTECTED] This is not a direct answer to any of your questions but perhaps it will spur your thinking. This is an example of using a custom (pluggable) validator that makes sure a date entry is not only a real date, but that the date is within a desired range (seemingly you are wanting to do something similar to this). I wrote this for Struts 1.1. I don't know if there is something new and improved that would be better, but it works. From validation.xml (you'll see the use of the date rule -- which uses the datePattern variable, as well as my custom dateRange rule -- which uses the minDate and maxDate variables): field property=licenseExpirationDate depends=date,dateRange arg0 key=vendor.edit.label.licenseExpirationDate/ var var-namedatePattern/var-name var-valueMM/dd//var-value /var var var-nameminDate/var-name var-value01/01/1900/var-value /var var var-namemaxDate/var-name var-value12/31/2030/var-value /var /field From validator-rules.xml: validator name=dateRange classname=ValidationUtil method=validateDateRange methodParams=java.lang.Object, org.apache.commons.validator.ValidatorAction, org.apache.commons.validator.Field, org.apache.struts.action.ActionErrors, javax.servlet.http.HttpServletRequest depends=required msg=errors.dateRange/ And finally the source of ValidationUtil: import javax.servlet.http.HttpServletRequest; import java.util.Date; import java.text.SimpleDateFormat; import org.apache.struts.action.ActionErrors; import org.apache.struts.validator.Resources; import org.apache.commons.validator.Field; import org.apache.commons.validator.ValidatorAction; import org.apache.commons.validator.ValidatorUtil; import org.apache.commons.validator.GenericValidator; public class ValidationUtil { public static final String DEFAULT_FORM_DATE_PATTERN = M/dd/; public static final Date DEFAULT_MIN_DATE = getDefaultMinDate(); public static final Date DEFAULT_MAX_DATE = getDefaultMaxDate(); public static boolean validateDateRange(Object bean, ValidatorAction va, Field field, ActionErrors errors, HttpServletRequest request) { //if we're not properly configured to parse dates, //all date validation will fail if (DEFAULT_MIN_DATE == null || DEFAULT_MAX_DATE == null) return false; try { String value = ValidatorUtil.getValueAsString(bean, field.getProperty()); Date date = getDate(value, DEFAULT_FORM_DATE_PATTERN); Date minDate = getDate(field.getVarValue(minDate), DEFAULT_FORM_DATE_PATTERN); Date maxDate = getDate(field.getVarValue(maxDate), DEFAULT_FORM_DATE_PATTERN); if (date.compareTo(minDate) 0 || date.compareTo(maxDate) 0) { errors.add(field.getKey(), Resources.getActionError(request, va, field)); return false; } return true; } catch (Exception e) { e.printStackTrace(); errors.add(field.getKey(), Resources.getActionError(request, va, field)); return false; } } protected static Date getDate(String dateString, String pattern) { Date date = null; try { SimpleDateFormat df = new SimpleDateFormat(pattern); date = df.parse(dateString); } catch (Exception e) { e.printStackTrace(); } return date; } protected static Date getDefaultMinDate() { return getDate(01/01/1900, DEFAULT_FORM_DATE_PATTERN); } protected static Date getDefaultMaxDate() { return getDate(12/31/2030, DEFAULT_FORM_DATE_PATTERN); } } Maybe you should browse the Struts wiki (wiki.apache.org/struts) for example links? Hope that helps some, Erik P.S. I never had much luck with DatePatternStrict, always wondered if it was buggy . . . But I guess others are using it successfully? Manisha Sathe wrote: I am testing struts
html:hidden query
Following i could get it but now i want this inside html hidden form tag. html:text property=myField bean:write name=myBean property=myProperty / /html:text But If i use hidden tag then gives me error saying hidden can not have value. How can i put my bean data in html:hidden ? regards Manisha Janarthan Sathiamurthy [EMAIL PROTECTED] wrote: Hi, If you have a bean by name myBean in request scope, a property of the bean by name myProperty can be displayed in the jsp page by - Best Regards, Janarthan S Manisha Sathe wrote: I have Add/Edit/Delete for one database table. For Edit what i want is to get the values from database and display it on form as default. What i am doing is - 1)First calling one action handler getting the values from database and putting inside one data bean. Putting that bean inside request scope then forwarding to Edit Form 2)Inside Edit form I want to get these values as by default for text box I tried something many different combination using cout / html:bean... etc etc but i am not getting the values. Is there any good solution for getting default values inside Edit Form? regards Manisha - Do you Yahoo!? Meet the all-new My Yahoo! Try it today! - Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. - Do you Yahoo!? All your favorites on one personal page Try My Yahoo!