RE: Article on JavaWorld
If users make changes to the Struts code then they won't be able to use the next release of Struts without re-implementing their changes in the new source. As Jean-Baptiste said, surely the right way to do it is to add or extend classes? Of course, getting your changes added to the Struts codebase itself is a different matter... ;-) Phil. -Original Message- From: Thor Kristmundsson [mailto:[EMAIL PROTECTED]] Sent: 04 December 2000 15:02 To: [EMAIL PROTECTED] Subject: RE: Article on JavaWorld You have a point, the article doens't make use of all of Struts feature. I was simply trying to convey the experience I got during a recent project of using the Struts JSP tag libraries. This project didn't lend itself to using the rest of Struts so I had nothing to report there. IMHO the methods presented do add value to Struts and could perhaps be incorporated. I cant see anything inherently wrong with changing the Struts code to accomodate these features. Thor Kristmundsson -Original Message- From: Jean-Baptiste Nizet [mailto:[EMAIL PROTECTED]] Sent: Montag, 4. Dezember 2000 16:06 To: [EMAIL PROTECTED] Subject: Article on JavaWorld Hi all, I just noticed that there is an article talking about Struts on JavaWorld, at http://www.javaworld.com/javaworld/jw-12-2000/jw-1201-struts.html, written by Thor Kristmundsson, from ATG. This shows, once again, that Struts is more and more used and recognized in the Java community. Unfortunately, the article, IMHO, shows exactly what should NOT be done with Struts. The MVC pattern is broken (no real form bean, controller code in the JSP page, direct forwards to JSP pages, ...), the validation process of Struts is bypassed and re-invented, the error management is also re-invented, and this is done by modifying the Struts sources, instead of trying to enhancing it by adding or extending classes. What do you all think about it? I personnally think that someone knowing Struts perfectly (Craig, are you here?), should react to this article and show how all this could be done using Struts in a smart way, and explain what the real Struts is able to do. JB. -- Jean-Baptiste Nizet [EMAIL PROTECTED] RD Engineer, S1 Belgium Kleine Kloosterstraat, 23 B-1932 Sint-Stevens Woluwe +32 2 200 45 42 This email and any files transmitted with it are intended solely for the addressee(s) and may be legally privileged and/or confidential. If you have received this email in error please destroy it and contact the sender, via our switchboard on +44 (0)20 7623 8000 or via return e-mail. You should not copy, forward or use the contents, attachments or information in any way. Any unauthorised use or disclosure may be unlawful. Dresdner Kleinwort Benson gives no warranty as to the accuracy or completeness of this email after it is sent over the Internet and accepts no responsibility for changes made after it was sent. Any opinion expressed in this email may be personal to the author and may not necessarily reflect the opinions of the Bank or its affiliates. They may also be subject to change without notice.
Re[2]: Article on JavaWorld
Hello Ted, Tuesday, December 05, 2000, 2:41:08 PM, you wrote: .. TH Personally, I think Thor's interfaces seem useful, and I may add his TH patches to my own code base. I think regexp validation is interesting and will be very useful.. But there are some problems with such kind of validation code - it uses hard rules to process number and date values. Java already has i18n mechanism and it can be used to format/parse output/input values in form processing. With it you can specify format strings too and make data formatting more flexible without regexp strings. But all it about number and date formatting only. Regexp validations useful for such validations as phone numbers, e-mails, etc. So it is good addition to the struts for my mind. -- Best regards, Olegmailto:[EMAIL PROTECTED]
RE: Article on JavaWorld
It would have been a good idea to ask this list first. Unfortunatly I didn't know the list existed until a few days ago. A few weeks back I looked for contact information on the Struts website and found an email address reserved for "the press". I sent an email to this address asking for a phone number of someone to talk to about the article but got no response. It even occured to me that the project might be dead. I agree that the whole of Struts deserves attention. Not just the tag libraries. And I'm glad to hear that books and articles are on their way to cover the whole. I can't see though how focusing on the tag libraries is harmful. Thor Kristmundsson -Original Message- From: Ted Husted [mailto:[EMAIL PROTECTED]] Sent: Dienstag, 5. Dezember 2000 12:41 To: Struts List Subject: RE: Article on JavaWorld On 12/4/2000 at 4:49 PM [EMAIL PROTECTED] wrote: As Jean-Baptiste said, surely the right way to do it is to add or extend classes? Developers in the open source community have always patched code to meet specific requirements. A prime argument for open source is the ability to choose between patching and extending. Obviously, developers who patch take the responsbility for applying the patch again later. And, of course, Thor could have posted questions about his patch to the list first. But now that the article is published http://www.javaworld.com/javaworld/jw-12-2000/jw-1201-struts.html , lets ask the questions: "How could Struts accomplish the same result without a patch?" and/or "Should these patches be added to Struts?" If alternates turn up, they could be posted somewhere as an addendum to the article. (Or, in a followup article?) It might also be nice to see another addendum that addressed the shortcomings Craig mentioned http://www.mail-archive.com/struts-user%40jakarta.apache.org/msg00891.ht ml . But, let's see some code, guys. Personally, I think Thor's interfaces seem useful, and I may add his patches to my own code base. -- Ted Husted, Husted dot Com, Fairport NY USA. -- Custom Software ~ Technical Services. -- Tel 716 425-0252; Fax 716 223-2506. -- http://www.husted.com/
Re: Re[2]: Article on JavaWorld
On 12/5/2000 at 3:34 PM Oleg V Alexeev wrote: Java already has i18n mechanism and it can be used to format/parse output/input values in form processing. But all it about number and date formatting only. Regexp validations useful for such validations as phone numbers, e-mails, etc. So it is good addition to the struts for my mind. Thanks, Oleg. Do you think Thor's Validation code could be extended to use the standard i18n mechanism for number and date formatting, but regex for others? -- Ted Husted, Husted dot Com, Fairport NY USA. -- Custom Software ~ Technical Services. -- Tel 716 425-0252; Fax 716 223-2506. -- http://www.husted.com/
Re: Article on JavaWorld
Thor Kristmundsson wrote: It would have been a good idea to ask this list first. Unfortunatly I didn't know the list existed until a few days ago. A few weeks back I looked for contact information on the Struts website and found an email address reserved for "the press". If you had looked with a little more attention, you would have found the various Struts mailing lists at the bottom of the Struts home page. It always impresses me how technical "gurus", writing in the press about technical products, don't even evaluate them in details. I sent an email to this address asking for a phone number of someone to talk to about the article but got no response. It even occured to me that the project might be dead. I agree that the whole of Struts deserves attention. Not just the tag libraries. And I'm glad to hear that books and articles are on their way to cover the whole. I can't see though how focusing on the tag libraries is harmful. It's harmful because you ignore the full power of the framework and thus reinvent the wheel. For example, Struts has a wonderful validation mechanism, but, unfortunately, lacks some tags for displaying the validation errors in an elegant way to the end user (the errors tag is not sufficient, IMHO). You focused on the tag library, saw that these tags were lacking, and thus reimplemented the whole validation mechanism. On the other hand, I know what Struts is able to do in terms of validation and thus just implemented two additional tags for displaying them in a more elegant way (See below for details, if you're interested). Thor Kristmundsson -Original Message- From: Ted Husted [mailto:[EMAIL PROTECTED]] Sent: Dienstag, 5. Dezember 2000 12:41 To: Struts List Subject: RE: Article on JavaWorld On 12/4/2000 at 4:49 PM [EMAIL PROTECTED] wrote: As Jean-Baptiste said, surely the right way to do it is to add or extend classes? Developers in the open source community have always patched code to meet specific requirements. A prime argument for open source is the ability to choose between patching and extending. Obviously, developers who patch take the responsbility for applying the patch again later. I agree completely with all this, but I think that 1. Extending should be preferred to patching when possible 2. A product should not be patched if it already has the functionality provided by the patch (ex: validation) And, of course, Thor could have posted questions about his patch to the list first. But now that the article is published http://www.javaworld.com/javaworld/jw-12-2000/jw-1201-struts.html , lets ask the questions: "How could Struts accomplish the same result without a patch?" and/or "Should these patches be added to Struts?" If alternates turn up, they could be posted somewhere as an addendum to the article. (Or, in a followup article?) It might also be nice to see another addendum that addressed the shortcomings Craig mentioned http://www.mail-archive.com/struts-user%40jakarta.apache.org/msg00891.ht ml . But, let's see some code, guys. Here's the doc of two tags I wrote to handle validation errors. They allow to display a message, or an image, or anything else, just next to the field the error is associated with, by leveraging the Struts validation mechanism. Te code of these tags is trivial. I leave it as an exercise for the reader to implement them ;-) ifErrorExists - tests if a specific error exists, for a specific property Executes its body if a specific error is found. If name is not specified, the tag checks if one or more errors exist for the specified property. If name is specified, then the tag checks that the specific error exists for the specified property. If not specified, the property defaults to the "global" property, i.e., the tag searches for global errors, not associated with any property. Attribute Description Should be omitted in most cases. Name of the request scope bean errorsName under which a String[] object has possibly been stored. [The value of the org.apache.struts.Action.ERROR_KEY constant string]. name Name of the specific error to test. property Name of the property the error is associated with. ifErrorMissing - tests if a specific error exists Executes its body if a specific error is not found.If name is not specified, the tag checks if one or more errors exist for the specified property. If name is specified, then the tag checks that the specific error exists for the specified property. If not specified, the property defaults to the "global" property, i.e., the tag searches for global errors, not associated with any property. Attribute Description Should be omitted in most cases. Name of the request scope bean errorsName under which a String[] object has possibly been stored. [The value of the org.apache.struts.Action.ERROR_KEY constant
Access of application-wide declared parameters from Action/ActionForm
Hello, is there a convenient way to access the ServletContext from an Action or from an ActionForm ? My problem, I've declared a couple of context-param in the web.xml. Some of them have the meaning of beeing used as default-values in the JSP-page. I have now the problem to pass this parameters/values to my ActionForm. Thanks in advance, fm
RE: Article on JavaWorld
What is "the full power of Struts" ? I was misled to believe it was flexibility ! I remember seen in this list few months ago some messages about Struts being VERY flexible in terms of usage scenarios. I can use just the MVC main process and forget about the tag libraries. One can use just the i18n mechanism and implement out all the other stuff. Or the forms. Here where I work, Struts i18n mechanism would be happily ignored, just because we have our own stuff. STILL it's MVC nucleus is very fine and the validation stuff...hmm... there's this problem too: we do prefer don't use the massive number of beans real big sites will demand from Struts. Who cares if you use scriptlets ? I also believe using tags massively will reduce the complexity of a page, will enable massive reuse, a very fine separation of roles, but...what if the company has only Java programmers as JSP designers ? Most of these arguments are based on cultural more than technical reasons. If a company has a culture devoted to light design more than programming, maybe one would like to use tags to encapsulate. Otherwise, if the environment is made of JSP freaks that use HTML mock-ups to build applications upon, the aim would be reuse. Otherwise, if the environment is made of Servlet freaks, who will care about JSP ??? Maybe, being a first article on Struts, it could pass a personal view more than an "institutional", so ? Wellington -Original Message- From: Jean-Baptiste Nizet [mailto:[EMAIL PROTECTED]] Sent: 05 December 2000 15:09 To: [EMAIL PROTECTED] Subject:Re: Article on JavaWorld Thor Kristmundsson wrote: It would have been a good idea to ask this list first. Unfortunatly I didn't know the list existed until a few days ago. A few weeks back I looked for contact information on the Struts website and found an email address reserved for "the press". If you had looked with a little more attention, you would have found the various Struts mailing lists at the bottom of the Struts home page. It always impresses me how technical "gurus", writing in the press about technical products, don't even evaluate them in details. I sent an email to this address asking for a phone number of someone to talk to about the article but got no response. It even occured to me that the project might be dead. I agree that the whole of Struts deserves attention. Not just the tag libraries. And I'm glad to hear that books and articles are on their way to cover the whole. I can't see though how focusing on the tag libraries is harmful. It's harmful because you ignore the full power of the framework and thus reinvent the wheel. For example, Struts has a wonderful validation mechanism, but, unfortunately, lacks some tags for displaying the validation errors in an elegant way to the end user (the errors tag is not sufficient, IMHO). You focused on the tag library, saw that these tags were lacking, and thus reimplemented the whole validation mechanism. On the other hand, I know what Struts is able to do in terms of validation and thus just implemented two additional tags for displaying them in a more elegant way (See below for details, if you're interested). Thor Kristmundsson -Original Message- From: Ted Husted [mailto:[EMAIL PROTECTED]] Sent: Dienstag, 5. Dezember 2000 12:41 To: Struts List Subject: RE: Article on JavaWorld On 12/4/2000 at 4:49 PM [EMAIL PROTECTED] wrote: As Jean-Baptiste said, surely the right way to do it is to add or extend classes? Developers in the open source community have always patched code to meet specific requirements. A prime argument for open source is the ability to choose between patching and extending. Obviously, developers who patch take the responsbility for applying the patch again later. I agree completely with all this, but I think that 1. Extending should be preferred to patching when possible 2. A product should not be patched if it already has the functionality provided by the patch (ex: validation) And, of course, Thor could have posted questions about his patch to the list first. But now that the article is
Re: Re[2]: Article on JavaWorld
But all it about number and date formatting only. Regexp validations useful for such validations as phone numbers, e-mails, etc. So it is good addition to the struts for my mind. In general, yes, but beware the trap of trying to validate email with regex's, unless you have a very finite, specific domain of email addresses you're trying to validate (such as addresses from a given company). Regex's simply cannot handle the entire domain of the email address space.
RE: Article on JavaWorld
I can't see though how focusing on the tag libraries is harmful. I think this is a good point, Thor. After all, the Web site does take the trouble to indicate what you need to download just use the tag library on its own. And as others have pointed out, the real power of Struts is it's flexibility. Any good Java project is component based, and you should be able to choose the components you want to use, and replace the ones you don't. I'm finishing the specification of what will be my first Struts application this week. When I get to the hard code, I will be looking closely at your validation interface, and comparing it to the one outlined by Jean-Baptist, and the other ideas that have come up on the list. If I come up with a refinement, I'll be sure to let you know, in case there is ever an expanded edtion of your article. And, thanks again for publishing the Java World article. Every open source projects suffers from a lack of working examples, and I hope you will publish more on Struts in the future. There's no replacement for real working code. Meanwhile, if anyone has any links to other Struts articles, or Powered by Struts sites, I'd be very interested to see them. -- Ted Husted, Husted dot Com, Fairport NY USA. -- Custom Software ~ Technical Services. -- Tel 716 425-0252; Fax 716 223-2506. -- http://www.husted.com/
Authentication question
Hi all, we are just about to start a project using Struts; maybe I can get some hints on two things: - authentication: In many services here we rely on DCE for authentication. This is also done for Web-based cgi-apps with Paul Henson's mod_auth_dce for Apache. Two questions: - anybody knows of a DCE solution in the Java servlet/Jsp environment? - if I keep the setup with relying on this Apache module for authentication, what's the best method to get the users name within the struts environment? What's the best method to organize access to different actions based on the fact, that I don't need a password but already have an authenticated user name from Apache? - For JDBC connections and the mysql/mm configuration, which is the recommended open source connection pool solution? TIA, Ralf -- Ralf Utermann _ Universität Augsburg, Institut für Physik -- EDV-Betreuer Universitätsstr.1 D-86135 Augsburg Phone: +49-821-598-3231 SMTP: [EMAIL PROTECTED] Fax: -3411
MessageResources and multipage form
Hi all, I am new to struts. I would like to find out how to use and access messageresources bundle if there is more than one bundle for application. For scalability purposes we are trying to put html messages in one bundle and error messages into another. Would this work? For large scale project as ours (stock market trading application) single resource bundle can be very large which I believe would hurt scalability and performance. Let me know if this is an incorrect assumption. Does anybody have other ideas about how to do this in struts way (making sure that errors and message tags work). How can I create multiform (collect data, preview, and confirm, or wizard like) action. It would be nice if struts had small examples of each of this type of problems. It would have been very beneficial and productive for newcomers like me. Please let me know if anyone has any ideas. Thanks for your help, Misak Boulatian Vantra Group, Inc.
RE: CLASSPATH problems (I think)
I don't use TOMCAT, but at least in Weblogic there is a properties file that maps web application to specific directories. I would think TOMCAT should have a config file that contains similar mappings. -Original Message- From: De Smet Koen [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 05, 2000 10:48 AM To: Struts Mailinglist (E-mail) Subject: CLASSPATH problems (I think) Hello, I've posted a question on this last week and finally found the solution myself, but there's still something wrong in my configuration somewhere and I still have some questions. The problem is that the files under the webapps/project/WEB-INF/lib are not found. It's obvious that the problem has something to do with the CLASSPATH. A solution for all this could be to manually add each path, .jar, ... in the OS Classpath, but I don't think this is a good solution. Don't think it's a good idea to change the CLASSPATH manually each time you create an application. I suppose TOMCAT should know at startup to add for each webapp the lib directory to the CLASSPATH. Why are those directories and files not recognized? Also when I try to access a package webapps/project/WEB-INF/classes/prog/package2 from a Java file in webapps/project/WEB-INF/classes/prog/package1 (import prog.package2.*), an error occurs (package prog.package2 does not exists). I hope you can help me with this. I think that many "Resource-bundle-related" questions can be solved the same way my problems will be solved... Greetings, Koen De Smet P.S. Is it possible to alter tomcat.bat and add the next lines? set _LIBJARS2= for %%i in (%TOMCAT_HOME%\webapps\*\lib) do call %TOMCAT_HOME%\bin\cpappend.bat %%i set CP=%CP%%_LIBJARS2% The information in this email is confidential and is intended solely for the addressee(s). Access to this email by anyone else is unauthorised. If you are not an intended recipient, you must not read, use or disseminate the information contained in the email. Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of The Capital Markets Company. http://www.capco.com ***
Struts article in Javaworld
FYI: http://www.javaworld.com/javaworld/jw-12-2000/jw-1201-struts_p.html incze
Question about errors tag
I've noticed a potential problem with the way errors are handled, and the ErrorsTag class. I'm assuming I'm missing something. (I'm new to Struts) Picture the following: A jsp page, login.jsp. It has a form. An action class, LoginAction.java. A form class, LoginForm.java. LoginAction does exactly what you would expect. It checks the database for the user and password. If the user or password is invalid, it loads a message into errors, and then calls saveErrors() in ActionBase. The difference in what I'm doing vs. the Struts examples is that, rather than using forward functionality to return back to login.jsp on errors, I'm using redirect instead. I don't want the URL in the browser to be login.do. You see the problem. Errors are stored to the request context, which is no longer valid after the redirect, therefore the errors tag can not retrieve the errors. I would suggest that session context should be used for the errors tag for cases just like this, although that causes problems as well. The problem will be, when does it get removed from the session? Is there another way to accomplish the same thing, without tacking the error on to the redirect URL? Thanks, Doug --- Doug Ahmann Macromedia, Inc. (612) 840-9544
Re: CommandToken
I posted a set of struts Tags on struts-dev back in October based on "Web Development with Java Server Pages" Token with complete JavaDoc documentation. I guess you could search the 'covalent ?' web site fore the exact message and attachments. William Jaynes wrote: I've been playing with adding the CommandToken functionality as described in the Fields/Kolb book "Web Development with Java Server Pages", but I'm not doing so well. In the book the setting of the command token takes place after the controlling servlet calls the command.execute() method (like the struts action.perform() method?), but before the servlet actually forwards to the corresponding jsp. I can't seem to find where this is in the struts world. My attempts so far haven't panned out. If anyone has implemented this I'd like to know how you did it. Thanks for any info, Will Jaynes -- Rob Leland [EMAIL PROTECTED] (+01-202-544-0533) CGH Technologies FAA ATA 200 Lab
Re: Struts on Dynamo 5.0
I've looked at this more and one problem is that Dynamo does automatic URL rewriting. That is what is messing up the links. I'm trying to turn it off. The buttons aren't showing up because the method doEndTag() is being run, but nothing is being printed from it. If I call doEndTag() from doStartTag(), it works (minus the body content). So the only thing left are the unexplained XML parsing errors. I've e-mailed [EMAIL PROTECTED] with these issues. I may refer them to you, Craig, if they tell me doEndTag() should work this way. David --- "Craig R. McClanahan" [EMAIL PROTECTED] wrote: Thanks for your report, David. See comments below. David Winterfeldt wrote: Is anyone running Struts on Dynamo 5.0? I can't the latest build to run correctly. I've listed the errors I was getting below. Any help would be apprectiated. David A few errors are XML errors that I assume are typos (see below). Struts.tld has the value of 'name' instead of true for the property element under textarea and password. Dynamo has a problem with this. I believe this typo is also under v0.5. I fixed this in the "struts.tld" that will be included in Struts 1.0. I mapped the struts example to simple for the root. The links from the index.jsp are writing the link like this. http://cmsnew:8840/simple/simple/editRegistration.do?action=Create I cannot tell for sure, but this looks like it might be either a Dynamo problem, or a problem with the way that the form:base/ tag works. Could you do a View Source on one of the sample app pages and send it to me? Another is that the buttons don't show up for forms once I type in the URL directly. I would bet this is the same issue as the previous one. Parse Error at line 69 column 29: Attribute "validate" must be declared for elem ent type "action". Attribute "validate" must be declared for element type "action". at org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:969) Parse Error at line 78 column 29: Attribute "validate" must be declared for elem ent type "action". Attribute "validate" must be declared for element type "action". at org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:969) The "validate" attribute was recently added to the DTD entry for the "action" element. Are you sure that you are using a very recent Struts distribution? Parse Error at line 135 column 17: The content of element type "struts-config" m ust match "(data-source,form-beans?,global-forwards?,action-mappings?)". The content of element type "struts-config" must match "(data-source,form-beans? ,global-forwards?,action-mappings?)". The implication of this message is that you have elements in your struts-config.xml file that are not in the order specified. Is this happening on the struts example app itself? (It might also be related to the complaints about the "validate" attribute.) Craig __ Do You Yahoo!? Yahoo! Shopping - Thousands of Stores. Millions of Products. http://shopping.yahoo.com/
RE: CLASSPATH problems (I think)
The web deployment directory structure was standardized in Tomcat 3.1. The Tomcat 3.1 download package has a good explanation of this in the doc/appdev folder. (My apologies if you already knew this - I found the writeup to be very helpful.)
RE: Struts on Dynamo 5.0
I am familiar with a few issues regarding Dynamo 5.0. There may be a naming conflict since Dynamo under the covers has a FormTag class just like struts does. We have some prototypes that we have been writing and ended up renaming any classes that might have a conflict. (e.g. CPFormTag.java). So far this works, but we are mostly running/testing with Tomcat right now. Mike K. ChannelPoint, Inc. -Original Message- From: David Winterfeldt [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 05, 2000 1:38 PM To: [EMAIL PROTECTED] Subject: Re: Struts on Dynamo 5.0 I've looked at this more and one problem is that Dynamo does automatic URL rewriting. That is what is messing up the links. I'm trying to turn it off. The buttons aren't showing up because the method doEndTag() is being run, but nothing is being printed from it. If I call doEndTag() from doStartTag(), it works (minus the body content). So the only thing left are the unexplained XML parsing errors. I've e-mailed [EMAIL PROTECTED] with these issues. I may refer them to you, Craig, if they tell me doEndTag() should work this way. David --- "Craig R. McClanahan" [EMAIL PROTECTED] wrote: Thanks for your report, David. See comments below. David Winterfeldt wrote: Is anyone running Struts on Dynamo 5.0? I can't the latest build to run correctly. I've listed the errors I was getting below. Any help would be apprectiated. David A few errors are XML errors that I assume are typos (see below). Struts.tld has the value of 'name' instead of true for the property element under textarea and password. Dynamo has a problem with this. I believe this typo is also under v0.5. I fixed this in the "struts.tld" that will be included in Struts 1.0. I mapped the struts example to simple for the root. The links from the index.jsp are writing the link like this. http://cmsnew:8840/simple/simple/editRegistration.do?action=Create I cannot tell for sure, but this looks like it might be either a Dynamo problem, or a problem with the way that the form:base/ tag works. Could you do a View Source on one of the sample app pages and send it to me? Another is that the buttons don't show up for forms once I type in the URL directly. I would bet this is the same issue as the previous one. Parse Error at line 69 column 29: Attribute "validate" must be declared for elem ent type "action". Attribute "validate" must be declared for element type "action". at org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:969) Parse Error at line 78 column 29: Attribute "validate" must be declared for elem ent type "action". Attribute "validate" must be declared for element type "action". at org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:969) The "validate" attribute was recently added to the DTD entry for the "action" element. Are you sure that you are using a very recent Struts distribution? Parse Error at line 135 column 17: The content of element type "struts-config" m ust match "(data-source,form-beans?,global-forwards?,action-mappings?)". The content of element type "struts-config" must match "(data-source,form-beans? ,global-forwards?,action-mappings?)". The implication of this message is that you have elements in your struts-config.xml file that are not in the order specified. Is this happening on the struts example app itself? (It might also be related to the complaints about the "validate" attribute.) Craig __ Do You Yahoo!? Yahoo! Shopping - Thousands of Stores. Millions of Products. http://shopping.yahoo.com/
Re[4]: Article on JavaWorld
Hello Ted, Tuesday, December 05, 2000, 5:59:58 PM, you wrote: TH Do you think Thor's Validation code could be extended to use the TH standard i18n mechanism for number and date formatting, but regex for TH others? I found this mechanism not ideal... More useful can be model where fields and validation rules for it defined in config file for struts not directly in classes or in jsp pages. There we can define separate field sections or incorporate it to the form sections. With each field section we can define all data needed to to validate input values. Now I use import/export methods in form beans to converse data to/from String values. public void importEntity( EntityBean value, HttpServletRequest request, ActionErrors errors ) throws ServletException {} public EntityBean exportEntity( EntityBean value, HttpServletRequest request, ActionErrors errors ) throws ServletException {} For each time bean with data used as source to populate form fields (with i18n support) and at save moment export method is called to populate bean with data from form bean. All conversion errors this mechanism stores in standart errors container. This is not ideal. Problem is hard coded conversions. Each conversion is some strings of code, where DateFormat or NumberFormat classes are used to import/export values. I think that all conversion logic can be incorporated to BeanUtils and instead of separate set/get callings populate method with automatic values conversions on i18n basis can be used. All rules for this conversions can be stored in struts config file and retrieved by the digester. For example, some fields of form are defined in struts config file and all conversions with it can be performed by BeanUtils in automatic mode. Some count of fields has set/get methods too, but are not defined in struts config - this fields would be populated in old manner and can be Strings only. But all it is a raw idea... But there are already exists some such solutions in my pocket.. 8) One of them - bean:format tag, which derived from bean:write tag to support properties printing with i18n support. Number, date, time values can be printed with it. For special cases I can specify special format and print values in special manner. I glad to pass it to the community. -- Best regards, Olegmailto:[EMAIL PROTECTED]
Re: Article on JavaWorld
Ted Husted wrote: More to the point, do you have any thoughts about his AutoBean or Validator interfaces? The "AutoBean" concept has been requested several times, often in the guise of "beans with dynamic properties" so that you don't have to create a form bean with individual getters and setters. I'd like to explore this concept in depth in Struts 1.1, which will give us time to make sure that a complete and coherent set of support for such beans can be included (for example, all the custom tags that know how to extract bean properties should now how to extract them from an AutoBean, without the page developer having to do anything). The "Validator" concept is interesting. Besides the server-side format checking that is being done here, I would also like to see the option for the form tags to generate client-side JavaScript code (if requested) to check as many things like this as you can on the client side, to improve the user experience. -T. Craig
Re: Struts on Dynamo 5.0
I can get the doEndTag() to work in Dynamo if I change pageContext.getOut() to getPreviousOut(). JspWriter writer = getPreviousOut(); //JspWriter writer = pageContext.getOut(); Should this cause any problems? David --- David Winterfeldt [EMAIL PROTECTED] wrote: I've looked at this more and one problem is that Dynamo does automatic URL rewriting. That is what is messing up the links. I'm trying to turn it off. The buttons aren't showing up because the method doEndTag() is being run, but nothing is being printed from it. If I call doEndTag() from doStartTag(), it works (minus the body content). So the only thing left are the unexplained XML parsing errors. I've e-mailed [EMAIL PROTECTED] with these issues. I may refer them to you, Craig, if they tell me doEndTag() should work this way. David --- "Craig R. McClanahan" [EMAIL PROTECTED] wrote: Thanks for your report, David. See comments below. David Winterfeldt wrote: Is anyone running Struts on Dynamo 5.0? I can't the latest build to run correctly. I've listed the errors I was getting below. Any help would be apprectiated. David A few errors are XML errors that I assume are typos (see below). Struts.tld has the value of 'name' instead of true for the property element under textarea and password. Dynamo has a problem with this. I believe this typo is also under v0.5. I fixed this in the "struts.tld" that will be included in Struts 1.0. I mapped the struts example to simple for the root. The links from the index.jsp are writing the link like this. http://cmsnew:8840/simple/simple/editRegistration.do?action=Create I cannot tell for sure, but this looks like it might be either a Dynamo problem, or a problem with the way that the form:base/ tag works. Could you do a View Source on one of the sample app pages and send it to me? Another is that the buttons don't show up for forms once I type in the URL directly. I would bet this is the same issue as the previous one. Parse Error at line 69 column 29: Attribute "validate" must be declared for elem ent type "action". Attribute "validate" must be declared for element type "action". at org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:969) Parse Error at line 78 column 29: Attribute "validate" must be declared for elem ent type "action". Attribute "validate" must be declared for element type "action". at org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:969) The "validate" attribute was recently added to the DTD entry for the "action" element. Are you sure that you are using a very recent Struts distribution? Parse Error at line 135 column 17: The content of element type "struts-config" m ust match "(data-source,form-beans?,global-forwards?,action-mappings?)". The content of element type "struts-config" must match "(data-source,form-beans? ,global-forwards?,action-mappings?)". The implication of this message is that you have elements in your struts-config.xml file that are not in the order specified. Is this happening on the struts example app itself? (It might also be related to the complaints about the "validate" attribute.) Craig __ Do You Yahoo!? Yahoo! Shopping - Thousands of Stores. Millions of Products. http://shopping.yahoo.com/ __ Do You Yahoo!? Yahoo! Shopping - Thousands of Stores. Millions of Products. http://shopping.yahoo.com/
Re: Authentication question
Ralf Utermann wrote: Hi all, we are just about to start a project using Struts; maybe I can get some hints on two things: - authentication: In many services here we rely on DCE for authentication. This is also done for Web-based cgi-apps with Paul Henson's mod_auth_dce for Apache. Two questions: - anybody knows of a DCE solution in the Java servlet/Jsp environment? I don't know of any off the top of my head. - if I keep the setup with relying on this Apache module for authentication, what's the best method to get the users name within the struts environment? Doesn't the username show up as the value of request.getRemoteUser()? What's the best method to organize access to different actions based on the fact, that I don't need a password but already have an authenticated user name from Apache? For Tomcat, at least, the Apache connector passes on the authenticated username as the value you receive via getRemoteUser(). This means you can base decisions on this fact, because you receive the user identity on every request. - For JDBC connections and the mysql/mm configuration, which is the recommended open source connection pool solution? A very simple connection pool was added to the Struts 1.0 code base last week, which will work across any JDBC 2.0 compatible driver. You configure it within the struts-config.xml file. Any connection pool implementation that implements the javax.sql.DataSource interface (from the JDBC 2.0 standard extention API) can be used instead, and still receive the benefit of automatic configuration support. The archives of this list contains pointers to various others. TIA, Ralf -- Ralf Utermann Craig
Re: EJB references
I'll be using ELB's for my application when I start building it in a few weeks time (still in the design stage). I expect to be using only EJBs from a action servlet, that are session beans, and those session beans use entity beans. From previous work I found there was too much overhead using the entity beans directly in the generation of a html page, and you rarely needed that direct conncetion to the database anyway. As for the references, I'm not sure what you mean. I'll be putting things like the JNDI and connection information into to web.xml as startup parameters. "Boulatian, Misak" wrote: Hi all, The application we design is quite large. I am still trying to figure out the question on EJB references. From the Craig Mcc.'s comment I could put those in one startup servlet. Is it a viable solution? I am going to have many session references. Where am I going to store those references (in servlet context)? How can I make those available to action classes? Or I can put only the handle in the servlet context and call lookup in every action class (any scalability problems with this approach?). I cannot believe that none of you worked in large applications and will not be using EJBs for business logic and did not go over this kind of issue. I appreciate response, Misak Boulatian
Re: Question about errors tag
[big snip ...] Is there another way to accomplish the same thing, without tacking the error on to the redirect URL? Probably not, no. I can't see where you'd store the errors. In the session would cause problems with synchronisation, and on the redirect URL could cause buffer problems (with more then 1024 bytes of errors). You could store it in the session, if you used a unique identifier to store them, and pass that identifier through to the redirected URL. I'd think you need to look at *why* you don't want the action URL displayed in the first place. You could always be sneaky and use a hidden frame to force the URL to always be the same.
Re: Nesting form inside ifParameterEquals
You can use java script. I posted a message about this to the struts-dev mailing list a few days ago. I don't have the email, but you can find it in the mail archives, which I don't have a reference for either. Nikolaus Rumm wrote: Hello, what I wanted to do is... struts:ifParameterEquals name="action" value="create" struts:form action="/html/user/storeUser.do?action=create" name="userForm" type="com.kephera.scivent.client.participant.UserForm" /struts:ifParameterEquals struts:ifParameterEquals name="action" value="edit" struts:form action="/html/user/storeUser.do?action=edit" name="userForm" type="com.kephera.scivent.client.participant.UserForm" /struts:ifParameterEquals However, under struts 0.5 the tag's body and thus the form tag is not evaluated, but the whole page is skipped. Is there a way to dynamically alter the action of a struts:form tag ? Regards Nikolaus
Re: CLASSPATH problems (I think)
I think that should be the server.xml file - Original Message - From: "Eyassu, Daniel" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, December 06, 2000 3:16 AM Subject: RE: CLASSPATH problems (I think) I don't use TOMCAT, but at least in Weblogic there is a properties file that maps web application to specific directories. I would think TOMCAT should have a config file that contains similar mappings. -Original Message- From: De Smet Koen [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 05, 2000 10:48 AM To: Struts Mailinglist (E-mail) Subject: CLASSPATH problems (I think) Hello, I've posted a question on this last week and finally found the solution myself, but there's still something wrong in my configuration somewhere and I still have some questions. The problem is that the files under the webapps/project/WEB-INF/lib are not found. It's obvious that the problem has something to do with the CLASSPATH. A solution for all this could be to manually add each path, .jar, ... in the OS Classpath, but I don't think this is a good solution. Don't think it's a good idea to change the CLASSPATH manually each time you create an application. I suppose TOMCAT should know at startup to add for each webapp the lib directory to the CLASSPATH. Why are those directories and files not recognized? Also when I try to access a package webapps/project/WEB-INF/classes/prog/package2 from a Java file in webapps/project/WEB-INF/classes/prog/package1 (import prog.package2.*), an error occurs (package prog.package2 does not exists). I hope you can help me with this. I think that many "Resource-bundle-related" questions can be solved the same way my problems will be solved... Greetings, Koen De Smet P.S. Is it possible to alter tomcat.bat and add the next lines? set _LIBJARS2= for %%i in (%TOMCAT_HOME%\webapps\*\lib) do call %TOMCAT_HOME%\bin\cpappend.bat %%i set CP=%CP%%_LIBJARS2% The information in this email is confidential and is intended solely for the addressee(s). Access to this email by anyone else is unauthorised. If you are not an intended recipient, you must not read, use or disseminate the information contained in the email. Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of The Capital Markets Company. http://www.capco.com ***
Re: Article on JavaWorld
If you're prepared to be patient, I need both of these, and can work on them but I won't be able to start unitl January on the development of it. The AutoBean idea (as an idea) is something I use already in Cold Fusion, and have done before in PL/SQL. The client side validator, as I posted before I have a good JavaScript validation library I can use, and am happy for it to be included. "Craig R. McClanahan" wrote: The "AutoBean" concept has been requested several times, often in the guise of "beans with dynamic properties" so that you don't have to create a form bean with individual getters and setters. I'd like to explore this concept in depth in Struts 1.1, which will give us time to make sure that a complete and coherent set of support for such beans can be included (for example, all the custom tags that know how to extract bean properties should now how to extract them from an AutoBean, without the page developer having to do anything). The "Validator" concept is interesting. Besides the server-side format checking that is being done here, I would also like to see the option for the form tags to generate client-side JavaScript code (if requested) to check as many things like this as you can on the client side, to improve the user experience.
debugging with struts/tomcat/JBuilder
Has anyone successfully debugged a struts 0.5 application running on Tomcat 3.2, with JBuilder 4 Foundation version? I'm able to start Tomcat from JBuilder in debug mode, but I don't know how to open a source file from my struts application and have it stop execution at my breakpoints. Thanks
Re: Article on JavaWorld
Wellington, but...what if the company has only Java programmers as JSP designers ? Most of these arguments are based on cultural more than technical reasons. There are still problems with, for example, scriptlets even in a situation like this. JSPs are not a particularly code-friendly environment. And re-use is more difficult. So I think even if the Java programmers are designing the pages, using scriptlets will tend to make life more difficult. I think these are sound technical objections. Dave Dave Harms [EMAIL PROTECTED]