Re: ValidatorForm.getServlet() == null !!
Hi Albrecht, The ActionServlet in an ActionForm is a private member with no accessor methods. So, try this in your form: this.servlet.getServletContext(); HTH, Curtis Albrecht Berger wrote: Hello, I need the ServletContext in one of my forms, which I'm trying to get with : getServlet().getServletContext() Unfortunately I get a NullpointerException, because the servlet is null. How could this be, is there a workaround ? Thx berger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: On usage of Resource Bundle
Hi Ashutosh, The safe bet is to have the default in both config files. It should be relatively easy (a couple 2-3 deployments) to test whether or not you need it in both places. My 2 cents, Curtis -- c dot tee at verizon dot net Ashutosh Satyam wrote: Still waiting if somebody can reply to the below question which I had posted yesterday. Regards, Ashutosh -Original Message- From: Ashutosh Satyam Sent: Thursday, March 11, 2004 11:22 AM To: Struts Users Mailing List Subject: On usage of Resource Bundle Hi, I needed one small clarification regarding the usage of resource bundle. My web application is divided into two sub modules i.e. basically the application uses two struts configuration file. I'm going to have only one resource bundle. Now, is it necessary to have tag configured in both the struts configuration file? Will providing the configuration at one place won't suffice? Since, MessageResources objects are created by the controller i.e. ActionServlet and saved in the ServletContext using either a generic key Globals.MESSAGES_KEY or the key provided as part of the 'key' attribute. So, I feel it should be accessible to the Action classes, which are part of the other struts configuration file too. Is my understanding correct? Anyone who can provide me a better insight on the same will be useful. Regards, Ashutosh - 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: Extending Request Processor to append request parameter
Hi Brad, Someone on this list (sorry; can't remember who) subclassed ActionForward to do exactly this. Search the archives for ParameterActionForward. If you can't find it, email me off-list & I'll send you the Java file (I have it stashed away somewhere. Curtis -- c dot tee at verizon dot net Brad Balmer wrote: I've been looking into this for a while and can't figure out how to do this easily. I would like to append a unique number to each request in an attempt to defeat caching (setting all the normal META tags as well as the 'nocache' in the controller doesn't seem to ALWAYS work). Therefore I wanted to append a Parameter to each request and add a unique number so that the server would not look in the cache. (Having the user change their browser caching mechanism isn't an option). I see where I can SEE the different request parameters, but where can I append a new parameter? I would like to do this in a central location. Any ideas? Has anybody else come up with a good way of doing this? 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]
Re: [OT] JBulder X users?
Hi Joe, Personally, I'm averse to IDEs which require a minimum 512MB (768MB recommended) RAM (hope you're not running XP on a stock laptop...;-) Curtis -- c dot tee at verizon dot net Joe Hertz wrote: I currently use JBuilder 8 Enterprise and I'm eval'ing JBuilder X. Anyone else using X for Struts dev? I'm curious as to your thoughts. Personally, I'm underwhelmed. I so wanted to see the validator framework being leveraged...or even addressed. It's existence is barely acknowledged. Is it my imagination or (with the notable exception of Struts Console, thank you James) does every GUI tool aimed at "Faster Struts Development" really mean "Faster Struts Learning Curve" and then just gets in your way once you know what youre doing? (Or worse, replace one learning curve with another -- theirs!) If I'm not alone, I might just consider doing something about it once this project finishes... Joe - 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: Checkbox not checked
Hi Wendy, I'm not exactly sure, but I'm a tad suspect of your 'c:if test' expression. It looks suspiciously like a Python "boolean" test for the object's presence. AFAIK, in JSTL one needs to be more explicit as to what value (or lack thereof) when testing... Unless, of course, it's just a typo in your email...;-) Curtis -- c dot tee at verizon dot net Wendy Smoak wrote: (No, this isn't the infamous "how do I uncheck my checkbox" question!) I have this: test="${item.value.activity[accountForm.map.calendarYear]}"> Unfortunately, the checkboxes corresponding to the String[] 'accounts' property of the form are not being rendered as checked. Before I go back to the Action and create a separate Map to hold only the "active" accounts based on the selected year, does anyone think this ought to work the way it is? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Error Start Tag Exception
Hi Betty, I think you need to set the 'message' attribute to false here, as the tag is looking for an ActionMessage instance, not an ActionError one (which is what you get in the loop created by the tag). Here's a snippet of an implementation I've used: HTH, Curtis -- c dot tee at verizon dot net Betty Koon wrote: Any one has any idea why this exception happens? I am using 1.2 nightly build currently. My jsp is simply using the following: java.lang.ClassCastException - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problems w/ logging.. again
Hi Adam, Insofar as I've seen it with JBoss, yes: the application-scope log4j config files have no effect. If you're using ant, it'd be fairly simple to write a task which copies your app's log4j.xml to the appropriate server/conf directory. And no, you shouldn't have to bounce the app server. It should pick up your config changes while it's running. Curtis Adam Levine wrote: Curtis: Thank you for the insight. I'll be sure to try this out this evening. Am I correct to assume that app-specific log4j config files will not be used (as in, to append/make use of the global config), and that anytime I want to change the logging for a specific app I have to make a global change and bounce the entire app server? Thanks again! From: Curtis Taylor <[EMAIL PROTECTED]> Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]> To: Struts Users Mailing List <[EMAIL PROTECTED]> Subject: Re: problems w/ logging.. again Date: Tue, 20 Jan 2004 08:58:25 -0800 Hi Adam, If you're using JBoss you need to edit the server's log4j.xml config file. For 3.2.2 it lives in $JBOSS_HOME/server/all|default|minimal/conf/. Edit the one in the server subdirectory you deploy your app to. HTH, Curtis Adam L wrote: I've scoured the archives. I"ve tried a million different log4j.properties configurations, some with .xml, some with commons-logging.properties. I've read the links to the apache site that seem to focus mainly on how to use logging from the programmatic aspect (and had no luck with the examples provided on the configuration aspect). in theory, these changes should take hold when i bounce the application (touch web.xml), rather than the entire app server.. correct? I'm beginning to wonder if it's a configuration issue elsewhere. jdk is 1.4.2, jboss 3.0.8/jetty, struts 1.1. in my web.xml i've set the debug parm on ActionServlet to 2, 9, 99, 999 in struts-config.xml, for the controller, i've set debug to 2,9,99,999 i cut and paste examples in the archives claiming to remove "00:24:09,816 INFO [PropertyMessageResources] Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnNull=true" from the logs.. and they don't. I've set my log levels to WARN, DEBUG, INFO.. and see no changes. What I'm trying to achieve is the debug info from the workflow extension controller to aid in debugging problems in my workflow, as well as turn off some of the extraneous struts messages. If someone would please be willing to hold my hand and guide me, my quickly receding hairline and I would be in great appreciation. thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Check out the new MSN 9 Dial-up — fast & reliable Internet access with prime features! http://join.msn.com/?pgmarket=en-us&page=dialup/home&ST=1 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problems w/ logging.. again
Hi Adam, If you're using JBoss you need to edit the server's log4j.xml config file. For 3.2.2 it lives in $JBOSS_HOME/server/all|default|minimal/conf/. Edit the one in the server subdirectory you deploy your app to. HTH, Curtis Adam L wrote: I've scoured the archives. I"ve tried a million different log4j.properties configurations, some with .xml, some with commons-logging.properties. I've read the links to the apache site that seem to focus mainly on how to use logging from the programmatic aspect (and had no luck with the examples provided on the configuration aspect). in theory, these changes should take hold when i bounce the application (touch web.xml), rather than the entire app server.. correct? I'm beginning to wonder if it's a configuration issue elsewhere. jdk is 1.4.2, jboss 3.0.8/jetty, struts 1.1. in my web.xml i've set the debug parm on ActionServlet to 2, 9, 99, 999 in struts-config.xml, for the controller, i've set debug to 2,9,99,999 i cut and paste examples in the archives claiming to remove "00:24:09,816 INFO [PropertyMessageResources] Initializing, config='org.apache.struts.taglib.html.LocalStrings', returnNull=true" from the logs.. and they don't. I've set my log levels to WARN, DEBUG, INFO.. and see no changes. What I'm trying to achieve is the debug info from the workflow extension controller to aid in debugging problems in my workflow, as well as turn off some of the extraneous struts messages. If someone would please be willing to hold my hand and guide me, my quickly receding hairline and I would be in great appreciation. thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Dependent Drop Down Boxes
Hi David, I'm in process of cobbling together something like this using Tiles. I've defined a generic selector widget as a jsp, then subclassed it in the tiles-defs.xml n times, with each new definition having its own controller which is responsible for populating the selector with context-specific data. These can be inserted as a Tile inside an html form. In the definitions I have an "onChange" attribute which is a string representing a Javascript function ("return document.forms[0].submit();", for example). Controller B uses the request param from selector A to populate selector B's data. Use an Action class for your form action, forward back to the input, etc. Seems promising so far. If you want a straight jsp/Javascript approach Danny Goodman has an excellent solution in his "Javascript & DHTML Cookbook." Very clean & simple to use, and you can populate your options dynamically inside a c:forEach loop. I found it easier to implement than Matt Kruse's library, but then again I'm not the sharpest pencil in the box...;-) HTH, Curtis David Erickson wrote: Hi I was wondering if anyone knew of any taglibraries or javascript related code that is meant to handle dependent drop down boxes. IE your choice in drop down box 1 choses the options you get in drop down box 2. Ideally this would not require a refresh of the browser. An example of this is carpoint.msn.com where you chose the vehicle manufacturer and in the next box it shows you only cars made by that manufacturer. They are using javascript coded in house... I was wondering if there is an open source project or solution to work with this. Thanks! -David - 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: .NET: We are just like Struts... only better.
This brings up an interesting point (for me, at least): Is anyone on this list developing under Linux w/XEmacs or Emacs? I'm curious as to whether I'm living in the past or not...;-) - Curtis Taylor (no relation to Robert...;-) On Sun, 2003-12-28 at 17:55, Nick Faiz wrote: > but still, I'm not dragging and > > dropping html form controls (or struts-html.tld taglib controls) to a > > designer screen, linking code and compiling. > > > > I believe that various IDEs are beginning to allow this. I saw a > demonstration of a Sun's Forte at a Java User Group, a while ago, and they > were dropping and dragging JATO taglibs. WebLogic Workshop can apparently > allow this using Struts. > > > > I don't know if any of this qualifies as decent programming, however. > > > > Nick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to detect that session has expired ?
HttpSessionListener is your friend...;-) http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/http/HttpSessionListener.html Kirk Wylie wrote: Ashish Kulkarni wrote: HI if u are using servelt 2.3 , then u can use servelt filter, in this filter u can have logic to check session before each request so u dont need to add any code in jsp or action class If he's using Servlet 2.3, then he can also use the ServletContextListener in conjunction, where is where the logic for whether the session has been restarted could likely belong. Kirk Wylie M7 Corporation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- c dot tee at verizon dot net - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]