Re: question about depends attribute in validator-rule.xml
Hi, could anyone tell me the meaning of depends attribute of validator element in validator-rules.xml? - Original Message - From: Kelvin wu [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Friday, July 04, 2003 6:40 PM Subject: question about depends attribute in validator-rule.xml Hi, i am using struts validator and want to add a validation rule by myself. i want the required validator only do validation when my custom validator return true. How can i do this? What is the meaning of depends attribute of validator element in validator-rules.xml? - 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: extending Action problems
Hey Andrew, in fact, your hacky way works out pretty well. I use the hastable to hold the ActionContexts. I am going to do the hammer test to see if it hurts anything on the performace. Thanks, Andrew! Billy Ng private final static HashTable threadTable = new HashTable(100); public ActionForward perform(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse resp) { Integer tKey = new Integer(Thread.getCurrentThread().hashCode()); try { ActionContext ac = new ActionContext(mapping, form, req, resp); threadTable.put (tKey, sc); process(); } catch (Exception e) { . getActionContext().setActionForward(error); } fianlly { ActionForweard af = getActionContext().getActionForward(); threadTable.remove(tKey); return af; } } public ActionContext getActionContext() { Integer tKey = new Integer(Thread.getCurrentThread().hashCode()); return (ActionContext) threadTable.get(tKey); } public HttpServletRequest getRequest() { return getActionContext().getRequest(); } - Original Message - From: Andrew Hill [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Sunday, July 06, 2003 8:35 PM Subject: RE: extending Action problems 1.) Probably not ;-) 2.) Yes. Ive never tried my hacky way - I only thought it up while I was thinking about your problem, so there is a good chance that it wont work as expected. (And worse = if it fails its likely to fail in a subtle way that is hard to reproduce consistently as it will probably be some kind of threading issue...) Id strongly discourage you from using this technique, but if you do let me know how it goes. -Original Message- From: Billy Ng [mailto:[EMAIL PROTECTED] Sent: Saturday, 5 July 2003 02:58 To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: Re: extending Action problems Hey, I like your last hacky way. but I am just so worried if: 1) I can trust the thread.hashCode() as key? 2) If I guess it right, I think I need to remove the ac from the Map when the thread exits perform(). Memory leak may cause if it fails to remove. But I still love it. Do you have any running application that is using this method? Thanks Andrew! Billy Ng - Original Message - From: Andrew Hill [EMAIL PROTECTED] To: Struts [EMAIL PROTECTED] Sent: Friday, July 04, 2003 3:49 AM Subject: RE: extending Action problems Almost - but the getRequest(ac) is redundant - you would just call ac.getRequest() when you needed the request as youve passed in ac as a method parameter. You will note though that you still have to pass the ac parameter to any method that needs access to the stuff it wraps. ie: public ActionForward perform(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse resp) { ActionContext ac = new ActionContext(mapping, form, req, resp); process(ac); etc.. } private void process(ActionContext ac) { String bob = ac.getRequest().getParameter(bob); etc } What you really really want to be able to do is: private void process() { String bob = getRequest().getParameter(bob); } isnt it? ;-) but as you saw already that simply wont work with a singleton Action - only way you can deal with this is either passing one or more parameters to methods in Action that need them OR modifying the RequestProcessor to return new instances of your Action for each request - that wouldnt need much code to achieve, but if your cautious Id suggest you stick with a parameter passing methodology. Well, I suppose there is one way I can think of to do it without having to pass around the ac as a param - but its an evil hack and Im including it more for your amusement than for your education! evil disclaimer=dont try this at home kids tested=no Put your ActionContext instance into the servlet context in perform() keyed by the threads hashcode. Provide a method getActionContext() in your base action to retrieve it. Now you can get it from any method in your action just by calling getActionContext() without having to pass it around in a param. /evil -Original Message- From: Billy Ng [mailto:[EMAIL PROTECTED] Sent: Friday, 4 July 2003 18:19 To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: Re: extending Action problems Sorry, Andrew! I am a little bit slow. Please review it if I understand what you told me with the following code. public abstract class ActionBase extends Action { protected
Error Message From Action Class
Hi All, In my Action class, If i get any exception I am populating my ActionErrors object and passing that object in saveErrors method of the Action Class. Then I redirect the navigation to an error page defined in global forward where i am using html:errors / to display the error message. Error page defined in the global forwards is displayed but the error message is not displayed. Is there any way to acheive this functionality. Below is the code snippet from my Action Class. errors.add(ActionErrors.GLOBAL_ERROR,new ActionError(NAMING)); saveErrors(request,errors); responsePage = error; Anurag Garg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Error Message From Action Class
Yes...NAMING property is already there in the resource properties file... This is my global forward mapping.. forward name=error path=/error.jsp/ -Original Message- From: Dan Tran [mailto:[EMAIL PROTECTED] Sent: Monday, July 07, 2003 12:19 PM To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: Re: Error Message From Action Class Did you define a property called NAMING in your resource properties file? -D - Original Message - From: Anurag Garg [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, July 06, 2003 11:36 PM Subject: Error Message From Action Class Hi All, In my Action class, If i get any exception I am populating my ActionErrors object and passing that object in saveErrors method of the Action Class. Then I redirect the navigation to an error page defined in global forward where i am using html:errors / to display the error message. Error page defined in the global forwards is displayed but the error message is not displayed. Is there any way to acheive this functionality. Below is the code snippet from my Action Class. errors.add(ActionErrors.GLOBAL_ERROR,new ActionError(NAMING)); saveErrors(request,errors); responsePage = error; Anurag Garg - 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]
[Q] Struts 1.0 or 1.1 ?
I have a web-app that uses the basic stuts stuff: form checking, mappings, etc. No hardcore or advanced features. It works fine in Struts 1.0.2 and after upgrading and making the minor tweaks, also on 1.1. But is it necessary to move up to 1.1? What do I gain? Is the implementation of the functionality I used also improved, or does 1.1 only provide new stuff? Is there a guideline for when I should use which version? __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [Q] Struts 1.0 or 1.1 ?
I would imagine that while there may be some performance gain due to code optimizations and the like the real benefit is in the expanded set of features (and that really is a big expansion from what I hear (the general consesus amoung the developers is that 1.1 would be more like 1.8 had they made regular point releases)) - so by moving to 1.1 you now have more 'power' at your disposal for future changes and additions you need to make for that app. For new applications you should use 1.1 as its (finally) the current version and 1.0.2 is old. 1.1 would of course also fix whatever bugs were in 1.0.2 (not many - and given the length of time before they finally released 1.1 I would think that it hasn't introduced any significant new ones either...) You will probably find that most of the support available on this list is nowadays geared towards 1.1 as are the available books and such like. Basically for new apps I can see no point using 1.0.2, while for existing apps its really a question of do you need it. If you foresee your application continuing to be developed further or have lots of maintenance its probably worth the effort to upgrade, whereas if its working fine and you dont ancipate any major changes then the benefit of an upgrade is of course significantly reduced. -Original Message- From: Riaan Oberholzer [mailto:[EMAIL PROTECTED] Sent: Monday, 7 July 2003 14:58 To: [EMAIL PROTECTED] Subject: [Q] Struts 1.0 or 1.1 ? I have a web-app that uses the basic stuts stuff: form checking, mappings, etc. No hardcore or advanced features. It works fine in Struts 1.0.2 and after upgrading and making the minor tweaks, also on 1.1. But is it necessary to move up to 1.1? What do I gain? Is the implementation of the functionality I used also improved, or does 1.1 only provide new stuff? Is there a guideline for when I should use which version? __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.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]
RE: [Q] Struts 1.1 Commons Logging
I have both my commons-logging.properties and log4j.properties in WEB-INF/classes directory. As for your other question I dont really know any more about how to do it than you do but heres what I understand so far for what its worth: Commons-Logging is just an abstraction wrapper around whichever actual logger you choose to plugin to do the logging work - in our case log4j. The configuration in commons-logging.properties specifies little more than which LogFactory and Log class to use - in other words which log implementation to use. The actual configuration of that logger is implementation dependant and for log4j is determined by whats in your log4j.properties file. Unfortunately I dont really have much of a clue as to how to properly configure log4j (Ive still got everything using one category and appender at INFO level!!!). I understand that it involves setting up seperate catagories for the struts and commons classes (org.apache.xxx) that have a higher log level than your own classes whose catagory might use something detailed like DEBUG level (which you would lift to a higher level once in production)... But as to the proper syntax to set up and use these extra categories Im at a loss. You will need to check the log4j documentation for the details. (Like you I found it a bit hard to follow and so have put it off till another day! If you come across a good summary of the details do post the link for us!) -Original Message- From: Riaan Oberholzer [mailto:[EMAIL PROTECTED] Sent: Monday, 7 July 2003 14:55 To: [EMAIL PROTECTED] Subject: [Q] Struts 1.1 Commons Logging I just converted a Struts 1.0.2 application to Struts 1.1. The first thing I noticed was the increased level of logging. I read a few threads and the commons documentation, but I cannot seem to disable the logging, or at least set it to another level. I read the commons-logging.properties file should be on the classpath - where in a .war file would that be? And how does that affect my application's log4j.properties file? I cannot put it on the classpath of the application server, as I deliver the .war file as an end result that should install as is. Thus, no tampering with the server's settings and files. And how should the properties file look like? I assume one entry such as: log4j.logger.org.apache=WARN which will set the logging to WARN level? I found the documentation on this very inclear and scattered across projects. Any help would be great, thanks. __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.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]
RE: [Q] Struts 1.0 or 1.1 ?
+ Modules (really, they are boon ;-) + Tiles/Nested Tags - not sure if you can get them in 1.0 + Lots of bug fixes. + Some peformance gain bcos of optimizations. + Few more classes in every package apart from keeping up with the latest ;-) you may wish to read http://jakarta.apache.org/struts/userGuide/release-notes-1.1.html -navjot |-Original Message- |From: Riaan Oberholzer [mailto:[EMAIL PROTECTED] |Sent: Monday, July 07, 2003 12:28 PM |To: [EMAIL PROTECTED] |Subject: [Q] Struts 1.0 or 1.1 ? | | |I have a web-app that uses the basic stuts stuff: form |checking, mappings, etc. No hardcore or advanced |features. It works fine in Struts 1.0.2 and after |upgrading and making the minor tweaks, also on 1.1. | |But is it necessary to move up to 1.1? What do I gain? |Is the implementation of the functionality I used also |improved, or does 1.1 only provide new stuff? | |Is there a guideline for when I should use which version? | |__ |Do you Yahoo!? |SBC Yahoo! DSL - Now only $29.95 per month! |http://sbc.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]
How To Specify Error Messages For Self-Provided Validation Rules: mask
I am trying to insert entries in the MessageResources.properties file for the error messages generated by automatic validation. I could find examples for email and date (see below): errors.email={0} is an invalid e-mail address. errors.date={0} is not a date. What should the messages look like for mask in the MessageResources.properties? I used mask to provide a number of validation rules. How do I specify those error messages? (I used mask several times.) __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
null form pointer
I have a simple struts application. I've begin with a login page, and a list, where you can add, edit or delete items in this list. The list is composed of 2 datas (a number and a string). The add function run OK, the delete function too. But the edit function is a bit harder to run... I've the GetCgAction, that runs OK, which use a CgForm class, and a EditCg.jsp. When the EditCg.jsp is displayed, datas are in the apropriate fields. When the Validate button is pressed, it call the EditCg.do link, but it passes a null form pointer to the function. In debugger, the function doesn't call the validate function of the CgForm class. What does I have to verify why he passes a null pointer? I think the form-beans and actions are correctly inserted in the struts-config.xml... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: struts 1.1 tutorial
Try http://jakarta.apache.org/struts/resources/tutorials.html José. -Original Message- From: Jagannayakam [mailto:[EMAIL PROTECTED] Sent: Monday, July 07, 2003 10:37 AM To: Struts Users Mailing List (E-mail) Subject: struts 1.1 tutorial Is there any struts1.1 based tutorial . Regards, Jagan. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] DISCLAIMER This e-mail and any attachment thereto may contain information which is confidential and/or protected by intellectual property rights and are intended for the sole use of the recipient(s) named above. Any use of the information contained herein (including, but not limited to, total or partial reproduction, communication or distribution in any form) by other persons than the designated recipient(s) is prohibited. If you have received this e-mail in error, please notify the sender either by telephone or by e-mail and delete the material from any computer. Thank you for your cooperation. For further information about Proximus mobile phone services please see our website at http://www.proximus.be or refer to any Proximus agent. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Form bean is not stored in request
Hello everyone, I have this weird little problem and I don't know how to fix it. I have a form (actually I have many forms but the others work just fine) and a form bean and action class for it. Now when the form gets processed (after hitting 'submit') its form bean should get stored in the request. But it isn't for some reason. When the action class now tries to access this form bean, it can't find it in the request and creates a new one - which results in exceptions since it doesn't have the data the form bean should've had. Any ideas why? I've checked the action mapping, it is set to request and there is an attribute defined for the form bean. I know the form does not get stored in the request since that would usually be logged in my log file (it gets logged for all the other forms, anyway) but there is no such entry for it. I would include code with this email but I have no idea where the error might be and I don't want to post all of the code of those two classes, the form and the action mapping for it, since that would be way too much code, I fear... If you could tell me what you need to look to find out where the error is, I'll send it in - and I'd greatly appreciate any kind of help. This error is slowly driving me crazy... Greetings, Nadja - Nadja Senoucci Universitaet Hamburg Zentrum für Molekulare Neurobiologie Service-Gruppe EDV Falkenried 94 20251 Hamburg Germany Tel.:040 - 428 - 03 - 6619 Fax.:040 - 428 - 03 - 6621 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Form bean is not stored in request
can u paste the "action form class" code and the "struts-config action mapping" here -nagi ---Original Message--- From: Struts Users Mailing List Date: Monday, July 07, 2003 02:45:34 PM To: [EMAIL PROTECTED] Subject: Form bean is not stored in request Hello everyone,I have this weird little problem and I don't know how to fix it. I have aform (actually I have many forms but the others work just fine) and a formbean and action class for it. Now when the form gets processed (afterhitting 'submit') its form bean should get stored in the request. But itisn't for some reason. When the action class now tries to access this formbean, it can't find it in the request and creates a new one - whichresults in exceptions since it doesn't have the data the form beanshould've had.Any ideas why? I've checked the action mapping, it is set to request andthere is an attribute defined for the form bean. I know the form does notget stored in the request since that would usually be logged in my logfile (it gets logged for all the other forms, anyway) but there is no suchentry for it. I would include code with this email but I have no ideawhere the error might be and I don't want to post all of the code of thosetwo classes, the form and the action mapping for it, since that would beway too much code, I fear... If you could tell me what you need to look tofind out where the error is, I'll send it in - and I'd greatly appreciateany kind of help. This error is slowly driving me crazy...Greetings,Nadja-Nadja SenoucciUniversitaet HamburgZentrum für Molekulare NeurobiologieService-Gruppe EDVFalkenried 9420251 HamburgGermanyTel.:040 - 428 - 03 - 6619Fax.:040 - 428 - 03 - 6621-To unsubscribe, e-mail: [EMAIL PROTECTED]For additional commands, e-mail: [EMAIL PROTECTED]. IncrediMail - Email has finally evolved - Click Here
Re: Form bean is not stored in request
Hello Nadja, *** NS Hello everyone, NS I have this weird little problem and I don't know how to fix it. I have a NS form (actually I have many forms but the others work just fine) and a form NS bean and action class for it. Now when the form gets processed (after NS hitting 'submit') its form bean should get stored in the request. Why do you expect it in the request? Why don't you use the action form parameter of the execute method? Are you doing some kind of action chaining? NS But it NS isn't for some reason. When the action class now tries to access this form NS bean, it can't find it in the request and creates a new one - which NS results in exceptions since it doesn't have the data the form bean NS should've had. NS Any ideas why? I've checked the action mapping, it is set to request and NS there is an attribute defined for the form bean. I know the form does not NS get stored in the request since that would usually be logged in my log NS file (it gets logged for all the other forms, anyway) but there is no such NS entry for it. I would include code with this email but I have no idea NS where the error might be and I don't want to post all of the code of those NS two classes, the form and the action mapping for it, since that would be NS way too much code, I fear... If you could tell me what you need to look to NS find out where the error is, I'll send it in - and I'd greatly appreciate NS any kind of help. This error is slowly driving me crazy... NS Greetings, NS Nadja NS - NS Nadja Senoucci NS Universitaet Hamburg NS Zentrum für Molekulare Neurobiologie NS Service-Gruppe EDV NS Falkenried 94 NS 20251 Hamburg NS Germany NS Tel.:040 - 428 - 03 - 6619 NS Fax.:040 - 428 - 03 - 6621 NS - NS To unsubscribe, e-mail: [EMAIL PROTECTED] NS For additional commands, e-mail: [EMAIL PROTECTED] Regards, Dirk +--- Quality leads ---+ | Dirk Markert [EMAIL PROTECTED] | | Dr. Markert Softwaretechnik AG | | Joseph-von-Fraunhofer-Str. 20 | | 44227 Dortmund | +-- to success! -+ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Form bean is not stored in request
Hello again, it is actually struts that seems to be expecting the form bean in the request, under name given in 'attribute' in the mapping for the action. At least, the log-file tells me that struts looks there for the form bean and creates a new one if it can't find it. Okay, here is the action mapping for this: action attribute=suchen input=/index.jsp name=suchen path=/suchen scope=request type=de.zmnh.struts.action.SuchenAction / And this is the form bean (I did not copy the imports btw): public class SuchenForm extends ActionForm { // - Instance Variables private org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger(this.getClass().getName()); private TreeMap fields; private TreeMap params; private Integer cnt; private boolean archivAnzeigen; private ArrayList auswahl; // - Methods public SuchenForm(){ fields = new TreeMap(); params = new TreeMap(); cnt = new Integer(1); } /** * Method validate * @param ActionMapping mapping * @param HttpServletRequest request * @return ActionErrors */ public ActionErrors validate( ActionMapping mapping, HttpServletRequest request) { ActionErrors err = new ActionErrors(); Integer temp = (Integer)request.getSession().getAttribute(cnt); if(temp!=null (temp.intValue()cnt.intValue())){ cnt=temp; } if(request.getParameter(mehr)!=null){ LoggerSupport.logDebug(Counter: +cnt.intValue(),log); LoggerSupport.logDebug(Mehr Felder Button gedrückt,log); cnt = new Integer(cnt.intValue()+1); LoggerSupport.logDebug(Counter: +cnt.intValue(),log); }else if(request.getParameter(weniger)!=null){ LoggerSupport.logDebug(Counter: +cnt.intValue(),log); LoggerSupport.logDebug(weniger Felder Button gedrückt,log); LoggerSupport.logDebug(Counter: +cnt.intValue(),log); } return err; } /** * Method reset * @param ActionMapping mapping * @param HttpServletRequest request */ public void reset(ActionMapping mapping, HttpServletRequest request) { this.archivAnzeigen=false; } /** * Returns the field. * @return String */ public Object getField(String key) { if(fields == null) return ; else if(fields.get(key)==null) return ; return this.fields.get(key); } public void setField(String key, String value){ this.fields.put(key,value); } /** * Returns the fields. * @return String[] */ public TreeMap getFields() { return fields; } /** * Returns the parameter. * @return String */ public Object getParameter(String key) { if(params == null) return ; else if(params.get(key)==null) return ; return this.params.get(key); } public void setParameter(String key, String value){ this.params.put(key,value); } /** * Returns the params. * @return String[] */ public TreeMap getParams() { return params; } /** * Sets the parameter. * @param parameter The parameter to set */ /** * Returns the cnt. * @return int */ public Integer getCnt() { return cnt; } /** * Feldauswahl */ public Collection getSearchFields(){ if(auswahl==null){ auswahl = new ArrayList(); Properties search = new Properties(); try{ FileInputStream in = new FileInputStream(InventarKonfiguration.getHandle().getInvpropPath()); search.load(in); }catch(Exception e){ LoggerSupport.logFatal(e,log); } int i=1; String temp; while((temp=search.getProperty(search+i))!=null){ LoggerSupport.logDebug(Nächstes Element für
execute / perform
in my struts application why is the perform function is called instead of execute, with the same parameters? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re[2]: Form bean is not stored in request
Hello Nadja, *** NS Hello again, NS it is actually struts that seems to be expecting the form bean in the NS request, under name given in 'attribute' in the mapping for the action. At NS least, the log-file tells me that struts looks there for the form bean and NS creates a new one if it can't find it. NS Okay, here is the action mapping for this: NS action NS attribute=suchen Do you need the above line for some good reason. If not, drop it. NS input=/index.jsp NS name=suchen NS path=/suchen NS scope=request NS type=de.zmnh.struts.action.SuchenAction / NS And this is the form bean (I did not copy the imports btw): NS public class SuchenForm extends ActionForm { NS // - Instance NS Variables NS private org.apache.log4j.Logger log = NS org.apache.log4j.Logger.getLogger(this.getClass().getName()); NS private TreeMap fields; NS private TreeMap params; NS private Integer cnt; NS private boolean archivAnzeigen; NS private ArrayList auswahl; NS // - Methods NS public SuchenForm(){ NS fields = new TreeMap(); NS params = new TreeMap(); NS cnt = new Integer(1); NS } NS /** NS * Method validate NS * @param ActionMapping mapping NS * @param HttpServletRequest request NS * @return ActionErrors NS */ NS public ActionErrors validate( NS ActionMapping mapping, NS HttpServletRequest request) { NS ActionErrors err = new ActionErrors(); NS Integer temp = (Integer)request.getSession().getAttribute(cnt); NS if(temp!=null (temp.intValue()cnt.intValue())){ NS cnt=temp; NS } NS if(request.getParameter(mehr)!=null){ NS LoggerSupport.logDebug(Counter: +cnt.intValue(),log); NS LoggerSupport.logDebug(Mehr Felder Button gedrückt,log); NS cnt = new Integer(cnt.intValue()+1); NS LoggerSupport.logDebug(Counter: +cnt.intValue(),log); NS }else if(request.getParameter(weniger)!=null){ NS LoggerSupport.logDebug(Counter: +cnt.intValue(),log); NS LoggerSupport.logDebug(weniger Felder Button gedrückt,log); NS LoggerSupport.logDebug(Counter: +cnt.intValue(),log); NS } NS return err; NS } NS /** NS * Method reset NS * @param ActionMapping mapping NS * @param HttpServletRequest request NS */ NS public void reset(ActionMapping mapping, HttpServletRequest request) { NS this.archivAnzeigen=false; NS } NS /** NS * Returns the field. NS * @return String NS */ NS public Object getField(String key) { NS if(fields == null) NS return ; NS else if(fields.get(key)==null) NS return ; NS return this.fields.get(key); NS } NS public void setField(String key, String value){ NS this.fields.put(key,value); NS } NS /** NS * Returns the fields. NS * @return String[] NS */ NS public TreeMap getFields() { NS return fields; NS } NS /** NS * Returns the parameter. NS * @return String NS */ NS public Object getParameter(String key) { NS if(params == null) NS return ; NS else if(params.get(key)==null) NS return ; NS return this.params.get(key); NS } NS public void setParameter(String key, String value){ NS this.params.put(key,value); NS } NS /** NS * Returns the params. NS * @return String[] NS */ NS public TreeMap getParams() { NS return params; NS } NS /** NS * Sets the parameter. NS * @param parameter The parameter to set NS */ NS /** NS * Returns the cnt. NS * @return int NS */ NS public Integer getCnt() { NS return cnt; NS } NS /** NS * Feldauswahl NS */ NS public Collection getSearchFields(){ NS if(auswahl==null){ NS auswahl = new ArrayList(); NS Properties search = new
Struts 1.1 - can't see debug entries.
Hi all. First, congratulations for the new struts 1.1 release, well done! I did upgrade my application from struts 1.1b3 struts 1.1 release. It works like a charm. But, I can't see the debug entries though I did turn it on like this: servlet servlet-nameaction/servlet-name servlet-classorg.apache.struts.action.ActionServlet/servlet-class init-param param-nameconfig/param-name param-value/WEB-INF/struts-config.xml/param-value /init-param init-param param-namedebug/param-name param-value3/param-value /init-param init-param param-namedetail/param-name param-value3/param-value /init-param load-on-startup2/load-on-startup /servlet In the past I had some conflicts with commons-logging and log4j, I can't say that there's a problem now, because I see no exceptions. Am I missing something? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: execute / perform
You must be using the Struts 1.0 release... Anurag Garg -Original Message- From: Nicolas Seinlet [mailto:[EMAIL PROTECTED] Sent: Monday, July 07, 2003 3:04 PM To: Struts Users Mailing List; Dr. Dirk Markert Subject: execute / perform in my struts application why is the perform function is called instead of execute, with the same parameters? - 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: Form bean is not stored in request
hi, change the scope to session , just to track down the problem. also make sure u have properly defined the form-bean== suchen to SuchenForm in the config remove attribute "attribute" in the action mapping if not needed -nagi ---Original Message--- From: Struts Users Mailing List Date: Monday, July 07, 2003 03:09:19 PM To: Struts Users Mailing List Subject: Re: Form bean is not stored in request Hello again,it is actually struts that seems to be expecting the form bean in therequest, under name given in 'attribute' in the mapping for the action. Atleast, the log-file tells me that struts looks there for the form bean andcreates a new one if it can't find it.Okay, here is the action mapping for this:actionattribute="suchen"input="/index.jsp"name="suchen"path="/suchen"scope="request"type="de.zmnh.struts.action.SuchenAction" /And this is the form bean (I did not copy the imports btw):public class SuchenForm extends ActionForm {// - InstanceVariablesprivate org.apache.log4j.Logger log =org.apache.log4j.Logger.getLogger(this.getClass().getName());private TreeMap fields;private TreeMap params;private Integer cnt;private boolean archivAnzeigen;private ArrayList auswahl;// - Methodspublic SuchenForm(){fields = new TreeMap();params = new TreeMap();cnt = new Integer(1);}/** * Method validate* @param ActionMapping mapping* @param HttpServletRequest request* @return ActionErrors*/public ActionErrors validate(ActionMapping mapping,HttpServletRequest request) {ActionErrors err = new ActionErrors();Integer temp = (Integer)request.getSession().getAttribute("cnt");if(temp!=null (temp.intValue()cnt.intValue())){cnt=temp;}if(request.getParameter("mehr")!=null){LoggerSupport.logDebug("Counter: "+cnt.intValue(),log);LoggerSupport.logDebug("Mehr Felder Button gedrückt",log);cnt = new Integer(cnt.intValue()+1);LoggerSupport.logDebug("Counter: "+cnt.intValue(),log);}else if(request.getParameter("weniger")!=null){LoggerSupport.logDebug("Counter: "+cnt.intValue(),log);LoggerSupport.logDebug("weniger Felder Button gedrückt",log);LoggerSupport.logDebug("Counter: "+cnt.intValue(),log);} return err;}/** * Method reset* @param ActionMapping mapping* @param HttpServletRequest request*/public void reset(ActionMapping mapping, HttpServletRequest request) {this.archivAnzeigen=false;}/*** Returns the field.* @return String*/public Object getField(String key) {if(fields == null)return "";else if(fields.get(key)==null)return "";return this.fields.get(key);}public void setField(String key, String value){this.fields.put(key,value);}/*** Returns the fields.* @return String[]*/public TreeMap getFields() {return fields;}/*** Returns the parameter.* @return String*/public Object getParameter(String key) {if(params == null)return "";else if(params.get(key)==null)return "";return this.params.get(key);}public void setParameter(String key, String value){this.params.put(key,value);}/*** Returns the params.* @return String[]*/public TreeMap getParams() {return params;}/*** Sets the parameter.* @param parameter The parameter to set*//*** Returns the cnt.* @return int*/public Integer getCnt() {return cnt;}/*** Feldauswahl*/public Collection getSearchFields(){if(auswahl==null){auswahl = new ArrayList();Properties search = new Properties();try{FileInputStream in = newFileInputStream(InventarKonfiguration.getHandle().getInvpropPath());search.load(in);}catch(Exception e){LoggerSupport.logFatal(e,log);}int i=1;String temp;while((temp=search.getProperty("search"+i))!=null){LoggerSupport.logDebug("Nächstes Element für SearchFields Coll.:"+temp,log);SearchOption temp2=new SearchOption(temp,search.getProperty("value"+i));auswahl.add(temp2);i++;}}return auswahl;}/*** Returns the archivAnzeigen.* @return boolean*/public boolean isArchivAnzeigen() {return archivAnzeigen;}/*** Sets the archivAnzeigen.* @param archivAnzeigen The archivAnzeigen to set*/public void setArchivAnzeigen(boolean archivAnzeigen) {this.archivAnzeigen = archivAnzeigen;}}Thanks for the help.Greetings,Nadja-Nadja SenoucciUniversitaet HamburgZentrum für Molekulare NeurobiologieService-Gruppe EDVFalkenried 9420251 HamburgGermanyTel.:040 - 428 - 03 - 6619Fax.:040 - 428 - 03 -
Re: How can I set the defualt selection?
Struts will automatically mark the selected option when the value of the select box field/property in the actionform is set. So if you want to set one option as default in a blank form, set the actionform property to the value of the option you want. Preferably in the action.execute() so you don't muddle your jsp unnecessarily. Adam Caroline Jen wrote: I have similar questions. What is the syntax of the html:option tag? Just take the example given by you, are the codes shown below correct? Will the default selection shown? html:select property=select1 html:option property=1 labelProperty=first html:option property=2 labelProperty=second html:option property=3 labelProperty=third /html:select JPJ --- leonZ [EMAIL PROTECTED] wrote: I make it more clear here: A normal html: select name=select1 option value=1first/option option value=2 SELECTEDsecond/option option value=3third/option /select how can I use the 'SELECTED' to set a defualt option with struts tags. html:select property=select1 html:option ... /html:select leon [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I am a beginner of struts. I can't use the 'selected' property of the select tag in struts to set the default selection like I used it in a normal html. It's happened in 'checked' property of struts radio tag. Could you tell me how to set a defualt selection. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.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]
Re: Do any one send me the simplest validate strut for me?
Hi MaFai, the subscription form in the struts-example does validation with the normal validation mechanism, and the registration form does it with the struts-validator plug-in. Which one are you having problems with? The subscription form is simpler. I just had a look at the struts-config.xml file, and I see that the action mapping for saveSubscription is not set to validate. You can edit this to make it perform validation by adding the attribute validate=true to the mapping. There are plenty of good resources, tutorials etc on the struts website to help get you started, check them out. Adam MaFai wrote: Hello, struts-user, I have read the strut example again and again.Attempt to use the simple validate in my validateform.But it failed,I still can not find the reason,so do any one send me the example which is only need to validate the field required. Thanks! Best regards. MaFai [EMAIL PROTECTED] 2003-07-07 - 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: Validate() in netscape
It's weird how many people have javascript issues with validator. What version of Netscape are you using and what errors are you getting? sriram wrote: I'm using Struts 1.0 and I have written some validations in the validate() method in ActionForm . For example, some of the fields on the form are mandatory and so if the form is submitted with giving input in those fields, appropriate messages are displayed. This is working fine in Internet Explorer, but it's not showing any messages in Netscape Navigator. Can somebody please suggest a solution? Thanks Sriram - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: question about depends attribute in validator-rule.xml
it's the attribute you use to set the validation tests you want validator to carry out, e.g. required, maxlength, creditCard Kelvin wu wrote: Hi, could anyone tell me the meaning of depends attribute of validator element in validator-rules.xml? - Original Message - From: Kelvin wu [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Friday, July 04, 2003 6:40 PM Subject: question about depends attribute in validator-rule.xml Hi, i am using struts validator and want to add a validation rule by myself. i want the required validator only do validation when my custom validator return true. How can i do this? What is the meaning of depends attribute of validator element in validator-rules.xml? - 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: null form pointer
First make sure you have specified the form bean in the action mapping correctly. What do you mean by the validate button? Is that your submit button which submits the form to your edit action mapping? Adam Nicolas Seinlet wrote: I have a simple struts application. I've begin with a login page, and a list, where you can add, edit or delete items in this list. The list is composed of 2 datas (a number and a string). The add function run OK, the delete function too. But the edit function is a bit harder to run... I've the GetCgAction, that runs OK, which use a CgForm class, and a EditCg.jsp. When the EditCg.jsp is displayed, datas are in the apropriate fields. When the Validate button is pressed, it call the EditCg.do link, but it passes a null form pointer to the function. In debugger, the function doesn't call the validate function of the CgForm class. What does I have to verify why he passes a null pointer? I think the form-beans and actions are correctly inserted in the struts-config.xml... - 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[2]: Form bean is not stored in request
Hello again, Do you need the above line for some good reason. If not, drop it. I deleted the attribute line. Stupid easy-struts is still telling me that attribute=suchen but I can't find the line the struts-config.xml anymore. I have that line in all my action mappings (for forms anyway), it never did anything... Why shouldn't I have the line in there? Still things seem to be behave oddly... Here's the logging (with comments from me) I don't quite understand what is going on anymore... 1) Looking for ActionForm bean instance in scope 'request' under attribute key 'suchen' 2) Creating new ActionForm instance of type 'de.zmnh.struts.form.SuchenForm' This is the first call to the form, it correctly creates a new instance. Then comes some general struts initialisation. Next 16 lines are from my own debugging info for the dropdown in my form and then follows some more struts message initialisations and such. All these are not really of consequence here, so I deleted them. Then after info in entered into the form and submit is pressed: 3) Get module name for path /suchen.do 4) Module name found: default 5) Processing a 'POST' for path '/suchen' 6) Looking for ActionForm bean instance in scope 'request' under attribute key 'suchen' 7) Creating new ActionForm instance of type 'de.zmnh.struts.form.SuchenForm' 8) -- [EMAIL PROTECTED] As you can see, the form bean is stil being looked for even though I deleted that line. Maybe, it's easy-struts messing things up but I checked the code the line is not there anymore... (mapping: action input=/index.jsp name=suchen path=/suchen scope=request type=de.zmnh.struts.action.SuchenAction / Tried switching to session, no change...) 9) Storing ActionForm bean instance in scope 'request' under attribute key 'suchen' Now, it created a new one and stores this one in the request right away... Why? 10) Populating bean properties from this request It can't. The data of the form is gone... 11) BeanUtils.populate([EMAIL PROTECTED], {field(searchfield1)=[Ljava.lang.String;@41a12f, submit=[Ljava.lang.String;@bd4e3c, parameter(searchparam1)=[Ljava.lang.String;@5b78cf}) 12) setProperty([EMAIL PROTECTED], field(searchfield1), [string_Geraet.Hersteller]) 13) Skipping read-only property I don't have a ready-only property in the form... Not that I know of anyway. I have one in the next page, that should be displayed when all this works, but not here... 14) setProperty([EMAIL PROTECTED], submit, [Suchen]) DEBUG 2003-07-07 12:13:44,519 [HttpProcessor[8080][3]] (BeanUtils.java:873) org.apache.commons.beanutils.BeanUtils - setProperty([EMAIL PROTECTED], parameter(searchparam1), [HP]) 15) Skipping read-only property 16) Validating input form properties 17) No errors detected, accepting input 18) Looking for Action instance for class de.zmnh.struts.action.SuchenAction 19) Creating new Action instance The next two line are from a bean created in my Action class, that does a few things with the data it shoudl be getting from my form. I have added one line telling me the size of one of the maps that are stored in my form bean and get passed to the this SearchSupportBean but since a new form bean was created the size of this map is of course zero... 20) SearchSupportBean.createNew() 21) Fields size: 0 Any ideas? I know, I don't have any anymore... Completely confused now... Thanks for the help so far. Greetings, Nadja - Nadja Senoucci Universitaet Hamburg Zentrum für Molekulare Neurobiologie Service-Gruppe EDV Falkenried 94 20251 Hamburg Germany Tel.:040 - 428 - 03 - 6619 Fax.:040 - 428 - 03 - 6621 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re[4]: Form bean is not stored in request
Hello Nadja, *** NS Hello again, Do you need the above line for some good reason. If not, drop it. NS I deleted the attribute line. Stupid easy-struts is still telling me that NS attribute=suchen but I can't find the line the struts-config.xml anymore. I NS have that line in all my action mappings (for forms anyway), it never did NS anything... Why shouldn't I have the line in there? NS Still things seem to be behave oddly... Here's the logging (with comments NS from me) I don't quite understand what is going on anymore... NS 1) Looking for ActionForm bean instance in scope 'request' under attribute NS key 'suchen' NS 2) Creating new ActionForm instance of type 'de.zmnh.struts.form.SuchenForm' NS This is the first call to the form, it correctly creates a new instance. NS Then comes some general struts initialisation. Next 16 lines are from my NS own debugging info for the dropdown in my form and then follows some more NS struts message initialisations and such. All these are not really of NS consequence here, so I deleted them. NS Then after info in entered into the form and submit is pressed: Attention. Here the new request starts! NS 3) Get module name for path /suchen.do NS 4) Module name found: default NS 5) Processing a 'POST' for path '/suchen' NS 6) Looking for ActionForm bean instance in scope 'request' under attribute NS key 'suchen' NS 7) Creating new ActionForm instance of type 'de.zmnh.struts.form.SuchenForm' 8) -- [EMAIL PROTECTED] NS As you can see, the form bean is stil being looked for even though I NS deleted that line. That's okay. Its only the debugging info beeing not quite correct. So far, everything looks okay to me. NS Maybe, it's easy-struts messing things up but I checked NS the code the line is not there anymore... NS (mapping: action NS input=/index.jsp NS name=suchen NS path=/suchen NS scope=request NS type=de.zmnh.struts.action.SuchenAction / NS Tried switching to session, no change...) NS 9) Storing ActionForm bean instance in scope 'request' under attribute key NS 'suchen' NS Now, it created a new one and stores this one in the request right away... NS Why? Because it is supposed to create a new form. We are dealing with a new request, aren't we? This new request is missing the form bean named suchen. NS 10) Populating bean properties from this request NS It can't. The data of the form is gone... NS 11) BeanUtils.populate([EMAIL PROTECTED], NS {field(searchfield1)=[Ljava.lang.String;@41a12f, NS submit=[Ljava.lang.String;@bd4e3c, NS parameter(searchparam1)=[Ljava.lang.String;@5b78cf}) NS 12) setProperty([EMAIL PROTECTED], field(searchfield1), NS [string_Geraet.Hersteller]) NS 13) Skipping read-only property NS I don't have a ready-only property in the form... Not that I know of NS anyway. I have one in the next page, that should be displayed when all this NS works, but not here... NS 14) setProperty([EMAIL PROTECTED], submit, [Suchen]) NS DEBUG 2003-07-07 12:13:44,519 [HttpProcessor[8080][3]] (BeanUtils.java:873) NS org.apache.commons.beanutils.BeanUtils - NS setProperty([EMAIL PROTECTED], parameter(searchparam1), NS [HP]) NS 15) Skipping read-only property NS 16) Validating input form properties NS 17) No errors detected, accepting input NS 18) Looking for Action instance for class de.zmnh.struts.action.SuchenAction NS 19) Creating new Action instance NS The next two line are from a bean created in my Action class, that does a NS few things with the data it shoudl be getting from my form. I have added NS one line telling me the size of one of the maps that are stored in my form NS bean and get passed to the this SearchSupportBean but since a new form bean NS was created the size of this map is of course zero... NS 20) SearchSupportBean.createNew() NS 21) Fields size: 0 NS Any ideas? I know, I don't have any anymore... Completely confused now... NS Thanks for the help so far. NS Greetings, NS Nadja NS - NS Nadja Senoucci NS Universitaet Hamburg NS Zentrum für Molekulare Neurobiologie NS Service-Gruppe EDV NS Falkenried 94 NS 20251 Hamburg NS Germany NS Tel.:040 - 428 - 03 - 6619 NS Fax.:040 - 428 - 03 - 6621 NS - NS To unsubscribe, e-mail: [EMAIL PROTECTED] NS For additional commands, e-mail: [EMAIL PROTECTED] Regards, Dirk +--- Quality leads ---+ | Dirk Markert [EMAIL PROTECTED] | | Dr. Markert Softwaretechnik AG | | Joseph-von-Fraunhofer-Str. 20 | | 44227 Dortmund | +-- to success! -+ - To unsubscribe, e-mail: [EMAIL
Re: execute / perform
perform method is still presend in 1.1 for backward compatibility. eventually it will go away. So in struts the seques is execute(1.1)--- perform(1.0) Which version are you using ? Cheers Ashwani Kalra http://www.geocities.com/ashwani_kalra/ ~~ Nicolas Seinlet [EMAIL PROTECTED]To: Struts Users Mailing List [EMAIL PROTECTED], ftware.be Dr. Dirk Markert [EMAIL PROTECTED] cc: (bcc: ashwani.kalra/Polaris) 07/07/2003 03:03 PMSubject: execute / perform Please respond to Struts Users Mailing List in my struts application why is the perform function is called instead of execute, with the same parameters? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e-Mail may contain proprietary and confidential information and is sent for the intended recipient(s) only. If by an addressing or transmission error this mail has been misdirected to you, you are requested to delete this mail immediately. You are also hereby notified that any use, any form of reproduction, dissemination, copying, disclosure, modification, distribution and/or publication of this e-mail message, contents or its attachment other than by its intended recipient/s is strictly prohibited. Visit Us at http://www.polaris.co.in - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Request/Response Utils future request
+1 ( crossposting to struts-dev to try and spark some discussion on implementation) Couldn't agree more George. I too have come across *numerous* situations where I wanted to override and do things a little bit differently for certain cases. And not just with Request Response Utils but also with a lot of the commons stuff like BeanUtils, PropertyUtils etc This is a good example of why its best to use singletons for utility classes - even if all the methods can be static - as other folk may want to override... If you want them to look at it you will need to add it as an enhancement request in bugzilla: http://issues.apache.org/bugzilla/ -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, 7 July 2003 17:25 To: [EMAIL PROTECTED] Subject: Request/Response Utils future request For a future version of Struts, I'd like to request that the Request and Response Utils be an instantiated object that we can subclass. One reason is that I'd like to override the 'filter' method of RequestUtils. It currently iterates through every character in the string. I have another 'filter' that I use for i18n purposes (LTR and RTL displays) that does the same thing, and I don't want to have to iterate through a string twice! In addition, the filter seems to be missing a few, such as the british pound symbol. Since I currently cannot override this method, I have to choose between doing the iteration twice or not use the struts jsp tags... ugly choice, no? Thanks! -gjb e-mail [EMAIL PROTECTED] www.convergys.com -- NOTICE: The information contained in this electronic mail transmission is intended by Convergys Corporation for the use of the named individual or entity to which it is directed and may contain information that is privileged or otherwise confidential. If you have received this electronic mail transmission in error, please delete it from your system without copying or forwarding it, and notify the sender of the error by reply email or by telephone (collect), so that the sender's address records can be corrected. - 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[4]: Form bean is not stored in request
And once again hello, [snip] NS 9) Storing ActionForm bean instance in scope 'request' under attribute key NS 'suchen' NS Now, it created a new one and stores this one in the request right away... NS Why? Because it is supposed to create a new form. We are dealing with a new request, aren't we? This new request is missing the form bean named suchen. Wait a moment, I thought the form bean is supposed to be known in the action. The form's data needs to be processed further in the action and that can't really be done if there is a new form bean getting created in the action class every time... Or am I completely misunderstanding something here? Also, I've added another line of debugging info and it seems that my variables don't get filled at all, meaning my setField and setParameter methods do not get called to. I have write debug info into my logfile there, so that should get printed into the logfile if they were called... Also, there are these lines that are worrying me: setProperty([EMAIL PROTECTED], field(searchfield1), [string_Geraet.Hersteller]) Skipping read-only property setProperty([EMAIL PROTECTED], parameter(searchparam1), [HP]) Skipping read-only property I never said anything about read-only. I guess, that's actually my whole problem (not sure though) but I have no idea how to fix it. Greetings, Nadja - Nadja Senoucci Universitaet Hamburg Zentrum für Molekulare Neurobiologie Service-Gruppe EDV Falkenried 94 20251 Hamburg Germany Tel.:040 - 428 - 03 - 6619 Fax.:040 - 428 - 03 - 6621 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Action forward to another action without form
just have your forward in the action go to something the servlet will pick up forward name=success path=/AnotherAction.do/ and just mapping.findForward(success); Note that this may not be syntatically correct... sandeep --- Benjamin Stewart [EMAIL PROTECTED] wrote: Can you point me in the right direction, none of my books talk about it, cant find examples etc. Ben Dan Tran wrote: Yes;) - Original Message - From: Benjamin Stewart [EMAIL PROTECTED] Newsgroups: Struts Sent: Sunday, July 06, 2003 6:59 PM Subject: Action forward to another action without form Greetings, I have a form that submits values. From the Action class I would (in some circumstances) like to go directly to another action class and then forward to a view. Is this possible ? Thanks Ben - 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!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problems with logic:iterate (indexId has no effect)
Hi, I have a vector called variationmargins and in it I have a property called loadProfile that is either 1 or 2 for all postings. I have tried to use the logic:iterate tag to output the result using the loadProfile as an index, but it has not effect. It just outputs everything, no matter the indexId. Does anyone have a clue what I am doing wrong? logic:iterate id=element name=variationmargins property=variationMargins indexId=loadProfile bean:write name=element property=loadProfileName/ br display:table name=variationmargins property=variationMargins scope=session width=100% pagesize=100 requestURI=result.jsp decorator=org.apache.taglibs.display.test.ColumnsWrapper display:column title=%=ldeliveryPeriod% property=deliveryPeriod sort=true width=10%/ display:column title=%=lhours% property=hours align=right sort=true width=10%/ /display:table /logic:iterate Thanks, Bard A. Evjen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: logic:iterate question
The following link should help: http://www.mail-archive.com/[EMAIL PROTECTED]/msg71256.html however it talks about using el, but this is not necessary. I have got the nested tags to work properly. The logic tag should work, but I think I was doing something slightly wrong when I tried. Remember to have getMap(String key) and setMap(String key, Object value) in your form. The online help has more on this. sandeep --- [EMAIL PROTECTED] wrote: hi all, i have a Map-backed action Form which contains an HashMap the ActionForm is as follows public MapActionForm extends ActionForm { HashMap table = new HashMap(); public void setValue(String key, String value) { ... } public Object getValue(String key) { .. } public HashMap getTable() { return table; } } in one of jsp i have to display a textfield for each key contained in the HashMap. i have written following code (name of the bean is DisplayKeys) logic:iterate id=params collection=%= displayKeys.getTable() % tr tdbean:write name=params//td tdhtml:text property=value(bean:write name=params/)//td /tr /logic:iterate but when i get into the page (after populating the bean) i got following exception: org.apache.jasper.JasperException: /callservice.jsp(53,79) equal symbol expected the hashmap contains parameter names. in the jps i want to display the name of the parameter (done with bean:write name=params) and i want to display close to teh name an input text with the name of the parameter.. Example: in the map i have following values param1, param2, and in the jsp i want to display param1 : input type=text name=param1/ anyone can give me some help? regards marco - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Multiple updates to objects from a table list
Hi folks, I have a question - however the root cause of the question may be because I am not understanding the best way to use the Form Beans and the Actions for updating multiple objects from one screen. Basically I have a jsp that displays a table list of objects (ItemType). I pass an ItemTypes ArrayList to the jsp (in the session) and use a logic:iterate to print out the HTML. Each printed ItemType row also needs to have a check box and a couple of text boxes to accept input if needed. Rather than use an edit hyperlink for each row to a separate screen - if the check box is checked for the row when the form is submitted (after validation) it needs to read the values for the text boxes and update for the relevant fields for the ItemType in the DB and repeat for all checked rows. Since I need to capture input I use text boxes, the property attribute needs to be present so my jsp FormBean has properties e.g. rate and units that will correspond to the values that need to be read? So each time I output the row in the iterate to draw the text box I use html:text property=units styleClass=textControl maxlength=8/ where units is an int in my FormBean. (In my formBean units is not an array - should it be?) Also, I cannot seem to read the units array from the request in the validate of the FormBean I have tried request.getParameter(units[1]); request.getParameter(units(1)]); both return null. and several other variations. Does anybody know the correct way to get at the units text box array? I am trying to get the basics working for now and then this will be expanded to test if check box is checked then process each row together. All other struts examples I have seen present a list then use a separate screen to edit each row and return to the list with updated values. I may have several item on the list all needing rates and units entered and would be much more user friendly to process at once. So, more importantly is there a better way to construct this, this must have been done many times before? - any examples would be much appreciated. This is probably as clear as mud but thanks in advance, Mark - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re[6]: Form bean is not stored in request
Hello Struts, *** NS And once again hello, NS [snip] NS 9) Storing ActionForm bean instance in scope 'request' under attribute NS key NS 'suchen' NS Now, it created a new one and stores this one in the request right NS away... NS Why? Because it is supposed to create a new form. We are dealing with a new request, aren't we? This new request is missing the form bean named suchen. NS Wait a moment, I thought the form bean is supposed to be known in the NS action. The form's data needs to be processed further in the action and NS that can't really be done if there is a new form bean getting created in NS the action class every time... Or am I completely misunderstanding NS something here? No. Before your action is called the form bean exists and its values are set. NS Also, I've added another line of debugging info and it seems that my NS variables don't get filled at all, meaning my setField and setParameter NS methods do not get called to. I have write debug info into my logfile NS there, so that should get printed into the logfile if they were called... NS Also, there are these lines that are worrying me: NS setProperty([EMAIL PROTECTED], field(searchfield1), NS [string_Geraet.Hersteller]) NS Skipping read-only property NS setProperty([EMAIL PROTECTED], NS parameter(searchparam1), [HP]) NS Skipping read-only property NS I never said anything about read-only. I guess, that's actually my whole NS problem (not sure though) but I have no idea how to fix it. This is definitely the problem. What properties are you trying to set? NS Greetings, NS Nadja NS - NS Nadja Senoucci NS Universitaet Hamburg NS Zentrum für Molekulare Neurobiologie NS Service-Gruppe EDV NS Falkenried 94 NS 20251 Hamburg NS Germany NS Tel.:040 - 428 - 03 - 6619 NS Fax.:040 - 428 - 03 - 6621 NS - NS To unsubscribe, e-mail: [EMAIL PROTECTED] NS For additional commands, e-mail: [EMAIL PROTECTED] Regards, Dirk +--- Quality leads ---+ | Dirk Markert [EMAIL PROTECTED] | | Dr. Markert Softwaretechnik AG | | Joseph-von-Fraunhofer-Str. 20 | | 44227 Dortmund | +-- to success! -+ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE : execute / perform
I've update to struts 1.1 At the start of the aplication I've the error: javax.servlet.jsp.JspException: Cannot find message resources under key org.apache.struts.action.MESSAGE What does i have to do? -Message d'origine- De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Envoyé : dimanche 7 juillet 2002 13:00 À : Struts Users Mailing List perform method is still presend in 1.1 for backward compatibility. eventually it will go away. So in struts the seques is execute(1.1)--- perform(1.0) Which version are you using ? Cheers Ashwani Kalra http://www.geocities.com/ashwani_kalra/ ~~ Nicolas Seinlet [EMAIL PROTECTED]To: Struts Users Mailing List [EMAIL PROTECTED], ftware.be Dr. Dirk Markert [EMAIL PROTECTED] cc: (bcc: ashwani.kalra/Polaris) 07/07/2003 03:03 PMSubject: execute / perform Please respond to Struts Users Mailing List in my struts application why is the perform function is called instead of execute, with the same parameters? - 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: Multiple updates to objects from a table list
If the name in the html sent to the browser is just units (with multiple instances of this field) then use: request.getParameters(units)[1] (this method returns an array of String) Have you looked at the nesting tutorials yet? http://www.keyboardmonkey.com/next/index.jsp If you use collections of nested beans (each row having one bean) you will find life a lot easier... -Original Message- From: Sinclair, Mark [mailto:[EMAIL PROTECTED] Sent: Monday, 7 July 2003 19:40 To: [EMAIL PROTECTED] Subject: Multiple updates to objects from a table list Hi folks, I have a question - however the root cause of the question may be because I am not understanding the best way to use the Form Beans and the Actions for updating multiple objects from one screen. Basically I have a jsp that displays a table list of objects (ItemType). I pass an ItemTypes ArrayList to the jsp (in the session) and use a logic:iterate to print out the HTML. Each printed ItemType row also needs to have a check box and a couple of text boxes to accept input if needed. Rather than use an edit hyperlink for each row to a separate screen - if the check box is checked for the row when the form is submitted (after validation) it needs to read the values for the text boxes and update for the relevant fields for the ItemType in the DB and repeat for all checked rows. Since I need to capture input I use text boxes, the property attribute needs to be present so my jsp FormBean has properties e.g. rate and units that will correspond to the values that need to be read? So each time I output the row in the iterate to draw the text box I use html:text property=units styleClass=textControl maxlength=8/ where units is an int in my FormBean. (In my formBean units is not an array - should it be?) Also, I cannot seem to read the units array from the request in the validate of the FormBean I have tried request.getParameter(units[1]); request.getParameter(units(1)]); both return null. and several other variations. Does anybody know the correct way to get at the units text box array? I am trying to get the basics working for now and then this will be expanded to test if check box is checked then process each row together. All other struts examples I have seen present a list then use a separate screen to edit each row and return to the list with updated values. I may have several item on the list all needing rates and units entered and would be much more user friendly to process at once. So, more importantly is there a better way to construct this, this must have been done many times before? - any examples would be much appreciated. This is probably as clear as mud but thanks in advance, 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: db connection pooling
Use jakarat DBCP. If you read thru tomcat's (that is if you use tomcat) howto's they explain how to set it up. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, July 07, 2003 12:39 AM To: [EMAIL PROTECTED] Subject: db connection pooling Hi, Is there any ways to achieve db connection pooling and access of such pooled connection though jndi in struts action classes. Regards, Jailani.S - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Form bean is not stored in request
Hello, This is definitely the problem. What properties are you trying to set? I have two map backed fields in form. Since they can actually exists repeatedly I am building the name in my .jsp and am displaying this as follows: tr bgcolor=#FF % String fname = field(searchfield+(counter)+); String pname = parameter(searchparam+(counter)+);% td html:select property=%=fname% html:optionsCollection property=searchFields value=value label=label/ /html:select/td tdhtml:text property=%=pname%//td /tr % counter++; }while(counter=number); % So, the fields should be set via setField(String key, String value) and setParameter(String key, String value): public void setField(String key, String value){ LoggerSupport.logDebug(setField(): key: +key+, value: +value,log); this.fields.put(key,value); LoggerSupport.logDebug(setField(): sind die Daten auch in der Map? +(this.fields.get(key)==null?Nein:Ja +this.fields.get(key)),log); } public void setParameter(String key, String value){ LoggerSupport.logDebug(setParameter(): key: +key+, value: +value,log); this.params.put(key,value); LoggerSupport.logDebug(setParameter(): sind die Daten auch in der Map? +(this.params.get(key)==null?Nein:Ja +this.params.get(key)),log); } The Maps are being initialzed in SuchenForm's contructor: public SuchenForm(){ fields = new TreeMap(); params = new TreeMap(); cnt = new Integer(1); } Greetings, Nadja - Nadja Senoucci Universitaet Hamburg Zentrum für Molekulare Neurobiologie Service-Gruppe EDV Falkenried 94 20251 Hamburg Germany Tel.:040 - 428 - 03 - 6619 Fax.:040 - 428 - 03 - 6621 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re[6]: Form bean is not stored in request
Hello Nadja, try to change your getters (Field/Param) to return String, not Object. Regards, Dirk +--- Quality leads ---+ | Dirk Markert [EMAIL PROTECTED] | | Dr. Markert Softwaretechnik AG | | Joseph-von-Fraunhofer-Str. 20 | | 44227 Dortmund | +-- to success! -+ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Parameters to Actions
Hello, i'm using this dynamic link to pass a parameters to an action: http://localhost:8081/deleteEvent.do?action=confirmDelete * code in deleteEventAction : try { String action = (String) request.getAttribute(action); if (action.equals(confirmDelete)) { request.setAttribute(action,action); } } catch (NullPointerException e) { System.err.println(attribute action onot found); } but i get an NullPointerException :( * Action mapping : action path=/deleteEvent type=org.jcrontab.web.struts.DeleteEventAction / what can be the problem ? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Parameters to Actions
When you pass a parameter like you did in your url, use the method getParameter() of the request... It will return you a string... And if you don't want to have a NullPointerException, do your if like this : String action = request.getParameter(action); if(confirmDelete.equals(action)){} Bye.. -Original Message- From: José Moreira [mailto:[EMAIL PROTECTED] Sent: lundi, 7. juillet 2003 13:51 To: Struts Users Mailing List Subject: Parameters to Actions Hello, i'm using this dynamic link to pass a parameters to an action: http://localhost:8081/deleteEvent.do?action=confirmDelete * code in deleteEventAction : try { String action = (String) request.getAttribute(action); if (action.equals(confirmDelete)) { request.setAttribute(action,action); } } catch (NullPointerException e) { System.err.println(attribute action onot found); } but i get an NullPointerException :( * Action mapping : action path=/deleteEvent type=org.jcrontab.web.struts.DeleteEventAction / what can be the problem ? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] *** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager to [EMAIL PROTECTED] *** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Re[6]: Form bean is not stored in request
Hello Dirk, try to change your getters (Field/Param) to return String, not Object. Thanks, that was it!! Can't believe I have been looking in the wrong place the whole damn time... That error had kept me guessing since last thursday! But now this part is working and I can face a whole new and different error. :) Thanks for all your help! Greetings, Nadja - Nadja Senoucci Universitaet Hamburg Zentrum für Molekulare Neurobiologie Service-Gruppe EDV Falkenried 94 20251 Hamburg Germany Tel.:040 - 428 - 03 - 6619 Fax.:040 - 428 - 03 - 6621 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
is war file essential
Hi all , I am using tomcat 4.1.24 . I am trying to start with struts. Is it essential that the application should be deployed as war file only . Suppose if i have index.jsp in my webapp/MyExample directory . this page is defined in the web.xml in webapp/MyExample/web-inf as welcome-file-list welcome-fileIndex.jsp/welcome-file /welcome-file-list But after starting the tomcat server and if i give the url as http://localhost:8080/MyExample the page is not getting identified . Regards, Jagan. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Parameters to Actions
typo in action field in input form. maybe... Jose' Moreira wrote: Hello, i'm using this dynamic link to pass a parameters to an action: http://localhost:8081/deleteEvent.do?action=confirmDelete * code in deleteEventAction : try { String action = (String) request.getAttribute(action); if (action.equals(confirmDelete)) { request.setAttribute(action,action); } } catch (NullPointerException e) { System.err.println(attribute action onot found); } but i get an NullPointerException :( * Action mapping : action path=/deleteEvent type=org.jcrontab.web.struts.DeleteEventAction / what can be the problem ? - 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[8]: Form bean is not stored in request
Hello Nadja, you are welcome. *** NS Hello Dirk, try to change your getters (Field/Param) to return String, not Object. NS Thanks, that was it!! Can't believe I have been looking in the wrong place NS the whole damn time... That error had kept me guessing since last thursday! NS But now this part is working and I can face a whole new and different NS error. :) Thanks for all your help! NS Greetings, NS Nadja NS - NS Nadja Senoucci NS Universitaet Hamburg NS Zentrum für Molekulare Neurobiologie NS Service-Gruppe EDV NS Falkenried 94 NS 20251 Hamburg NS Germany NS Tel.:040 - 428 - 03 - 6619 NS Fax.:040 - 428 - 03 - 6621 NS - NS To unsubscribe, e-mail: [EMAIL PROTECTED] NS For additional commands, e-mail: [EMAIL PROTECTED] Regards, Dirk +--- Quality leads ---+ | Dirk Markert [EMAIL PROTECTED] | | Dr. Markert Softwaretechnik AG | | Joseph-von-Fraunhofer-Str. 20 | | 44227 Dortmund | +-- to success! -+ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: is war file essential
You have a typo in your web.xml change Index.jsp to index.jsp And no it is not essential to start app as war. You can dearchive it too and it will deploy just as well. -Original Message- From: Jagannayakam [mailto:[EMAIL PROTECTED] Sent: Monday, July 07, 2003 7:54 AM To: Struts Users Mailing List (E-mail) Subject: is war file essential Hi all , I am using tomcat 4.1.24 . I am trying to start with struts. Is it essential that the application should be deployed as war file only . Suppose if i have index.jsp in my webapp/MyExample directory . this page is defined in the web.xml in webapp/MyExample/web-inf as welcome-file-list welcome-fileIndex.jsp/welcome-file /welcome-file-list But after starting the tomcat server and if i give the url as http://localhost:8080/MyExample the page is not getting identified . Regards, Jagan. - 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: Validate() in netscape
I'm using Netscape 4.7 And the erors here are not javascript. Simple validations performed in validate() method of ActionForm. I'm using an image in place of a submit button (using html:image tag). In case value is not provided for a mandatory field, the validate() method will chk for null and return an error. This error is shown in IE but not in Netscape. What could be the reason? Doesn't netscape support form submission through html:image tags? -Original Message- From: Adam Hardy [mailto:[EMAIL PROTECTED] Sent: Monday, July 07, 2003 3:46 PM To: Struts Users Mailing List Subject: Re: Validate() in netscape It's weird how many people have javascript issues with validator. What version of Netscape are you using and what errors are you getting? sriram wrote: I'm using Struts 1.0 and I have written some validations in the validate() method in ActionForm . For example, some of the fields on the form are mandatory and so if the form is submitted with giving input in those fields, appropriate messages are displayed. This is working fine in Internet Explorer, but it's not showing any messages in Netscape Navigator. Can somebody please suggest a solution? Thanks Sriram - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Parameters to Actions
Hello, i'm using this dynamic link to pass a parameters to an action: http://localhost:8081/deleteEvent.do?action=confirmDelete String action = (String) request.getAttribute(action); Use getParameter instead of getAttribute! HTH, Heiko - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts 1.1 Api
Hi , From where can I get struts 1.1 API Regards, Jagan. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Parameters to an action from a tile
Haven't tried but try amp; ... edit.doamp;header=true cheers mark On Friday, June 27, 2003, at 09:10 PM, Peter Smith wrote: Hi all, I am trying to insert in a tile with a value that needs to pass two parameters. When I put in the '', the parser dies. Here is the definition I am inserting. definition name=profile.edit.search.body extends=simpleLayout.body put name=content value=/search.do?dispatch=/edit.doheader=true/ /definition So its the 'header=true' that will kill it. Any thoughts? Thanks, Peter -- Peter Smith Software Engineer InfoNow Corporation - 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: odd tiles behavior with tile parameters
Thanks for the follow-up - I will try String. My problem really isn't with the attributes I'm specifying as direct=true or type=string, it's with the one (navNode from my example) that I must specifically leave off the type/direct attributes in order for it to work with the useAttribute tag: tiles:useAttribute name=navNode classname=java.lang.String / If I specify direct/type for navNode I get ClassCastExceptions when my JSP runs with the above tag. It seems if there is a bug, it's with the useAttribute tag implementation or the put tag implementation. Any other ideas? Thanks again. -matt On Mon, Jul 07, 2003 at 06:07:33AM -0700, Sandeep Takhar wrote: Not sure if this is what you are after, but according to the docs it says that tiles:get will respect the type parameter. So maybe this is a bug. From the docs: -- If 'direct=true' content is 'string', if 'direct=false', content is 'page' Specify content type: string, page, template or definition. String : Content is printed directly. page | template : Content is included from specified URL. Name is used as an URL. definition : Value is the name of a definition defined in factory (xml file). Definition will be searched in the inserted tile, in a template:insert attribute=attributeName tag, where 'attributeName' is the name used for this tag. -- maybe it is case sensitive 'String' instead of 'string'? sandeep --- matthew c. mead [EMAIL PROTECTED] wrote: I'm trying to use Tiles for a couple different things and seeing some bizarre behavior. I've not looked into its source too thoroughly at this point, but would be willing to do so to help figure this out. I use tile parameters in a couple different ways: definition name=ServiceWithoutSearchHeader path=/include/header_without_search.jsp / definition name=ServiceWithoutSearchLeftNav path=/include/left_nav.jsp / definition name=ServiceWithoutSearchFooter path=/includes/footer.inc / definition name=ServiceWithoutSearchDebug path=/includes/debug_output.jsp / definition name=ServiceWithoutSearch put name=header value=ServiceWithoutSearchHeader / put name=leftnav value=ServiceWithoutSearchLeftNav / put name=footer value=ServiceWithoutSearchFooter / put name=debug value=ServiceWithoutSearchDebug / put name=navNode value=Maintenance type=string / put name=title value=Service direct=true / /definition So you can see I use them to include tiles within a tile, as well as some parameters. When I want to include one of those JSPs in the output, I simply use tiles:insert. The other parameters in that outer definition (navNode, title), I pass along to some specific subtiles - the header and the leftnav: tiles:insert attribute=header tiles:put name=title beanName=title beanScope=tile / tiles:put name=navNode beanName=navNode beanScope=tile / /tiles:insert In the sub-tiles I access the title like so: tiles:get name=title / and it works fine. However, the navNode I need to use programmatically: tiles:useAttribute name=navNode classname=java.lang.String / If I specify direct=true or type=string for navNode in the definition I get a ClassCastException with the above line in my JSP. However, the way I'm currently putting it in the definition, I cannot use it within a tiles:get tag because it assumes it is not direct and tries to read a file. Is there one method I can use for defining these parameters so they are consistent or am I stuck with the different definition entries based on how I use them? Thanks! -matt -- matthew c. mead http://www.goof.com/~mmead/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- matthew c. mead http://www.goof.com/~mmead/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 1.1 Api
If you've a struts-documentation.war file in your distribution then install on your container and look at that or http://jakarta.apache.org/struts/api/index.html On Monday, July 7, 2003, at 02:05 PM, Jagannayakam wrote: Hi , From where can I get struts 1.1 API Regards, Jagan. - 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]
include javascript (urgent)
Hi all, I'm using the Struts framework for my web application. Unfortunatly I have to include some java-script from an other webserver (Lotus Domino). I have stored the url for the include in a Bean called: URLBean: package ordermanager.urlbean; public class URLBean { private String scriptFile; public String getScriptFile() { return scriptFile; } public void setScriptFile(String string) { scriptFile = string; } } In my first Action I create the URLBean. And I add it to the session object using the following code: URLBean urlBean = new URLBean(); urlBean.setScriptFile(properties.getProperty(script.include)); request.getSession().setAttribute(urls, urlBean); Then In my JSP I tried to do this: logic:present name=urls jsp:useBean id=urls scope=session class=ordermanager.urlbean .URLBean / ScriptFile: bean:write name=urls property=scriptFile/ br/ /logic:present This code works... But I want to use this url in a script tag like this: script src=%= urls.getScriptFile() %/script But when I try this I get a comiple error. Jasper complains that the urls object cannot be found. What am I doing wrong. And what should I do to correct it? Thanks, Harm de Laat Informatiefabriek - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts Tiles definitions
Hello, is it possible to associate a request variable like 'action' to struts tiles definitions, in the tiles-definition.xml ? Usually i have an index.jsp requesting a layout depending on the value of the 'action' request parameter like this: logic:present parameter=action scope=request logic:equal parameter=action value=add scope=request tiles:insert definition=site.mainLayout.addEvent flush=true / /logic:equal logic:equal parameter=action value=edit scope=request tiles:insert definition=site.mainLayout.editEvent flush=true / /logic:equal logic:equal parameter=action value=confirmDelete scope=request tiles:insert definition=site.mainLayout.confirmDeleteEvent flush=true / /logic:equal /logic:present And what about the 'best-pratice' of it ? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: include javascript (urgent)
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, July 07, 2003 9:35 AM To: [EMAIL PROTECTED] Subject: include javascript (urgent) Hi all, I'm using the Struts framework for my web application. Unfortunatly I have to include some java-script from an other webserver (Lotus Domino). I have stored the url for the include in a Bean called: URLBean: package ordermanager.urlbean; public class URLBean { private String scriptFile; public String getScriptFile() { return scriptFile; } public void setScriptFile(String string) { scriptFile = string; } } In my first Action I create the URLBean. And I add it to the session object using the following code: URLBean urlBean = new URLBean(); urlBean.setScriptFile(properties.getProperty(script.include)); request.getSession().setAttribute(urls, urlBean); Then In my JSP I tried to do this: logic:present name=urls jsp:useBean id=urls scope=session class=ordermanager.urlbean .URLBean / ScriptFile: bean:write name=urls property=scriptFile/ br/ /logic:present This code works... But I want to use this url in a script tag like this: script src=%= urls.getScriptFile() %/script This is impossible with the way you do it. You want to use it as a context independent variable and yet you attach your bean to the session context. You will have to declare and initialize the urls variable somewhere in your script. Otherwise you can't get to it. So something like this will work: URLBean urls = (URLBean) request.getSession ().getAttribute (urls); But then again is it shorter or better than what you have already. I am not so sure. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: is war file essential
No. its' not necessary but convenient way to deploy app. You may directly copy the entire dir into context dir and start the tomcat. It will stillwork. Are you sure the file name is Index.sjp and NOT index.jsp? navjot singh |-Original Message- |From: Jagannayakam [mailto:[EMAIL PROTECTED] |Sent: Monday, July 07, 2003 5:24 PM |To: Struts Users Mailing List (E-mail) |Subject: is war file essential | | |Hi all , | |I am using tomcat 4.1.24 . I am trying to start with struts. Is it |essential |that the application should be deployed as war file only . | | |Suppose if i have index.jsp in my webapp/MyExample directory . this page |is defined in the web.xml in webapp/MyExample/web-inf as | | welcome-file-list |welcome-fileIndex.jsp/welcome-file | /welcome-file-list | | |But after starting the tomcat server and if i give the url as |http://localhost:8080/MyExample |the page is not getting identified . | |Regards, |Jagan. | | | |- |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: Validate() in netscape
sriram wrote: I'm using Netscape 4.7 And the erors here are not javascript. Simple validations performed in validate() method of ActionForm. I'm using an image in place of a submit button (using html:image tag). In case value is not provided for a mandatory field, the validate() method will chk for null and return an error. This error is shown in IE but not in Netscape. What could be the reason? Doesn't netscape support form submission through html:image tags? Oh I see. If netscape didn't support html:image tags as submit-triggers, then you wouldn't be able to submit to the server. So what you mean is that when submitting from netscape, a field that should fail validation actually passes without error? Are you using struts-validator plugin? What validation test are you doing? Show us some code, maybe it's the java. What is the value of the field that should fail the validation? Try logging it or System.out.println Adam - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] - Realm Security - How to set overlapping constraints?
- Original Message - From: Navjot Singh [EMAIL PROTECTED] Thanks Craig, Reversing the order of constraints does work. I should have RTFM. That kind of surprises me. The Servlet Spec v2.3 section SRV 11.1 says that exact patterns should be tried first, then paths (longest to shortest, by number of elements), then extensions, then the default servlet (/). The description of each of these types of patterns is also in the spec (the rules are simple and clear). Going by the spec, I would think that it would try /p/status.do first, since it is an exact pattern, and it would fail (403 error) there if the user didn't have the admin role. Perhaps there is something going on since the servlet mapping pattern is *.do. Craig, any input on what is going on there? But now, there is another problem. When user is authenticated once, and then i accessed a resource that needs login to admin. It simply throws 403. That is the correct behavior -- your user should log out and then back in if they need to change who they are along the way. I like to shoot for designing the system so that each user needs only one account to do everything they need to do, but sometimes that can be a real challenge as requirements are added on. Some folks have a hard time with the roles concept (that one user can have multiple roles), too, which complicates things. Can't it throw LOGIN PAGE? I can replace the default 403 page with my LOGIN page but i guess that wouldn't be the right solution. That won't work with container-managed security -- the container typically won't accept login form submittals when it (the server) didn't send the user to the login page. Setting the 403 error page to the login page, or having your app send the user there does not count (the server won't like the submittal in those cases). If i move my role constraints to struts-config, think i can handle that in my actions then. Am i right? Struts will just give an error if a user doesn't have the required role to access an action, which doesn't really help in your situation. Doing programmatic security in the action itself won't help, either. The basic problem is that you can't send the user to the login page yourself and expect the container-managed security to go along with it. The user needs to log out if they need to change accounts while using the app. You could have a message on the 403 error page that suggests the user log out if they need to change what user they are logged in as. It isn't ideal, but it might be your only alternative. -Max regards Navjot Singh |-Original Message- |From: Craig R. McClanahan [mailto:[EMAIL PROTECTED] |Sent: Saturday, July 05, 2003 11:37 PM |To: Struts Users Mailing List |Subject: Re: [OT] - Realm Security - How to set overlapping constraints? | |On Sat, 5 Jul 2003, Navjot Singh wrote: | | Date: Sat, 5 Jul 2003 21:39:34 +0530 | From: Navjot Singh [EMAIL PROTECTED] | Reply-To: Struts Users Mailing List [EMAIL PROTECTED] | To: Struts Users Mailing List [EMAIL PROTECTED] | Subject: [OT] - Realm Security - How to set overlapping constraints? | | hi, | | It may be quite simple but it's not working for me. | | I have a set of servlets | /myapp/p/ab.do | /myapp/p/groups.do | /myapp/p/contacts.do | | AND I want all of them to be accessible to roles user and admin. | | There is 1 more servlet that MUST be accessible ONLY to admin | /myapp/p/status.do | | I am setting config like given below. | But still, user roles are being able to access status.do | | What am i doing wrong? | | thanks for any help | -navjot singh | | __My XML Declarations__ | | security-constraint | web-resource-collection | web-resource-nameProtected/web-resource-name | url-pattern*.do/url-pattern | http-methodGET/http-method | http-methodPOST/http-method | /web-resource-collection | auth-constraint | role-nameuser/role-name | role-nameadmin/role-name | /auth-constraint | /security-constraint | |The list of security roles inside an auth-constraint is an *or* list, so |the container is doing exactly what you told it to do -- allow anyone with |either user or admin to access all *.do URLs. | | | security-constraint | web-resource-collection | web-resource-nameShow Status/web-resource-name | url-pattern/p/status.do/url-pattern | http-methodGET/http-method | http-methodPOST/http-method | /web-resource-collection | auth-constraint | role-nameadmin/role-name | /auth-constraint | /security-constraint | | |The fact that this one is second means that it will never get used, |because /p/status.do satisfies the matching pattern on the first test. |Try reversing your constraints. | |Another alternative is to do some of the role-based protection on Struts |actions in struts-config.xml instead, by using the role attribute on the |action element. That way, you can have just your first constraint above |(the one matching *.do) to force people to
Re: notEmpty/empty and interation
seems right. what happens if you just print hello in between the tags? Does it print the correct number of times? sandeep --- ben [EMAIL PROTECTED] wrote: Hi, Using struts1.1 I have problems getting the iterate tag working. the page scoped id bean for the element is never found. This happens when the collection is empty or contains values. Help is greatly appreciated. Details: I store a Collection under oss_prod_list in my session, with the following jsp snippet: logic:empty name=oss_prod_list No products available. /logic:empty !-- @TODO: notEmpty tag does not work for some reason -- logic:notEmpty name=oss_prod_list logic:iterate name=oss_prod_list id=prod_list_el td bean:write name=prod_list_el property=name / ... /logic:iterate /logic:notEmpty I get the empty as well as the not empty printed out when the collection is empty or not. When i remove the content between the iterate tag my jsp works, when not I get always (when collection is empty or not) the exception that the id bean specified as iteration element is not found: root cause javax.servlet.ServletException: Cannot find bean prod_list_el in any scope at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp l.java:530) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: notEmpty/empty and interation
also check to see if you have logic taglib api defined. If it is not, then check your source and you will see the xml .. logic:iterate right in the source. sandeep --- ben [EMAIL PROTECTED] wrote: Hi, Using struts1.1 I have problems getting the iterate tag working. the page scoped id bean for the element is never found. This happens when the collection is empty or contains values. Help is greatly appreciated. Details: I store a Collection under oss_prod_list in my session, with the following jsp snippet: logic:empty name=oss_prod_list No products available. /logic:empty !-- @TODO: notEmpty tag does not work for some reason -- logic:notEmpty name=oss_prod_list logic:iterate name=oss_prod_list id=prod_list_el td bean:write name=prod_list_el property=name / ... /logic:iterate /logic:notEmpty I get the empty as well as the not empty printed out when the collection is empty or not. When i remove the content between the iterate tag my jsp works, when not I get always (when collection is empty or not) the exception that the id bean specified as iteration element is not found: root cause javax.servlet.ServletException: Cannot find bean prod_list_el in any scope at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp l.java:530) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: odd tiles behavior with tile parameters
The docs on useAttribute seem do not mention that it will honour the type attribute. Obviously it is not a string when placed as a put. This would cause the class cast. What is the cast exception. It should specify what it thinks it is? There is a getAsString method as well, but I don't know if this will help you... sandeep --- matthew c. mead [EMAIL PROTECTED] wrote: Thanks for the follow-up - I will try String. My problem really isn't with the attributes I'm specifying as direct=true or type=string, it's with the one (navNode from my example) that I must specifically leave off the type/direct attributes in order for it to work with the useAttribute tag: tiles:useAttribute name=navNode classname=java.lang.String / If I specify direct/type for navNode I get ClassCastExceptions when my JSP runs with the above tag. It seems if there is a bug, it's with the useAttribute tag implementation or the put tag implementation. Any other ideas? Thanks again. -matt On Mon, Jul 07, 2003 at 06:07:33AM -0700, Sandeep Takhar wrote: Not sure if this is what you are after, but according to the docs it says that tiles:get will respect the type parameter. So maybe this is a bug. From the docs: -- If 'direct=true' content is 'string', if 'direct=false', content is 'page' Specify content type: string, page, template or definition. String : Content is printed directly. page | template : Content is included from specified URL. Name is used as an URL. definition : Value is the name of a definition defined in factory (xml file). Definition will be searched in the inserted tile, in a template:insert attribute=attributeName tag, where 'attributeName' is the name used for this tag. -- maybe it is case sensitive 'String' instead of 'string'? sandeep --- matthew c. mead [EMAIL PROTECTED] wrote: I'm trying to use Tiles for a couple different things and seeing some bizarre behavior. I've not looked into its source too thoroughly at this point, but would be willing to do so to help figure this out. I use tile parameters in a couple different ways: definition name=ServiceWithoutSearchHeader path=/include/header_without_search.jsp / definition name=ServiceWithoutSearchLeftNav path=/include/left_nav.jsp / definition name=ServiceWithoutSearchFooter path=/includes/footer.inc / definition name=ServiceWithoutSearchDebug path=/includes/debug_output.jsp / definition name=ServiceWithoutSearch put name=header value=ServiceWithoutSearchHeader / put name=leftnav value=ServiceWithoutSearchLeftNav / put name=footer value=ServiceWithoutSearchFooter / put name=debug value=ServiceWithoutSearchDebug / put name=navNode value=Maintenance type=string / put name=title value=Service direct=true / /definition So you can see I use them to include tiles within a tile, as well as some parameters. When I want to include one of those JSPs in the output, I simply use tiles:insert. The other parameters in that outer definition (navNode, title), I pass along to some specific subtiles - the header and the leftnav: tiles:insert attribute=header tiles:put name=title beanName=title beanScope=tile / tiles:put name=navNode beanName=navNode beanScope=tile / /tiles:insert In the sub-tiles I access the title like so: tiles:get name=title / and it works fine. However, the navNode I need to use programmatically: tiles:useAttribute name=navNode classname=java.lang.String / If I specify direct=true or type=string for navNode in the definition I get a ClassCastException with the above line in my JSP. However, the way I'm currently putting it in the definition, I cannot use it within a tiles:get tag because it assumes it is not direct and tries to read a file. Is there one method I can use for defining these parameters so they are consistent or am I stuck with the different definition entries based on how I use them? Thanks! -matt -- matthew c. mead http://www.goof.com/~mmead/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- matthew c. mead http://www.goof.com/~mmead/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional
sorting in struts.
Hi All I have a struts page. Which is creating a table and showing a list of records from a collection. I am using table, tr td tags. Now I want to sort the table based on which column header user clicks. How can i do it using minimal possible use of java script and using as much of struts features. Please Help. Regards Imran. Imran ___ Click below to experience Sooraj R Barjatya's latest offering 'Main Prem Ki Diwani Hoon' starring Hrithik, Abhishek Kareena http://www.mpkdh.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: sorting in struts.
I am doing the same in my application. I created my own custom tags to display the table.That way i have more flexibility and i wrote my sorting logic(multi sort) in my tags. I think this is the best way -Original Message- From: imran ali [mailto:[EMAIL PROTECTED] Sent: Monday, July 07, 2003 10:11 AM To: Struts Users Mailing List Subject: sorting in struts. Hi All I have a struts page. Which is creating a table and showing a list of records from a collection. I am using table, tr td tags. Now I want to sort the table based on which column header user clicks. How can i do it using minimal possible use of java script and using as much of struts features. Please Help. Regards Imran. Imran ___ Click below to experience Sooraj R Barjatya's latest offering 'Main Prem Ki Diwani Hoon' starring Hrithik, Abhishek Kareena http://www.mpkdh.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]
generic SQL implementation
Has anybody implemented a generic implementation for querying databases during runtime. I am using DAO's for data access layer. But I want to furthur move the database logic to down one more layer of abstraction.I am dealing with different kinds of database (eg. let's say a MySQL, MS Access and another not SQL at all ,index sequential files). I want the DAO to access the database during runtime. So I want my DAO to be independent of the SQL statements.The Database Interfrace would talk to either MySQL,or Oracle or any other database.So that there is no need to have DAO for each database syntax, rather , this should be handled by a API thru an interface. Here's and examples Let's say for select statement , we supply table name, column names, where cluase , and's etc The following method should handle the query List getSelect(String tablename, List columnnames, List Orderby,.) etc { return queryresult } Any ideas appreciated Thank you Vinay
RE: notEmpty/empty and interation
;) that was it forgot to declare the taglib. thanks. -Original Message- From: Sandeep Takhar [mailto:[EMAIL PROTECTED] Sent: Montag, 7. Juli 2003 16:59 To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: Re: notEmpty/empty and interation also check to see if you have logic taglib api defined. If it is not, then check your source and you will see the xml .. logic:iterate right in the source. sandeep --- ben [EMAIL PROTECTED] wrote: Hi, Using struts1.1 I have problems getting the iterate tag working. the page scoped id bean for the element is never found. This happens when the collection is empty or contains values. Help is greatly appreciated. Details: I store a Collection under oss_prod_list in my session, with the following jsp snippet: logic:empty name=oss_prod_list No products available. /logic:empty !-- @TODO: notEmpty tag does not work for some reason -- logic:notEmpty name=oss_prod_list logic:iterate name=oss_prod_list id=prod_list_el td bean:write name=prod_list_el property=name / ... /logic:iterate /logic:notEmpty I get the empty as well as the not empty printed out when the collection is empty or not. When i remove the content between the iterate tag my jsp works, when not I get always (when collection is empty or not) the exception that the id bean specified as iteration element is not found: root cause javax.servlet.ServletException: Cannot find bean prod_list_el in any scope at org.apache.jasper.runtime.PageContextImpl.handlePageException( PageContextImp l.java:530) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.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]
RE: generic SQL implementation
Look at OJB to take care of everything for you with object/dao management. You can do a ReportByQuery with OJB that allows you to do what you are describing. -Original Message- From: Vinay [mailto:[EMAIL PROTECTED] Sent: Monday, July 07, 2003 10:09 AM To: Struts Users Mailing List Subject: generic SQL implementation Has anybody implemented a generic implementation for querying databases during runtime. I am using DAO's for data access layer. But I want to furthur move the database logic to down one more layer of abstraction.I am dealing with different kinds of database (eg. let's say a MySQL, MS Access and another not SQL at all ,index sequential files). I want the DAO to access the database during runtime. So I want my DAO to be independent of the SQL statements.The Database Interfrace would talk to either MySQL,or Oracle or any other database.So that there is no need to have DAO for each database syntax, rather , this should be handled by a API thru an interface. Here's and examples Let's say for select statement , we supply table name, column names, where cluase , and's etc The following method should handle the query List getSelect(String tablename, List columnnames, List Orderby,.) etc { return queryresult } Any ideas appreciated Thank you Vinay - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Validate() in netscape
I'm not using struts validator package. I'm just checking if a mandatory field is null or not using the following code in validate() function of ActionForm. public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { ActionErrors errors = new ActionErrors(); if( oldPassword == null || oldPassword.length()==0 ){ errors.add(oldPassword,new ActionError(error.oldPassword.required)); } return (errors); } HTML FORM is defined as follows: html:form action=/str/userview_maintpost.do focus=oldPassword The SUBMIT image is provided in .jsp page as follows: html:image src=../images/submit.jpg border=0 alt=Submit onclick=preSubmit(this.form, 'New'); property=action/ This is calling a javascipt function 'preSubmit' which is given below: function preSubmit(form, action_value) { form.lrAction.value=action_value; form.submit(); } // end of preSubmit That's it. This is the code I'm using. When I submit the page without providing any input for 'oldPassword' field, it's showing appropriate message in IE, but not in Netscape. In Netscape, it's simply going to the page specified in Action Forward. Any clue why this doesn't work in Netscape? -Original Message- From: Adam Hardy [mailto:[EMAIL PROTECTED] Sent: Monday, July 07, 2003 7:36 PM To: Struts Users Mailing List Subject: Re: Validate() in netscape sriram wrote: I'm using Netscape 4.7 And the erors here are not javascript. Simple validations performed in validate() method of ActionForm. I'm using an image in place of a submit button (using html:image tag). In case value is not provided for a mandatory field, the validate() method will chk for null and return an error. This error is shown in IE but not in Netscape. What could be the reason? Doesn't netscape support form submission through html:image tags? Oh I see. If netscape didn't support html:image tags as submit-triggers, then you wouldn't be able to submit to the server. So what you mean is that when submitting from netscape, a field that should fail validation actually passes without error? Are you using struts-validator plugin? What validation test are you doing? Show us some code, maybe it's the java. What is the value of the field that should fail the validation? Try logging it or System.out.println Adam - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: generic SQL implementation
There is a Mapper project in the commons sandbox that might help you. It allows you to store SQL in a properties file to remove it from your code. Also, it acts as a layer between your app and your persistence technology so you can swap in an O/R mapping tool, EJBs, etc if you decide against using JDBC in the future. It also, makes using JDBC a breeze and removes much error prone and repetitive code from your app. David --- Vinay [EMAIL PROTECTED] wrote: Has anybody implemented a generic implementation for querying databases during runtime. I am using DAO's for data access layer. But I want to furthur move the database logic to down one more layer of abstraction.I am dealing with different kinds of database (eg. let's say a MySQL, MS Access and another not SQL at all ,index sequential files). I want the DAO to access the database during runtime. So I want my DAO to be independent of the SQL statements.The Database Interfrace would talk to either MySQL,or Oracle or any other database.So that there is no need to have DAO for each database syntax, rather , this should be handled by a API thru an interface. Here's and examples Let's say for select statement , we supply table name, column names, where cluase , and's etc The following method should handle the query List getSelect(String tablename, List columnnames, List Orderby,.) etc { return queryresult } Any ideas appreciated Thank you Vinay __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Validator using A href instead of html:submit
Hi, I'm using trying to use ValidatorActionForm and tile, but the submit button is outside of the form on a different JSP, therefore, I need to submit my form indirectly using a link and javascript (see code below). Neither the client-side javascript nor the server-side validation get called. But if I hardcode a submit button WITHIN the form, the javascript will get called. So, does this mean that validator will not work with document.forms[0].submit(); ? Is there a workaround this? I'm sure there are someone out there doing similar thing. Thanks! JP My action form: html:form action=/enterAppInfo1 onsubmit=validateEnterAppInfo1(this); html:errors /nbsp; html:select property=primAddrState onchange='runSelectOnChange();' html:optionsCollection label=label value=value name=... property=... / /html:select /html:form html:javascript formName=enterAppInfo1 / !-- Assuming one form per page, in the end of doSomethingBeforeSubmit(...), I'm calling: -- !-- document.forms[0].submit(); -- A href=javascript:doSomethingBeforeSubmit(...);/ IMG name=... src=... onmouseover=javascript:submitChoiceOnMouseOver(...);return true; onmouseout=javascript:submitChoiceOnMouseOut(...);return true; alt=. border=0/A My validation.xml: formset form name=enterAppInfo1 field property=primAddrState depends=required msg name=required key=errors.state.required / /field /form /formset ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: generic SQL implementation
David, Can you give me the URL for the mapper, this might be the one I am looking for ,even though I wanted to implement the API on my own. Thanks a lot VInay - Original Message - From: David Graham [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, July 07, 2003 11:35 AM Subject: Re: generic SQL implementation There is a Mapper project in the commons sandbox that might help you. It allows you to store SQL in a properties file to remove it from your code. Also, it acts as a layer between your app and your persistence technology so you can swap in an O/R mapping tool, EJBs, etc if you decide against using JDBC in the future. It also, makes using JDBC a breeze and removes much error prone and repetitive code from your app. David --- Vinay [EMAIL PROTECTED] wrote: Has anybody implemented a generic implementation for querying databases during runtime. I am using DAO's for data access layer. But I want to furthur move the database logic to down one more layer of abstraction.I am dealing with different kinds of database (eg. let's say a MySQL, MS Access and another not SQL at all ,index sequential files). I want the DAO to access the database during runtime. So I want my DAO to be independent of the SQL statements.The Database Interfrace would talk to either MySQL,or Oracle or any other database.So that there is no need to have DAO for each database syntax, rather , this should be handled by a API thru an interface. Here's and examples Let's say for select statement , we supply table name, column names, where cluase , and's etc The following method should handle the query List getSelect(String tablename, List columnnames, List Orderby,.) etc { return queryresult } Any ideas appreciated Thank you Vinay __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.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]
Re: Validator using A href instead of html:submit
should it be a validatorForm? sandeep --- Poon, Johnny [EMAIL PROTECTED] wrote: Hi, I'm using trying to use ValidatorActionForm and tile, but the submit button is outside of the form on a different JSP, therefore, I need to submit my form indirectly using a link and javascript (see code below). Neither the client-side javascript nor the server-side validation get called. But if I hardcode a submit button WITHIN the form, the javascript will get called. So, does this mean that validator will not work with document.forms[0].submit(); ? Is there a workaround this? I'm sure there are someone out there doing similar thing. Thanks! JP My action form: html:form action=/enterAppInfo1 onsubmit=validateEnterAppInfo1(this); html:errors /nbsp; html:select property=primAddrState onchange='runSelectOnChange();' html:optionsCollection label=label value=value name=... property=... / /html:select /html:form html:javascript formName=enterAppInfo1 / !-- Assuming one form per page, in the end of doSomethingBeforeSubmit(...), I'm calling: -- !-- document.forms[0].submit(); -- A href=javascript:doSomethingBeforeSubmit(...);/ IMG name=... src=... onmouseover=javascript:submitChoiceOnMouseOver(...);return true; onmouseout=javascript:submitChoiceOnMouseOut(...);return true; alt=. border=0/A My validation.xml: formset form name=enterAppInfo1 field property=primAddrState depends=required msg name=required key=errors.state.required / /field /form /formset ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Where is GenericDataSource?
I assume I need to copy another jar file to by WEB-INF/lib dir... So where *is* the GenericDataSource packaged now? Steve Raeburn wrote: The short answer is that GenericDataSource was originally deprecated in favour of Commons DBCP. Unfortunately, problems with DBCP that could not be fixed in time for the 1.1 release meant that DBCP was removed and 1.1 reverted back to Generic DataSource. This is only a temporary measure so GenericDataSource was packaged separately from the main struts jar. Steve -Original Message- From: David Bolsover [mailto:[EMAIL PROTECTED] Sent: July 4, 2003 4:04 AM To: Struts User Subject: GenericDataSource Can someone explain why GenericDataSource was moved to lagacy? I have been using it successfully as a JINI DataSourse - have others experienced problems? - if so, what problems? db - 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]
ActionForm mapped property submit/populate error
I'm sure this is a common question for Struts newcomers dealing with mapped and indexed properties, but I can't find a good solution. To sum it up quickly, I can read values from an ActionForm with the following syntax in a JSP tag rows(1).val, but when I submit, I get the following exception. Ideas?: java.lang.IllegalArgumentException: No bean specified at org.apache.commons.beanutils.PropertyUtils.getPropertyDescriptor (PropertyUtils.java:837) at org.apache.commons.beanutils.BeanUtils.setProperty (BeanUtils.java:934) at org.apache.commons.beanutils.BeanUtils.populate (BeanUtils.java:808) Here are more details: I've got an ActionForm subclass with the following methods: public Map getMap(); public void setMap(Map map); public MyRow getRows(String idx); public void setRows(String idx, MyRow val); I prepopulate the form in an open action and everything displays beautifully. However, when I submit, the bean is lost and BeanUtils can't seem to repopulate it. What am I missing here? - The reset() method is implemented and it reinitializes everything. - It is a request scope form. What is the best practice for this type of use case? Nate - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: jsp links to stay within module
But using the switch action is a bit strange since I do not want to switch module but stay in the current module. Hm however if the module is only request scoped... ??? -Original Message- From: Sandeep Takhar [mailto:[EMAIL PROTECTED] Sent: Montag, 7. Juli 2003 17:59 To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: Re: jsp links to stay within module there is a SwitchAction that you can use. someone else probably has more details... sandeep --- ben [EMAIL PROTECTED] wrote: Hi, I link 2 jsp's in moduleA (=not default module). In order for struts to stay within moduleA i learnt i cannot href the jsp directly, because the module will then switch again to the default. I cannot make the module session persistent, right? When then using a forward action like below, I get a 404: message Invalid path /prodSubmit was requested source jsp: a href=osscatalog/prodSubmit.doSubmit a Product/abr struts-config-moduleA.xml: action path=/osscatalog/prodSubmit type=org.apache.struts.actions.ForwardAction name=prodSubmitForm parameter=/osscatalog/prodSubmit.jsp/ Ideas? Cheers ben - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.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]
Re: Where is GenericDataSource?
To answer my own question: in struts-legacy.jar Michael Muller wrote: I assume I need to copy another jar file to by WEB-INF/lib dir... So where *is* the GenericDataSource packaged now? Steve Raeburn wrote: The short answer is that GenericDataSource was originally deprecated in favour of Commons DBCP. Unfortunately, problems with DBCP that could not be fixed in time for the 1.1 release meant that DBCP was removed and 1.1 reverted back to Generic DataSource. This is only a temporary measure so GenericDataSource was packaged separately from the main struts jar. Steve -Original Message- From: David Bolsover [mailto:[EMAIL PROTECTED] Sent: July 4, 2003 4:04 AM To: Struts User Subject: GenericDataSource Can someone explain why GenericDataSource was moved to lagacy? I have been using it successfully as a JINI DataSourse - have others experienced problems? - if so, what problems? db - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Where is GenericDataSource?
It's packaged in struts-legacy.jar which is in the lib directory of your the struts distribution. Steve -Original Message- From: Michael Muller [mailto:[EMAIL PROTECTED] Sent: July 7, 2003 8:59 AM To: Struts Users Mailing List Subject: Where is GenericDataSource? I assume I need to copy another jar file to by WEB-INF/lib dir... So where *is* the GenericDataSource packaged now? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Why html:xxx tags? / Dreamweaver and .do extension
Thank you all for your replies! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts and WebService
Hello, I have an Struts Application. Now I need to expose some of it's functions in a WebService. I say that my Web Services must call my Action Classes. My problem is that I don't have any idea about that. I know web services with Axis o JWSDP, but I don't know how can I do to use it in my Struts Application. The sequence is like that: Browser WS Client | | ActionServletWS Server | | Action Class --- | | Business Logic I need help in call an Action class with the WS Server Class. Anybody can help me??? Regards Alejandro - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: db connection pooling
On Mon, 7 Jul 2003 [EMAIL PROTECTED] wrote: Date: Mon, 7 Jul 2003 10:09:08 +0530 From: [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: db connection pooling Hi, Is there any ways to achieve db connection pooling and access of such pooled connection though jndi in struts action classes. JNDI-based data sources are a feature of any J2EE app server, and some servlet containers (such as Tomcat). They can easily be used in a Struts Action. One of the many conveniences of this approach is that the resources are configured externally -- you don't need to mess with web.xml or struts-config.xml for them. So, for example, the exact same WAR file can be deployed on a test machine and a production machine, with the server resource configuration pointing you at the appropriate test or production database. Configuration details will depend on your server -- here's the docs for Tomcat: http://jakarta.apache.org/tomcat/tomcat-4.1-docs/jndi-resources-howto.html http://jakarta.apache.org/tomcat/tomcat-4.1-docs/jndi-datasource-examples-howto.html Regards, Jailani.S Craig - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: generic SQL implementation
I use torque and IMHO combined with struts , it slides through the molecules of wetness like an eel through sea weed .. http://db.apache.org/torque A chap called Ville who posted this group a few weeks ago sent me some notes where he spent a week of so gathering sources of info on how to get torque and struts running together (Thanks Ville) . If you want them just mail me.. cheers mark On Monday, July 7, 2003, at 04:08 PM, Vinay wrote: Has anybody implemented a generic implementation for querying databases during runtime. I am using DAO's for data access layer. But I want to furthur move the database logic to down one more layer of abstraction.I am dealing with different kinds of database (eg. let's say a MySQL, MS Access and another not SQL at all ,index sequential files). I want the DAO to access the database during runtime. So I want my DAO to be independent of the SQL statements.The Database Interfrace would talk to either MySQL,or Oracle or any other database.So that there is no need to have DAO for each database syntax, rather , this should be handled by a API thru an interface. Here's and examples Let's say for select statement , we supply table name, column names, where cluase , and's etc The following method should handle the query List getSelect(String tablename, List columnnames, List Orderby,.) etc { return queryresult } Any ideas appreciated Thank you Vinay - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Webapp Security?
On Sun, 7 Jul 2003, Rick Reumann wrote: Date: 07 Jul 2003 00:47:20 -0400 From: Rick Reumann [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: Webapp Security? On Thu, 2003-07-03 at 16:42, Craig R. McClanahan wrote: Why are you trying to mess with the container's implementation of authentication at all? Why not just write a Filter that does an RD.forward() to some safe place if it sees that the session does not contain the right stuff (because it was timed out and recreated)? Remember, a filter is *not* required to call chain.doFilter() to pass the request on -- it can forward wherever it wants and then return, and this is portable to any Servlet 2.3 container. Filters are your friend :-). Well, here's the deal... Basically there are are too many things that rely on certain objects being in Session scope for this application so I don't want to have to test every type of action url. So what I did was write a Servlet Filter that also is called from the urr pattern /* the relevant filter method looks like : if ( httpRequest.getUserPrincipal() != null session.getAttribute(userBean) == null ) { RequestDispatcher rd = request.getRequestDispatcher(mainPage); rd.forward(request, response ); } else { chain.doFilter(request, response); } The above seems to work fine- forcing the forward to the mainPage (which in my case is an index page that then forwards to an Action that sets up appropriate Session information). Throughout the course of the application there are other session objects (mainly some Lists for reporting that are put in Session scope) so rather than test for everything and have to figure out what page/action to bring the user to in oder to make things are set up correctly, I just want them all back some initial page. The part I don't like is every request now has to hit both the security filter and this other filter. Would it maybe be better to maybe just do this type of check in my base action execute method? (check for the userBean being null there and if null forward to the appropriate setUpAction? I wouldn't be concerned -- combining things through composition (versus putting everything in one big class) makes the individual pieces much easier to understand and maintain. Also, note that the Filter approach works even if your user tries to request a JSP page directly, while embedding the logic in your Action would not catch this. Thanks, -- Rick Craig - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: generic SQL implementation
Mapper doesn't have a real website yet but you can view the source online at: http://cvs.apache.org/viewcvs.cgi/jakarta-commons-sandbox/mapper/ You could also check it out of the cvs repository. David --- Vinay [EMAIL PROTECTED] wrote: David, Can you give me the URL for the mapper, this might be the one I am looking for ,even though I wanted to implement the API on my own. Thanks a lot VInay - Original Message - From: David Graham [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, July 07, 2003 11:35 AM Subject: Re: generic SQL implementation There is a Mapper project in the commons sandbox that might help you. It allows you to store SQL in a properties file to remove it from your code. Also, it acts as a layer between your app and your persistence technology so you can swap in an O/R mapping tool, EJBs, etc if you decide against using JDBC in the future. It also, makes using JDBC a breeze and removes much error prone and repetitive code from your app. David --- Vinay [EMAIL PROTECTED] wrote: Has anybody implemented a generic implementation for querying databases during runtime. I am using DAO's for data access layer. But I want to furthur move the database logic to down one more layer of abstraction.I am dealing with different kinds of database (eg. let's say a MySQL, MS Access and another not SQL at all ,index sequential files). I want the DAO to access the database during runtime. So I want my DAO to be independent of the SQL statements.The Database Interfrace would talk to either MySQL,or Oracle or any other database.So that there is no need to have DAO for each database syntax, rather , this should be handled by a API thru an interface. Here's and examples Let's say for select statement , we supply table name, column names, where cluase , and's etc The following method should handle the query List getSelect(String tablename, List columnnames, List Orderby,.) etc { return queryresult } Any ideas appreciated Thank you Vinay __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
ClassCastException using the DynaValidatorForm
I've got the validation framework working for me using my own form bean which is derived from ValidatorForm. I changed the form bean to be a DynaValidatorForm, and now I get a ClassCastException, the guts of which is appended below. What gives? Am I using the wrong validator form class? Did I neglect to make some other configuration change? I'm using Tomcat 4.1, Struts 1.1 final, and jdk 1.4.1. -- Mike java.lang.ClassCastException at org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java:783) at org.apache.struts.action.RequestProcessor.processActionForm(RequestProcessor.java:364) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:253) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) 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:260) 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.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:2415) 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:170) 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.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:223) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:432) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:386) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:534) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:530) at java.lang.Thread.run(Thread.java:536) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Validator using A href instead of html:submit
What is the javascript created by the custom tag when looking at the source? I think you shouldn't need to call: validateEnterAppInfo1(this) but what happens if you do? maybe there is more than one form? Is the form being submitted and the data is in the form? sorry I can't help any more than that. sandeep --- Poon, Johnny [EMAIL PROTECTED] wrote: Sandeep, No, because I'm using the same bean across different screen, so ValidatorActionForm suits me better, as it validates based on the action instead of the form. JP -Original Message- From: Sandeep Takhar [mailto:[EMAIL PROTECTED] Sent: Monday, July 07, 2003 10:48 AM To: Struts Users Mailing List Subject: Re: Validator using A href instead of html:submit should it be a validatorForm? sandeep --- Poon, Johnny [EMAIL PROTECTED] wrote: Hi, I'm using trying to use ValidatorActionForm and tile, but the submit button is outside of the form on a different JSP, therefore, I need to submit my form indirectly using a link and javascript (see code below). Neither the client-side javascript nor the server-side validation get called. But if I hardcode a submit button WITHIN the form, the javascript will get called. So, does this mean that validator will not work with document.forms[0].submit(); ? Is there a workaround this? I'm sure there are someone out there doing similar thing. Thanks! JP My action form: html:form action=/enterAppInfo1 onsubmit=validateEnterAppInfo1(this); html:errors /nbsp; html:select property=primAddrState onchange='runSelectOnChange();' html:optionsCollection label=label value=value name=... property=... / /html:select /html:form html:javascript formName=enterAppInfo1 / !-- Assuming one form per page, in the end of doSomethingBeforeSubmit(...), I'm calling: -- !-- document.forms[0].submit(); -- A href=javascript:doSomethingBeforeSubmit(...);/ IMG name=... src=... onmouseover=javascript:submitChoiceOnMouseOver(...);return true; onmouseout=javascript:submitChoiceOnMouseOut(...);return true; alt=. border=0/A My validation.xml: formset form name=enterAppInfo1 field property=primAddrState depends=required msg name=required key=errors.state.required / /field /form /formset ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] - Realm Security - How to set overlapping constraints?
On Mon, 7 Jul 2003, Max Cooper wrote: Date: Mon, 7 Jul 2003 07:26:42 -0700 From: Max Cooper [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: [OT] - Realm Security - How to set overlapping constraints? - Original Message - From: Navjot Singh [EMAIL PROTECTED] Thanks Craig, Reversing the order of constraints does work. I should have RTFM. That kind of surprises me. The Servlet Spec v2.3 section SRV 11.1 says that exact patterns should be tried first, then paths (longest to shortest, by number of elements), then extensions, then the default servlet (/). The description of each of these types of patterns is also in the spec (the rules are simple and clear). Going by the spec, I would think that it would try /p/status.do first, since it is an exact pattern, and it would fail (403 error) there if the user didn't have the admin role. Perhaps there is something going on since the servlet mapping pattern is *.do. Craig, any input on what is going on there? This whole topic has been the subject of several very long threads on the servlet EG mailing list, because the intent of referring to Section 11.1 was to describe the valid syntax for URL expressions, not the priority order of matching. The bottom line is that is's currently somewhat ambiguous, and different containers sometimes behave differently. I've described what Tomcat does (and it's the basis of the reference implementation). We tried to detangle the ambiguities in Servlet 2.4 (currently in Proposed Final Draft) -- I'd be interested in your feedback on whether we succeeded. http://java.sun.com/products/servlet/download.html Feedback can be sent to [EMAIL PROTECTED] for the servlet spec. Craig - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Validator using A href instead of html:submit
Sandeep, The validateEnterAppInfo1(form) method gets called with the submit button hardcode w/i the html:form. If I remove the validateEnterAppInfo1(this) call, no javascript validation will take place, while the server-side validation still works. There is always going to be only one form per page, so using document.forms[0].submit() should be ok. When this form pass validation the data is submitted. This is part of the generated javascripts: script type=text/javascript language=Javascript1.1 !-- Begin var bCancel = false; function validateEnterAppInfo1(form) { if (bCancel) return true; else return validateRequired(form); } function required () { this.aa = new Array(primAddrState, Please select your state of residence to continue., new Function (varName, return this[varName];)); } function validateRequired(form) { var isValid = true; var focusField = null; var i = 0; var fields = new Array(); oRequired = new required(); for (x in oRequired) { var field = form[oRequired[x][0]]; if (field.type == 'text' || field.type == 'textarea' || field.type == 'file' || field.type == 'select-one' || field.type == 'radio' || field.type == 'password') { var value = ''; // get field's value if (field.type == select-one) { var si = field.selectedIndex; if (si = 0) { value = field.options[si].value; } } else { value = field.value; } if (value == '') { if (i == 0) { focusField = field; } fields[i++] = oRequired[x][1]; isValid = false; } } } if (fields.length 0) { focusField.focus(); alert(fields.join('\n')); } return isValid; } function required () { this.aa = new Array(primAddrState, Please select your state of residence to continue., new Function (varName, return this[varName];)); } -Original Message- From: Sandeep Takhar [mailto:[EMAIL PROTECTED] Sent: Monday, July 07, 2003 11:29 AM To: Struts Users Mailing List Subject: RE: Validator using A href instead of html:submit What is the javascript created by the custom tag when looking at the source? I think you shouldn't need to call: validateEnterAppInfo1(this) but what happens if you do? maybe there is more than one form? Is the form being submitted and the data is in the form? sorry I can't help any more than that. sandeep --- Poon, Johnny [EMAIL PROTECTED] wrote: Sandeep, No, because I'm using the same bean across different screen, so ValidatorActionForm suits me better, as it validates based on the action instead of the form. JP -Original Message- From: Sandeep Takhar [mailto:[EMAIL PROTECTED] Sent: Monday, July 07, 2003 10:48 AM To: Struts Users Mailing List Subject: Re: Validator using A href instead of html:submit should it be a validatorForm? sandeep --- Poon, Johnny [EMAIL PROTECTED] wrote: Hi, I'm using trying to use ValidatorActionForm and tile, but the submit button is outside of the form on a different JSP, therefore, I need to submit my form indirectly using a link and javascript (see code below). Neither the client-side javascript nor the server-side validation get called. But if I hardcode a submit button WITHIN the form, the javascript will get called. So, does this mean that validator will not work with document.forms[0].submit(); ? Is there a workaround this? I'm sure there are someone out there doing similar thing. Thanks! JP My action form: html:form action=/enterAppInfo1 onsubmit=validateEnterAppInfo1(this); html:errors /nbsp; html:select property=primAddrState onchange='runSelectOnChange();' html:optionsCollection label=label value=value name=... property=... / /html:select
Re: Action forward to another action without form
Forwarding to a target action is not considered as a good practice in the past is because the form bean population and validation machineries will be invoked again when Struts process the action (and some more reasons). Of course, if there is no form bean specified in the target action mapping, it makes sense in such cases. In many use cases, I find people really need *shared* action controllers in their business requirements. The best way to have the functionality is to develop your own action controller delegation model. In such a model, you *find* the target action the same way as Struts *find* it. It is a very simple solution and you could avoid the form bean populations and validations. Jing Netspread Carrier http://www.netspread.com - Original Message - From: Frances Aleah Z. de Guzman [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Sunday, July 06, 2003 9:41 AM Subject: Re: Action forward to another action without form you can define it to your forward in your struts-config, instead of forwarding it to a page, forward it to an action. but this is not a good practice though. On Monday 07 July 2003 10:31 am, Benjamin Stewart wrote: Can you point me in the right direction, none of my books talk about it, cant find examples etc. Ben Dan Tran wrote: Yes;) - Original Message - From: Benjamin Stewart [EMAIL PROTECTED] Newsgroups: Struts Sent: Sunday, July 06, 2003 6:59 PM Subject: Action forward to another action without form Greetings, I have a form that submits values. From the Action class I would (in some circumstances) like to go directly to another action class and then forward to a view. Is this possible ? Thanks Ben - 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] -- Frances Aleah Z. De Guzman SA/Programmer Ingenium Technology, Inc. http://www.ingenium.com.ph Disclaimer : This message is intended only for the named recipient. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited. - 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]
Problems with logic:iterate (indexId has no effect) - doesn't anyone know the solution?
I didn't think this was a big problem for you Struts-gurus, but maybe I'm wrong :-) I have a vector called variationmargins and in it I have a property called loadProfile that is either 1 or 2 for all postings. I have tried to use the logic:iterate tag to output the result using the loadProfile as an index, but it has not effect. It just outputs everything, no matter the indexId. Does anyone have a clue what I am doing wrong? logic:iterate id=element name=variationmargins property=variationMargins indexId=loadProfile bean:write name=element property=loadProfileName/ br display:table name=variationmargins property=variationMargins scope=session width=100% pagesize=100 requestURI=result.jsp decorator=org.apache.taglibs.display.test.ColumnsWrapper display:column title=%=ldeliveryPeriod% property=deliveryPeriod sort=true width=10%/ display:column title=%=lhours% property=hours align=right sort=true width=10%/ /display:table /logic:iterate I would really appreciate the help. Cheers, Bard A. Evjen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Webapp Security?
Look at the http://www.securityfilter.org project on sourceforge. It provides a portable implementation that is similar to container security but can be regarded as an improvment in some cases. request.isUserInRole will work and also struts role checking. -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED] Sent: 07 July, 2003 18:21 To: Struts Users Mailing List Subject: Re: Webapp Security? On Sun, 7 Jul 2003, Rick Reumann wrote: Date: 07 Jul 2003 00:47:20 -0400 From: Rick Reumann [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: Webapp Security? On Thu, 2003-07-03 at 16:42, Craig R. McClanahan wrote: Why are you trying to mess with the container's implementation of authentication at all? Why not just write a Filter that does an RD.forward() to some safe place if it sees that the session does not contain the right stuff (because it was timed out and recreated)? Remember, a filter is *not* required to call chain.doFilter() to pass the request on -- it can forward wherever it wants and then return, and this is portable to any Servlet 2.3 container. Filters are your friend :-). Well, here's the deal... Basically there are are too many things that rely on certain objects being in Session scope for this application so I don't want to have to test every type of action url. So what I did was write a Servlet Filter that also is called from the urr pattern /* the relevant filter method looks like : if ( httpRequest.getUserPrincipal() != null session.getAttribute(userBean) == null ) { RequestDispatcher rd = request.getRequestDispatcher(mainPage); rd.forward(request, response ); } else { chain.doFilter(request, response); } The above seems to work fine- forcing the forward to the mainPage (which in my case is an index page that then forwards to an Action that sets up appropriate Session information). Throughout the course of the application there are other session objects (mainly some Lists for reporting that are put in Session scope) so rather than test for everything and have to figure out what page/action to bring the user to in oder to make things are set up correctly, I just want them all back some initial page. The part I don't like is every request now has to hit both the security filter and this other filter. Would it maybe be better to maybe just do this type of check in my base action execute method? (check for the userBean being null there and if null forward to the appropriate setUpAction? I wouldn't be concerned -- combining things through composition (versus putting everything in one big class) makes the individual pieces much easier to understand and maintain. Also, note that the Filter approach works even if your user tries to request a JSP page directly, while embedding the logic in your Action would not catch this. Thanks, -- Rick Craig - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ For information about the Standard Bank group visit our web site www.standardbank.co.za __ Disclaimer and confidentiality note Everything in this e-mail and any attachments relating to the official business of Standard Bank Group Limited is proprietary to the group. It is confidential, legally privileged and protected by law. Standard Bank does not own and endorse any other content. Views and opinions are those of the sender unless clearly stated as being that of the group. The person addressed in the e-mail is the sole authorised recipient. Please notify the sender immediately if it has unintentionally reached you and do not read, disclose or use the content in any way. Standard Bank can not assure that the integrity of this communication has been maintained nor that it is free of errors, virus, interception or interference. ___
RE: html:link / - add parameters
Hey everyone, I'm trying to add 2 dynamic parameters to a link. Someone posted the following solution a while back. I'm using this, slightly modified, within a logic:iterate tag. However, the param names are showing up in the generated link, but the param values aren't. Should I be able to use ansm.getNumberType() within the scriptlet? (ansm refers to the object storing the current element in the collection I'm iterating through.) Any help would be really appreciated. Thanks in advance! - Keith _ titleTest html:link Tag/title % String newValue = New string value; pageContext.setAttribute(newValue, newValue); java.util.HashMap newValues = new java.util.HashMap(); newValues.put(floatProperty, new Float(444.0)); newValues.put(intProperty, new Integer(555)); newValues.put(stringArray, new String[] { Value 1, Value 2, Value 3 }); pageContext.setAttribute(newValues, newValues); % tr td colspan=4 align=center html:link action=/html-link name=newValues Float, int, and stringArray via name (Map) /html:link /td /tr -- Best regards, Nikolaymailto:[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: html:link / - add parameters
Sorry, ignore my last post. I figured it out. The call to ansm.getNumberType() was just returning an empty string. Sorry to waste space in your inbox. -Original Message- From: Kamholz, Keith (corp-staff) USX [mailto:[EMAIL PROTECTED] Sent: Monday, July 07, 2003 1:04 PM To: 'Struts Users Mailing List' Subject: RE: html:link / - add parameters Hey everyone, I'm trying to add 2 dynamic parameters to a link. Someone posted the following solution a while back. I'm using this, slightly modified, within a logic:iterate tag. However, the param names are showing up in the generated link, but the param values aren't. Should I be able to use ansm.getNumberType() within the scriptlet? (ansm refers to the object storing the current element in the collection I'm iterating through.) Any help would be really appreciated. Thanks in advance! - Keith _ titleTest html:link Tag/title % String newValue = New string value; pageContext.setAttribute(newValue, newValue); java.util.HashMap newValues = new java.util.HashMap(); newValues.put(floatProperty, new Float(444.0)); newValues.put(intProperty, new Integer(555)); newValues.put(stringArray, new String[] { Value 1, Value 2, Value 3 }); pageContext.setAttribute(newValues, newValues); % tr td colspan=4 align=center html:link action=/html-link name=newValues Float, int, and stringArray via name (Map) /html:link /td /tr -- Best regards, Nikolaymailto:[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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problems with logic:iterate (indexId has no effect) - doesn't anyone know the solution?
I wouldn't use a vector, but maybe you can? My understanding is that iterate works on anything that returns an iterator. logic:iterate name=someName should be used when the bean someName is in some scope and is the collection that you want. logic:iterate name=someName property=someProperty should not be used if the above case is true. sandeep --- Bård Arve Evjen [EMAIL PROTECTED] wrote: I didn't think this was a big problem for you Struts-gurus, but maybe I'm wrong :-) I have a vector called variationmargins and in it I have a property called loadProfile that is either 1 or 2 for all postings. I have tried to use the logic:iterate tag to output the result using the loadProfile as an index, but it has not effect. It just outputs everything, no matter the indexId. Does anyone have a clue what I am doing wrong? logic:iterate id=element name=variationmargins property=variationMargins indexId=loadProfile bean:write name=element property=loadProfileName/ br display:table name=variationmargins property=variationMargins scope=session width=100% pagesize=100 requestURI=result.jsp decorator=org.apache.taglibs.display.test.ColumnsWrapper display:column title=%=ldeliveryPeriod% property=deliveryPeriod sort=true width=10%/ display:column title=%=lhours% property=hours align=right sort=true width=10%/ /display:table /logic:iterate I would really appreciate the help. Cheers, Bard A. Evjen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Validator using A href instead of html:submit
It seems to me like it should work. I have used submit() on forms and it will go to the action element of the form tag. So this is just html specs here. Don't know why the validation is not being called. There should be some onSubmit= somewhere in the form tag probably... sandeep --- Poon, Johnny [EMAIL PROTECTED] wrote: Sandeep, The validateEnterAppInfo1(form) method gets called with the submit button hardcode w/i the html:form. If I remove the validateEnterAppInfo1(this) call, no javascript validation will take place, while the server-side validation still works. There is always going to be only one form per page, so using document.forms[0].submit() should be ok. When this form pass validation the data is submitted. This is part of the generated javascripts: script type=text/javascript language=Javascript1.1 !-- Begin var bCancel = false; function validateEnterAppInfo1(form) { if (bCancel) return true; else return validateRequired(form); } function required () { this.aa = new Array(primAddrState, Please select your state of residence to continue., new Function (varName, return this[varName];)); } function validateRequired(form) { var isValid = true; var focusField = null; var i = 0; var fields = new Array(); oRequired = new required(); for (x in oRequired) { var field = form[oRequired[x][0]]; if (field.type == 'text' || field.type == 'textarea' || field.type == 'file' || field.type == 'select-one' || field.type == 'radio' || field.type == 'password') { var value = ''; // get field's value if (field.type == select-one) { var si = field.selectedIndex; if (si = 0) { value = field.options[si].value; } } else { value = field.value; } if (value == '') { if (i == 0) { focusField = field; } fields[i++] = oRequired[x][1]; isValid = false; } } } if (fields.length 0) { focusField.focus(); alert(fields.join('\n')); } return isValid; } function required () { this.aa = new Array(primAddrState, Please select your state of residence to continue., new Function (varName, return this[varName];)); } -Original Message- From: Sandeep Takhar [mailto:[EMAIL PROTECTED] Sent: Monday, July 07, 2003 11:29 AM To: Struts Users Mailing List Subject: RE: Validator using A href instead of html:submit What is the javascript created by the custom tag when looking at the source? I think you shouldn't need to call: validateEnterAppInfo1(this) but what happens if you do? maybe there is more than one form? Is the form being submitted and the data is in the form? sorry I can't help any more than that. sandeep --- Poon, Johnny [EMAIL PROTECTED] wrote: Sandeep, No, because I'm using the same bean across different screen, so ValidatorActionForm suits me better, as it validates based on the action instead of the form. JP -Original Message- From: Sandeep Takhar [mailto:[EMAIL PROTECTED] Sent: Monday, July 07, 2003 10:48 AM To: Struts Users Mailing List Subject: Re: Validator using A href instead of html:submit should it be a validatorForm? sandeep --- Poon, Johnny [EMAIL PROTECTED] wrote: Hi, I'm using trying to use ValidatorActionForm and tile, but the submit button is outside of the form on a different JSP, therefore, I need to submit my form indirectly using a link and javascript (see code below). Neither the client-side javascript nor the server-side validation get called. But if I hardcode a submit button WITHIN the form, the javascript will get called. So, does this mean that validator will not work with
RE: generic SQL implementation
I don't quite understand the data access part of the Mapper project. How do you initialize a new Jdbc connection? Shouldn't there be a JdbcFactory class similar to MapperFactory class, where you could pass the connection properties? + public JdbcFactoryTest(String, java.util.Properties) { + } similar to the following test: public MapperFactoryTest(String name) { super(name); this.mappers.put(testMapper, org.apache.commons.mapper.TestMapper); this.mappers.put( java.util.ArrayList, org.apache.commons.mapper.TestMapper); } -Original Message- From: David Graham [mailto:[EMAIL PROTECTED] Sent: July 7, 2003 10:24 AM To: Struts Users Mailing List Subject: Re: generic SQL implementation Mapper doesn't have a real website yet but you can view the source online at: http://cvs.apache.org/viewcvs.cgi/jakarta-commons-sandbox/mapper/ You could also check it out of the cvs repository. David --- Vinay [EMAIL PROTECTED] wrote: David, Can you give me the URL for the mapper, this might be the one I am looking for ,even though I wanted to implement the API on my own. Thanks a lot VInay - Original Message - From: David Graham [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, July 07, 2003 11:35 AM Subject: Re: generic SQL implementation There is a Mapper project in the commons sandbox that might help you. It allows you to store SQL in a properties file to remove it from your code. Also, it acts as a layer between your app and your persistence technology so you can swap in an O/R mapping tool, EJBs, etc if you decide against using JDBC in the future. It also, makes using JDBC a breeze and removes much error prone and repetitive code from your app. David --- Vinay [EMAIL PROTECTED] wrote: Has anybody implemented a generic implementation for querying databases during runtime. I am using DAO's for data access layer. But I want to furthur move the database logic to down one more layer of abstraction.I am dealing with different kinds of database (eg. let's say a MySQL, MS Access and another not SQL at all ,index sequential files). I want the DAO to access the database during runtime. So I want my DAO to be independent of the SQL statements.The Database Interfrace would talk to either MySQL,or Oracle or any other database.So that there is no need to have DAO for each database syntax, rather , this should be handled by a API thru an interface. Here's and examples Let's say for select statement , we supply table name, column names, where cluase , and's etc The following method should handle the query List getSelect(String tablename, List columnnames, List Orderby,.) etc { return queryresult } Any ideas appreciated Thank you Vinay __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.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]
resolving relative paths to servet webapp/myapp directory
Hello, I'm doing an XML-PDF XSLT transformation using a XSL stylesheet. Programmatically, within my Action class, I refer to the stylesheet needed by using a relative path, with the goal of it being relative to my appname directory off of the servlet webapps directory: TransformerFactory tFactory = TransformerFactory.newInstance(); Transformer transformer = tFactory.newTransformer(new StreamSource(stylesheets\\mystylesheet.xsl)); .. Problem is, Struts appears to be resolving relative paths from my project working directory, *not* relative to the appname from the webapps directory in Tomcat. To confirm this, removing the xsl stylesheet from my working directory returned this error when I ran the app in Tomcat: java.io.FileNotFoundException: D:\myworkingdir\myapp\stylesheets\mystylesheet.xsl and not this error: java.io.FileNotFoundException: D:\tomcat4.1\webapps\myapp\stylesheets\mystylesheet.xsl How do I specify filenames in Struts so they will be resolved relative to the webapps\myapp directory (whatever I name myapp to be), and not my (deleteable) working directory? Thanks, Glen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ActionForm mapped property submit/populate error
A very common problem and you can spend too much time on these issues. Personally - I would use the nested tags. When using them - don't worry about generating the nested property syntax. Just use them intuitively in the easiest fashion possible. This includes mapped properties. For indexed properties you will need Object getObject(int index) and setObject(int index, Object o) and for mapped properties you need Map getMap(String key) setMap(String key, Object value) on the action forms. then just use this for indexed: nested:iterate property=collection id=someId nested:text property=name/ /nested:iterate This will populate and load from the name property of the object that is in the collection. The collection is stored in an attribute called collection in some scope (in the above example). for mapped nested:iterate property=myFormsMap nested:property=name/ nested:iterate This will load and populate the name property of whatever object is in the map. that's it - it is that easy. Here is another reference: http://www.mail-archive.com/[EMAIL PROTECTED]/msg71256.html sandeep --- Nate Bowler [EMAIL PROTECTED] wrote: I'm sure this is a common question for Struts newcomers dealing with mapped and indexed properties, but I can't find a good solution. To sum it up quickly, I can read values from an ActionForm with the following syntax in a JSP tag rows(1).val, but when I submit, I get the following exception. Ideas?: java.lang.IllegalArgumentException: No bean specified at org.apache.commons.beanutils.PropertyUtils.getPropertyDescriptor (PropertyUtils.java:837) at org.apache.commons.beanutils.BeanUtils.setProperty (BeanUtils.java:934) at org.apache.commons.beanutils.BeanUtils.populate (BeanUtils.java:808) Here are more details: I've got an ActionForm subclass with the following methods: public Map getMap(); public void setMap(Map map); public MyRow getRows(String idx); public void setRows(String idx, MyRow val); I prepopulate the form in an open action and everything displays beautifully. However, when I submit, the bean is lost and BeanUtils can't seem to repopulate it. What am I missing here? - The reset() method is implemented and it reinitializes everything. - It is a request scope form. What is the best practice for this type of use case? Nate - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
multi-user development
I am about to allow others to work on my project now that I've set up much of the framework. I can see a few problems, most notable is the struts-config.xml file. I believe there will be much contention for this file. I seem to recall a discussion about splitting this file up into multiple config files, but it appears that the search facility on the apache/struts site is down. Is splitting the config file possible? If so, how? Also, assuming the above is possible, what are others doing for this? I.e., do you have multiple config files based on modules in your app? For example, I assume the way *not* to do this would be to have an action-config.xml file, but rather a functional-area1.xml file. But, this assumes you can have multiple tags/sections for things like global-forwards and action-mappings. Can you? Any insight would be really appreciated. Thanks! /greg -- Gregory F. March-=-http://www.gfm.net:81/~march-=-AIM:GfmNet - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: resolving relative paths to servet webapp/myapp directory
we do something similar but we use the WEB-INF directory as the starting point and all works fine lets say we are looking for XML/extraction-map-classday.xml the following code achieves this ... public final class HomePageAction extends Action ... ... String xmlURI = this.getServlet().getServletContext().getRealPath(/WEB-INF/XML/extraction-m ap-classday.xml); Therefore the RealPath to extraction-map-classday.xml = the value in xmlURI if you had stylesheets\mystylesheet.xsl under the WEB-INF directory maybe you could follow or approach i know it works for us but maybe we just got lucky !!! HTH Mike - Original Message - From: Mazza, Glen R., ,CPMS [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, July 07, 2003 11:38 AM Subject: resolving relative paths to servet webapp/myapp directory Hello, I'm doing an XML-PDF XSLT transformation using a XSL stylesheet. Programmatically, within my Action class, I refer to the stylesheet needed by using a relative path, with the goal of it being relative to my appname directory off of the servlet webapps directory: TransformerFactory tFactory = TransformerFactory.newInstance(); Transformer transformer = tFactory.newTransformer(new StreamSource(stylesheets\\mystylesheet.xsl)); .. Problem is, Struts appears to be resolving relative paths from my project working directory, *not* relative to the appname from the webapps directory in Tomcat. To confirm this, removing the xsl stylesheet from my working directory returned this error when I ran the app in Tomcat: java.io.FileNotFoundException: D:\myworkingdir\myapp\stylesheets\mystylesheet.xsl and not this error: java.io.FileNotFoundException: D:\tomcat4.1\webapps\myapp\stylesheets\mystylesheet.xsl How do I specify filenames in Struts so they will be resolved relative to the webapps\myapp directory (whatever I name myapp to be), and not my (deleteable) working directory? Thanks, Glen - 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]
Resources not loading
Hi, Our environment consists of IPlanet webserver and weblogic app server. All the style sheets, images are loaded in webserver. In my application (in struts 1.1 framework), I have specified locale specific resources. (like banner images, text etc). During login, when I switch the locale, the first page rendered did not have the resources displayed. (Style sheet colors, images). What might be the problem? This happens in IE 6.0. But if I refresh the page, everything is loaded fine. Any help is appreciated. Thanks Shoba - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]