Re: need help with struts error
you might have xalan in ur class path, now struts uses only jaxp remove xalan and start it might work - Original Message - From: Matthew Van Horn [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, March 04, 2003 1:39 PM Subject: need help with struts error I get the following error whenever I deploy an .ear file, but if I just stop and start JBoss the file is picked up and deploys fine. If I then touch the file, I get the error again. What gives? The best I can find with google is that it may have something to do with the DTD going missing, or another parser being there, but neither of those seems to be the case. 17:02:59,730 ERROR [ActionServlet] Parsing error processing resource path /WEB-INF/struts-config.xml java.lang.LinkageError: loader constraints violated when linking org/apache/commons/digester/ObjectCreationFactory class at org.apache.struts.config.ConfigRuleSet.addRuleInstances(ConfigRuleSet.ja va:121) at org.apache.commons.digester.Digester.addRuleSet(Digester.java:1610) at org.apache.struts.action.ActionServlet.initConfigDigester(ActionServlet. java:1211) at org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.ja va:923) at org.apache.struts.action.ActionServlet.init(ActionServlet.java:468) at javax.servlet.GenericServlet.init(GenericServlet.java:256) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.jav a:924) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:813) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.j ava:3341) at org.apache.catalina.core.StandardContext.start(StandardContext.java:3534 ) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.ja va:821) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:579) at org.jboss.web.catalina.EmbeddedCatalinaService41.createWebContext(Embedd edCatalinaService41.java:432) at org.jboss.web.catalina.EmbeddedCatalinaService41.performDeploy(EmbeddedC atalinaService41.java:306) at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:300) at org.jboss.deployment.MainDeployer.start(MainDeployer.java:807) at org.jboss.deployment.MainDeployer.start(MainDeployer.java:799) at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:621) at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:585) at java.lang.reflect.Method.invoke(Native Method) at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDi spatcher.java:284) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517) at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174) at $Proxy4.deploy(Unknown Source) at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentSc anner.java:435) at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScan ner.java:561) at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doS can(AbstractDeploymentScanner.java:212) at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loo p(AbstractDeploymentScanner.java:225) at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run (AbstractDeploymentScanner.java:202) 17:03:00,005 INFO [Engine] StandardWrapper[/atjweb:action]: Marking servlet action as unavailable 17:03:00,039 ERROR [Engine] StandardContext[/atjweb]: Servlet /atjweb threw load() exception javax.servlet.UnavailableException: Parsing error processing resource path /WEB-INF/struts-config.xml at org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.ja va:952) at org.apache.struts.action.ActionServlet.init(ActionServlet.java:468) at javax.servlet.GenericServlet.init(GenericServlet.java:256) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.jav a:924) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:813) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.j ava:3341) at org.apache.catalina.core.StandardContext.start(StandardContext.java:3534 ) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.ja va:821) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:579) at org.jboss.web.catalina.EmbeddedCatalinaService41.createWebContext(Embedd edCatalinaService41.java:432) at
Struts not parsing HTML correctly?
There are actually 2 problems I'm experiencing: Firstly, I have the following snippet in one of my forms (user_add.jsp): !-- tr thContract User/th td html:checkbox property=contractUser/ /td /tr -- If this is present, struts fails with the following error: org.apache.jasper.JasperException: No getter method for property contractUser of bean org.apache.struts.taglib.html.BEAN This happens whether that section is commented out or not, but does not occur if I remove the code entirely. The second problem is that I actually DO have a getter (and setter) method for contractUser in UserForm.java: /* Contract User */ private boolean contractUser = false; public boolean getContractUser() { return this.contractUser; } public void setContractUser(boolean contractUser) { this.contractUser = contractUser; } I have the following in my struts config: struts-config form-beans ... form-bean name=userForm type=com.somewhere.aproject.UserForm / ... /form-beans action-mappings ... action path=/screen_user_add forward=/user_add.jsp name=userForm validate=false/ ... /action-mappings /struts-config I know the configuration is right since the rest of the fields work fine. Should I be using type String instead of boolean for contractUser? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts not parsing HTML correctly?
Firstly, I have the following snippet in one of my forms (user_add.jsp): !-- tr thContract User/th td html:checkbox property=contractUser/ /td /tr -- If this is present, struts fails with the following error: org.apache.jasper.JasperException: No getter method for property contractUser of bean org.apache.struts.taglib.html.BEAN This happens whether that section is commented out or not, but does not occur if I remove the code entirely. As !-- -- is HTML comment, it will not change the way jour JSP compiler handles custom tags. The second problem is that I actually DO have a getter (and setter) method for contractUser in UserForm.java Yout html:checkbox is looking for a getter method for property contractUser (String getContractUser()) of the current formBean defined by a parent html:form. How are you using html:fom tag in your JSP ? Is the declared action path associated with the correct ActionFormBean in struts-config ? Nico. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts not parsing HTML correctly?
Oh almost forgot: it's struts 1.0.2 running under Tomcat 4.1 (B (B2003 3$B7n(B 4 $B2PMKF|(B 17:51$B!"(BKarl $B$5$s$O=q$-$^$7$?(B: (B There are actually 2 problems I'm experiencing: (B (B Firstly, I have the following snippet in one of my forms (user_add.jsp): (B (B !-- tr (B thContract User/th (B td (B html:checkbox property="contractUser"/ (B /td (B /tr -- (B (B If this is present, struts fails with the following error: (B (B org.apache.jasper.JasperException: No getter method for property (B contractUser of bean org.apache.struts.taglib.html.BEAN (B (B This happens whether that section is commented out or not, but does not (B occur if I remove the code entirely. (B (B (B The second problem is that I actually DO have a getter (and setter) method (B for contractUser in UserForm.java: (B (B /* Contract User */ (B private boolean contractUser = false; (B public boolean getContractUser() { (B return this.contractUser; (B } (B public void setContractUser(boolean contractUser) { (B this.contractUser = contractUser; (B } (B (B (B I have the following in my struts config: (B (B struts-config (B form-beans (B ... (B form-bean name="userForm" (Btype="com.somewhere.aproject.UserForm" / (B ... (B /form-beans (B action-mappings (B ... (B action path="/screen_user_add" (B forward="/user_add.jsp" (B name="userForm" (B validate="false"/ (B ... (B /action-mappings (B /struts-config (B (B (B I know the configuration is right since the rest of the fields work fine. (B Should I be using type String instead of boolean for contractUser? (B (B (B - (B To unsubscribe, e-mail: [EMAIL PROTECTED] (B For additional commands, e-mail: [EMAIL PROTECTED] (B (B (B- (BTo unsubscribe, e-mail: [EMAIL PROTECTED] (BFor additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts not parsing HTML correctly?
At 09:51 04/03/2003, you wrote: There are actually 2 problems I'm experiencing: Firstly, I have the following snippet in one of my forms (user_add.jsp): !-- tr thContract User/th td html:checkbox property=contractUser/ /td /tr -- If this is present, struts fails with the following error: org.apache.jasper.JasperException: No getter method for property contractUser of bean org.apache.struts.taglib.html.BEAN This happens whether that section is commented out or not, but does not occur if I remove the code entirely. Struts doesn't care of HTML comments, all the JSP source is processed to produce HTML content, and that's the navigator which is checking HTML comments to display contents or not. The second problem is that I actually DO have a getter (and setter) method for contractUser in UserForm.java: /* Contract User */ private boolean contractUser = false; public boolean getContractUser() { return this.contractUser; } public void setContractUser(boolean contractUser) { this.contractUser = contractUser; } I have the following in my struts config: struts-config form-beans ... form-bean name=userForm type=com.somewhere.aproject.UserForm / ... /form-beans action-mappings ... action path=/screen_user_add forward=/user_add.jsp name=userForm validate=false/ ... /action-mappings /struts-config I know the configuration is right since the rest of the fields work fine. Should I be using type String instead of boolean for contractUser? I've read somewhere that all forms fields should be declared as String in the Form classes... It is recommended to make the conversions in your actions classes. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Modules
Thomas CORNET wrote: At 03:18 03/03/2003, you wrote: You're going through a JSP to invoke an action? Is the action in a different module? Be aware that only by going through the controller do you enable non-default modules. If you don't explicitly go though the servlet (and going through a JSP does not go through the servlet) then Struts hasn't the opportunity to change to your module (read: none of your modules information [ mappings, forms, etc ] are available) and you'll only be able to acheive success if what you wished to reach was located in the default module. Clear as mud? hmmm yes. but when i go to a JSP directly within the site, without passing by the controller, this means that I can't render html:form elements because it doesn't know about the modules ? The basics of what you're doing appear correct to me. I'm not sure I understand where the breakdown is or why - I would assume it's developer (the developer being you - not us) error. I know a lot of folks have had problems getting their heads around modules - don't know what could be done to help that. Do you have any questions whos' ansers might help you? Perhaps if you posted or attached your config? I've been out of the loop for a bit, so it could just be brain-rot, but I don't see a definite cause for your problem. Seeing your config(s) and knowing precisely how you're invoking things would help us assist you better. I know that's my fault. 99% percent of people achieved to use modules, so I know something is missing... Here is in attachment, the jsp source, the action and form classes, and the struts config of the module. Just wanted to say all is working well when module's config content is place in the default module's config. Most everything knows how to get at the configuration for the default module. You see, most configuration data is available in two places: 1) application scope under a combination of whatever the key is that identifies that given piece of data -- plus a module identifier. 2) in request scope [if you go through the controller] under the key identifying that piece of data, but without the module identifier. Some things will go on to app scope and pull things from there. The data you're working with if you don't go through the controller to get at things (ie. you don't go through an action to get at your JSP pages) will be the data for the main (default) module. Only by going through the controller (ie. invoking pages through actions) will the controller have the opportunity to determine which module is being invoked and place the data relevant to that module in the request. That's why things work as expected if you put your configuration into the default config file. Still clear as mud? RULE: Always go through the controller. (always use an action to get at a JSP) This is a really strong recommendation for folks not using modules, but it really becomes an absolute must when you are using modules. Sorry, but there's no way go get around it without rewriting Struts to be a filter instead of a servlet (... which might possibly happen in Struts 2.x.x - we've speculated on this point) You can let yourself get carried away with it like a lot of folks do and hide your JSPs off under WEB-INF, if you like (TONS of folks do this, and I've taken to it as well). This will make it impossible to access a resource unless you go through an action. This both ensures that the user can't inadvertantly access the page directly, and ensures you write an action to reach it. It's really a handy trick on a lot of levels. Users can bookmark actions just like they can pages. They're just storing the URL. Yes, you'll have to have request parameters cluttering your URL, but it can be done. They can handle it (or, I should say, the browser can) just fine. I can't count the times I've saved queries on pricegrabber.com -- same principle. I haven't examined your files yet. Sorry, but I really don't have time right now :-( What I would do if I were you is to make everything go through an action and see if you're still having problems. If you're always going through the controller, everything should always be A-OK. If you do continue to have problems once you've fixed your application to act as I have stated, please do let us know. Here's another perspective: If you don't go through the controller, how is the page supposed to know which module you're invoking it from? I guess you could hard-code it -- and you could actually get at your configuration data (study source code and user guide) if you knew which module you were in. Unfortunately, without hard-coding it or going through the controller, there's no way a page has a clue which module it's a part of. That information is something that is perculiar only to your Struts configuartion - and the controller is the only one capable of changing which module you're in. Is it becoming any
Re: Tiles Body question
James, The beauty of Tiles is that you can nest the templates really easily. Have you been fooling with Tiles long? You might consider looking over the tiles-documentation.war file. There are some fine examples of usage there. The thing you need to wrap your head around is that the body could be a page - but could just as easily be another template! Be careful to keep track of which templates are intended to be fragments though (ie. which ones contain htmlbody.../body/html tags), as you could wind up with some unexpected output. Just cram your nose into the examples inside of the tiles-documenation.war file and all should become clear ... after a requisite amount of tinkering and puttering (and grumbling, perhaps!). Playing with technology such as this is seldom not instructive. James Prance wrote: In a classic template, the header, footer and menu could be common across your application. However the body would likely change depending on the business process. Is there a way to alter the 'body' value dynamically? I'm a bit confused by this at the moment and my current understanding is that you need a new 'layout' for each differing 'body' page.. is this correct or am i totally arse about face? James -- Eddie Bush - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OnLoad
JavaScript is on the client. Your request-scoped variables are on the server. I don't see how you'd manage this unless you somehow wrote the variables values into your JavaScript somehow. Essentially, you'd have to generate your script on-the-fly. Ray Madigan wrote: I am working in a jsp and I have found the item im looking for. I write out an img that represents the current selected item. Now I want to inform another frame that something occured. There is no onload javascript handler for the img tag like there is in it's html equilivant? The arguments for the javascript need to be able to look at request scope variables? Anyone know how to accomplish this? Thanks RayM -- Eddie Bush - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Modules
Most everything knows how to get at the configuration for the default module. You see, most configuration data is available in two places: 1) application scope under a combination of whatever the key is that identifies that given piece of data -- plus a module identifier. 2) in request scope [if you go through the controller] under the key identifying that piece of data, but without the module identifier. Some things will go on to app scope and pull things from there. The data you're working with if you don't go through the controller to get at things (ie. you don't go through an action to get at your JSP pages) will be the data for the main (default) module. Only by going through the controller (ie. invoking pages through actions) will the controller have the opportunity to determine which module is being invoked and place the data relevant to that module in the request. That's why things work as expected if you put your configuration into the default config file. Still clear as mud? RULE: Always go through the controller. (always use an action to get at a JSP) This is a really strong recommendation for folks not using modules, but it really becomes an absolute must when you are using modules. Sorry, but there's no way go get around it without rewriting Struts to be a filter instead of a servlet (... which might possibly happen in Struts 2.x.x - we've speculated on this point) You can let yourself get carried away with it like a lot of folks do and hide your JSPs off under WEB-INF, if you like (TONS of folks do this, and I've taken to it as well). This will make it impossible to access a resource unless you go through an action. This both ensures that the user can't inadvertantly access the page directly, and ensures you write an action to reach it. It's really a handy trick on a lot of levels. Users can bookmark actions just like they can pages. They're just storing the URL. Yes, you'll have to have request parameters cluttering your URL, but it can be done. They can handle it (or, I should say, the browser can) just fine. I can't count the times I've saved queries on pricegrabber.com -- same principle. I haven't examined your files yet. Sorry, but I really don't have time right now :-( What I would do if I were you is to make everything go through an action and see if you're still having problems. If you're always going through the controller, everything should always be A-OK. If you do continue to have problems once you've fixed your application to act as I have stated, please do let us know. Here's another perspective: If you don't go through the controller, how is the page supposed to know which module you're invoking it from? I guess you could hard-code it -- and you could actually get at your configuration data (study source code and user guide) if you knew which module you were in. Unfortunately, without hard-coding it or going through the controller, there's no way a page has a clue which module it's a part of. That information is something that is perculiar only to your Struts configuartion - and the controller is the only one capable of changing which module you're in. Is it becoming any clearer why this is a requirement? If we ever do swap over to having the controller be a filter instead of a servlet, we'll be able to tell very easily if a JSP lives in a certain module and will be able to go directly to pages if we so choose. Until then, you've simply got to get over whatever reasons you have for not prefacing all pages with an action and ... like Nike would say ... Just Do It! HTH! Eddie -- Eddie Bush Many thanks for the explainations. Things like this are not present on tutorials on Net. It must be time for me to buy a big book about Struts ;) I see the need to place the JSP under WEB-INF directory, but is it possible, according recommandations, to let a minimum of JSP out of the WEB-INF directory for the front pages of a webapp ? However, I'm going to follow your recommandations to make those modules work. Don't waste time on it, I'll bother you only if it's still not working :) Thomas - 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: How fast is bean:message?
David Graham wrote: It's as fast as it takes to lookup a key in a hashmap. If that's unacceptable then you should write a different jsp for each language with hardcoded text. I'm searching a more automated solution. If the design has to be changed every translated JSP should be changed automatically, so something like a preprocessor would be great. cu, boris -- Dipl.-Inf. Boris Folgmann mailto:[EMAIL PROTECTED] Folgmann IT-Consulting http://www.folgmann.de - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Anyone using JBoss with custom validator rules?
Caused by: java.lang.NoClassDefFoundError: What's the structure of your .war? Two possible solutions: A) Put the commons (or even all Struts related) libraries in your $jboss/server/$setup/lib. B) Nest your .war inside a .sar that contains all libraries at the top level. -- Eric Jain - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT]: What is vim?
actually the vimulator on jEdit is buggy. No, sorry for the confusion. I'm not using the vim emulator on jEdit, I'm using the standard vim on Linux (and then also jEdit on Linux when I have to get stuff done quickly and don't have the time to learn vim:) Easy yank for Vim v0.99b1: use v for visual selection. then y for yanking, d for deleting, Esc for cancelling. This e-mail is intended only for the above addressee. It may contain privileged information. If you are not the addressee you must not copy, distribute, disclose or use any of the information in it. If you have received it in error please delete it and immediately notify the sender. Security Notice: all e-mail, sent to or from this address, may be accessed by someone other than the recipient, for system management and security reasons. This access is controlled under Regulation of Investigatory Powers Act 2000, Lawful Business Practises. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: OnLoad
I generate the arguments to the scripts on the server. when the jsp is being executed and passed to the client. What i don't know how to do is to figure out when to make the call. The img tag doesn't call the onload when it is loaded. I think i am just going to inline the script call. I was hoping for a little more formality - since regular html will call onload. -Original Message- From: Eddie Bush [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 04, 2003 2:46 AM To: Struts Users Mailing List Subject: Re: OnLoad JavaScript is on the client. Your request-scoped variables are on the server. I don't see how you'd manage this unless you somehow wrote the variables values into your JavaScript somehow. Essentially, you'd have to generate your script on-the-fly. Ray Madigan wrote: I am working in a jsp and I have found the item im looking for. I write out an img that represents the current selected item. Now I want to inform another frame that something occured. There is no onload javascript handler for the img tag like there is in it's html equilivant? The arguments for the javascript need to be able to look at request scope variables? Anyone know how to accomplish this? Thanks RayM -- Eddie Bush - 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: need help with struts error
It's because Struts and JBoss don't play well together. They will for a while... until you really don't expect it, and you will spend a couple of days flossing the plaque from your configuration while trying to get it working again. Struts and JBoss are two of the dozen or so must haves... so they ought to be pretty robust together if you ask me. If I had the knowledge to fix this problem, I would take a crack at it. GAWD I WOULD LOVE TO FIX THIS!!! I think the only way it will get fixed is if Scott and Craig were locked in a conference room until the problem was solved. There might be people that can fix it besides these two, but the solution undoubtedly is steeped in both architecture and politics, and these two are the only two that I can think of that have the noodle to make it happen and the power of one to lay down the new unified law of the landscape. Struts depends on a lot of libraries and is quite precise about it's specification of a class loader. I don't understand it all, but I gather that this precision makes it more portable in general. But I wonder whether Struts would work better under JBoss if it were more sloppy (using class.forName() instead of ClassLoader.loadClass() for instance...) JBoss, for all it's glory, tries to make all class loaders in a VM look like the same one, but they show their colors under very specific circumstances. Okay, I'm frustrated because I've burned up the last 24 hours on this. I guess I'm doing better than last time where it took something like a week to muddle through the problem. So I'll quit bitching now and tell you what I know. Maybe it will help, hopefully others can add more. My issue has to do with getting a class in WEB-INF/classes to be found by the validator in a call to getMethod I presume you are running on JBoss because you are using EJBs. It's easy for your classes and libraries to get co-mingled between the ejb.jar and web.war as a part of your build. Don't allow that. Go through and purge from each what is not necessary in the other. For instance, get all your entity classes out of the web.war... strictly interfaces only over there. Same is true for your web classes. They don't belong in the ejb container, get them out of there. Make absolutely sure that all the libraries that you are using are of the same version. A good way to find them is to do a file system search in both JBoss' temp directory and the Catalina temp directory to see if the jars are exactly the same version. If they are not necessary on one or the other side, remove them as appropriate. JBoss tries to be smart with sharing your jars within a VM, but JBoss seems all to happy to let an app be very specific about where a jar comes from, and when it does, it seems to cut off all the other linkages to the other libraries in the transitive closure of the load chain. Again, I don't understand it all, and generally call in a witch doctor with a rooster and two chickens for a sacrifice over the keyboard. After praising Chairman Bill and Lou Cipher as soulmates and a dab of sacred balm on the forehead, things start to work again, but only if the moon is just right. It's all about this scientific, so have fun. I bet you can solve the problem with these tricks. When trying to reproduce a problem though, always blow away your temp directories with each iteration or you are asking for enhanced humiliation and pain. I know that is precisely what you don't want to do, but because it works when you do that and does not when you don't that the problem is in the load order of the libraries being different from load-to-load and two libraries are in the path that are different versions. They won't even look like they are relevant, but clean them up anyway, they could be on the transitive closure of the runtime link. hth, -b -Original Message- From: Matthew Van Horn [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 04, 2003 12:09 AM To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: need help with struts error I get the following error whenever I deploy an .ear file, but if I just stop and start JBoss the file is picked up and deploys fine. If I then touch the file, I get the error again. What gives? The best I can find with google is that it may have something to do with the DTD going missing, or another parser being there, but neither of those seems to be the case. 17:02:59,730 ERROR [ActionServlet] Parsing error processing resource path /WEB-INF/struts-config.xml java.lang.LinkageError: loader constraints violated when linking org/apache/commons/digester/ObjectCreationFactory class at org.apache.struts.config.ConfigRuleSet.addRuleInstances(ConfigRuleSet.ja va:121) at org.apache.commons.digester.Digester.addRuleSet(Digester.java:1610) at org.apache.struts.action.ActionServlet.initConfigDigester(ActionServlet. java:1211) at
Re: OnLoad
I'd think it would ... but inlining it should solve things. Ray Madigan wrote: I generate the arguments to the scripts on the server. when the jsp is being executed and passed to the client. What i don't know how to do is to figure out when to make the call. The img tag doesn't call the onload when it is loaded. I think i am just going to inline the script call. I was hoping for a little more formality - since regular html will call onload. -- Eddie Bush - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Modules
Many thanks for the explainations. Things like this are not present on tutorials on Net. It must be time for me to buy a big book about Struts ;) Actually ... I know for a fact that information is present in the users guide. I put it there :-) At least, I felt I made it that clear. Maybe I should revise what's there? I see the need to place the JSP under WEB-INF directory, but is it possible, according recommandations, to let a minimum of JSP out of the WEB-INF directory for the front pages of a webapp ? You never really *have* to expose even a single JSP. Just stuff them off under WEB-INF (say WEB-INF/jsp or some such) and then forward to them through your actions. You can reach anything under WEB-INF by forwarding to it. There was a day when this wasn't as clearly-stated in the spec as it is now, and not all containers supported it. I believe those days are past. Certainly, Tomcat (and many others) support it -- it is spec-compliant behavior. However, I'm going to follow your recommandations to make those modules work. Don't waste time on it, I'll bother you only if it's still not working :) Ok. I'm going to grab some shut-eye then. The morning seems to have snuck up on me :-( again ... Thomas -- Eddie Bush - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: displaying \n in html?
That depends on him having a certain JDK. Was that introduced in 1.3 or 1.4? I think it was introduced in 1.4. I know I cut some code for someone that didn't have as modern of a system as myself and I wound up going back and doing free work to fix it, so it hasn't been around forever :-( ... but, yes, that's how I'd go about it as well. There is also, I believe, a string taglib in the jakarta taglibs project -- they've discussed how to implement this as well. I *believe* they have configured something in that taglib to perform this exact function. Personally, I use pre ... /pre - works like a champ. I suppose that's not always suitable though. In cases where it's not, the string taglib should fit the bill. Aside: Laziness can occasionally be seen in ignorance. Sometimes people just don't know where to look and wind up coming off as lazy. You should always think to examine every possible alternative you have - at every level. You'd be surprised the problems you can solve when you become adventuresome enough to do so. David Graham wrote: i'd love to see one-liner that converts char to string. return newlineString.replaceAll(\n, br/); David -- Eddie Bush - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: displaying \n in html?
Oh :-) and ... my preivous post might also explain why you've had so many questions go unanswered. You see, people here expect you to do your homework. Then, most folks go for the interesting or mission-critical problems. You see, none of us are getting paid to solve your problems, and we have our own problems to solve too! ... not trying to come off as an ass, but you can call me anything you like ;-) (except late for dinner! I won't tolerate that!) Eddie Bush wrote: That depends on him having a certain JDK. Was that introduced in 1.3 or 1.4? I think it was introduced in 1.4. I know I cut some code for someone that didn't have as modern of a system as myself and I wound up going back and doing free work to fix it, so it hasn't been around forever :-( ... but, yes, that's how I'd go about it as well. There is also, I believe, a string taglib in the jakarta taglibs project -- they've discussed how to implement this as well. I *believe* they have configured something in that taglib to perform this exact function. Personally, I use pre ... /pre - works like a champ. I suppose that's not always suitable though. In cases where it's not, the string taglib should fit the bill. Aside: Laziness can occasionally be seen in ignorance. Sometimes people just don't know where to look and wind up coming off as lazy. You should always think to examine every possible alternative you have - at every level. You'd be surprised the problems you can solve when you become adventuresome enough to do so. David Graham wrote: i'd love to see one-liner that converts char to string. return newlineString.replaceAll(\n, br/); David -- Eddie Bush - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Unable to access title attribute in Tiles under layout (1.1-rc1)
Hi, Once again ;-) : The attributes of a tile are only accessible from this tile, not from its sub- tiles or its parent. Attributes of a tile are like parameters of a method: they are only visible in this method. It is why you can't access the title attribute owned by the layout from the header tile. To access it, you need to pass it explicitly to the tile: tiles:insert attribute=header tiles:put name=title beanName=title beanScope=tiles / /tiles:insert Cedric Steve Stair wrote: Inside /layouts/layout.jsp page, I have the following: %@ taglib uri=/WEB-INF/struts-tiles.tld prefix=tiles % titletiles:getAsString name=title//title Which works fine, the page title as defined in the tiles defintion file is displayed in the browser's title bar However, when I attempt to use that same title in /tiles/header.jsp %@ taglib uri=/WEB-INF/struts-tiles.tld prefix=tiles % h1tiles:getAsString name=title//h1 I get the following error message: [ServletException in:/tiles/header.jsp] Error - tag.getAsString : attribute 'title' not found in context. Check tag syntax' I haven't been able to find an example that does this. So far I've only found an example that statically includes the header file, which somewhat defeats the purpose of using Tiles. My definition looks like this definition name=.app.Base path=/layouts/layout.jsp put name=title value=${title} / put name=header value=/tiles/header.jsp / put name=nav value=/tiles/nav.jsp / put name=messages value=/tiles/messages.jsp / put name=content value=${content} / put name=footer value=/tiles/footer.jsp / /definition -- Steve Stair - 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: AW: AW: Tiles Body question
The configuration you propose should work. All example ship with struts are based on this kind of nesting (portal, tabs, menu, ...). The reported exception usually appear when an insert ... is performed inside a tag implementing the BodyTag interface (like insert, iterate, ...). Is there a tag surrounding tiles:insert ... in your memberDetail.jsp file ? Cedric Roland Berger wrote: Hi Cedric Sorry, but I can not find the problem even with the examples. I belive I do it the same way as it is done there. May be you can have a look at the code below: *** tiles-defs.xml snippets *** definition name=.detailLayout path=/WEB-INF/common/layouts/detailLayout.jsp ... /definition definition name=.pages.member.detail.show extends=.detailLayout put name=body value=.pages.member.detail.show.head/ /definition definition name=.pages.member.detail.show.head path=/WEB-INF/pages/memberDetail.jsp put name=bodyHead value=/WEB-INF/pages/memberDetailShowHead.jsp/ /definition involved jsp page snippets File: detailLayout.jsp tiles:insert attribute=body / File: memberDetail.jsp tiles:insert attribute=bodyHead flush=false/ Remark: If I don't set flush to false I get: Can't insert page '/WEB-INF/pages/memberDetailShowHead.jsp' : Illegal to flush within a custom tag java.io.IOException: Illegal to flush within a custom tag at javax.servlet.jsp.tagext.BodyContent.flush(BodyContent.java:115) at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.ja va:817) at Again, the page memberDetailShowHead.jsp is put at the beginning of memberDetail.jsp and not where the tiles:insert attribute=bodyHead flush=false/ tag is. Thank you very much Roland -Ursprüngliche Nachricht- Von: Cedric Dumoulin [mailto:[EMAIL PROTECTED] Gesendet: Montag, 3. März 2003 18:08 An: Struts Users Mailing List Betreff: Re: AW: Tiles Body question The examples in struts-documentation use a master layout (classicLayout.jsp), and the body is often made of tiles inserted with another layout (like columnsLayout, vboxLayout, tabsLayout...). You can easily define your own layout with an insert. It is also possible to insert the definition corresponding to a page inside a nested bodies (see the tabs in the example directory). Maybe I have miss something in what you are trying to do ... Cedric Roland Berger wrote: Yes, that's exactly what I also want to do. But it seems that I missed the big picture. When I set flush=true I get a Illegal to flush error. If I set flush=false the tile I want to insert into the body template is inserted at the top of the page and not where the insert tag is. Can you give a small example with tiles-defs.xml and the JSP Part? ( see also thread: 'tiles insert in sub layout' ) Thanks a lot. Roland. -Ursprüngliche Nachricht- Von: Cedric Dumoulin [mailto:[EMAIL PROTECTED] Gesendet: Samstag, 22. Februar 2003 14:13 An: Struts Users Mailing List Betreff: Re: Tiles Body question You can have a body acting as a body template which in turn insert other bodies ... Cedric James Prance wrote: In a classic template, the header, footer and menu could be common across your application. However the body would likely change depending on the business process. Is there a way to alter the 'body' value dynamically? I'm a bit confused by this at the moment and my current understanding is that you need a new 'layout' for each differing 'body' page.. is this correct or am i totally arse about face? James - 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] - 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: Setting tiles attributes from a bean in different scopes
BaTien Duong wrote: Thanks Cedric. You save us a day! 3 more items to be sure: 1) Assuming we have *myAttribute* from *myBean* in user session myBean.getLevel2().getMyAttribute(). To use myAttribute as a JSP Java variable, we need: //set an attribute for tile insert tiles:insert attribute=myAttribute / tiles:put name=myAttribute beanName=myBean beanScope=session beanProperty=level2.myAttribute / /tiles:insert This declare a tile attribute initialized from your bean. This attribute can be used in the inserted tile only, not in the current page //declare a Java variable for JSP usage tiles:useAttribute name=myAttribute scope=request / This can be done in the inserted tile only. It declare a java variable and a bean in the request scope. A java variable is only visible inside the jsp page where it is declared. The bean is visible in its scope. // myAttribute is now available for all sub tiles in the jsp %= myAttribute ... % NO ! The java variable is not visible in sub tiles because they are other jsps. But the bean stored in the request scope is visible. so, you can retrieve it from the scope: bean:define .../ 2) Assuming now level2 is a HashMap and myAttributeName is the key corresponding to myAttribute value: myAttribute = (HashMap myBean.getLevel2()).get(myAttributeName) the beanProperty can be set: beanProperty=level2.myAttributeName I don't remember the exact syntax for accessing hashmap. It is the same syntax used in Struts tags. 3) Assuming as in (2) but myAttribute is now a property of level2Obj, which is the value of myAttributeName key: myAttribute = ( Level2Obj (HashMap myBean.getLevel2()).get(myAttributeName).getMyAttribute(), the beanProperty can be set: beanProperty=level2.myAttributeName.myAttribute It should work. In fact Tiles use the BeanUtils library. So, if this library support it, Tiles support it also. Cedric Thanks. -Original Message- From: Cedric Dumoulin [mailto:[EMAIL PROTECTED] Sent: Monday, March 03, 2003 9:35 AM To: Struts Users Mailing List Subject: Re: Setting tiles attributes from a bean in different scopes Hi, BaTien Duong wrote: Hello Cedric and the group: Issue: need to retrieve properties of *myBean* in user session scope as values for tiles attributes in request scope. You can't set the scope of a tiles attribute: a tiles attribute is defined with put nested in an insert. A tile attribute is always in the tiles scope (the tiles context). However, you can import (importAttribute) a tile attribute in any jsp scope, or use it (useAttribute) as java variable. So, I don't clearly see what you are trying to do ;-). Solution from a scratch of my head: jsp:useBean id=myBean scope=session / tiles:useAttribute id=myAttribute name=myAttribute scope=request className=java.lang.String / tiles:put name=myAttribute beanName=myBean beanProperty=myAttribute / This code is not valid because the put tag should be nested inside an insert tag. Questions: 1) The bean and attribute are in different scopes. Can one set tile attributes from session scope? You can set an attribute from a bean stored in any scope: tiles:insert ... tiles:put name=myAttribute beanName=myBean beanScope=session / /tiles:insert This declare and set an attribute for the tile to be inserted. The attribute is called myAttribute, its value is taken from the bean myBean which is in the session scope. 2) Is there a faster way to assign an attribute at the time of initialization in useAttribute tag so we do not need jsp:useBean and tiles:put tags? useAttribute .../ tag is used to declare a java variable inside the jsp page. This variable is initialized from an attribute of the current tiles. This attribute has been passed to the current tiles. A side effect of this tag is to declare also a bean in one of the jsp scope. 3) Assuming myAttribute is a nested level of myBean ( i.e. getMyBean().getMyLevel2().getMyAttribute() ), is there an EL way similar to JSTL? Remind that you can use the dot separator in the bean property name: beanProperty=myLevel2.myAttribute Cedric Thanks? - 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]
Problems with ValidatorForm: validate is being called when it shouldn't be...
There's a strange situation regarding to the ValidatorForm. I want to display an empty Form (e.g. for a new functionality), but all validation rules have already fired. I don't think this was the case using a regular ActionForm, however with ValidatorForm all fields are being validated before they are being displayed! Anyone any idea how to solve this problem? Ruud. __ Do you Yahoo!? Yahoo! Tax Center - forms, calculators, tips, more http://taxes.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts not parsing HTML correctly?
Actually, you can use html comments to remove tags you just have to embed them in the tag...thusly: !--bean:write name=foobar property=nothing-- That will be ignored by the container, browser and everything else. -Original Message- From: Thomas CORNET [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 04, 2003 3:04 AM To: Struts Users Mailing List Subject: Re: Struts not parsing HTML correctly? At 09:51 04/03/2003, you wrote: There are actually 2 problems I'm experiencing: Firstly, I have the following snippet in one of my forms (user_add.jsp): !-- tr thContract User/th td html:checkbox property=contractUser/ /td /tr -- If this is present, struts fails with the following error: org.apache.jasper.JasperException: No getter method for property contractUser of bean org.apache.struts.taglib.html.BEAN This happens whether that section is commented out or not, but does not occur if I remove the code entirely. Struts doesn't care of HTML comments, all the JSP source is processed to produce HTML content, and that's the navigator which is checking HTML comments to display contents or not. The second problem is that I actually DO have a getter (and setter) method for contractUser in UserForm.java: /* Contract User */ private boolean contractUser = false; public boolean getContractUser() { return this.contractUser; } public void setContractUser(boolean contractUser) { this.contractUser = contractUser; } I have the following in my struts config: struts-config form-beans ... form-bean name=userForm type=com.somewhere.aproject.UserForm / ... /form-beans action-mappings ... action path=/screen_user_add forward=/user_add.jsp name=userForm validate=false/ ... /action-mappings /struts-config I know the configuration is right since the rest of the fields work fine. Should I be using type String instead of boolean for contractUser? I've read somewhere that all forms fields should be declared as String in the Form classes... It is recommended to make the conversions in your actions classes. - 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: Struts not parsing HTML correctly?
Actually, you can use html comments to remove tags you just have to embed them in the tag...thusly: !--bean:write name=foobar property=nothing-- That will be ignored by the container, browser and everything else. Or you can use JSP comments: %-- foo bean:write name=foobar property=nothing bar --% This e-mail is intended only for the above addressee. It may contain privileged information. If you are not the addressee you must not copy, distribute, disclose or use any of the information in it. If you have received it in error please delete it and immediately notify the sender. Security Notice: all e-mail, sent to or from this address, may be accessed by someone other than the recipient, for system management and security reasons. This access is controlled under Regulation of Investigatory Powers Act 2000, Lawful Business Practises. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts not parsing HTML correctly?
They will be ignored but the will still be visible in the HTML received by the browser, it is therefore much better to use JSP comments %-- --% -Original Message- From: Jaye Bass [mailto:[EMAIL PROTECTED] Sent: 04 March, 2003 13:24 To: 'Struts Users Mailing List' Subject: RE: Struts not parsing HTML correctly? Actually, you can use html comments to remove tags you just have to embed them in the tag...thusly: !--bean:write name=foobar property=nothing-- That will be ignored by the container, browser and everything else. -Original Message- From: Thomas CORNET [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 04, 2003 3:04 AM To: Struts Users Mailing List Subject: Re: Struts not parsing HTML correctly? At 09:51 04/03/2003, you wrote: There are actually 2 problems I'm experiencing: Firstly, I have the following snippet in one of my forms (user_add.jsp): !-- tr thContract User/th td html:checkbox property=contractUser/ /td /tr -- If this is present, struts fails with the following error: org.apache.jasper.JasperException: No getter method for property contractUser of bean org.apache.struts.taglib.html.BEAN This happens whether that section is commented out or not, but does not occur if I remove the code entirely. Struts doesn't care of HTML comments, all the JSP source is processed to produce HTML content, and that's the navigator which is checking HTML comments to display contents or not. The second problem is that I actually DO have a getter (and setter) method for contractUser in UserForm.java: /* Contract User */ private boolean contractUser = false; public boolean getContractUser() { return this.contractUser; } public void setContractUser(boolean contractUser) { this.contractUser = contractUser; } I have the following in my struts config: struts-config form-beans ... form-bean name=userForm type=com.somewhere.aproject.UserForm / ... /form-beans action-mappings ... action path=/screen_user_add forward=/user_add.jsp name=userForm validate=false/ ... /action-mappings /struts-config I know the configuration is right since the rest of the fields work fine. Should I be using type String instead of boolean for contractUser? I've read somewhere that all forms fields should be declared as String in the Form classes... It is recommended to make the conversions in your actions classes. - 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] __ 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 company. 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 Standard Bank. 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. __ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How fast is bean:message?
Boris, You could switch to tiles. Depending on a users' locale it could automagically use a different jsp. This way you limit the lookup of messages considerably, only once (per tile) you need to determine which tile to load in. If you break down your site-pages in smaller chunks you can tile-fy each page and you will not have a need for pre-processing. When you already make allowances for the fact that your design might change, switching to tiles is not such a bad option. Hope this is useful, Roeland Lengers [EMAIL PROTECTED] Boris Folgmann [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]... David Graham wrote: It's as fast as it takes to lookup a key in a hashmap. If that's unacceptable then you should write a different jsp for each language with hardcoded text. I'm searching a more automated solution. If the design has to be changed every translated JSP should be changed automatically, so something like a preprocessor would be great. cu, boris -- Dipl.-Inf. Boris Folgmann mailto:[EMAIL PROTECTED] Folgmann IT-Consulting http://www.folgmann.de - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[HK] List backed parameter validation
Is it possible to add a validation rule (required for ex.) to all list backed parameters in a dynamic form? If yes, how is it defined in validation.xml / validation-rules.xml? - Do you Yahoo!? Yahoo! Tax Center - forms, calculators, tips, and more
Tiles problems (Building complex pages)
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi all, Sorry for this lengthy mail but I am getting crazy! I am working with Struts and Tiles and I am developing a small site to test (and stress this technology) I reused some layouts taken from the tiles documentation. The standard page layout with the classical header, body, footer attributes and, in particular I took the vboxLayout: % Iterator i = list.iterator(); while(i.hasNext()) { String name = (String)i.next(); % tiles:insert name=%= name % flush=true/ % } % What I want is a page with the standard layout whose body is a vboxLayout with some tiles. To do this I have to write the following files: main.jsp mainBody.jsp t1.jsp t2.jsp Where main is a page which uses the standard layout, mainBody is a simple .jsp with only a tiles:insert page=vboxLayout.jsp tiles:putList name=list tiles:add value=t1.jsp/ tiles:add value=t2.jsp/ ... t1, t2 are .jsp tiles. Now my questions are: 1) The mainBody contains a list of tiles some of which might be text-only. I would like to do something like this: tiles:insert page=vboxLayout.jsp tiles:putList name=list tiles:add value=t1.jsp/ tiles:add type=stringThis is an embedded text only tile/tiles:add ... In this way I would get rid of all the .jsp which contains only text/html and are peculiar to a single page. But this doesn't work. 2) Another problem is when a tile, let's say t1.jsp, needs some attributes to be passed in order to be instantiated. Let's suppose that the tile t1 needs a title. How do I pass that attribute in the previous example? tiles:insert page=vboxLayout.jsp tiles:putList name=list tiles:add value=t1.jsp tiles:put name=title value=Yupi/ /tiles:add tiles:add value=t2.jsp/ ... Doesn't work. I tried to write a local definition before actually inserting the tile: tiles:definition id=instantiatedT1 page=t1.jsp tiles:put name=title value=Yupi/ /tiled:definition tiles:insert page=vboxLayout.jsp tiles:putList name=list tiles:add value=instantiatedT1/ tiles:add value=t2.jsp/ ... But this doesn't work too. I tried also to specify different scopes for the definition (even the application one!) and different types for the tiles:add tag (namely type=definition and also beanName=instantiatedT1). The only way I've found to make this work is to put the definition inside the tiles-config.xml, but this would be equivalent in having a separate t1.jsp with no parameters. I suppose the problem is in the vboxLayout but I cannot figure out how to write a layout which supports what I said in 1). The problem in 2) still has no solution (to me). A presto, Fabio - -- - - Fabio Mancinelli, PhD student EMail : [EMAIL PROTECTED] Dipartimento di Informatica WWW : http://www.di.univaq.it/~mancinel Universita' dell'Aquila - - -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) Comment: Made with pgp4pine 1.75-6 iD8DBQE+ZKrs6dsQbk2R3cMRArgjAKCcW4oqazE/lbRwXBnOEA7odtvTyACgzw9p oSPR57Gl6YLcMAA6B08KZbo= =BmVa -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] Text editor usage (was RE: [OT]: What is vim?)
:). In any case, OTI is an ex-Smalltalk IDE shop, so I presume there's a strong NIH syndrome there similar to most other IDE's I've run across -- Then why is there an Emacs keybinding preference setting but none for vi? David Huh? I can't quite understand what you are asking David. If you are asking why emacs instead of vi -- I can only offer that perhaps Emacs users asked them for it repeatedly (OTI used to build VisualAge suite of products before being acquired by IBM, and perhaps found the emacs demands harder to ignore :). If you are asking why emacs at all? given what I said about their NIH syndrome, I have to point out that the emacs key-binding support in Eclipse is much like the key-binding support within Visual Studio or .Net IDEs.. they are very poor implementations, and I'd rather not have them at all. It is a great mistake to think that just by simply rebinding keys you can get emacs-like behavior.. if you've used things like the keyboard macros, key-rebinding support, regexp search, file commands etc. etc., you will see that deeper integration can provide a lot more benefits. I think an open plugin-based IDE like Eclipse can do much, much more.. by actually embedding Emacs within the IDE as a true component plugin, much like it allows the embedding of multiple HTML/JSP editors, viewers or VCM tools etc. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Form Beans: Design Question
Please excuse the simple question (I am new to Struts): When is it appropriate to use form beans for an action? The reason why I ask is because you can obtain information from a request via the information sent by the HTTP/Post/Get. If I have a bunch of widgets in a form I can just obtain the info in the action this way: request.getParameter(widgetName) I have a fairly good understanding of how form beans work, but I'm just wondering in what type(s) of situation(s) these would be applied. Thanks for your help. John Curley - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Form Beans: Design Question
Please excuse the simple question (I am new to Struts): When is it appropriate to use form beans for an action? The reason why I ask is because you can obtain information from a request via the information sent by the HTTP/Post/Get. If I have a bunch of widgets in a form I can just obtain the info in the action this way: request.getParameter(widgetName) I have a fairly good understanding of how form beans work, but I'm just wondering in what type(s) of situation(s) these would be applied. Thanks for your help. The form bean is simply the OO view of what the user has typed in his HTML form. One of the benefits of this object is that you can validate() it. And reset() it to default values. This e-mail is intended only for the above addressee. It may contain privileged information. If you are not the addressee you must not copy, distribute, disclose or use any of the information in it. If you have received it in error please delete it and immediately notify the sender. Security Notice: all e-mail, sent to or from this address, may be accessed by someone other than the recipient, for system management and security reasons. This access is controlled under Regulation of Investigatory Powers Act 2000, Lawful Business Practises. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Setting tiles attributes from a bean in different scopes
Great. Thanks again. Nothing can replace words from the mouth of a real developer. BaTien -Original Message- From: Cedric Dumoulin [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 04, 2003 3:46 AM To: Struts Users Mailing List Subject: Re: Setting tiles attributes from a bean in different scopes BaTien Duong wrote: Thanks Cedric. You save us a day! 3 more items to be sure: 1) Assuming we have *myAttribute* from *myBean* in user session myBean.getLevel2().getMyAttribute(). To use myAttribute as a JSP Java variable, we need: //set an attribute for tile insert tiles:insert attribute=myAttribute / tiles:put name=myAttribute beanName=myBean beanScope=session beanProperty=level2.myAttribute / /tiles:insert This declare a tile attribute initialized from your bean. This attribute can be used in the inserted tile only, not in the current page //declare a Java variable for JSP usage tiles:useAttribute name=myAttribute scope=request / This can be done in the inserted tile only. It declare a java variable and a bean in the request scope. A java variable is only visible inside the jsp page where it is declared. The bean is visible in its scope. // myAttribute is now available for all sub tiles in the jsp %= myAttribute ... % NO ! The java variable is not visible in sub tiles because they are other jsps. But the bean stored in the request scope is visible. so, you can retrieve it from the scope: bean:define .../ 2) Assuming now level2 is a HashMap and myAttributeName is the key corresponding to myAttribute value: myAttribute = (HashMap myBean.getLevel2()).get(myAttributeName) the beanProperty can be set: beanProperty=level2.myAttributeName I don't remember the exact syntax for accessing hashmap. It is the same syntax used in Struts tags. 3) Assuming as in (2) but myAttribute is now a property of level2Obj, which is the value of myAttributeName key: myAttribute = ( Level2Obj (HashMap myBean.getLevel2()).get(myAttributeName).getMyAttribute(), the beanProperty can be set: beanProperty=level2.myAttributeName.myAttribute It should work. In fact Tiles use the BeanUtils library. So, if this library support it, Tiles support it also. Cedric - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DynaBeans
Hello Sorry another dynabeans question I'm getting NoSuchMethodException when i can see that the properties i wish to access are available (using the describes to produce a map and exstracting the names with the keySet() method thanks mark - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Form Beans: Design Question
Your right, formbean just get request parameter for you. But they are doing this too: - allow syntax validation, programatically or by rules (via validator.xml) - allow dotted and indexed syntax (like property1.property2[3]), and so a realy objet-oriented formbean design - can be dynabeans (so you don't need to create javabeans) Nico. Please excuse the simple question (I am new to Struts): When is it appropriate to use form beans for an action? The reason why I ask is because you can obtain information from a request via the information sent by the HTTP/Post/Get. If I have a bunch of widgets in a form I can just obtain the info in the action this way: request.getParameter(widgetName) I have a fairly good understanding of how form beans work, but I'm just wondering in what type(s) of situation(s) these would be applied. Thanks for your help. John Curley - 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]
requestURI
Hi, I have an action my.do that in case of success redirect to my.jsp in myAction.java requestURI return my.do URI in my.jsp requestURI return my.jsp URI is there a possibility to retrieve my.do URI from my.jsp page struts 1.1b2 thank you for answers, Slavic
Transaction Tokens
Hi all, I really did not found any answer to this simple question: How do we use the transaction token mechanism? How to avoid the double submit problem ? Tanks, Alban. ** 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 at postmaster.eim.ch. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Transaction Tokens
Search list archive. Answers are there. I remember I even posted my code snippet. -Original Message- From: Alban Soupper [mailto:[EMAIL PROTECTED] Sent: March 4, 2003 9:25 AM To: Struts Users Mailing List (E-mail) Subject: Transaction Tokens Hi all, I really did not found any answer to this simple question: How do we use the transaction token mechanism? How to avoid the double submit problem ? Tanks, Alban. ** 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 at postmaster.eim.ch. ** - 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: How fast is bean:message?
I think you'll find that using the messaging tags with be acceptable performance and easier to maintain. David From: Boris Folgmann [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: How fast is bean:message? Date: Tue, 04 Mar 2003 10:33:30 +0100 David Graham wrote: It's as fast as it takes to lookup a key in a hashmap. If that's unacceptable then you should write a different jsp for each language with hardcoded text. I'm searching a more automated solution. If the design has to be changed every translated JSP should be changed automatically, so something like a preprocessor would be great. cu, boris -- Dipl.-Inf. Boris Folgmann mailto:[EMAIL PROTECTED] Folgmann IT-Consulting http://www.folgmann.de - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Transaction Tokens
The struts-example webapp uses tokens and the Action class' javadoc is informative. David From: Alban Soupper [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List (E-mail) [EMAIL PROTECTED] Subject: Transaction Tokens Date: Tue, 4 Mar 2003 15:24:32 +0100 Hi all, I really did not found any answer to this simple question: How do we use the transaction token mechanism? How to avoid the double submit problem ? Tanks, Alban. ** 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 at postmaster.eim.ch. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
BEA's Java Page Flow
Anyone care to comment on the Java Page Flow thing that BEA is selling? It's a collection of tags and some IDE wrapped around Struts to make life even easier for web app developers. http://dev2dev.bea.com/articles/Dew.jsp More proof that Struts in right on the mark? -Original Message- From: David Graham [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 04, 2003 9:39 AM To: [EMAIL PROTECTED] Subject: Re: Transaction Tokens The struts-example webapp uses tokens and the Action class' javadoc is informative. David From: Alban Soupper [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List (E-mail) [EMAIL PROTECTED] Subject: Transaction Tokens Date: Tue, 4 Mar 2003 15:24:32 +0100 Hi all, I really did not found any answer to this simple question: How do we use the transaction token mechanism? How to avoid the double submit problem ? Tanks, Alban. ** 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 at postmaster.eim.ch. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail - 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: Anyone using JBoss with custom validator rules?
What version of JBoss are you using? I have successfully gotten custom validators to work without a hitch on JBoss 3.0.x (all versions beta through latest). All validator classes and jars are contained in the war like this: /WEB-INF/*.tld /WEB-INF/web.xml /WEB-INF/struts-config.xml /WEB-INF/validation.xml /WEB-INF/validator-rules.xml /WEB-INF/custom-validator-rules.xml /WEB-INF/lib/commons-beanutils.jar /WEB-INF/lib/commons-collections-2.0.jar /WEB-INF/lib/commons-digester.jar /WEB-INF/lib/commons-logging.jar /WEB-INF/lib/commons-validator.jar /WEB-INF/lib/jakarta-oro.jar /WEB-INF/lib/struts.jar /WEB-INF/classes/**/*.properties /WEB-INF/classes/**/*.class chris - Original Message - From: Brian Topping [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, March 03, 2003 5:31 PM Subject: Anyone using JBoss with custom validator rules? Hi all, I have Validator operational with two-password validation along the lines of what is in the developer guide. I've found that the custom validator function can be found when the setup is running under standalone Tomcat 4.0.x, but not when that tomcat is running under JBoss, I get the attached NoClassDefFoundError exception. I've traced the cause of the exception down to Line 367 of Validator.java v1.11: Method m = c.getMethod(va.getMethod(), paramClass); The class that getMethod is operating on was loaded via getClassLoader().loadClass() a dozen or so lines earlier. I presume the problem then is not related to the class itself, but the method signature classes. I've checked a hundred times that the classpath is clean of everything but the code in the nightly build. There are no additional or incorrect validator jars anywhere else on the classpath during compile or deployment, which is what I am implying from the exception I am getting below. I've also checked that the correct validator jar is in the JBoss deployment, inside the WAR file along with the rest of the correctly operating Struts jars. It looks like an incompatibility at best from where I am right now... Any ideas appreciated. Brian java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39 ) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl . java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java: 2 80) at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProces s or.java:479) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1420) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:520) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) ... Caused by: java.lang.NoClassDefFoundError: org/apache/commons/validator/ValidatorAction at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:1627) at java.lang.Class.privateGetPublicMethods(Class.java:1655) at java.lang.Class.getMethod0(Class.java:1744) at java.lang.Class.getMethod(Class.java:963) at org.apache.commons.validator.Validator.validateFieldForRule(Validator.java:3 9 3) at org.apache.commons.validator.Validator.validateField(Validator.java:512) at org.apache.commons.validator.Validator.validate(Validator.java:551) at org.apache.struts.validator.ValidatorForm.validate(ValidatorForm.java:152) at com.bill2.incamail.web.controller.DomainSetupAction.choosePlan(DomainSetupAc t ion.java:186) ... 42 more - 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: How fast is bean:message?
Great! Let us know when you've got it done. chris - Original Message - From: Boris Folgmann [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Tuesday, March 04, 2003 4:33 AM Subject: Re: How fast is bean:message? David Graham wrote: It's as fast as it takes to lookup a key in a hashmap. If that's unacceptable then you should write a different jsp for each language with hardcoded text. I'm searching a more automated solution. If the design has to be changed every translated JSP should be changed automatically, so something like a preprocessor would be great. cu, boris -- Dipl.-Inf. Boris Folgmann mailto:[EMAIL PROTECTED] Folgmann IT-Consulting http://www.folgmann.de - 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 Beans: Design Question
On Tue, 4 Mar 2003 08:51:39 -0500 Curley, John [EMAIL PROTECTED] wrote: The reason why I ask is because you can obtain information from a request via the information sent by the HTTP/Post/Get. If I have a bunch of widgets in a form I can just obtain the info in the action this way: request.getParameter(widgetName) Another reason that I didn't see mentioned is: often times you usually need to the information from a form into the business layer. You don't really want to pass the servlet stuff (request,etc) over into the other layer so usually you transfer the request information into a business object (often called a Data Transfer Object or Value Object). Using BeanUtils makes it very easy to copy all of your form bean parameters in one fell swoop into this business object: BeanUtils.copyProperties( businessObject, formBean ); So having all of your request information in a formBean is usually very convenient and it makes it very easy to hand off the information to the business logic of your application. -- Rick Reumann - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DynaBeans
This is a wild guess, but... are you using getProperty() instead of get( property ) ? Mark Lowe wrote: Hello Sorry another dynabeans question I'm getting NoSuchMethodException when i can see that the properties i wish to access are available (using the describes to produce a map and exstracting the names with the keySet() method thanks 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: DynaBeans
Has nobody anything to say on this problem? e.g. DynaBean myBean = DynaBean newBean = mybasicdynaclass.newInstance(); Map myMap = myBean.descibe(); Object[] keys = mymap.keySet().toArray(); for(int = i;i keys.length;i++) { String key = keys[i].toString(); newBean.set(key,SOME VALUE); } now i'm getting a NoSuchMethodException when i the keys i'm extracting are fine. when i'm setting values i'm getting Illegalinputexception or such I'm getting my original dynaBeans from ResultSetDynaClass.. which could be a potental issue but the same happens when i copy the properties to a xerox bean exactly like the docs example... It could also be My BasicDynaBean constructer many thanks mark Martedì, 4 mar 2003, alle 15:02 Europe/Rome, Mark Lowe ha scritto: Hello Sorry another dynabeans question I'm getting NoSuchMethodException when i can see that the properties i wish to access are available (using the describes to produce a map and exstracting the names with the keySet() method thanks 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: DynaBeans
no sorry.. gosh that would be simple... :) Martedì, 4 mar 2003, alle 15:50 Europe/Rome, Jose Gonzalez Gomez ha scritto: This is a wild guess, but... are you using getProperty() instead of get( property ) ? Mark Lowe wrote: Hello Sorry another dynabeans question I'm getting NoSuchMethodException when i can see that the properties i wish to access are available (using the describes to produce a map and exstracting the names with the keySet() method thanks 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DynaBeans
In fact over the last 3 days i've tried using bean.set(name,value); PropertyUtils.setProperty(bean,name,value); etc, etc... anything that looks vaguely possible i've tried I know that commons.beanutils is kinda green so i've been expecting problems.. mutabledynaclass would theoretically work as well but i'd prefer to do things this way until the mutabledynaclass spec has solidifed... cheers mark Martedì, 4 mar 2003, alle 15:54 Europe/Rome, Mark Lowe ha scritto: no sorry.. gosh that would be simple... :) Martedì, 4 mar 2003, alle 15:50 Europe/Rome, Jose Gonzalez Gomez ha scritto: This is a wild guess, but... are you using getProperty() instead of get( property ) ? Mark Lowe wrote: Hello Sorry another dynabeans question I'm getting NoSuchMethodException when i can see that the properties i wish to access are available (using the describes to produce a map and exstracting the names with the keySet() method thanks 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] - 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: [OT] Text editor usage (was RE: [OT]: What is vim?)
I think an open plugin-based IDE like Eclipse can do much, much more.. by actually embedding Emacs within the IDE as a true component plugin, much like it allows the embedding of multiple HTML/JSP editors, viewers or VCM tools etc. Amen! I'm torn between the two and having the power of the Emacs editor inside of Eclipse would be my dream! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How fast is bean:message?
The only caveat I would give is that messages that have parameters are on the order of 100 times slower than those that do not. I did some tests on this a while back and found that the MessageFormat class is the bottleneck. I wrote some unit tests against MessageTag that tracked the time to perform the parsing. Taking the String Humpty Dumpty sat on a wall as the first test case and {0} sat on the wall as the second (and passing it the appropriate parameter) gave the following results: 50 unparameterized requests took 296 milliseconds. // Humpty Dumpty sat on a wall 5000 parameterized requests took 10607 milliseconds.// {0} sat on a wall YMMV, but if so let's try and find out why. The disparity here is just incredile. -= J David Graham wrote: It's as fast as it takes to lookup a key in a hashmap. If that's unacceptable then you should write a different jsp for each language with hardcoded text. I'm searching a more automated solution. If the design has to be changed every translated JSP should be changed automatically, so something like a preprocessor would be great. cu, boris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How fast is bean:message?
MessageFormat has always been very slow. I wonder how much faster this would be going through a better templating system like Velocity. I'm a little swamped right now or I would be posting the difference in this message. BAL From: James Childers [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: RE: How fast is bean:message? Date: Tue, 4 Mar 2003 09:17:57 -0600 The only caveat I would give is that messages that have parameters are on the order of 100 times slower than those that do not. I did some tests on this a while back and found that the MessageFormat class is the bottleneck. I wrote some unit tests against MessageTag that tracked the time to perform the parsing. Taking the String Humpty Dumpty sat on a wall as the first test case and {0} sat on the wall as the second (and passing it the appropriate parameter) gave the following results: 50 unparameterized requests took 296 milliseconds. // Humpty Dumpty sat on a wall 5000 parameterized requests took 10607 milliseconds. // {0} sat on a wall YMMV, but if so let's try and find out why. The disparity here is just incredile. -= J David Graham wrote: It's as fast as it takes to lookup a key in a hashmap. If that's unacceptable then you should write a different jsp for each language with hardcoded text. I'm searching a more automated solution. If the design has to be changed every translated JSP should be changed automatically, so something like a preprocessor would be great. cu, boris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How fast is bean:message?
That's not all that surprising because the java.text.* classes have always been rather slow. I think they create a lot of objects while processing text which slows them down. I've found that I don't use paramterized messages very often anyway. David The only caveat I would give is that messages that have parameters are on the order of 100 times slower than those that do not. I did some tests on this a while back and found that the MessageFormat class is the bottleneck. I wrote some unit tests against MessageTag that tracked the time to perform the parsing. Taking the String Humpty Dumpty sat on a wall as the first test case and {0} sat on the wall as the second (and passing it the appropriate parameter) gave the following results: 50 unparameterized requests took 296 milliseconds. // Humpty Dumpty sat on a wall 5000 parameterized requests took 10607 milliseconds. // {0} sat on a wall YMMV, but if so let's try and find out why. The disparity here is just incredile. -= J David Graham wrote: It's as fast as it takes to lookup a key in a hashmap. If that's unacceptable then you should write a different jsp for each language with hardcoded text. I'm searching a more automated solution. If the design has to be changed every translated JSP should be changed automatically, so something like a preprocessor would be great. cu, boris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] Text editor usage (was RE: [OT]: What is vim?)
I don't use it but eclipse does have an emacs keybindings preference. David From: James Higginbotham [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED],[EMAIL PROTECTED] Subject: RE: [OT] Text editor usage (was RE: [OT]: What is vim?) Date: Tue, 4 Mar 2003 09:15:35 -0600 I think an open plugin-based IDE like Eclipse can do much, much more.. by actually embedding Emacs within the IDE as a true component plugin, much like it allows the embedding of multiple HTML/JSP editors, viewers or VCM tools etc. Amen! I'm torn between the two and having the power of the Emacs editor inside of Eclipse would be my dream! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Proper way to Link
Hi all, I have two action classes that used to handle separate forms that I want to merge into one. Rather than delete one of the action classes I will just have the mappings for it go from the previous file to it. So I have dummy handlers in the first file that does a return new ActionForward(/blah.do); to get to the second action. Just out of curiousity. Is this the proper way to link actions? Is there a better way? I'm sure alot of people do this just to break up larger actions to make it more managable but I can't find any references for this on the Struts site and via Google (Linking Struts Actions) Thanks. -Tim - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How fast is bean:message?
Do we have an idea if same is true of the JSTL FMT tag? (bean tags are now redundant to JSTL). .V David Graham wrote: That's not all that surprising because the java.text.* classes have always been rather slow. I think they create a lot of objects while processing text which slows them down. I've found that I don't use paramterized messages very often anyway. David The only caveat I would give is that messages that have parameters are on the order of 100 times slower than those that do not. I did some tests on this a while back and found that the MessageFormat class is the bottleneck. I wrote some unit tests against MessageTag that tracked the time to perform the parsing. Taking the String Humpty Dumpty sat on a wall as the first test case and {0} sat on the wall as the second (and passing it the appropriate parameter) gave the following results: 50 unparameterized requests took 296 milliseconds.// Humpty Dumpty sat on a wall 5000 parameterized requests took 10607 milliseconds.// {0} sat on a wall YMMV, but if so let's try and find out why. The disparity here is just incredile. -= J David Graham wrote: It's as fast as it takes to lookup a key in a hashmap. If that's unacceptable then you should write a different jsp for each language with hardcoded text. I'm searching a more automated solution. If the design has to be changed every translated JSP should be changed automatically, so something like a preprocessor would be great. cu, boris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How fast is bean:message?
It's up to the JSTL implementations to decide how to implement the message tag. My guess is that they will use the MessageFormat class. You could always look at the jakarta taglibs implementation to see how they do it. David From: Vic Cekvenich [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: How fast is bean:message? Date: Tue, 04 Mar 2003 10:39:06 -0500 Do we have an idea if same is true of the JSTL FMT tag? (bean tags are now redundant to JSTL). .V David Graham wrote: That's not all that surprising because the java.text.* classes have always been rather slow. I think they create a lot of objects while processing text which slows them down. I've found that I don't use paramterized messages very often anyway. David The only caveat I would give is that messages that have parameters are on the order of 100 times slower than those that do not. I did some tests on this a while back and found that the MessageFormat class is the bottleneck. I wrote some unit tests against MessageTag that tracked the time to perform the parsing. Taking the String Humpty Dumpty sat on a wall as the first test case and {0} sat on the wall as the second (and passing it the appropriate parameter) gave the following results: 50 unparameterized requests took 296 milliseconds.// Humpty Dumpty sat on a wall 5000 parameterized requests took 10607 milliseconds.// {0} sat on a wall YMMV, but if so let's try and find out why. The disparity here is just incredile. -= J David Graham wrote: It's as fast as it takes to lookup a key in a hashmap. If that's unacceptable then you should write a different jsp for each language with hardcoded text. I'm searching a more automated solution. If the design has to be changed every translated JSP should be changed automatically, so something like a preprocessor would be great. cu, boris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: AW: AW: Tiles Body question
Yes, the Tag's surrounding tiles:insert are: nested:form ... nested:nest ... nested:nest ... table ... tr ... td ... tiles:insert ... Do you know a work around? Thank's Roland -Ursprüngliche Nachricht- Von: Cedric Dumoulin [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 4. März 2003 11:33 An: Struts Users Mailing List Betreff: Re: AW: AW: Tiles Body question The configuration you propose should work. All example ship with struts are based on this kind of nesting (portal, tabs, menu, ...). The reported exception usually appear when an insert ... is performed inside a tag implementing the BodyTag interface (like insert, iterate, ...). Is there a tag surrounding tiles:insert ... in your memberDetail.jsp file ? Cedric Roland Berger wrote: Hi Cedric Sorry, but I can not find the problem even with the examples. I belive I do it the same way as it is done there. May be you can have a look at the code below: *** tiles-defs.xml snippets *** definition name=.detailLayout path=/WEB-INF/common/layouts/detailLayout.jsp ... /definition definition name=.pages.member.detail.show extends=.detailLayout put name=body value=.pages.member.detail.show.head/ /definition definition name=.pages.member.detail.show.head path=/WEB-INF/pages/memberDetail.jsp put name=bodyHead value=/WEB-INF/pages/memberDetailShowHead.jsp/ /definition involved jsp page snippets File: detailLayout.jsp tiles:insert attribute=body / File: memberDetail.jsp tiles:insert attribute=bodyHead flush=false/ Remark: If I don't set flush to false I get: Can't insert page '/WEB-INF/pages/memberDetailShowHead.jsp' : Illegal to flush within a custom tag java.io.IOException: Illegal to flush within a custom tag at javax.servlet.jsp.tagext.BodyContent.flush(BodyContent.java:115) at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.j a va:817) at Again, the page memberDetailShowHead.jsp is put at the beginning of memberDetail.jsp and not where the tiles:insert attribute=bodyHead flush=false/ tag is. Thank you very much Roland -Ursprüngliche Nachricht- Von: Cedric Dumoulin [mailto:[EMAIL PROTECTED] Gesendet: Montag, 3. März 2003 18:08 An: Struts Users Mailing List Betreff: Re: AW: Tiles Body question The examples in struts-documentation use a master layout (classicLayout.jsp), and the body is often made of tiles inserted with another layout (like columnsLayout, vboxLayout, tabsLayout...). You can easily define your own layout with an insert. It is also possible to insert the definition corresponding to a page inside a nested bodies (see the tabs in the example directory). Maybe I have miss something in what you are trying to do ... Cedric Roland Berger wrote: Yes, that's exactly what I also want to do. But it seems that I missed the big picture. When I set flush=true I get a Illegal to flush error. If I set flush=false the tile I want to insert into the body template is inserted at the top of the page and not where the insert tag is. Can you give a small example with tiles-defs.xml and the JSP Part? ( see also thread: 'tiles insert in sub layout' ) Thanks a lot. Roland. -Ursprüngliche Nachricht- Von: Cedric Dumoulin [mailto:[EMAIL PROTECTED] Gesendet: Samstag, 22. Februar 2003 14:13 An: Struts Users Mailing List Betreff: Re: Tiles Body question You can have a body acting as a body template which in turn insert other bodies ... Cedric James Prance wrote: In a classic template, the header, footer and menu could be common across your application. However the body would likely change depending on the business process. Is there a way to alter the 'body' value dynamically? I'm a bit confused by this at the moment and my current understanding is that you need a new 'layout' for each differing 'body' page.. is this correct or am i totally arse about face? James - 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] - 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
RE: How fast is bean:message?
Yes, Jakarta's JSTL implementation makes use of MessageFormat for both the EL and RT tag flavors. See org.apache.taglibs.standard.tag.common.fmt.MessageSupport. -Original Message- From: Vic Cekvenich [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 04, 2003 10:39 AM To: [EMAIL PROTECTED] Subject: Re: How fast is bean:message? Do we have an idea if same is true of the JSTL FMT tag? (bean tags are now redundant to JSTL). .V David Graham wrote: That's not all that surprising because the java.text.* classes have always been rather slow. I think they create a lot of objects while processing text which slows them down. I've found that I don't use paramterized messages very often anyway. David The only caveat I would give is that messages that have parameters are on the order of 100 times slower than those that do not. I did some tests on this a while back and found that the MessageFormat class is the bottleneck. I wrote some unit tests against MessageTag that tracked the time to perform the parsing. Taking the String Humpty Dumpty sat on a wall as the first test case and {0} sat on the wall as the second (and passing it the appropriate parameter) gave the following results: 50 unparameterized requests took 296 milliseconds.// Humpty Dumpty sat on a wall 5000 parameterized requests took 10607 milliseconds.// {0} sat on a wall YMMV, but if so let's try and find out why. The disparity here is just incredile. -= J David Graham wrote: It's as fast as it takes to lookup a key in a hashmap. If that's unacceptable then you should write a different jsp for each language with hardcoded text. I'm searching a more automated solution. If the design has to be changed every translated JSP should be changed automatically, so something like a preprocessor would be great. cu, boris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail - 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 reuse mappings and jsp pages
Hi all. I'm trying to model a set of Anagraphics objects; each object extends a base abstract class, and only adds getter and setter method specific to it; all these object behave the same way, in the sense that all I have to do on them is reading, listing, updating, inserting. I can already persist those object in and independent way, so Action Objects are written assuming to use the base class, and don't have to know what the exact runtime class is; what I would like to do now is: 1) write action-mappings in struts-config in a similar independent way; this seems difficult to me because in the mapping I have to specify the name of the ActionForm bean to use, and therefore it's class! I tried do subclass ActionServlet, and determine the class of the Bean to use using a runtime request parameter, if present, instead of using information from the mapping; this works, but not all work is done by ActionServlet !! For example the html:form tag uses its action attribute to look up the bean name (and type) to use, so I get stuck again, because it tries to instantiate an abstract class; even if this class was not abstract i get a wrong object !!. Should I extend this tag ? And what else ? Is there a better way ? 2) write jsp pages in a similar independent way. This seems more difficult and maybe not so useful, also considering that rendering appropriate input forms, or listing tables using generic jsp pages would not lead to frendly interfaces, I think!! Suggestions are welcome. Renato Renato Romano Sistemi e Telematica S.p.A. Calata Grazie - Vial Al Molo Giano 16127 - GENOVA e-mail: [EMAIL PROTECTED] Tel.: 010 2712603 _ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: AW: AW: AW: Tiles Body question
Roland Berger wrote: Yes, the Tag's surrounding tiles:insert are: nested:form ... nested:nest ... nested:nest ... table ... tr ... td ... tiles:insert ... Do you know a work around? No workaround apart not using nested:nest . The problem is not from Tiles, but from the jsp spec: it is not allowed to flush inside a BodyTag. Also, your webserver seem to deal badly with inclusion because when you set flush=false, the tiles should normally appear at its right place, not at the top of page. What webserver do you use ? Cedric Thank's Roland -Ursprüngliche Nachricht- Von: Cedric Dumoulin [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 4. März 2003 11:33 An: Struts Users Mailing List Betreff: Re: AW: AW: Tiles Body question The configuration you propose should work. All example ship with struts are based on this kind of nesting (portal, tabs, menu, ...). The reported exception usually appear when an insert ... is performed inside a tag implementing the BodyTag interface (like insert, iterate, ...). Is there a tag surrounding tiles:insert ... in your memberDetail.jsp file ? Cedric - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to reuse mappings and jsp pages
Not to mention the validator and everything uses BeanUtils and PropertyUtils from commons... What remains to be seen is if these will introspect the base (abstract) class or the proper (bean) class, but either way i fear they will miss out on the underlying fields. i havent personnally tested this, but perhaps the introspection is smart enough to get the properties from extended classes. You've also touched on some things I've experienced, i.e. tight configuration between tiers in the Struts-MVC implementation. I've been looking for a more loose way too. Regards, Mark *** REPLY SEPARATOR *** On 03/04/2003 at 5:00 PM Renato Romano wrote: Hi all. I'm trying to model a set of Anagraphics objects; each object extends a base abstract class, and only adds getter and setter method specific to it; all these object behave the same way, in the sense that all I have to do on them is reading, listing, updating, inserting. I can already persist those object in and independent way, so Action Objects are written assuming to use the base class, and don't have to know what the exact runtime class is; what I would like to do now is: 1) write action-mappings in struts-config in a similar independent way; this seems difficult to me because in the mapping I have to specify the name of the ActionForm bean to use, and therefore it's class! I tried do subclass ActionServlet, and determine the class of the Bean to use using a runtime request parameter, if present, instead of using information from the mapping; this works, but not all work is done by ActionServlet !! For example the html:form tag uses its action attribute to look up the bean name (and type) to use, so I get stuck again, because it tries to instantiate an abstract class; even if this class was not abstract i get a wrong object !!. Should I extend this tag ? And what else ? Is there a better way ? 2) write jsp pages in a similar independent way. This seems more difficult and maybe not so useful, also considering that rendering appropriate input forms, or listing tables using generic jsp pages would not lead to frendly interfaces, I think!! Suggestions are welcome. Renato Renato Romano Sistemi e Telematica S.p.A. Calata Grazie - Vial Al Molo Giano 16127 - GENOVA e-mail: [EMAIL PROTECTED] Tel.: 010 2712603 _ - 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]
[HK] List backed parameter validation
Is it possible to add a validation rule (required for ex.) to all list backed parameters in a dynamic form? If yes, how is it defined in validation.xml / validation-rules.xml? __ Do you Yahoo!? Yahoo! Tax Center - forms, calculators, tips, more http://taxes.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
struts validation question
Hi, I have 3 questiona about handling validation in struts 1.1b3, using dyna form and using validation.xml Q1, Suppose i have to validate date for 3 different format depending upon a value set in sessio, so if the value of fomrat is '1' date format is dd/MM/yy, if '2' date format is MM/dd/yy and '3' date format is yy/MM/dd Also how to use mask for field entry Q2, Validating numeric field, for '.' and ',' for decimal values, like in US . is used for decimal while in france , is used for decimal value is double. so how do i validate depending upon local, or using a value set in session, like if the valus is '1' then the valid decimal is . and if the vaus is 2 the valid decimal is , Q3, Is there a way to validate number of digits before decimal and after decimal, like valid value is 123.23 but not 12.323 Any code or defination in validation.xml will really help, Do i have to write custom validtor for above requirements or is there a way to do it in struts Ashish __ Do you Yahoo!? Yahoo! Tax Center - forms, calculators, tips, more http://taxes.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: AW: AW: AW: Tiles Body question
Tomcat 4.1.18 Can I teach it to deal right with inclusion? Regards Roland -Ursprüngliche Nachricht- Von: Cedric Dumoulin [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 4. März 2003 16:59 An: Struts Users Mailing List Betreff: Re: AW: AW: AW: Tiles Body question Roland Berger wrote: Yes, the Tag's surrounding tiles:insert are: nested:form ... nested:nest ... nested:nest ... table ... tr ... td ... tiles:insert ... Do you know a work around? No workaround apart not using nested:nest . The problem is not from Tiles, but from the jsp spec: it is not allowed to flush inside a BodyTag. Also, your webserver seem to deal badly with inclusion because when you set flush=false, the tiles should normally appear at its right place, not at the top of page. What webserver do you use ? Cedric Thank's Roland -Ursprüngliche Nachricht- Von: Cedric Dumoulin [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 4. März 2003 11:33 An: Struts Users Mailing List Betreff: Re: AW: AW: Tiles Body question The configuration you propose should work. All example ship with struts are based on this kind of nesting (portal, tabs, menu, ...). The reported exception usually appear when an insert ... is performed inside a tag implementing the BodyTag interface (like insert, iterate, ...). Is there a tag surrounding tiles:insert ... in your memberDetail.jsp file ? Cedric - 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]
Synch Token and DispatchActions
I am attempting to use the synchronizer token in a DispatchAction. I have two methods view() and update(). When the user first enters the page they will be calling view() Once the response page has loaded and they submit the form in the page it will call update(). I cant seem to get the token working right. It is always invalid? Basically I have the following: External action calls MyAction.do?method=view public ActionForward view(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { ... Some code ... saveToken(request); ...Some other code ... } Response sends MyPage.jsp with a form in it and the input type=hidden name=token piece in the jsp. I enter data in the form and hit submit which calls MyAction.do?method=update public ActionForward update(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { ... Some code ... saveToken(request); if (!isTokenValid(request)) { System.out.println(TOKEN INVALID!); ActionForward forwardTo = view(mapping, form, request, response); return forwardTo; } else { System.out.println(TOKEN IS VALID. CONTINUING!); resetToken(request); } ...Some other code ... } What I want is to keep a user from updating the form again by hitting the refresh button. But it is ok to resubmit the form with new data (that validation will be handled client side). What am I missing?? Dave Patton
RE: How to reuse mappings and jsp pages
I'm not sure I understood your answer. To get closer to the problem: in the action mapping for the path, say, listAnag(.do), I have to specify the name attribute, which determines the class of objects I have to retrieve and then list in the result page. Suppose I have a BaseAnagForm class (which extends ActionForm) and then CatAnag and DogAnag, both extending BaseAnag. What i'd like to do is determine wheter to list Cats or Dogs, using some other parameter, because I don't want to determine this at deploy time. A solution of course would be to define several mappings in struts-config, like: action-mappings actionpath=/listCatsAnag type=myPackage.ListAnagAction name=cats scope=session input=--- validate=true forward name=success path=/showCatsAnag.jsp/ forward name=failure path=/failure.jsp/ /action actionpath=/listDogsAnag type=myPackage.ListAnagAction name=dogs scope=session input=--- validate=true forward name=success path=/showDogsAnag.jsp/ forward name=failure path=/failure.jsp/ /action Where dogs is a Bean of class DogsAnag and cats is a bean of class CatsAnag. What I would like to do is configure a UNIQUE action element, because I have lots of those objects, and the things I have to do on them (list, save, retrieve) are substantially the same... Thanks Renato Romano Sistemi e Telematica S.p.A. Calata Grazie - Vial Al Molo Giano 16127 - GENOVA e-mail: [EMAIL PROTECTED] Tel.: 010 2712603 _ -Original Message- From: Mark [mailto:[EMAIL PROTECTED] Sent: martedì 4 marzo 2003 17.03 To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: How to reuse mappings and jsp pages Not to mention the validator and everything uses BeanUtils and PropertyUtils from commons... What remains to be seen is if these will introspect the base (abstract) class or the proper (bean) class, but either way i fear they will miss out on the underlying fields. i havent personnally tested this, but perhaps the introspection is smart enough to get the properties from extended classes. You've also touched on some things I've experienced, i.e. tight configuration between tiers in the Struts-MVC implementation. I've been looking for a more loose way too. Regards, Mark *** REPLY SEPARATOR *** On 03/04/2003 at 5:00 PM Renato Romano wrote: Hi all. I'm trying to model a set of Anagraphics objects; each object extends a base abstract class, and only adds getter and setter method specific to it; all these object behave the same way, in the sense that all I have to do on them is reading, listing, updating, inserting. I can already persist those object in and independent way, so Action Objects are written assuming to use the base class, and don't have to know what the exact runtime class is; what I would like to do now is: 1) write action-mappings in struts-config in a similar independent way; this seems difficult to me because in the mapping I have to specify the name of the ActionForm bean to use, and therefore it's class! I tried do subclass ActionServlet, and determine the class of the Bean to use using a runtime request parameter, if present, instead of using information from the mapping; this works, but not all work is done by ActionServlet !! For example the html:form tag uses its action attribute to look up the bean name (and type) to use, so I get stuck again, because it tries to instantiate an abstract class; even if this class was not abstract i get a wrong object !!. Should I extend this tag ? And what else ? Is there a better way ? 2) write jsp pages in a similar independent way. This seems more difficult and maybe not so useful, also considering that rendering appropriate input forms, or listing tables using generic jsp pages would not lead to frendly interfaces, I think!! Suggestions are welcome. Renato Renato Romano Sistemi e Telematica S.p.A. Calata Grazie - Vial Al Molo Giano 16127 - GENOVA e-mail: [EMAIL PROTECTED] Tel.: 010 2712603 _ - 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]
AW: AW: AW: AW: Tiles Body question
Hi Cedric Thanks a lot for your help. I could rearange and rename the tags like follows: html:form ... tiles:insert ... nested:nest ... nested:nest ... table ... tr ... td ... Now it works. Thanks Roland -Ursprüngliche Nachricht- Von: Cedric Dumoulin [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 4. März 2003 16:59 An: Struts Users Mailing List Betreff: Re: AW: AW: AW: Tiles Body question Roland Berger wrote: Yes, the Tag's surrounding tiles:insert are: nested:form ... nested:nest ... nested:nest ... table ... tr ... td ... tiles:insert ... Do you know a work around? No workaround apart not using nested:nest . The problem is not from Tiles, but from the jsp spec: it is not allowed to flush inside a BodyTag. Also, your webserver seem to deal badly with inclusion because when you set flush=false, the tiles should normally appear at its right place, not at the top of page. What webserver do you use ? Cedric Thank's Roland -Ursprüngliche Nachricht- Von: Cedric Dumoulin [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 4. März 2003 11:33 An: Struts Users Mailing List Betreff: Re: AW: AW: Tiles Body question The configuration you propose should work. All example ship with struts are based on this kind of nesting (portal, tabs, menu, ...). The reported exception usually appear when an insert ... is performed inside a tag implementing the BodyTag interface (like insert, iterate, ...). Is there a tag surrounding tiles:insert ... in your memberDetail.jsp file ? Cedric - 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: Synch Token and DispatchActions
On your update(...) method you shouldn't call saveToken before you validate your token. What this does is update the current session with a new token, so the token you submitted with your from will not match the new one in the session. danny -Original Message- From: Dave Patton [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 04, 2003 8:38 AM To: [EMAIL PROTECTED] Subject: Synch Token and DispatchActions I am attempting to use the synchronizer token in a DispatchAction. I have two methods view() and update(). When the user first enters the page they will be calling view() Once the response page has loaded and they submit the form in the page it will call update(). I cant seem to get the token working right. It is always invalid? Basically I have the following: External action calls MyAction.do?method=view public ActionForward view(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { ... Some code ... saveToken(request); ...Some other code ... } Response sends MyPage.jsp with a form in it and the input type=hidden name=token piece in the jsp. I enter data in the form and hit submit which calls MyAction.do?method=update public ActionForward update(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { ... Some code ... saveToken(request); if (!isTokenValid(request)) { System.out.println(TOKEN INVALID!); ActionForward forwardTo = view(mapping, form, request, response); return forwardTo; } else { System.out.println(TOKEN IS VALID. CONTINUING!); resetToken(request); } ...Some other code ... } What I want is to keep a user from updating the form again by hitting the refresh button. But it is ok to resubmit the form with new data (that validation will be handled client side). What am I missing?? Dave Patton - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
ActionForm Does Not Contain Dynamically Set Data
I have a web page (the parent) that opens a child window using javascript. The parent window sets a field on the child window. The child window needs to use that data, as it is opening, to perform a DB query and display information on itself. The problem is that, even though the parent successfully sets the data on the child, I have no access to it in my ActionForm or in the request object. Is there a way to make that happen? __ Do you Yahoo!? Yahoo! Tax Center - forms, calculators, tips, more http://taxes.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
ExceptionHandler
I moved my ExceptionHandler from a global-exception to an exception in the action section. I no longer get the exception detail in the Globals.EXCEPTION_KEY location. Am I doing something wrong and it should be there, or has it moved, or do i need to define a Handler and override where the exception is put? Thanks Ray Madigan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] JavaScript: ActionForm Does Not Contain Dynamically Set Data
Please label JavaScript topics as [OT]. -- James Mitchell Web Developer/Struts Evangelist http://jakarta.apache.org/struts/ People demand freedom of speech to make up for the freedom of thought which they avoid. - Soren Aabye Kierkegaard (1813-1855) -Original Message- From: Art Vandalay [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 04, 2003 11:59 AM To: Struts Mailing List Subject: ActionForm Does Not Contain Dynamically Set Data I have a web page (the parent) that opens a child window using javascript. The parent window sets a field on the child window. The child window needs to use that data, as it is opening, to perform a DB query and display information on itself. The problem is that, even though the parent successfully sets the data on the child, I have no access to it in my ActionForm or in the request object. Is there a way to make that happen? __ Do you Yahoo!? Yahoo! Tax Center - forms, calculators, tips, more http://taxes.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: ActionForm Does Not Contain Dynamically Set Data
I don't believe this is off topic. This question regards how to get Struts to populate a form field that was set using Javascript. --- James Mitchell [EMAIL PROTECTED] wrote: Please label JavaScript topics as [OT]. -- James Mitchell Web Developer/Struts Evangelist http://jakarta.apache.org/struts/ People demand freedom of speech to make up for the freedom of thought which they avoid. - Soren Aabye Kierkegaard (1813-1855) -Original Message- From: Art Vandalay [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 04, 2003 11:59 AM To: Struts Mailing List Subject: ActionForm Does Not Contain Dynamically Set Data I have a web page (the parent) that opens a child window using javascript. The parent window sets a field on the child window. The child window needs to use that data, as it is opening, to perform a DB query and display information on itself. The problem is that, even though the parent successfully sets the data on the child, I have no access to it in my ActionForm or in the request object. Is there a way to make that happen? __ Do you Yahoo!? Yahoo! Tax Center - forms, calculators, tips, more http://taxes.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] __ Do you Yahoo!? Yahoo! Tax Center - forms, calculators, tips, more http://taxes.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: ActionForm Does Not Contain Dynamically Set Data
Are you saying that you open the window, then set a field value in that child window to something from the parent, and you want to use that value to do something on the server? why not pass the value as a querystring parameter? -Original Message- From: Art Vandalay [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 04, 2003 11:59 AM To: Struts Mailing List Subject: ActionForm Does Not Contain Dynamically Set Data I have a web page (the parent) that opens a child window using javascript. The parent window sets a field on the child window. The child window needs to use that data, as it is opening, to perform a DB query and display information on itself. The problem is that, even though the parent successfully sets the data on the child, I have no access to it in my ActionForm or in the request object. Is there a way to make that happen? __ Do you Yahoo!? Yahoo! Tax Center - forms, calculators, tips, more http://taxes.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to reuse mappings and jsp pages
I do something very similar to this. But Im not sure exactly what you are trying to do. If your base class is abstract and defines a general interface that the extending classes implement, like public Collection list ( ); and the classes that extend your base class implement this interface, all the action class has to do is call list on the object it holds and doesn't need to know if it is cats or dogs? Im not sure if this helps. -Original Message- From: Renato Romano [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 04, 2003 8:46 AM To: 'Struts Users Mailing List' Subject: RE: How to reuse mappings and jsp pages I'm not sure I understood your answer. To get closer to the problem: in the action mapping for the path, say, listAnag(.do), I have to specify the name attribute, which determines the class of objects I have to retrieve and then list in the result page. Suppose I have a BaseAnagForm class (which extends ActionForm) and then CatAnag and DogAnag, both extending BaseAnag. What i'd like to do is determine wheter to list Cats or Dogs, using some other parameter, because I don't want to determine this at deploy time. A solution of course would be to define several mappings in struts-config, like: action-mappings actionpath=/listCatsAnag type=myPackage.ListAnagAction name=cats scope=session input=--- validate=true forward name=success path=/showCatsAnag.jsp/ forward name=failure path=/failure.jsp/ /action actionpath=/listDogsAnag type=myPackage.ListAnagAction name=dogs scope=session input=--- validate=true forward name=success path=/showDogsAnag.jsp/ forward name=failure path=/failure.jsp/ /action Where dogs is a Bean of class DogsAnag and cats is a bean of class CatsAnag. What I would like to do is configure a UNIQUE action element, because I have lots of those objects, and the things I have to do on them (list, save, retrieve) are substantially the same... Thanks Renato Romano Sistemi e Telematica S.p.A. Calata Grazie - Vial Al Molo Giano 16127 - GENOVA e-mail: [EMAIL PROTECTED] Tel.: 010 2712603 _ -Original Message- From: Mark [mailto:[EMAIL PROTECTED] Sent: martedì 4 marzo 2003 17.03 To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: How to reuse mappings and jsp pages Not to mention the validator and everything uses BeanUtils and PropertyUtils from commons... What remains to be seen is if these will introspect the base (abstract) class or the proper (bean) class, but either way i fear they will miss out on the underlying fields. i havent personnally tested this, but perhaps the introspection is smart enough to get the properties from extended classes. You've also touched on some things I've experienced, i.e. tight configuration between tiers in the Struts-MVC implementation. I've been looking for a more loose way too. Regards, Mark *** REPLY SEPARATOR *** On 03/04/2003 at 5:00 PM Renato Romano wrote: Hi all. I'm trying to model a set of Anagraphics objects; each object extends a base abstract class, and only adds getter and setter method specific to it; all these object behave the same way, in the sense that all I have to do on them is reading, listing, updating, inserting. I can already persist those object in and independent way, so Action Objects are written assuming to use the base class, and don't have to know what the exact runtime class is; what I would like to do now is: 1) write action-mappings in struts-config in a similar independent way; this seems difficult to me because in the mapping I have to specify the name of the ActionForm bean to use, and therefore it's class! I tried do subclass ActionServlet, and determine the class of the Bean to use using a runtime request parameter, if present, instead of using information from the mapping; this works, but not all work is done by ActionServlet !! For example the html:form tag uses its action attribute to look up the bean name (and type) to use, so I get stuck again, because it tries to instantiate an abstract class; even if this class was not abstract i get a wrong object !!. Should I extend this tag ? And what else ? Is there a better way ? 2) write jsp pages in a similar independent way. This seems more difficult and maybe not so useful, also considering that rendering appropriate input forms, or listing tables using generic jsp pages would not lead to frendly interfaces, I think!! Suggestions are welcome. Renato Renato Romano Sistemi e Telematica S.p.A. Calata Grazie - Vial Al Molo Giano 16127 - GENOVA e-mail: [EMAIL PROTECTED] Tel.: 010 2712603 _ - To unsubscribe,
RE: [OT] JavaScript: ActionForm Does Not Contain Dynamically Set Data
I have a web page (the parent) that opens a child window using javascript. The parent window sets a field on the child window. The child window needs to use that data, as it is opening, to perform a DB query and display information on itself. The problem is that, even though the parent successfully sets the data on the child, I have no access to it in my ActionForm or in the request object. Is there a way to make that happen? Your parent JSP has a form with one field. When you submit this form, the child *action* gets it, makes the connection, formats results and returns the forward that will display them. The details (the parent form is hidden and completely managed via Javascript, the child JSP appears in a new window) is pure Javascript tricks. This e-mail is intended only for the above addressee. It may contain privileged information. If you are not the addressee you must not copy, distribute, disclose or use any of the information in it. If you have received it in error please delete it and immediately notify the sender. Security Notice: all e-mail, sent to or from this address, may be accessed by someone other than the recipient, for system management and security reasons. This access is controlled under Regulation of Investigatory Powers Act 2000, Lawful Business Practises. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: ActionForm Does Not Contain Dynamically Set Data
Yes, a query parameter is an option. The reason I don't want to use query parameters is we have a standard to avoid using them if at all possible as they expose data to the user. This particular piece of data in question doesn't present a security risk by being exposed, but exposing it does go against our standards so I'd like to find another way to pass it. --- Miller, Jason [EMAIL PROTECTED] wrote: Are you saying that you open the window, then set a field value in that child window to something from the parent, and you want to use that value to do something on the server? why not pass the value as a querystring parameter? -Original Message- From: Art Vandalay [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 04, 2003 11:59 AM To: Struts Mailing List Subject: ActionForm Does Not Contain Dynamically Set Data I have a web page (the parent) that opens a child window using javascript. The parent window sets a field on the child window. The child window needs to use that data, as it is opening, to perform a DB query and display information on itself. The problem is that, even though the parent successfully sets the data on the child, I have no access to it in my ActionForm or in the request object. Is there a way to make that happen? __ Do you Yahoo!? Yahoo! Tax Center - forms, calculators, tips, more http://taxes.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Tax Center - forms, calculators, tips, more http://taxes.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] JavaScript: ActionForm Does Not Contain Dynamically Set Data
yes! if you are usine javascript you can do something like the following. in the parent create a hidden field html:hidden name=foo/ when the user submits the form have the onclick javacsript function run that sets the document.forms[0].foo.value = xxx; where xxx is the path to the value in the child window. -Original Message- From: ROSSEL Olivier [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 04, 2003 9:11 AM To: 'Struts Users Mailing List' Subject: RE: [OT] JavaScript: ActionForm Does Not Contain Dynamically Set Data I have a web page (the parent) that opens a child window using javascript. The parent window sets a field on the child window. The child window needs to use that data, as it is opening, to perform a DB query and display information on itself. The problem is that, even though the parent successfully sets the data on the child, I have no access to it in my ActionForm or in the request object. Is there a way to make that happen? Your parent JSP has a form with one field. When you submit this form, the child *action* gets it, makes the connection, formats results and returns the forward that will display them. The details (the parent form is hidden and completely managed via Javascript, the child JSP appears in a new window) is pure Javascript tricks. This e-mail is intended only for the above addressee. It may contain privileged information. If you are not the addressee you must not copy, distribute, disclose or use any of the information in it. If you have received it in error please delete it and immediately notify the sender. Security Notice: all e-mail, sent to or from this address, may be accessed by someone other than the recipient, for system management and security reasons. This access is controlled under Regulation of Investigatory Powers Act 2000, Lawful Business Practises. - 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]
Nested problem not finding the id
I'm currently using a nested:form part inside a nested:iterate loop to display a number of different items along with a corresponding edit and delete button for each item. The problem I have is that I can't refer to the id of the item using: nested:hidden property=addressId/ Could somebody tell me why it's looking for the addressId in my initial person form instead of the nested Address object which is contained with an arraylist in person, i.e. PersonForm Arraylist addressList where addressList is of type person. I get the following error message. ServletException in:/person/addperson.jsp] No getter method for property addressId of bean Personform This is the following code segment, note that the nested:write tag locates the address object correctly but the nested:hidden tag within the nested:form tag does not. Do I need to use nested:root or something? nested:iterate property=addressList scope=session tr td class=listtextnested:write property=addressId//td td class=listtextnested:write property=addressText//td td nested:form action=/addperson scope=session nested:hidden property=addressId/ nested:submit property=action bean:message key=button.edit/ /nested:submit /nested:form /td td nested:form action=/addperson scope=session nested:hidden property=addressId / nested:submit onclick=return confirm('Confirm Delete?'); property=action bean:message key=button.delete/ /nested:submit /nested:form /td /tr /nested:iterate Many thanks in advance, Jon. *-* Jonathan Holloway, Dept. Of Computer Science, Aberystwyth University, Ceredigion, West Wales, SY23 3DV. 07968 902140 http://users.aber.ac.uk/jph8 *-*
RE: [OT] JavaScript: ActionForm Does Not Contain Dynamically Set Data
I think you've misunderstood... The child is not an action, it is a page. A page that is opened using Javascript. In this case, the parent window is never submitted. From what I can tell about Struts (I'm pretty new to it) is that the only way to get data onto a form is via the submission of a form. That's a problem as I want to pass info between these 2 windows without using query parameters if at all possible (see my post from about 2 seconds ago as to why). --- ROSSEL Olivier [EMAIL PROTECTED] wrote: I have a web page (the parent) that opens a child window using javascript. The parent window sets a field on the child window. The child window needs to use that data, as it is opening, to perform a DB query and display information on itself. The problem is that, even though the parent successfully sets the data on the child, I have no access to it in my ActionForm or in the request object. Is there a way to make that happen? Your parent JSP has a form with one field. When you submit this form, the child *action* gets it, makes the connection, formats results and returns the forward that will display them. The details (the parent form is hidden and completely managed via Javascript, the child JSP appears in a new window) is pure Javascript tricks. This e-mail is intended only for the above addressee. It may contain privileged information. If you are not the addressee you must not copy, distribute, disclose or use any of the information in it. If you have received it in error please delete it and immediately notify the sender. Security Notice: all e-mail, sent to or from this address, may be accessed by someone other than the recipient, for system management and security reasons. This access is controlled under Regulation of Investigatory Powers Act 2000, Lawful Business Practises. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Tax Center - forms, calculators, tips, more http://taxes.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] JavaScript: ActionForm Does Not Contain Dynamically Set Data
I don't think this is just a javascript question - more like how does one use javascript and struts together to create a dynamic application. -Original Message- From: James Mitchell [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 04, 2003 9:03 AM To: 'Struts Users Mailing List' Subject: RE: [OT] JavaScript: ActionForm Does Not Contain Dynamically Set Data Please label JavaScript topics as [OT]. -- James Mitchell Web Developer/Struts Evangelist http://jakarta.apache.org/struts/ People demand freedom of speech to make up for the freedom of thought which they avoid. - Soren Aabye Kierkegaard (1813-1855) -Original Message- From: Art Vandalay [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 04, 2003 11:59 AM To: Struts Mailing List Subject: ActionForm Does Not Contain Dynamically Set Data I have a web page (the parent) that opens a child window using javascript. The parent window sets a field on the child window. The child window needs to use that data, as it is opening, to perform a DB query and display information on itself. The problem is that, even though the parent successfully sets the data on the child, I have no access to it in my ActionForm or in the request object. Is there a way to make that happen? __ Do you Yahoo!? Yahoo! Tax Center - forms, calculators, tips, more http://taxes.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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT]JavaScript: ActionForm Does Not Contain Dynamically Set Data
Is it necessary that the child window displays a location bar? Seems to me that if you are opening the window using javascript, you can certainly turn off the various features you won't need anyway. The way you describe this it sounds like a dialog box, so it seems to me the simplest response is the best - querystring it man. you know you want to. -Original Message- From: Art Vandalay [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 04, 2003 12:14 PM To: Struts Users Mailing List Subject: RE: ActionForm Does Not Contain Dynamically Set Data Yes, a query parameter is an option. The reason I don't want to use query parameters is we have a standard to avoid using them if at all possible as they expose data to the user. This particular piece of data in question doesn't present a security risk by being exposed, but exposing it does go against our standards so I'd like to find another way to pass it. --- Miller, Jason [EMAIL PROTECTED] wrote: Are you saying that you open the window, then set a field value in that child window to something from the parent, and you want to use that value to do something on the server? why not pass the value as a querystring parameter? -Original Message- From: Art Vandalay [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 04, 2003 11:59 AM To: Struts Mailing List Subject: ActionForm Does Not Contain Dynamically Set Data I have a web page (the parent) that opens a child window using javascript. The parent window sets a field on the child window. The child window needs to use that data, as it is opening, to perform a DB query and display information on itself. The problem is that, even though the parent successfully sets the data on the child, I have no access to it in my ActionForm or in the request object. Is there a way to make that happen? __ Do you Yahoo!? Yahoo! Tax Center - forms, calculators, tips, more http://taxes.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Tax Center - forms, calculators, tips, more http://taxes.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] JavaScript: ActionForm Does Not Contain Dynamically Set Data
Actually, this has nothing to do with Struts. If your script is not setting fields (on parent, top, child, whatever) correctly, then you cannot assume that it is a problem with Struts. Struts picks up when the request comes in, anything before that is outside the scope. On the other hand however, there are a lot of people on this list with JavaScript knowledge, but there are many more who would prefer that we use [OT] to designate that this discussion is not related. If you find that you are constantly dealing with JavaScript, perhaps (assuming you are on windoze) you can download and use the ScriptDebugger for IE. It lets you step through JavaScript with or without frames. Good Luck! -- James Mitchell Web Developer/Struts Evangelist http://jakarta.apache.org/struts/ People demand freedom of speech to make up for the freedom of thought which they avoid. - Soren Aabye Kierkegaard (1813-1855) -Original Message- From: Art Vandalay [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 04, 2003 12:06 PM To: Struts Users Mailing List Subject: RE: ActionForm Does Not Contain Dynamically Set Data I don't believe this is off topic. This question regards how to get Struts to populate a form field that was set using Javascript. --- James Mitchell [EMAIL PROTECTED] wrote: Please label JavaScript topics as [OT]. -- James Mitchell Web Developer/Struts Evangelist http://jakarta.apache.org/struts/ People demand freedom of speech to make up for the freedom of thought which they avoid. - Soren Aabye Kierkegaard (1813-1855) -Original Message- From: Art Vandalay [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 04, 2003 11:59 AM To: Struts Mailing List Subject: ActionForm Does Not Contain Dynamically Set Data I have a web page (the parent) that opens a child window using javascript. The parent window sets a field on the child window. The child window needs to use that data, as it is opening, to perform a DB query and display information on itself. The problem is that, even though the parent successfully sets the data on the child, I have no access to it in my ActionForm or in the request object. Is there a way to make that happen? __ Do you Yahoo!? Yahoo! Tax Center - forms, calculators, tips, more http://taxes.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] __ Do you Yahoo!? Yahoo! Tax Center - forms, calculators, tips, more http://taxes.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: [OT] JavaScript: ActionForm Does Not Contain Dynamically Set Data
Ray, I am doing that part. The problem is that I want that value to be available to the child's Action class ** as the child window is opening **. I am expecting it to be on the form, but the value in the form is null even though the value is successfully set on the child. How can I get Struts to set the value of this field on the form? There has to be a way because I've noticed in Struts that if you have a field defined on your JSP with no corresponding get/set methods on the Form, an exception is thrown when the window is opening. So Struts has to be doing some sort of validation between the JSP's form and the form class at window open time, but it doesn't seem to be setting the data. --- Ray Madigan [EMAIL PROTECTED] wrote: yes! if you are usine javascript you can do something like the following. in the parent create a hidden field html:hidden name=foo/ when the user submits the form have the onclick javacsript function run that sets the document.forms[0].foo.value = xxx; where xxx is the path to the value in the child window. -Original Message- From: ROSSEL Olivier [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 04, 2003 9:11 AM To: 'Struts Users Mailing List' Subject: RE: [OT] JavaScript: ActionForm Does Not Contain Dynamically Set Data I have a web page (the parent) that opens a child window using javascript. The parent window sets a field on the child window. The child window needs to use that data, as it is opening, to perform a DB query and display information on itself. The problem is that, even though the parent successfully sets the data on the child, I have no access to it in my ActionForm or in the request object. Is there a way to make that happen? Your parent JSP has a form with one field. When you submit this form, the child *action* gets it, makes the connection, formats results and returns the forward that will display them. The details (the parent form is hidden and completely managed via Javascript, the child JSP appears in a new window) is pure Javascript tricks. This e-mail is intended only for the above addressee. It may contain privileged information. If you are not the addressee you must not copy, distribute, disclose or use any of the information in it. If you have received it in error please delete it and immediately notify the sender. Security Notice: all e-mail, sent to or from this address, may be accessed by someone other than the recipient, for system management and security reasons. This access is controlled under Regulation of Investigatory Powers Act 2000, Lawful Business Practises. - 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!? Yahoo! Tax Center - forms, calculators, tips, more http://taxes.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] JavaScript: ActionForm Does Not Contain Dynamically Set Data
I think you've misunderstood... The child is not an action, it is a page. A page that is opened using Javascript. In this case, the parent window is never submitted. From what I can tell about Struts (I'm pretty new to it) is that the only way to get data onto a form is via the submission of a form. That's a problem as I want to pass info between these 2 windows without using query parameters if at all possible (see my post from about 2 seconds ago as to why). The point is to pass this info to server side at one moment or the other. Struts is designed with *actions* to retrieve/format data, and JSP just to display them. It seems that you want your child window to make things an action is supposed to do. This e-mail is intended only for the above addressee. It may contain privileged information. If you are not the addressee you must not copy, distribute, disclose or use any of the information in it. If you have received it in error please delete it and immediately notify the sender. Security Notice: all e-mail, sent to or from this address, may be accessed by someone other than the recipient, for system management and security reasons. This access is controlled under Regulation of Investigatory Powers Act 2000, Lawful Business Practises. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] Clearing up a misconception - was ActionForm Does Not Contain Dynamically Set Data
Yes, a query parameter is an option. The reason I don't want to use query parameters is we have a standard to avoid using them if at all possible as they expose data to the user. This particular piece of data in question doesn't present a security risk by being exposed, but exposing it does go against our standards so I'd like to find another way to pass it. I would just like to point out to anyone reading this list that the technique mentioned above, Security Through Obscurity, is totally invalid. Do not believe that simply because you are not explicitly displaying information in a browser to a user directly that you have done something that mitigates any security risks. A knowledgeable, lucky, or well-read user can find out anything the client is doing. I would just like to see people understand that whether you post or get, the information you submit is easily viewable by your users. I had to spend two hours explaining to one of my companies developers that just because he posted the user login instead of getting it, he was not providing adequate protection for the password. That is all.
RE: [OT] JavaScript: ActionForm Does Not Contain Dynamically Set Data
Mr. Police Man, If you read the question you'll see that my script *IS* setting field correctly ( I made that very clear in my original post). My question is how do I get those values set in an ActionForm when when the page is being displayed (not at submit time). --- James Mitchell [EMAIL PROTECTED] wrote: Actually, this has nothing to do with Struts. If your script is not setting fields (on parent, top, child, whatever) correctly, then you cannot assume that it is a problem with Struts. Struts picks up when the request comes in, anything before that is outside the scope. On the other hand however, there are a lot of people on this list with JavaScript knowledge, but there are many more who would prefer that we use [OT] to designate that this discussion is not related. If you find that you are constantly dealing with JavaScript, perhaps (assuming you are on windoze) you can download and use the ScriptDebugger for IE. It lets you step through JavaScript with or without frames. Good Luck! -- James Mitchell Web Developer/Struts Evangelist http://jakarta.apache.org/struts/ People demand freedom of speech to make up for the freedom of thought which they avoid. - Soren Aabye Kierkegaard (1813-1855) -Original Message- From: Art Vandalay [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 04, 2003 12:06 PM To: Struts Users Mailing List Subject: RE: ActionForm Does Not Contain Dynamically Set Data I don't believe this is off topic. This question regards how to get Struts to populate a form field that was set using Javascript. --- James Mitchell [EMAIL PROTECTED] wrote: Please label JavaScript topics as [OT]. -- James Mitchell Web Developer/Struts Evangelist http://jakarta.apache.org/struts/ People demand freedom of speech to make up for the freedom of thought which they avoid. - Soren Aabye Kierkegaard (1813-1855) -Original Message- From: Art Vandalay [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 04, 2003 11:59 AM To: Struts Mailing List Subject: ActionForm Does Not Contain Dynamically Set Data I have a web page (the parent) that opens a child window using javascript. The parent window sets a field on the child window. The child window needs to use that data, as it is opening, to perform a DB query and display information on itself. The problem is that, even though the parent successfully sets the data on the child, I have no access to it in my ActionForm or in the request object. Is there a way to make that happen? __ Do you Yahoo!? Yahoo! Tax Center - forms, calculators, tips, more http://taxes.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] __ Do you Yahoo!? Yahoo! Tax Center - forms, calculators, tips, more http://taxes.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] __ Do you Yahoo!? Yahoo! Tax Center - forms, calculators, tips, more http://taxes.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] JavaScript: ActionForm Does Not Contain Dynamically Set Data
Oliver, Thanks. As mentioned, I am new to Struts but have used other Java MVC frameworks that allow me to do what I am trying to do with Struts (e.g. Barracuda). If Struts does not permit it, then I'll find another way to do it (query parameter being the best approach I guess) --- ROSSEL Olivier [EMAIL PROTECTED] wrote: I think you've misunderstood... The child is not an action, it is a page. A page that is opened using Javascript. In this case, the parent window is never submitted. From what I can tell about Struts (I'm pretty new to it) is that the only way to get data onto a form is via the submission of a form. That's a problem as I want to pass info between these 2 windows without using query parameters if at all possible (see my post from about 2 seconds ago as to why). The point is to pass this info to server side at one moment or the other. Struts is designed with *actions* to retrieve/format data, and JSP just to display them. It seems that you want your child window to make things an action is supposed to do. This e-mail is intended only for the above addressee. It may contain privileged information. If you are not the addressee you must not copy, distribute, disclose or use any of the information in it. If you have received it in error please delete it and immediately notify the sender. Security Notice: all e-mail, sent to or from this address, may be accessed by someone other than the recipient, for system management and security reasons. This access is controlled under Regulation of Investigatory Powers Act 2000, Lawful Business Practises. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Tax Center - forms, calculators, tips, more http://taxes.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] JavaScript: ActionForm Does Not Contain Dynamically Set Data
Does the child window create the correct html:form action=xxx -Original Message- From: Art Vandalay [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 04, 2003 9:23 AM To: Struts Users Mailing List Subject: RE: [OT] JavaScript: ActionForm Does Not Contain Dynamically Set Data Ray, I am doing that part. The problem is that I want that value to be available to the child's Action class ** as the child window is opening **. I am expecting it to be on the form, but the value in the form is null even though the value is successfully set on the child. How can I get Struts to set the value of this field on the form? There has to be a way because I've noticed in Struts that if you have a field defined on your JSP with no corresponding get/set methods on the Form, an exception is thrown when the window is opening. So Struts has to be doing some sort of validation between the JSP's form and the form class at window open time, but it doesn't seem to be setting the data. --- Ray Madigan [EMAIL PROTECTED] wrote: yes! if you are usine javascript you can do something like the following. in the parent create a hidden field html:hidden name=foo/ when the user submits the form have the onclick javacsript function run that sets the document.forms[0].foo.value = xxx; where xxx is the path to the value in the child window. -Original Message- From: ROSSEL Olivier [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 04, 2003 9:11 AM To: 'Struts Users Mailing List' Subject: RE: [OT] JavaScript: ActionForm Does Not Contain Dynamically Set Data I have a web page (the parent) that opens a child window using javascript. The parent window sets a field on the child window. The child window needs to use that data, as it is opening, to perform a DB query and display information on itself. The problem is that, even though the parent successfully sets the data on the child, I have no access to it in my ActionForm or in the request object. Is there a way to make that happen? Your parent JSP has a form with one field. When you submit this form, the child *action* gets it, makes the connection, formats results and returns the forward that will display them. The details (the parent form is hidden and completely managed via Javascript, the child JSP appears in a new window) is pure Javascript tricks. This e-mail is intended only for the above addressee. It may contain privileged information. If you are not the addressee you must not copy, distribute, disclose or use any of the information in it. If you have received it in error please delete it and immediately notify the sender. Security Notice: all e-mail, sent to or from this address, may be accessed by someone other than the recipient, for system management and security reasons. This access is controlled under Regulation of Investigatory Powers Act 2000, Lawful Business Practises. - 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!? Yahoo! Tax Center - forms, calculators, tips, more http://taxes.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: deploy with ant, best practices
Jaye: There is a setting in the server.xml file for this. In the Host element add liveDeploy=true This should, and I repeat should solve the problem. Dave Patton Jaye Bass wrote: My ant targets build directly into my webapp directories...the root location is set in an env variable. This really seems to work for us on a variety of systems (linux, windows, and occasionally macs) from development to ultimate deployment and maintenance. -Original Message- From: Dan Allen [mailto:[EMAIL PROTECTED] Sent: Friday, February 28, 2003 1:30 AM To: [EMAIL PROTECTED] Subject: deploy with ant, best practices I have been studying ant very thoroughly over the past two days, and I completely understand the file from top to bottom, including how to reload the application using the reload tag imported from org.apache.catalina.ant.ReloadTask. However, I am stuck on an issue. Assuming that I follow the techniques from the book Struts Kick Start, I create a development tree such as ${app.home} /build /deploy /object /src /lib /web /WEB-INF /META-INF then the actual target tree (under tomcat/webapps) is the typical ${app.name}.war ${app.name} /WEB-INF /WEB-INF/lib /WEB-INF/classes /META-INF Okay, now stay with me here. Assume that I currently have the application running under tomcat. If I build the .war file from the build/ directory and place it into ${app.home}/deploy, then copy it to ${app.name}.war under tomcat/webapps, it isn't going to automatically expand over the current running tree. It just sits there until I kick tomcat (restart it) after deleting the running application directory. So what I did instead was I made the build/ directory the actual running application directory so it just copied over the live files directly as they were updated by javac. Then a simple reload would cause the application to start using the updated files. The question on the table is as follows. How do you get tomcat to expand an updated .war file over a currently running application before you reload it? It seems wrong to have the live application the target of my build process. The goal here is to update the running application without having to restart tomcat and without having to use the running application as the target of the build process. I want to be able to copy the updated .war file into the tomcat/webapps folder and have it expand it over the running application files. Is this unreasonable to expect this? How does everyone else do it. Surely you are not restarting tomcat all day. Dan - 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: Tiles problems (Building complex pages)
Hi, It looks like your unlucky using Tiles ;-). Fabio Mancinelli wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi all, Sorry for this lengthy mail but I am getting crazy! I am working with Struts and Tiles and I am developing a small site to test (and stress this technology) I reused some layouts taken from the tiles documentation. The standard page layout with the classical header, body, footer attributes and, in particular I took the vboxLayout: % Iterator i = list.iterator(); while(i.hasNext()) { String name = (String)i.next(); % tiles:insert name=%= name % flush=true/ % } % What I want is a page with the standard layout whose body is a vboxLayout with some tiles. To do this I have to write the following files: main.jsp If you use the tiles-config.xml, you can replace this page by a Struts action forwarding to a definition. mainBody.jsp As it use the vboxLayout.jsp, you can alsoreplace this page by a definition t1.jsp t2.jsp These are your bodies, you need them ;-) Where main is a page which uses the standard layout, mainBody is a simple .jsp with only a tiles:insert page=vboxLayout.jsp tiles:putList name=list tiles:add value=t1.jsp/ tiles:add value=t2.jsp/ ... t1, t2 are .jsp tiles. Now my questions are: 1) The mainBody contains a list of tiles some of which might be text-only. I would like to do something like this: tiles:insert page=vboxLayout.jsp tiles:putList name=list tiles:add value=t1.jsp/ tiles:add type=stringThis is an embedded text only tile/tiles:add ... In this way I would get rid of all the .jsp which contains only text/html and are peculiar to a single page. But this doesn't work. This is useful only if the body contains small text, and preferably without tags. Specifying type=String should work. 2) Another problem is when a tile, let's say t1.jsp, needs some attributes to be passed in order to be instantiated. Let's suppose that the tile t1 needs a title. How do I pass that attribute in the previous example? You can define another definition declaring your attributes. Then, you specify the definition instead of the jsp url: definition name=t1 page=/t1.jsp put name=title value=Yupi/ definition/ definition name=body page=/layouts/vboxLayout.jsp putList name=list add value=t1/ add value=/t1.jsp/ /putList definition/ tiles:insert page=vboxLayout.jsp tiles:putList name=list tiles:add value=t1.jsp tiles:put name=title value=Yupi/ /tiles:add tiles:add value=t2.jsp/ ... Doesn't work. I tried to write a local definition before actually inserting the tile: tiles:definition id=instantiatedT1 page=t1.jsp tiles:put name=title value=Yupi/ /tiled:definition This define a definition defined in a jsp scope. tiles:insert page=vboxLayout.jsp tiles:putList name=list tiles:add value=instantiatedT1/ You need to do somethink like: tiles:add beanName=instantiatedT1/ But I am not sure that the vboxLayout support a definition bean as list element. Definitions are more useful when defined in the tiles factory from a tiles-config.xml file. tiles:add value=t2.jsp/ ... But this doesn't work too. I tried also to specify different scopes for the definition (even the application one!) and different types for the tiles:add tag (namely type=definition and also beanName=instantiatedT1). The only way I've found to make this work is to put the definition inside the tiles-config.xml, but this would be equivalent in having a separate t1.jsp with no parameters. I suppose the problem is in the vboxLayout but I cannot figure out how to write a layout which supports what I said in 1). The problem in 2) still has no solution (to me). I suggest that you use the tiles-config.xml file. It will help reduce the number of pages. I also suggest to have one jsp per tiles, and to not write big pieces of body inside a put tag. Also, don't forget that you can write your own layout doing the exact behavior that you are looking for. Cedric A presto, Fabio - -- - - Fabio Mancinelli, PhD student EMail : [EMAIL PROTECTED] Dipartimento di Informatica WWW : http://www.di.univaq.it/~mancinel Universita' dell'Aquila - - -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) Comment: Made with pgp4pine 1.75-6 iD8DBQE+ZKrs6dsQbk2R3cMRArgjAKCcW4oqazE/lbRwXBnOEA7odtvTyACgzw9p oSPR57Gl6YLcMAA6B08KZbo= =BmVa -END PGP SIGNATURE- - 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: how to catch exception using tiles thrown by e.g. org.apache.struts.tiles.TilesUtilStrutsModulesImpl.doInclude
I suppose that your exception is thrown by a tiles:insert ... tag in a jsp. This exception is thrown by the tiles framework, which know nothing about the struts exception mechanism, so it can't be used. The exception is then propagated by the tag handler and reach the jsp page (the tile jsp). If there is an exception handler associated to the jsp, it is called, if there is no handler, the exception is propagated to parent page inserting this one. If the parent page have inserted the child page with an insert ..., then the insert catch the exception and show it. Normally, the jsp exception handling should work, but it appear that it is not always the case. A workaround is to put a big try/catch in the jsp throwing the exception ;-(. This will be improved in future versions. Cedric Jörg Maurer wrote: Hi struts people! I have really defined everywhere i think i can put an exception handler for servlet exception : 1.) in my base layout.jsp an %@ errorPage='/pages/common/error/errorsGeneralHandler.jsp'% 2.) in struts config a global exception handler global-exceptions exception path=pages/common/error/errorsGeneralHandler.jsp type=javax.servlet.ServletException/ /global-exceptions 3.) in web.xml error-page exception-typejavax.servlet.ServletException/exception-type location/pages/common/error/errorsGeneralHandler.jsp/location /error-page Still ServletException slip through my guards. Last know point as stack trace shows below is org.apache.struts.tiles.TilesUtilStrutsModulesImpl.doInclude(TilesUtilSt rutsModulesImpl.java:122) , which throws ServletException but is never catchable to me. The point is not the FileNotFound, which is pretty clear to me, but why such exception doesn´t hit any of my error handler. Any hints appreciated! 2003-03-04 12:36:06 ApplicationDispatcher[] Servlet.service() for servlet jsp threw exception javax.servlet.ServletException: /pages/wf_category/pager_region.jsp at org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet$JspServletWra pper.service(IDEJspServlet.java:183) at org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet.serviceJspFil e(IDEJspServlet.java:246) at org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet.service(IDEJs pServlet.java:339) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatc her.java:683) at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDisp atcher.java:574) at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispat cher.java:497) at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.ja va:819) at org.apache.jsp.wf_0005fcategory_0005fchoose$jsp._jspService(wf_0005fcate gory_0005fchoose$jsp.java:107) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet$JspServletWra pper.service(IDEJspServlet.java:173) at org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet.serviceJspFil e(IDEJspServlet.java:246) at org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet.service(IDEJs pServlet.java:339) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatc her.java:683) at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDisp atcher.java:574) at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispat cher.java:497) at org.apache.struts.tiles.TilesUtilStrutsModulesImpl.doInclude(TilesUtilSt rutsModulesImpl.java:122) at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:161) at org.apache.struts.taglib.tiles.InsertTag.doInclude(InsertTag.java:703) at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTa g.java:818) at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:467) at org.apache.jsp.base_0005flayout$jsp._jspService(base_0005flayout$jsp.jav a:1006) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet$JspServletWra pper.service(IDEJspServlet.java:173) at org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet.serviceJspFil e(IDEJspServlet.java:246) at org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet.service(IDEJs pServlet.java:339) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatc her.java:683) at
Basic Tiles question
How do I get the contents of a variable which is clearly available inside the layout file to be available inside a tile? In my layout file, I can have something like tiles:getAsString name=title/ which works just fine. If I put the same tag in a tile, I get this error message: [ServletException in:/tiles/test.jsp] Error - tag.getAsString : attribute 'title' not found in context. Check tag syntax' -- Steve Stair - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Validating 2 radios together.
I have two series of radio buttons in my page. Let's say: radioButton1 has 3 possibilites radioButton2 has 4 possibilites. I want to validate my form because radioButton1=3 and radioButton2=4 is not allowed. What's the best practice? Using requiredif, so I validate radioButton2 only if radioButton1=3 ? Or is there a better way? BTW, is requiredif available in Struts 1.1b2 ? ---cut here--- This e-mail is intended only for the above addressee. It may contain privileged information. If you are not the addressee you must not copy, distribute, disclose or use any of the information in it. If you have received it in error please delete it and immediately notify the sender. Security Notice: all e-mail, sent to or from this address, may be accessed by someone other than the recipient, for system management and security reasons. This access is controlled under Regulation of Investigatory Powers Act 2000, Lawful Business Practises. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: displaying \n in html?
David Graham [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] i'd love to see one-liner that converts char to string. return newlineString.replaceAll(\n, br/); which is not very backward compatible, i am still at 1.3 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: displaying \n in html?
Then use the jakarta lang package to acheive the same result in one line of code. David From: dario [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: displaying \n in html? Date: Tue, 4 Mar 2003 19:13:11 +0100 David Graham [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] i'd love to see one-liner that converts char to string. return newlineString.replaceAll(\n, br/); which is not very backward compatible, i am still at 1.3 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Unable to access title attribute in Tiles under layout(1.1-rc1)
Hi, Once again ;-) : The attributes of a tile are only accessible from this tile, not from its sub- tiles or its parent. Attributes of a tile are like parameters of a method: they are only visible in this method. It is why you can't access the title attribute owned by the layout from the header tile. To access it, you need to pass it explicitly to the tile: tiles:insert attribute=header tiles:put name=title beanName=title beanScope=tile / /tiles:insert Cedric Thanks, got that working (once i changed scope to tile :) After getting it working, I went back over the documentation in Struts in Action, as well as your Tiles Advanced Features document, and still can't find this behavior explained anywhere. -- Steve Stair - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Accepting arrays as values in mapped-backed ActionForms
Hello Struts community! No one's picked up on this thread and I just wonder whether it's a stupid or unclear question or whether it's just not of interest. If the question's been answered before, could someone let me know and I'll go back to searching lists. I didn't find any answers earlier. Basically what I'm trying to is set up a form that will contain a Map of String arrays. At this point, when Struts populates the Map, it assumes the map elements will be plain strings. Does anyone know of a way to tell it that the members of the map should be populated as arrays (because multiple request parameters will have the same name). Thanks in advance for any response, John Devine -Original Message- From: John Devine [mailto:[EMAIL PROTECTED] Sent: Monday, March 03, 2003 5:10 PM To: [EMAIL PROTECTED] Subject: Accepting arrays as values in mapped-backed ActionForms Does anyone know how to specify that the value of the HashMap in a mapped-backed ActionForm should be an array of Strings rather than just a single String? I'm having a problem in trying to set up a page of several rows of indexed multi-boxes: I have a regular action form that includes: public Map existingGroups = new HashMap(); public Map getExistingGroups(){ return existingGroups; } public void setExistingGroups(Map map){ this.existingGroups = map; } On my JSP, I include several different rows of multiboxes, and I want the user to be able to choose different groups for each object: % List storyList = searchBean.getList(); int counter = 1; for (Iterator i = storyList.iterator(); i.hasNext(); counter++ ) { Story story = (Story)i.next(); pageContext.setAttribute(story, story); pageContext.setAttribute(counter, new Integer(counter)); % tr td bean:write name=story property=title / /td logic:iterate id=group name=submitToGroupForm property=availableGroups type=com.rd.Group td html:multibox property='%=existingGroups(+story.getId()+)%' bean:write name=group property=id / /html:multibox bean:write name=group property=name / /td /logic:iterate /tr % } % (Oh, and I use the scriptlet iteration because there's a tile being called within that loop that I edited out for readability.) What happens is that value of existingGroups(primaryKey1) is a String instead of an array of Strings. So that if I try to cast it to String[], I get a ClassCastException. Is this a limitation of using maps in forms, or is there a way to return arrays of strings as entries of the Map on your ActionForm? Thanks, John - 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: [OT] JavaScript: ActionForm Does Not Contain Dynamically Set Data
Sorry for the late reply... I got called into a meeting. Yes, it does. --- Ray Madigan [EMAIL PROTECTED] wrote: Does the child window create the correct html:form action=xxx -Original Message- From: Art Vandalay [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 04, 2003 9:23 AM To: Struts Users Mailing List Subject: RE: [OT] JavaScript: ActionForm Does Not Contain Dynamically Set Data Ray, I am doing that part. The problem is that I want that value to be available to the child's Action class ** as the child window is opening **. I am expecting it to be on the form, but the value in the form is null even though the value is successfully set on the child. How can I get Struts to set the value of this field on the form? There has to be a way because I've noticed in Struts that if you have a field defined on your JSP with no corresponding get/set methods on the Form, an exception is thrown when the window is opening. So Struts has to be doing some sort of validation between the JSP's form and the form class at window open time, but it doesn't seem to be setting the data. --- Ray Madigan [EMAIL PROTECTED] wrote: yes! if you are usine javascript you can do something like the following. in the parent create a hidden field html:hidden name=foo/ when the user submits the form have the onclick javacsript function run that sets the document.forms[0].foo.value = xxx; where xxx is the path to the value in the child window. -Original Message- From: ROSSEL Olivier [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 04, 2003 9:11 AM To: 'Struts Users Mailing List' Subject: RE: [OT] JavaScript: ActionForm Does Not Contain Dynamically Set Data I have a web page (the parent) that opens a child window using javascript. The parent window sets a field on the child window. The child window needs to use that data, as it is opening, to perform a DB query and display information on itself. The problem is that, even though the parent successfully sets the data on the child, I have no access to it in my ActionForm or in the request object. Is there a way to make that happen? Your parent JSP has a form with one field. When you submit this form, the child *action* gets it, makes the connection, formats results and returns the forward that will display them. The details (the parent form is hidden and completely managed via Javascript, the child JSP appears in a new window) is pure Javascript tricks. This e-mail is intended only for the above addressee. It may contain privileged information. If you are not the addressee you must not copy, distribute, disclose or use any of the information in it. If you have received it in error please delete it and immediately notify the sender. Security Notice: all e-mail, sent to or from this address, may be accessed by someone other than the recipient, for system management and security reasons. This access is controlled under Regulation of Investigatory Powers Act 2000, Lawful Business Practises. - 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!? Yahoo! Tax Center - forms, calculators, tips, more http://taxes.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] __ Do you Yahoo!? Yahoo! Tax Center - forms, calculators, tips, more http://taxes.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] JavaScript: ActionForm Does Not Contain Dynamically Set Data
LOLwhatever dude. It takes a real loser to got from 'discussion' to 'personal attack'. -- James Mitchell Web Developer/Struts Evangelist http://jakarta.apache.org/struts/ People demand freedom of speech to make up for the freedom of thought which they avoid. - Soren Aabye Kierkegaard (1813-1855) -Original Message- From: Art Vandalay [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 04, 2003 12:30 PM To: Struts Users Mailing List Subject: RE: [OT] JavaScript: ActionForm Does Not Contain Dynamically Set Data Mr. Police Man, If you read the question you'll see that my script *IS* setting field correctly ( I made that very clear in my original post). My question is how do I get those values set in an ActionForm when when the page is being displayed (not at submit time). --- James Mitchell [EMAIL PROTECTED] wrote: Actually, this has nothing to do with Struts. If your script is not setting fields (on parent, top, child, whatever) correctly, then you cannot assume that it is a problem with Struts. Struts picks up when the request comes in, anything before that is outside the scope. On the other hand however, there are a lot of people on this list with JavaScript knowledge, but there are many more who would prefer that we use [OT] to designate that this discussion is not related. If you find that you are constantly dealing with JavaScript, perhaps (assuming you are on windoze) you can download and use the ScriptDebugger for IE. It lets you step through JavaScript with or without frames. Good Luck! -- James Mitchell Web Developer/Struts Evangelist http://jakarta.apache.org/struts/ People demand freedom of speech to make up for the freedom of thought which they avoid. - Soren Aabye Kierkegaard (1813-1855) -Original Message- From: Art Vandalay [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 04, 2003 12:06 PM To: Struts Users Mailing List Subject: RE: ActionForm Does Not Contain Dynamically Set Data I don't believe this is off topic. This question regards how to get Struts to populate a form field that was set using Javascript. --- James Mitchell [EMAIL PROTECTED] wrote: Please label JavaScript topics as [OT]. -- James Mitchell Web Developer/Struts Evangelist http://jakarta.apache.org/struts/ People demand freedom of speech to make up for the freedom of thought which they avoid. - Soren Aabye Kierkegaard (1813-1855) -Original Message- From: Art Vandalay [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 04, 2003 11:59 AM To: Struts Mailing List Subject: ActionForm Does Not Contain Dynamically Set Data I have a web page (the parent) that opens a child window using javascript. The parent window sets a field on the child window. The child window needs to use that data, as it is opening, to perform a DB query and display information on itself. The problem is that, even though the parent successfully sets the data on the child, I have no access to it in my ActionForm or in the request object. Is there a way to make that happen? __ Do you Yahoo!? Yahoo! Tax Center - forms, calculators, tips, more http://taxes.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] __ Do you Yahoo!? Yahoo! Tax Center - forms, calculators, tips, more http://taxes.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] __ Do you Yahoo!? Yahoo! Tax Center - forms, calculators, tips, more http://taxes.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: how to catch exception using tiles thrown by e.g. org.apache.struts.tiles.TilesUtilStrutsModulesImpl.doInclude
Cedric exactly as you said, insert is used. despite the big try-catch block approach, its unclear to me why error-page in web.xml doesn#t get a try. Additionally i searched for similar behaviour and all i found was following page 52 of the JSP 1.2 spec : Note: if autoFlush=true then if the contents of the initial Jsp- Writer has been flushed to the ServletResponse output stream then any subsequent attempt to dispatch an uncaught exception from the offending page to an errorPage may fail. When an error page is also indicated in the web.xml descriptor, the JSP error page applies first, then the web.xml page.. You as a more experienced one than myself, does it make some sense to the issue? -Original Message- From: Cedric Dumoulin [mailto:[EMAIL PROTECTED] Sent: Dienstag, 04. März 2003 18:35 To: Struts Users Mailing List Subject: Re: how to catch exception using tiles thrown by e.g. org.apache.struts.tiles.TilesUtilStrutsModulesImpl.doInclude I suppose that your exception is thrown by a tiles:insert ... tag in a jsp. This exception is thrown by the tiles framework, which know nothing about the struts exception mechanism, so it can't be used. The exception is then propagated by the tag handler and reach the jsp page (the tile jsp). If there is an exception handler associated to the jsp, it is called, if there is no handler, the exception is propagated to parent page inserting this one. If the parent page have inserted the child page with an insert ..., then the insert catch the exception and show it. Normally, the jsp exception handling should work, but it appear that it is not always the case. A workaround is to put a big try/catch in the jsp throwing the exception ;-(. This will be improved in future versions. Cedric Jörg Maurer wrote: Hi struts people! I have really defined everywhere i think i can put an exception handler for servlet exception : 1.) in my base layout.jsp an %@ errorPage='/pages/common/error/errorsGeneralHandler.jsp'% 2.) in struts config a global exception handler global-exceptions exception path=pages/common/error/errorsGeneralHandler.jsp type=javax.servlet.ServletException/ /global-exceptions 3.) in web.xml error-page exception-typejavax.servlet.ServletException/exception-type location/pages/common/error/errorsGeneralHandler.jsp/location /error-page Still ServletException slip through my guards. Last know point as stack trace shows below is org.apache.struts.tiles.TilesUtilStrutsModulesImpl.doInclude(TilesUtilS t rutsModulesImpl.java:122) , which throws ServletException but is never catchable to me. The point is not the FileNotFound, which is pretty clear to me, but why such exception doesn´t hit any of my error handler. Any hints appreciated! 2003-03-04 12:36:06 ApplicationDispatcher[] Servlet.service() for servlet jsp threw exception javax.servlet.ServletException: /pages/wf_category/pager_region.jsp at org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet$JspServletWr a pper.service(IDEJspServlet.java:183) at org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet.serviceJspFi l e(IDEJspServlet.java:246) at org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet.service(IDEJ s pServlet.java:339) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispat c her.java:683) at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDis p atcher.java:574) at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispa t cher.java:497) at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.j a va:819) at org.apache.jsp.wf_0005fcategory_0005fchoose$jsp._jspService(wf_0005fcat e gory_0005fchoose$jsp.java:107) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet$JspServletWr a pper.service(IDEJspServlet.java:173) at org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet.serviceJspFi l e(IDEJspServlet.java:246) at org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet.service(IDEJ s pServlet.java:339) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispat c her.java:683) at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDis p atcher.java:574) at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispa t cher.java:497) at org.apache.struts.tiles.TilesUtilStrutsModulesImpl.doInclude(TilesUtilS t rutsModulesImpl.java:122) at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:161) at
select multiple=true and setting properties
I have an ActionForm with the following: ArrayList msoIds; public ArrayList getMsoIds() { return msoIds; } public void setMsoIds(ArrayList msoIds) { this.msoIds = msoIds; } Now I have a JSP that displays a select with the ability to select multiples: html:select multiple=true property=msoIds styleId=msoIds size=10 html:options collection=userMsoList property=value labelProperty=label/ /html:select However, as you probably know, I get an exception when Struts does BeanUtils.copyProperties - can't convert String to ArrayList. I tried adding indexed setters for the multiple select: public String getMsoIds(int index) { return (String) msoIds.get(index); } public void setMsoIds(int index, String msoId) { msoIds.set(index, msoId); } but this results in the following error: Caused by: java.lang.NoSuchMethodException: Property 'msoIds' has no setter method I saw stuff in the mailing list about naming the indexed properties different, and I tried this (also renaming the select), but then my page stops loading when it hits the new name (allowedMSOs). Using tiles hides all the errors :(. Any ideas are appreciated. Matt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]