html:errors error?
I just noticed that my error messages are acting strange. I recently changed to a nightly build (approx 1/2). For example, instead of getting the text: You must specify a Contact Name. I am now getting: null You must specify a Contact Name. null There are no substitution parms in the properties spec: error.no_contact_name=You must specify a Contact Name. The html generated almost looks like there are two null error entries: font color=red bnull You must specify a Contact Name. null but when I add my message the error array is empty. Anyone else on a nightly build noticed any funny error messages? Thanks, Frank Lawlor Athens Group, Inc. (512) 345-0600 x151 Athens Group, an employee-owned consulting firm integrating technology strategy and software solutions. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Subclassing ActionMapping
Struts makes it easy to subclass ActionForm, ActionServlet. Is there a way to specify that ActionMapping is subclassed and have struts create mappings for calls to the perform methods that are of my subclass? Thanks, Frank Lawlor Athens Group, Inc. (512) 345-0600 x151 Athens Group, an employee-owned consulting firm integrating technology strategy and software solutions. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Indexed html:radio is broken
I could be mistaken, but this seems related to the issue I noticed recently, which is that the property attribute (and apparently, the name/property pair, in the indexed case) is improperly overloaded to serve two purposes, I agree with you that there are many ways one might want to map the collection to the radio buttons and the limited set of html:radio properties can't handle all the reasonable things one might want to do. You should submit your proposal. Can it handle the scenario that Dave Hay also raised? Frank Lawlor Athens Group, Inc. (512) 345-0600 x151 Athens Group, an employee-owned consulting firm integrating technology strategy and software solutions. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Indexed html:radio is broken
That way the buttons SHOULD all have the same name for each iteration, and different one for the next one etc.. That was the thinking behind it. Thanks for your quick and helpful response. That is yet another reasonable interpretation of how to map the collection to radio buttons. There many reasonable ways one might want to map the collection. I think is important that 1) the tag supports the reasonable mappings (e.g., how do I do what I wanted to do using the html:radio tag) 2) since there are many possible mappings and how to do it is NOT AT ALL INTUITIVE there needs to be some decent documentation and examples. I think it would be good to start this process by defining some of the mappings it should support. This would include mapping of the collection information to the button specs and the mapping of the button selection back to the collection (or something else - e.g., makes sense to me to allow mapping of the selected value to a single variable). David Karr seems to have some good suggestions. Frank Lawlor Athens Group, Inc. (512) 345-0600 x151 Athens Group, an employee-owned consulting firm integrating technology strategy and software solutions. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Indexed html:radio is broken
Maybe I'm misunderstanding how to use html:radio with indexed, but it seems broken to me. If I specify: logic:iterate name=ListForm property=itemList id=item ... ... html:radio indexed=true name=item property=contact ... / then it generates code like: input type=radio name=item[0].contact ... input type=radio name=item[1].contact ... ... which puts every button in its own button group (the name MUST stay the same)! Further, the mapping of a button group to a collection opens a lot of questions. In trying to figure out how html:radio might behave (the documentation is COMPLETELY lacking in semantic description!) I could think of several possible behaviors, not all of which are exclusive. This is even more true when value is brought into the picture. Is there some description somewhere of how this is supposed to operate (the documentation on the website does NOT explain any of this)? What about examples (I found nothing useful in the examples or the forum posts)? Is this a bug? Frank Lawlor Athens Group, Inc. (512) 345-0600 x151 Athens Group, an employee-owned consulting firm integrating technology strategy and software solutions. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
A suggestion for Product-quality Code
Now that Struts has passed its 1.0 birthday I would like to suggest something that I think would help the many users it is attracting. When I have lead development groups I have explained one of the differences between a prototype and a product as programming for more that the narrow path. What I mean by this is that a prototype can, and often should, only worry about making things work so long as the user stays on some narrow path to the goal (stray off the path and you die a horrible death). A product needs to be more robust. In particular it needs to expect that users WILL attempt. out of ignorance, malice or inspiration, to use it in ways not intended. In the case of Struts users, it can help their productivity if misuses are clearly called to the developers attention. Unfortunately, many of the likely Struts errors result simply in silence. I have spent many hours tracking down problems (usually mine) and even having to trace into Struts code to do it. Specifically, some of the problems I have run into are: - If the ActionForm name is not defined in struts-config, silence - If the ActionForward string is not found, silence - If no app.properties found, pretty close to silence - if you say html:text indexed=yes (should be true), silence (note, the documentation implies it should be yes) - If the ActionError type is not found, silence In most of these cases exception and/or log entries would be very helpful. Don't get me wrong. Struts is great and the developers have done a great job (congratulations!), but now that it is attracting a wider following, it is time to also help the many developers be more productive. Frank Lawlor Athens Group, Inc. (512) 345-0600 x151 Athens Group, an employee-owned consulting firm integrating technology strategy and software solutions. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Struts intermittently not working after startup
Error 500: No action instance for path /findEntity could be created ... I've gotten this type of thing when I'm changing any of the action classes during development. I assume struts might be doing its own class loading and I'm pulling the old class out from under it. If you are not modifying the classes, I don't know what might be the cause. By the way, is there any way to tell struts to re-initialize itself, including reloading the classes? Frank Lawlor Athens Group, Inc. (512) 345-0600 x151 Athens Group, an employee-owned consulting firm integrating technology strategy and software solutions. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: 500 Error
I just upgraded to Tomcat 4.01 and get the following exception: javax.servlet.ServletException: Servlet.init() for servlet jsp threw exception at org.apache.catalina.core.StandardWrapper.load(StandardWrapper. java:871) . java.lang.NoSuchMethodError at org.apache.jasper.compiler.TldLocationsCache.processJars(TldLo cationsCache.java:202) One possible cause of this is having an incorrect (usually old) version of a class/jar in your path. - Make sure you have installed all correct version of any jars. - Make sure you don't put jars in the jre lib or lib/ext dirs unless they belong there. - The above seems to indicate a problem with the org.apache.jasper.compiler.TldLocationsCache class so look to see where this is located (probably in some jasper*.jar) and make sure its not an old one. Tomcat should have the correct version in jasper/jasper-compiler.jar Frank Lawlor Athens Group, Inc. (512) 345-0600 x151 Athens Group, an employee-owned consulting firm integrating technology strategy and software solutions. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Dynamic SQL query library
While not politically correct I too use a CachedRowSet, by setting a property in my FromBean of rowset to accomplish this. For more see http://developer.java.sun.com/developer/earlyAccess/crs Vic Note, however, that CachedRowSet is no commercially redistributable (Stated on the above reverence). Frank Lawlor Athens Group, Inc. (512) 345-0600 x151 Athens Group, an employee-owned consulting firm integrating technology strategy and software solutions. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Struts Design question
But my beans already contain the validation! Besides, performing the validation in the ActionForm is effectively tying business logic (data validation) to the web framework dontya think? Well, I put data type and required field validation only in the bean. Validation that is more advanced than that, or based on business rules should be in your app server (if you have one), or in the action object. While the response might be OK in a specific solution, I think it is, in general, the wrong partitioning of the validation issue. The questioner was more on the correct track. To understand the more general case, consider the case where a company has a database(s) and is developing multiple applications, some may even be developed by 3rd parties. How do they look at the data validation issue? Any DB administrator will tell you HE/SHE is responsible for the DB integrity, not the (irresponsible :-) app developers: - The data integrity issues need to be defined by those who really understand and are responsible for them. This includes business data rules. - You don't want to replicate the validation in multiple applications. - You don't want to have to change multiple applications and the database simultaneously if there are changes. - etc., etc., etc. Note that this doesn't mean ALL validation is associated with the database, just that which relates to the data model and the business integrity of the data base. If one app requires certain data, another app different data, and the database doesn't care, then it is the application responsibility. To address this we defined a set of objects which front the database. They worry not only about validation, but also things specific to the database (e.g. query language), connection pooling, etc. To work well with web applications these objects need to have a validation interface that lets you provide the total set of new (string?) data and allows the object to return field-specific and object-general error information. This is also a good place to place the common business data rules (not application rules) so that all applications use one common set, maintenance is consistent, etc. In VERY simple cases you could merge this with Action classes, but generally there are significant differences, no 1-1 relationship, etc. Frank Lawlor Athens Group, Inc. (512) 345-0600 x151 Athens Group, an employee-owned consulting firm integrating technology strategy and software solutions. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: File upload facility / file manager example app
Does anyone out there know of an opensource, java based file upload facility or file manager app ??? You will have to check the licensing statements yourself but two sources: - the struts source download has an upload app - the O'Reilly website has a very complete dicussion and sample code of this (search on upload). Frank Lawlor Athens Group, Inc. (512) 345-0600 x151 Athens Group, an employee-owned consulting firm integrating technology strategy and software solutions. winmail.dat Description: application/ms-tnef -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Problem with Struts in IBM VisualAge 3.5.2
- Did you remove IBM's XML parser and install the correct Xerces version? - Did you add your application project to the Class Path | Project Path of the TomcatRunner class? - Check to make sure you have ...\VisualAge for Java\ide\project_resources\Apache_Tomcat_Test_Environment\webapps\employeeli st\WEB-INF\struts-config.xml - Make sure the struts-config.xml format is correct (start with a known good one just to check) - You don't have any security enabled (IBM\VisualAge for Java\ide\program\lib\security\java.policy) do you? Make sure a simple app can open a file. Frank Lawlor Athens Group, Inc. (512) 345-0600 x151 Athens Group, an employee-owned consulting firm integrating technology strategy and software solutions. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: How to pass beans this way with Struts?
Frank Lawlor wrote: Because this needs to be open-ended and dynamic, my project managers can easily define a new 'page type' and define the beans they will provide to these client pages. To make this easy to use yet flexible, they use JSPs to define the beans to be passed for any page type. E.g.: Ted Husted wrote The project managers would define ActionForm beans, and map these to Action in the Struts-config. You would then not need to define the beans in the JSP. The Struts html:form tag takes care of this. It sees where you are submitting the form, and then looks for or creates the appropriate bean. No scriptlets needed. ... Thanks for the response. My concern with this is that it means deploying new classes, updating the config, possibly restarting the app, etc. With my current approach it usually just means the definition of a simple JSP (understood technology) and uploading the file to a directory. Then there is still the issue of dynamically invoking a client-defined JSP. Currently I use an XML file to define the dynamic JSPs. There is an easy client interface to pick the desired 'style' for any page type. Using the struts approach would mean some kind of dynamic generation of the forwards and reprocessing. I guess I'll have to see if I can integrate my current design w/struts, but I hate having multiple ways of doing the same sort of thing. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
How to pass beans this way with Struts?
I'm new to Struts and trying to see how to best map an existing app to Struts. In my current app I let clients define certain page types (e.g., 'home', 'contacts', etc.) To allow this and still have some security I put the client pages in their own web app. There may be any number of these client pages with any name. To invoke them, I populate the request with beans they may use and then forward to the client version of the page. Because this needs to be open-ended and dynamic, my project managers can easily define a new 'page type' and define the beans they will provide to these client pages. To make this easy to use yet flexible, they use JSPs to define the beans to be passed for any page type. E.g.: % ... com.athensgroup.autoweb_projects.AGTable table = new com.athensgroup.autoweb_projects.AGTable(cons); table.setTableTitle(Data-driven Contacts Table); table.setColumnNames(new String[]{Cons.NAME, Cons.COMPANY, Cons.PHONE, Cons.EMAIL, Cons.ROLE}); table.setColumnLabels(new String[]{Name, Company, Phone, e-mail, Role}); request.setAttribute(ContactsTable, table); % First issue seems to be how to manage some arbitrary number of app beans. Do I need to map these into some one Form bean? How can this be done when these are an arbitrary number of these beans which may dynamically added for any given page 'type'? The next question is how to forward to some page in another app which is dynamically discovered. I don't see any way statically define the forwards (needs to be dynamic). If this is too hard for struts, can I just do my own includes, forwards, etc. as I do now without impacting the rest of the app which uses struts? Frank Lawlor Athens Group, Inc. (512) 345-0600 x151 Athens Group, an employee-owned consulting firm integrating technology strategy and software solutions. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Question/Issue with forward specifications
In my code I had accidentally typed: return mapping.findForward(succcess); (note the 3 c's) Instead of getting a runtime error my app just went nowhere? 1) why doesn't findForward() throw an exception rather than returning null? 2) more generally, I am concerned about errors that you cannot discover until runtime and then only by ensuring you have tested every possible situation. One of the important things about Java is the emphasis on catching things at compile time. It would be good in the design of Struts to keep some focus on allowing error detection at compile time, or at least at application init. In the above case for example, there may be some way to use static constants rather than strings. It would be good to look at some of the other Struts elements. This may not seem like a big deal to some people, but I remember well the 'bad old days' of maintaining applications with interpreted code. Runtime discovery of bugs is a bad characteristic for quality apps. Introspect, don't interpret. Frank Lawlor Athens Group, Inc. (512) 345-0600 x151 Athens Group, an employee-owned consulting firm integrating technology strategy and software solutions. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Need help in Running employeelist example in VAJ3.5.3 and WTE
when i try to acess the application in browser http://localhost:808/employeelist/index.jsp it says following error. An error has occured while processing request:http://localhost:8080/employeelist/index.jsp Message: Server caught unhandled exception from servlet [jsp]: Missing message for key index.heading Take a look in the log files and see if there are any errors or odd messages during initialization of the app. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: JDBCRealms
When using JDBCRealm with Tomcat, does anyone know if the user's roles are loaded from the database for each request, or are they loaded once and held in a session object? I'm pretty sure the database is always queried. If you have debug on you can see the calls. This is important if you want to dynamically change the roles. Frank Lawlor Athens Group, Inc. (512) 345-0600 x151 Athens Group, an employee-owned consulting firm integrating technology strategy and software solutions. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Missing message for key index.title - My Problem Found
When I try to run the struts-example in Tomcat 4.0 (jre 1.3.1, NT 4, SP6) I get the infamous Missing message for key index.title I noticed tho, that the logs have an earlier exception trying to load /WEB-INF/struts-config.xml: 2001-11-30 12:45:39 action: Initializing configuration from resource path /WEB-INF/struts-config.xml 2001-11-30 12:45:39 StandardWrapper[/struts-example:action]: Marking servlet action as unavailable 2001-11-30 12:45:39 StandardContext[/struts-example]: Servlet /struts-example threw load() exception javax.servlet.UnavailableException: Missing configuration resource for path /WEB-INF/struts-config.xml at org.apache.struts.action.ActionServlet.initMapping(ActionServlet.java:1316) at org.apache.struts.action.ActionServlet.init(ActionServlet.java:465) ... The error is coming in ActionServlet.initMapping on the lines: InputStream input = getServletContext().getResourceAsStream(config); if (input == null) throw new UnavailableException (internal.getMessage(configMissing, config)); Changing the first line to String path = getServletContext().getRealPath(config); input = new java.io.FileInputStream(path); throws a security exception! (it doesn't seem right that getServletContext().getResourceAsStream(config) swallows this!) I have security on and it isn't allowing file access! Unfortunately, I can't see a proper fix for this. It should be possible to fix it by granting permission in catalina.policy, but the spec to give struts.jar permission, e.g.: grant codeBase file:${catalina.home}/webapps/struts-example/WEB-INF/lib/- { permission java.security.AllPermission; }; doesn't work because of a Tomcat bug loading libraries from /WEB-INF/lib. Moving the lib to tomcat/common/lib also seems to have problems with derived classes in the /WEB-INF/classes classes. HOWEVER, the tomcat bug can be worked around by exploding struts.jar into your /WEB-INF/classes directory. This may not be everyone's solution to the infamous Missing message for key index.title (see post Missing message for key index.title - general comments). Frank Lawlor Athens Group, Inc. (512) 345-0600 x151 Athens Group, an employee-owned consulting firm integrating technology strategy and software solutions. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Missing message for key index.title - general comments
I noticed lots of people having struts problems with this symptom. From what I have seen of the struts startup, many startup problems will cause this to be the first symptom for the example app. This kind of one error for all situations makes diagnosis difficult. Looking in the log may clarify the problem, but I noticed that some of the problems do not produce obvious log entries (errors are swallowed). I have some suggestions that struts (and web apps generally) can use to help make it easier to debug installation and other similar startup problems. 1) Don't just swallow errors without a clear error log entry. E.g., getServletContext().getResourceAsStream(config) just swallows security exceptions. Not good. It does return a null, but this is not enough to identify the problem. 2) keep some type of structure in which some meaningful message can be sent to the application interface. For example, initialization and other code can put some indication of the problem in an Errors structure. When the user makes a query the application (or struts infrastructure) can check to see if Errors is non-empty and display a special error page which will provide better help in diagnosing the problem. 3) install and config problems can be more easily diagnosed by explicitly checking for necessary pre-conditions (e.g., file access, network access, etc.) and generating specific errors. This could be run separately or optionally as part of init. Frank Lawlor Athens Group, Inc. (512) 345-0600 x151 Athens Group, an employee-owned consulting firm integrating technology strategy and software solutions. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Missing message for key index.title getResourceAsStream()
When I try to run the struts-example in Tomcat 4.0 (jre 1.3.1, NT 4, SP6) I get the infamous Missing message for key index.title I notice tho, that the logs have an earlier exception trying to load /WEB-INF/struts-config.xml: 2001-11-30 12:45:39 action: Initializing configuration from resource path /WEB-INF/struts-config.xml 2001-11-30 12:45:39 StandardWrapper[/struts-example:action]: Marking servlet action as unavailable 2001-11-30 12:45:39 StandardContext[/struts-example]: Servlet /struts-example threw load() exception javax.servlet.UnavailableException: Missing configuration resource for path /WEB-INF/struts-config.xml at org.apache.struts.action.ActionServlet.initMapping(ActionServlet.java:1316) at org.apache.struts.action.ActionServlet.init(ActionServlet.java:465) ... The error is coming in ActionServlet.initMapping on the lines: InputStream input = getServletContext().getResourceAsStream(config); if (input == null) throw new UnavailableException (internal.getMessage(configMissing, config)); For some reason the getResourceAsStream() call is failing. The xml file IS there and I tried a lot of (valid) variations on the location and name and they all fail. There seems to be something wrong with getResourceAsStream(). Is this because it is in the init of the servlet? Frank Lawlor Athens Group, Inc. (512) 345-0600 x151 Athens Group, an employee-owned consulting firm integrating technology strategy and software solutions. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Missing message for key index.title - Problem Found
I found the problem, at least in my installation, and maybe for others. I have security turned on. This causes all the application accesses to local files (e.g., properties, struts-config.xml, etc.) to fail. This isn't apparent since many of the methods seem to silently swallow the security exception. Unfortunately, I can't see how to fix this. It should be possible to fix it by granting permission in catalina.policy, but the spec to give struts.jar permission, e.g.: grant codeBase file:${catalina.home}/webapps/struts-example/WEB-INF/lib/- { permission java.security.AllPermission; }; doesn't work because of a Tomcat bug loading libraries from /WEB-INF/lib. Moving the lib to tomcat/common/lib also seems to have problems with derived classes in the /WEB-INF/classes classes. Frank Lawlor Athens Group, Inc. (512) 345-0600 x151 Athens Group, an employee-owned consulting firm integrating technology strategy and software solutions. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Missing message for key index.title - Workaround
One way to workarounf the Tomcat security bug in loading libs is to explode struts.jar into your /WEB-INF/classes directory. Frank Lawlor Athens Group, Inc. (512) 345-0600 x151 Athens Group, an employee-owned consulting firm integrating technology strategy and software solutions. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
PLEASE, PLEASE, PLEASE UNSUBSCRIBE ME!!!!!!!!!
PLEASE, PLEASE, PLEASE UNSUBSCRIBE ME! Isn't there anyone managing this listserver? After many requests I still cannot get unsubscribed! try [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] etc. (Yes, I have tried the automated way.) PLEASE, PLEASE, PLEASE UNSUBSCRIBE ME! PLEASE, PLEASE, PLEASE UNSUBSCRIBE ME! PLEASE, PLEASE, PLEASE UNSUBSCRIBE ME! PLEASE, PLEASE, PLEASE UNSUBSCRIBE ME! Frank Lawlor
Please Unsubscribe Me!
I've been trying without luck to unsubscribe with the official mechanism even though my subscription note says the userid IS correct. Notes to [EMAIL PROTECTED] have gotten no response. subscriber id: [EMAIL PROTECTED] try also: [EMAIL PROTECTED] [EMAIL PROTECTED] and any capitalization variants on the above. I'd appreciate anyone with access to the listserve removing me from the list Thanks, Frank Lawlor Athens Group, Inc. (512) 345-0600 x151 Athens Group, an employee-owned consulting firm integrating technology strategy and software solutions.
RE: (architectural issue/feature request) JavaBeans in Struts aren't flexible enough
I agree 100%. We do the same thing. Most of our DBAccessor classes fill a HashMap from the DB tables and we use bean.getProperty(name) to access them. This means we do not need to do maitenance on the classes to add new properties. Just add it to the database and use it in the JSP. This is much more extensible and maintainable. Frank Lawlor Athens Group, Inc.