RE: Struts Validator / dynamically enabling/disabling
I tend to use the DispatchAction mechanism for forms that are used to do create/update/delete of objects. The pattern I have fallen into is having cancel be another one of the dispatch methods in this case. I have validation turned on for the form, but, conditionally disable the validation both on the client-side and on the server-side based upon the setting of the dispatch method. It is actually quite easy to do for the client-side implementation. You already have to explicitly provide the onSubmit event handler for the form anyway. No one is forcing you to call the JavaScript function generated by the html:javascript/ tag. So, I have my own JavaScript function that conditionally calls the validateYourFormNameHere() function based on the setting of the dispatch method. An example of mine looks like this: function handleFormValidation(form) { result = true; if (form.dispatchMethod.value == save) { result = validateModifyUserForm(form); } return result; } On the server-side, this does require a form class where you can put the conditional logic in your validate() form function override. However, this doesn't prevent me from using DynaForms for the tedious getters and setters. It just means I have to extend the flavor of DynaForm I am using depending on whether action-based or form-based validation is being used. In the form class, you only override the validate function and conditionally call the super.validate() based upon the setting of the dispatch method in the form. You can still define all the form properties in your Struts configuration file. I'm not thrilled with this approach, but, it does work within the current architecture to make the validation somewhat dynamic without being overly complex. Your mileage may vary. :-) - Mike Van Riper mailto:mvanriper;verisign.com P.S. Having the cancel method in the same DispatchAction subclass that handles creates/updates/deletes has worked nicely for workflows that are multiple steps too. I tend to use session scope beans in that case both for the form and for related workflow data. So, I can have common logic for releasing session scope resources for the workflow in one common action for create/update/delete/cancel. -Original Message- From: Thomas Delnoij [mailto:t.delnoij;imn.nl] Sent: Wednesday, October 30, 2002 6:58 AM To: Struts Users Mailing List Subject: Struts Validator / dynamically enabling/disabling Hi. I am using the Struts Validator in conjunction with a ValidatorForm. My html form has two submit buttons, one for saving without validation, another one with validation. Is it possible to dynamically switch on and of the validator depending on which button is pressed? I could of course dynamically set the action attribute of the form tag, using JavaScript. But I don't want to depend on JavaScript being switched on/off in the clients browser. Another possibility, that didn't convince me up intil now, is writing a custom validate method, that checks for the value of the clicked button. This method could be called before every other validate method and return false in the case no validation is necessary and an empty ActionErrors Object to make the framework assume everything is OK. Would this work? Any suggestions? Thomas Delnoij Internet Engineer IMN - SSE Baarn Mobile: +31 6 144 300 14 EMail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
RE: Tiles and parameters...
Unless I'm missing something here, you simply use: request.getParameter(fieldid); in scriptlet code in any of your leaf JSPs to access this request parameter. You can also use bean:define in conjunction with this to define a bean at the top of your page for use as a bean reference in other Struts tags within your JSP pages. You must be new to JSP development. I recommend taking a look at the JSP spec. In particular, section 2.8 of the JSP 1.1 spec lists the implicit objects available to all JSP pages. Good Luck, Mike Van Riper mailto:[EMAIL PROTECTED] -Original Message- From: Craig Tataryn [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 26, 2002 5:03 AM To: [EMAIL PROTECTED] Subject: Re: Tiles and parameters... Anyone have any suggestions? From: Craig Tataryn [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Tiles and parameters... Date: Sun, 24 Nov 2002 00:39:23 -0600 I am using a tiles for a project where I have the following scenario: a href=forecast.do?fieldid=1Forecast for Field 1/a The action for forecast.do, simply does some data extraction and then returns a forward to a tiles def which displays this data. Here is what the existing tiles def looks like: definition name=site.forecast extends=site.introPage put name=body value=/chart.jsp / put name=left value=/form/displayChartSummary.jsp/ /definition However, each of these jsp pages really should be passed the fieldid parameter that the Forecast action was passed. Is there anyway to get my Forecast action to pass this fieldid parameter to the pages setup in the tiles def it is going to forward to? Or is there any other technique you might suggest as a workaround (don't particularly want to throw things in the session as I want the fieldid to be at the request level so users can see forecasts for different fields at the same time). Thanks, Craig. Craig W. Tataryn Programmer/Analyst Compuware _ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] Craig W. Tataryn Programmer/Analyst Compuware _ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Tiles and parameters...
Craig, Yes, I am relatively new to Tiles. This is my first major project using it and we make extensive use of Tiles in our webapp. We also use the display taglib and take advantage of its column sorting support. Sorting of table data is handled automatically by this taglib using request parameters and it works fine in our webapp. For example, the default display of our user list is sorted in ascending order based on the values in the 4th column (zero based sort offset in example below) of the listing like so: /portal/admin/users/list.dbm?order=ascsort=3 This will trigger the following action mapping in our struts-config.xml file: actionpath=/portal/admin/users/list type=com.verisign.dbms.portal.ListUsersAction forward name=success path=portal.admin.users.list/ /action And the following tile definitions are interpreted when the success forward is used: definition name=portal.admin.users.list extends=portal.admin.users put name=menu value=portal.menu.admin.users.modify / put name=body value=portal.body.admin.users.list / /definition definition name=portal.body.admin.users.list extends=portal.body.admin.users put name=bodyContent value=/portal/admin/users/list.jsp / /definition And the list.jsp usings the display taglib tags: display:table width=90% name=%=UserMgmtBean.KEY% property=users scope=session requestURI='%=request.getContextPath() + /portal/admin/users/list.dbm%' ... /display:table In the layout JSP that ultimately includes the bodyContent value above, we are using: tiles:insert attribute=bodyContent/ which is comparable to the example that you suggest I try. So, I can honestly say that I have tried it and it works. :-) Without rummaging through the display taglib source, the traversal through action mapping to action with forward to the tile definition that ultimately displays our master page layout containing the leaf listing JSP is working to control sorting. So, the request parameters are getting through to the leaf listing JSP. Otherwise, the display tags wouldn't be responding to the request parameter settings that control how to sort the list contents. We are working with the version of Tiles integrated in Struts 1.1-b2. Maybe you are working with a different version of Struts/Tiles. If so, that might explain why something similar isn't working for you. In any case, it sounds like you have a workaround for now. - Van -Original Message- From: Craig Tataryn [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 27, 2002 9:59 AM To: [EMAIL PROTECTED] Subject: Re: Tiles and parameters... sighYou must be new to Tiles :) It doesn't seem to work. Try it for yourself, make yourself a controller called MyController who's success forward, forwards to a tiles template called tiles.template. The tiles template can looks something like this: definition path=mainlayout.jsp name=tiles.template put name=page1 value=/page1.jsp / put name=page2 value=/page2.jsp/ /definition Your mainlayout.jsp would look something like this: html body tiles:insert attribute=page1/ tiles:insert attribute=page2/ /body /html In page1.jsp put the following: h1%=request.getParameter(param1)%/h1 Call your controller like so: MyController.do?param1=1 You will get the error: bean param1 not found within scope. However, I found a solution. In MyController, I simply use request.getParameter(param1) and then take that value and place it back in using request.setAttribute. Tiles or Struts does not seem to preserve the request parameters from the original call for the Tiles which are being forwarded to, so you have to do it manually (which might make sense?). Craig. P.S. I have read the specs :) - Original Message - From: Van Riper, Mike [EMAIL PROTECTED] To: 'Craig Tataryn' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, November 26, 2002 11:42 AM Subject: RE: Tiles and parameters... Unless I'm missing something here, you simply use: request.getParameter(fieldid); in scriptlet code in any of your leaf JSPs to access this request parameter. You can also use bean:define in conjunction with this to define a bean at the top of your page for use as a bean reference in other Struts tags within your JSP pages. You must be new to JSP development. I recommend taking a look at the JSP spec. In particular, section 2.8 of the JSP 1.1 spec lists the implicit objects available to all JSP pages. Good Luck, Mike Van Riper mailto:[EMAIL PROTECTED] -Original Message- From: Craig Tataryn [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 26, 2002 5:03 AM To: [EMAIL PROTECTED] Subject: Re: Tiles and parameters... Anyone have any suggestions? From: Craig Tataryn [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject
RE: Tiles and parameters...
Oops! Forgot to reply to the mailing list too. ListUsersAction is my code. I do nothing with the request parameters required by the display tags to support table sorting. This is why I assumed it would work for you too. I have no idea why it doesn't work for you. As Cedric Dumoulin, *the* developer of Tiles, mentioned in a separate response, the only obvious reason it would not work is in the event of redirecting rather than forwarding. Based on your initial response, I'm sure you know that though. So, that is probably not it. In my case, it worked both with Tomcat 4.0.3 for early development testing and with Weblogic 6.1 (with service pack 3) in our production environment. Definitely whacky stuff. Sorry that I couldn't be more help. - Van -Original Message- From: Craig Tataryn [mailto:[EMAIL PROTECTED]] Sent: Friday, November 29, 2002 7:01 AM To: Struts Users Mailing List Subject: Re: Tiles and parameters... Whacky whacky stuff. Are you completely sure that ListUsersAction isn't doing a request.setAttribute for the order and sort parameters it recieves? Is this display taglib custom? I don't see you passing it the order and sort parameters through it's attributes, meaning that it is getting them from some other source (session)? Perhaps ListUserAction is somehow priming the display:table tag... Craig. - Original Message - From: Van Riper, Mike [EMAIL PROTECTED] To: 'Craig Tataryn' [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Thursday, November 28, 2002 1:03 AM Subject: RE: Tiles and parameters... Craig, Yes, I am relatively new to Tiles. This is my first major project using it and we make extensive use of Tiles in our webapp. We also use the display taglib and take advantage of its column sorting support. Sorting of table data is handled automatically by this taglib using request parameters and it works fine in our webapp. For example, the default display of our user list is sorted in ascending order based on the values in the 4th column (zero based sort offset in example below) of the listing like so: /portal/admin/users/list.dbm?order=ascsort=3 This will trigger the following action mapping in our struts-config.xml file: actionpath=/portal/admin/users/list type=com.verisign.dbms.portal.ListUsersAction forward name=success path=portal.admin.users.list/ /action And the following tile definitions are interpreted when the success forward is used: definition name=portal.admin.users.list extends=portal.admin.users put name=menu value=portal.menu.admin.users.modify / put name=body value=portal.body.admin.users.list / /definition definition name=portal.body.admin.users.list extends=portal.body.admin.users put name=bodyContent value=/portal/admin/users/list.jsp / /definition And the list.jsp usings the display taglib tags: display:table width=90% name=%=UserMgmtBean.KEY% property=users scope=session requestURI='%=request.getContextPath() + /portal/admin/users/list.dbm%' ... /display:table In the layout JSP that ultimately includes the bodyContent value above, we are using: tiles:insert attribute=bodyContent/ which is comparable to the example that you suggest I try. So, I can honestly say that I have tried it and it works. :-) Without rummaging through the display taglib source, the traversal through action mapping to action with forward to the tile definition that ultimately displays our master page layout containing the leaf listing JSP is working to control sorting. So, the request parameters are getting through to the leaf listing JSP. Otherwise, the display tags wouldn't be responding to the request parameter settings that control how to sort the list contents. We are working with the version of Tiles integrated in Struts 1.1-b2. Maybe you are working with a different version of Struts/Tiles. If so, that might explain why something similar isn't working for you. In any case, it sounds like you have a workaround for now. - Van -Original Message- From: Craig Tataryn [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 27, 2002 9:59 AM To: [EMAIL PROTECTED] Subject: Re: Tiles and parameters... sighYou must be new to Tiles :) It doesn't seem to work. Try it for yourself, make yourself a controller called MyController who's success forward, forwards to a tiles template called tiles.template. The tiles template can looks something like this: definition path=mainlayout.jsp name=tiles.template put name=page1 value=/page1.jsp / put name=page2 value=/page2.jsp/ /definition Your mainlayout.jsp would look something like this: html body tiles:insert attribute=page1/ tiles:insert attribute=page2/ /body /html
Validation DTD bug?
Before submitting a bug report on this, I wanted to verify that I am doing this correctly. This isn't causing any real runtime problems at this point. I just discovered the problem when I turned on DTD validation in my IDE. I am working with the 1.1-b2 release, but, I checked and the same problem exists in the 20021206 nightly build. The validation_1_1.dtd file has the following element definition for field elements: !ELEMENT field (msg?, arg0?, arg1?, arg2?, arg3?, var* ) Shouldn't this be: !ELEMENT field (msg*, arg0*, arg1*, arg2*, arg3*, var* ) Unless I am missing something, the DTD should allow for multiple definitions of each subelement in a field element definition. As an example of why this is so, I have a validation definition for a field that has both minimum and maximum length validations specified. The error messages for both of these validations want to insert the number for the minimum or maximum length as the arg1 value. So, I need more than one arg1 definition inside the 'field definition. The example from my working application is: field property=zip depends=required,minlength,maxlength,mask msg name=mask key=msg.zip.invalid/ arg0 key=prompt.zip/ arg1 name=minlength key=${var:minlength} resource=false/ arg1 name=maxlength key=${var:maxlength} resource=false/ var var-nameminlength/var-name var-value5/var-value /var var var-namemaxlength/var-name var-value10/var-value /var var var-namemask/var-name var-value${zipLong}/var-value /var /field This example from my code only requires multiple arg1 definitions, but, the same principle applies to the other arg fields. Similarly, I could contrive an example that would require multiple definitions for msg. The convention in the examples provided with the release always reserve arg0 for the display name of the field. So, I suppose you could make an argument for not needing support for multiple arg0 elements. Still, the DTD probably shouldn't rely on that convention. - Mike Van Riper [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: [OT] Learning Curve Management or Confusions of a Newbie
I think the Java Tutorial trail approach would be a good fit for this: http://java.sun.com/docs/books/tutorial/reallybigindex.html For example, there already is a Creating a GUI with JFC/Swing trail: http://java.sun.com/docs/books/tutorial/uiswing/index.html Similar to this in concept, there could be a Building a webapp with Struts trail. Granted, this may not belong in the reallybigindex maintained by Sun because Struts is under the Apache umbrella. However, it might be time to setup a reallybigindex for an online Apache Tutorial comprised of trails similar to the way trails are used in Sun's online Java Tutorial. Specifically with respect to learning Struts though, there is already a significant amount of online learning material to be found directly or indirectly from here: http://jakarta.apache.org/struts/learning.html Still, I do see the value in having trails that organize some of the online information in various trails to follow through this wealth of information. I'm not sure how to go about initiating such a project at Apache, but, I am willing to volunteer some time to contribute to the creation of a Building a webapp with Struts trail. Does anyone else think this would be a good idea? Anyone else interested in volunteering some time to build a Struts trail? If there is enough interest, I would be glad to setup a separate mailing list for further discussion among interested volunteers on creation of this trail. Thanks, Mike Van Riper mailto:[EMAIL PROTECTED] -Original Message- From: Simon Kelly [mailto:[EMAIL PROTECTED] Sent: Friday, March 07, 2003 1:01 AM To: Struts Users Mailing List Subject: Re: [OT] Learning Curve Management or Confusions of a Newbie Jeff you are not alone in this. I've been at this for six months and have gone through pretty much the same set of problems. The thing with what you are suggesting (and this is only my opinion) is, Who will do it *AND* look after it?. The trouble is (and I have found this through searching the net) the shear volume of papers, documents, examples and postings (150+ per day) that would have to be referenced and collected to make this of any use to people. And I have to say, I DO NOT want the job :-) Cheers Simon - Original Message - From: Jeff Smith [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Friday, March 07, 2003 9:05 AM Subject: [OT] Learning Curve Management or Confusions of a Newbie I have to confess, I'm a newbie. I've been a C/C++ programmer for 20 years, but after dinking around for a few months with ASP, VBScript, PHP and a few other technologies, I decided that Java was the language to build my web apps in. A month ago I was completely cold. Didn't know the first thing about any of this stuff. But I knew I wanted to learn it, so off I went, marching into the high weeds. First I had to learn Java. Then came servlets and JSPs and Tomcat. And along that path I also had to absorb Ant. And JUnit. And Log4J. And then there was a bunch of time lost exploring NetBeans/Eclipse/WebSphere before settling on JEdit as my environment of choice. Then came Struts, and all the various taglibs. An experiment with Cayenne. And Cactus. And god-knows what else I've explored. And through it all, I am continually amazed at the strength and breadth of the resources and support available. And equally frustrated by it. I can never remember where I saw a particular bit of information. So when I finally learn enough to understand what Ted was talking about in his monograph on Connection Pooling, I can't remember where I saw it. And when I want to learn enough about EJBs to figure out if I need to care about them, or if they are relevant to my planned project, I have to wade through another day of voluminous coverage before I have enough of a handle on what they are to make some intelligent guesses about where to look next. My point is that I believe the Apache/Java/Struts/... universe is quickly reaching a point where its very breadth is becoming a barrier to entry for people who don't have a couple of months to devote to bootstrapping themselves. Is there any thought being given to creating a higher-level resource interface that could serve as a single point of reference for all things Apache? (I realize that all things java would be going way too far.) As a simple solution, if every document in the Apache infrastructure had a meta tag that listed the questions answered by the document, then a very powerful, automated FAQ could be maintained. And such a system would make it much easier (I believe) to find things quickly than simply searching the site for key words. This may not be the best (or only) solution, but I do believe that for all the very specific support and discussions there are, there is really very little over-view material to assist
RE: [struts-atlanta]
I am envious every time I see one of these postings for the Struts user group in Atlanta. Anyone interested in helping me start a Struts user group in silicon valley? If so, please contact me. If there is enough interest, I will setup a mailing list for the group and we can start planning an initial user group meeting. Thanks, Mike Van Riper mailto:[EMAIL PROTECTED] P.S. I'm a Struts developer at VeriSign in Mountain View. I work on enterprise webapps for VeriSign's security services. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[ANNOUNCE] struts-silicon-valley
I have received several responses from others interested in starting a local Struts user group in Silicon Valley. So, I went ahead and setup a mailing list for the user group. Based on initial responses, I'm leaning towards an initial meeting location somewhere in the vicinity of Palo Alto. If you would like to be one of the founding members of the group, please join the mailing list soon. I plan to use the mailing list to make plans with other founding members for an initial group meeting. You can join the group here: http://groups.yahoo.com/group/struts-silicon-valley Given the high volume of traffic on this list, I'm going to wait a week to give people (that don't monitor the struts-user list on a daily basis) a chance to read and respond to this message. After that, I'll initiate the planning discussion for the first group meeting using the new struts-silicon-valley list. Realistically, the first meeting will probably be scheduled for sometime in April. That's all folks, Mike Van Riper mailto:[EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[ANN] struts-silicon-valley meeting on April 2nd in Palo Alto
The inaugural meeting of the Silicon Valley Struts user group will be a dinner meeting at 7:30pm on Wednesday, April 2nd, in Palo Alto at Jing Jing: http://www.jingjingonline.com/ Please send your RSVPs directly to me [EMAIL PROTECTED] by noon on April 2nd. I have participated in several group meals at this restaurant and the food is excellent. There are also plenty of vegetarian options to choose from. I hope you can join us. Please come prepared to discuss group logistics going forward. For starters: 1. What topics you would like to see covered at future meetings. 2. Any suggestions you have with respect to potential speakers or meeting venues. If you have contacts that might help us with lining up suggested speakers or meeting venues, that would be even better. 3. Of course, we will take some time to find out a bit about each other and our own experiences with Struts too. That's all folks, Mike Van Riper mailto:[EMAIL PROTECTED] P.S. If you would like to get future struts-silicon-valley announcements, you can join our mailing list here: http://groups.yahoo.com/group/struts-silicon-valley P.P.S. Yes, they do serve beer at Jing Jing unless your name is Mark Galbreath. Just seeing who actually reads to the end of this message. ;-) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: validator plugin
Michael, I ran into this problem myself and the online review chapters of Chuck Cavaness' Struts book provided the answer. According to the chapter on the Struts Validator, There was some confusion in one of the earlier beta releases for the Validator that used multiple set-property elements. That is no long supported and you should use a single set-property element that specifies multiple Validator resource files, separated by a comma. Also notice that the property value is the plural *pathnames*. Your example code indicates you are using the deprecated form with separate set-property elements. Try this instead: plug-in className=org.apache.struts.validator.ValidatorPlugIn set-property property=pathnames value=/WEB-INF/conf/validator-rules.xml,/WEB-INF/conf/validation.xml/ /plug-in Assuming you are working with the latest beta release or a recent nightly build, this should help. Good luck, Mike Van Riper mailto:[EMAIL PROTECTED] -Original Message- From: Michael Delamere [mailto:[EMAIL PROTECTED]] Sent: Saturday, August 17, 2002 2:01 AM To: Struts Users Mailing List Subject: validator plugin Hi, I´m having problems using the validator plugin. When leaving fields blank, I expect struts to take me back to the registration form. I copied most of the code from an example and read the chapter concening this topic in the orreilly book. For some reason though it appears that nothing is happening! Well, I added my own version of the validation mehod in my form bean just to see if it goes in there at all and it does. However the ActionErrors is always empty. VALIDATE === public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { ActionErrors errors = super.validate(mapping, request); System.out.println(VALIDATING!! + errors.size()); // this always returns 0 return errors; } = STRUTS-CONFIG Here are my entries in my struts-config.xml: form-bean name=registrationForm type=com.morelogs.ims.formbeans.RegisterFB/ action path=/saveRegister type=com.morelogs.ims.actions.SaveRegisterAction name=registrationForm input=register.do scope=request validate=true forward name=success path=/../WEB-INF/templates/Register_ok.vm / forward name=error path=/../WEB-INF/templates/Register.vm/ /action [...] plug-in className=org.apache.struts.validator.ValidatorPlugIn set-property property=pathname value=/WEB-INF/conf/validator-rules.xml/ set-property property=pathname value=/WEB-INF/conf/validation.xml/ /plug-in == I´ve rechecked the files about 10 times and I just don´t seems to be able to get it to work. Another question I have is, when validation is false, do I get redirected back to the form automatically or do I have to specify this in the Action class using: return mapping.findForward(registrationForm); ? Any help on this matter would be greatly appreciated, Thanks, Michael -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Why html:javascript failed?
I had this same symptom when trying to use client-side validation with deprecated form of plug-in specification for the Validator plug-in. If you are using separate property elements to specify multiple xml files for your validator plugin, you need to use a single set-property with plural property name of "pathnames" and the multiple files comma separated in the value field. In my installation, the correct configuration looks like this: plug-in className="org.apache.struts.validator.ValidatorPlugIn" set-property property="pathnames"value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/ /plug-in Just because you are having similar symptoms, it doesn't necessarily mean it is being caused by the same problem. Still, it is worth checking your plug-in configuration to make sure you aren't using the deprecated form with separate set-property elements. Good luck, Mike Van Riper mailto:[EMAIL PROTECTED] -Original Message-From: Kwang-Shi Shu [mailto:[EMAIL PROTECTED]]Sent: Tuesday, August 20, 2002 1:06 PMTo: Kwang-Shi Shu; Struts Users Mailing ListSubject: Why html:javascript failed? I am running the "struts-validator/jsRegistration.jsp" from Tomcat 4.0.4 with Struts 1.1-b1 on IE5 from Windows XP. The screen shows the "// End --" as follows: (Please see jsRegister.doc When I clicked the "Save" button, I got (Please see error.doc) When I viewed the source code vis "View Source", I notice that ===beginning of excerpt == /form // End -- /SCRIPT /body /html ==end of excerpt== There is no JavaScript tag. Apparently something is wrong. Could somebody explain this and show me how to work around this problem? Thanks. Kwang-Shi smime.p7s Description: application/pkcs7-signature
RE: Right way to extends Action
-Original Message- From: Xavier Saint-Denis [mailto:[EMAIL PROTECTED] Sent: Monday, March 31, 2003 4:21 AM To: Struts Users Mailing List Subject: Re: Right way to extends Action Hi, In our application we use a similar concept : - we have a class like this : public abstract class BaseAction extends Action What about DispatchAction and LookupDispatchAction? Anyone have a good solution for reuse of common action logic across these multiple action base classes provided by Struts? In this class : - we added some usefull field like a logger an a pointer to a singleton that retains application's data protected Log log = LogFactory.getLog(this.getClass()); protected static final Infos infos = Infos.getInstance(); - We change the modifier of the execute Method so as to be sure nobody use it directly: public final ActionForward execute(ActionMapping _mapping, ActionForm _form, HttpServletRequest _req, HttpServletResponse _res) throws Exception { - In this method we check the user session and log in information - At the end of this method we call return executeAction(_mapping, _form, _req, _res); - This method executeAction is defined as this : public abstract ActionForward executeAction(ActionMapping _mapping, ActionForm _form, HttpServletRequest _req, HttpServletResponse _res) throws Exception; - So when we create a new action, we extend BaseAction and implement the abstract method executeAction This way, we have automatic user login check, and a logger at disposition. regards, Xavier - Original Message - From: niksa_os [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, March 31, 2003 1:45 PM Subject: Right way to extends Action I want all my Actions to extend BaseAction. In BaseAction I want to check user session and to put some data in it, if that data doesn't exist. Is it good way: public class SomeAction extends BaseAction { public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response ) { super.execute( mapping,form, request, response); OK, proceed ... public class BaseAction extends BaseAction { public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response ) { if (userSession is wrong) { -try -- put data in session -catch -- return mapping.findForward(wrongSession);} else return null; //everything is OK What you think about this way and is there better way to extend Action? Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Right way to extends Action
-Original Message- From: V. Cekvenich [mailto:[EMAIL PROTECTED] Sent: Monday, March 31, 2003 5:58 PM To: [EMAIL PROTECTED] Subject: Re: Right way to extends Action What about DispatchAction and LookupDispatchAction? Anyone have a good solution for reuse of common action logic across these multiple action base classes provided by Struts? I wrote my own dispatch: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/basicportal/bP/ WEB-INF/src/war/org/apache/scaffoldingLib/base/BaseAct.java .V I think this is the strategy I will be going with myself. Since we have the source of these helper actions, I think it is cleaner to have common action logic in one base action class of my own and then extend all my application actions from this one base action class. I'm good at cut/paste. So, it is easy to create my own versions from Struts sources for the helper classes that extend from my own base action class. :-) Still, that means I need to track changes made in these helper actions as Struts improves over time. I would hate to miss out on any refinements/improvements made over subsequent releases. Which is why I was wondering if there was a better way that I am missing. - Van [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: PHP version of Struts
At JavaOne this week one of the announcements about future plans was for scripting language support, specifically in the context of web pages, that will focus initially on PHP support. It was suggested that an initial reference implementation of this would provide PHP support in a future release of Tomcat. This is at the early JSR stage now. So, it would not be of much use any time soon. Still, it seemed worth mentioning in the context of this discussion. The JSR for this is JSR-223, Scripting Pages in Java Web Applications: http://www.jcp.org/en/jsr/detail?id=223 FYI, Van Mike Van Riper mailto:[EMAIL PROTECTED] -Original Message- From: Brandon Goodin [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 11, 2003 3:30 PM To: Struts Users Mailing List Subject: RE: PHP version of Struts It's PHP... what do you think? Brandon Goodin -Original Message- From: Lai, Kenny [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 11, 2003 4:22 PM To: 'Struts Users Mailing List' Subject: RE: PHP version of Struts the question is, is it as good as struts -Original Message- From: Brandon Goodin [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 11, 2003 6:22 PM To: Struts User List Subject: PHP version of Struts Would you use it? http://phrame.sourceforge.net/ Brandon Goodin - 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: PHP version of Struts
Wow! A lot of discussion about this in less than 24 hours. I'm still catching up and haven't read all the messages yet. So, I apologize if someone else already addressed what I am about to say. First of all, I am neither for or against this initiative personally. I have not done any PHP development myself and probably never will. Still, I thought this would be interesting to the person asking the original question about PHP and Struts. Secondly, the initial thrust for a reference implementation is around PHP because of the wide adoption of PHP as a web page scripting language. However, my best understanding of the brief announcements I have seen at JavaOne suggest the real focus is opening up web page development to any reasonable web page scripting language out there with PHP as the initial proof of concept. Personally, I wouldn't get hung up on whether PHP is a good fit with Struts or not. The real take home message is they are taking a serious look at better support for the commonly used scripting languages out there today for web page development. - Van Mike Van Riper mailto:[EMAIL PROTECTED] -Original Message- From: Van Riper, Mike Sent: Wednesday, June 11, 2003 4:05 PM To: Struts Users Mailing List Subject: RE: PHP version of Struts At JavaOne this week one of the announcements about future plans was for scripting language support, specifically in the context of web pages, that will focus initially on PHP support. It was suggested that an initial reference implementation of this would provide PHP support in a future release of Tomcat. This is at the early JSR stage now. So, it would not be of much use any time soon. Still, it seemed worth mentioning in the context of this discussion. The JSR for this is JSR-223, Scripting Pages in Java Web Applications: http://www.jcp.org/en/jsr/detail?id=223 FYI, Van Mike Van Riper mailto:[EMAIL PROTECTED] -Original Message- From: Brandon Goodin [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 11, 2003 3:30 PM To: Struts Users Mailing List Subject: RE: PHP version of Struts It's PHP... what do you think? Brandon Goodin -Original Message- From: Lai, Kenny [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 11, 2003 4:22 PM To: 'Struts Users Mailing List' Subject: RE: PHP version of Struts the question is, is it as good as struts -Original Message- From: Brandon Goodin [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 11, 2003 6:22 PM To: Struts User List Subject: PHP version of Struts Would you use it? http://phrame.sourceforge.net/ Brandon Goodin - 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]
July 2nd meeting at 7pm in Mountain View
We had a nice turnout for the Struts User gathering in San Francisco last week. It was good to see several of our group members in attendance. Our next meeting is scheduled to take place in Mountain View at 7pm on Wednesday, July 2nd. A demonstration of Exadel Struts Studio, by Igor Shabalov, will show why you need more than just a Java IDE to be a productive Struts User. Please refer to the online announcement for the details and directions to the meeting site: http://www.baychi.org/calendar/20030702/ It is important that I get an accurate headcount in advance for meeting facility planning purposes and for determining how much pizza and soft drinks to order. So, please do RSVP in advance per the instructions in the online announcement. I'll make sure that the facilities and food are adequate for all that RSVP by noon on the day of the event. Thanks, Van Mike Van Riper mailto:[EMAIL PROTECTED] http://www.baychi.org/bof/struts - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: FW: Validation DTD bug? (impacts my use of Struts Console)
James, I never received any feedback, but, they did address this problem in the just announced release of the 1.0.1 version of the Commons Validator. The DTD in this version has the following DOCTYPE specification: !DOCTYPE form-validation PUBLIC -//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.0//EN http://jakarta.apache.org/commons/dtds/validator_1_0.dtd; And the ELEMENT definition in the DTD for field elements has been changed to this: !ELEMENT field (msg|arg0|arg1|arg2|arg3|var)* Until a future release of your tool that supports this new version of the Commons Validator, I can continue to hand edit my validation.xml files directly. My main concern was that the DTD allow for the necessary field validation definitions going forward and this has been dealt with. So, I'm a happy camper now. It would have been nice for someone to let me know they were taking care of it when I asked though. Oh well. Cheers, Mike Van Riper [EMAIL PROTECTED] -Original Message- From: James Holmes [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 12, 2002 12:48 PM To: Van Riper, Mike Subject: RE: FW: Validation DTD bug? (impacts my use of Struts Console) Actually, I think this message is best targeted at the Commons Validator lists. I think you're right about the DTD, but haven't fully looked into it. If you get feedback from the Commons lists let me know. -james --- Van Riper, Mike [EMAIL PROTECTED] wrote: -Original Message- I'm guessing your Validator config file issue is similar. I don't think it is. The DOCTYPE in that case was already using the 1.1 versioning like so: !DOCTYPE form-validation PUBLIC -//Apache Software Foundation//DTD Validation Configuration 1.1//EN http://jakarta.apache.org/struts/dtds/validation_1_1.dtd; I believe this has more to do with the original issue I posted on the struts-user list. My validation.xml file doesn't validate successfully against this DTD requirement: !ELEMENT field (msg?, arg0?, arg1?, arg2?, arg3?, var* ) because when you use both the minlength and maxlength validations on a single field, you end up with more than one arg1 element inside the field element definition like so: field property=zip depends=minlength,maxlength arg0 key=prompt.zip/ arg1 name=minlength key=${var:minlength} resource=false/ arg1 name=maxlength key=${var:maxlength} resource=false/ var var-nameminlength/var-name var-value5/var-value /var var var-namemaxlength/var-name var-value10/var-value /var /field Unless the arg1 is defined separately for minlength and maxlength validations, it is not possible to generate the correct validation error message with the appropriate minlength or maxlength value inserted in the error message. This is why I suggested that the DTD needed to change like so: !ELEMENT field (msg?, arg0*, arg1*, arg2*, arg3*, var* ) This way, you are allowed to specify different argx values for substitution in the error message when different validation rules are violated. I realize this is a validation DTD issue and not a Struts Console issue. However, it is preventing me from using the Struts Console in the recommended fashion with validation turned on and I do believe this is a validator DTD bug. I've already changed my local copy of the DTD so I can validate against it in my IDE, IntelliJ. However, this doesn't help me when I try to use the Struts Console on my validation.xml file. I'm surprised that I didn't get a single response when I posted this on the struts-user list before. Should I have posted this on the struts-dev list instead? - Mike Van Riper [EMAIL PROTECTED] P.S. James, Thanks again for your help correcting my DOCTYPE specification for tile definitions. I am able to edit tile definitions now using your tool without leaving the comfort of my Java IDE. :-) __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Placing a Scriptlet inside bean:message
I believe support for this depends upon whether the custom tag is configured in the tag library descriptor file to support runtime expressions for the attribute in question. I just looked at the struts-bean.tld for B2 and the key attribute of the message tag has the rtexprvalue set to true. So, it should support this sort of thing. I believe the docs for the various Struts custom tags also state whether runtime expressions are supported for particular tag attributes. However, the tag library descriptor information is used by the JSP engine. So, you can definitely count on that information whether the docs say it is so or not. FYI, Van -Original Message- From: Lister, Tom (ANTS) [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 03, 2002 5:30 AM To: 'Struts Users Mailing List' Subject: RE: Placing a Scriptlet inside bean:message I'm sure we've done this recently along the lines of e.g. bean:message key=%= beanref.getText()%/ :-) Tom Lister * 020 7612 3030 * [EMAIL PROTECTED] -Original Message- From: Sudhir S. Shetty [mailto:[EMAIL PROTECTED]] Sent: 03 September 2002 13:31 To: Struts Users Mailing List Subject: Placing a Scriptlet inside bean:message Hi Everybody, Is it possible to place a scriptlet inside the key attribute for the bean:message tag? TIA, Sudhir -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] ** * This communication (including any attachments) contains confidential information. If you are not the intended recipient and you have received this communication in error, you should destroy it without copying, disclosing or otherwise using its contents. Please notify the sender immediately of the error. Internet communications are not necessarily secure and may be intercepted or changed after they are sent. Abbey National Treasury Services plc does not accept liability for any loss you may suffer as a result of interception or any liability for such changes. If you wish to confirm the origin or content of this communication, please contact the sender by using an alternative means of communication. This communication does not create or modify any contract and, unless otherwise stated, is not intended to be contractually binding. Abbey National Treasury Services plc. Registered Office: Abbey National House, 2 Triton Square, Regents Place, London NW1 3AN. Registered in England under Company Registration Number: 2338548. Regulated by the Financial Services Authority (FSA). ** * -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: iterate question
I have a similar need to the one expressed by Kirby. I have not used the nested extension, but, I have read through the online primer. I saw nothing there that would indicate it would handle *dynamic* tree structures. Yes, you can use the nesting custom tags to any depth you want. Yes, you don't need to know in advance how many items there are in a collection at a particular level. However, it looks like you need to know in advance what depth to go to. When the tree is being generated dynamically and the depth can not be known in advance, I don't see how to use the nesting extension to handle it. I hope that I am wrong about that because I'd love to just use the nesting extension rather than write something on my own. If the nesting extension can handle this situation, please point me to the right part of the docs or an existing example that will help me figure that out. Assuming I am right and the nesting extension doesn't handle what I need yet, my sense is there might be a way to enhance the nesting extension to handle this for recursive structures. For example, consider a Node object that had some instance data and a collection of child Node objects and a getChildNodes() method. What if nested:iterate took an additional parameter which was recurseProperty=childNodes? It should be possible to implement tail recursion in the implementation of nested:iterate that would repeat the execution of the body of the nested:iterate tag with the new collection being the one returned from the getChildNodes() call on the current node. This would do a depth first recursion of nodes outputting the same information for each node. Assuming there is a way to get depth information, I could use that information in the body of my nested:iterate and dynamically reflect that in the formatting of the nodes for display too. Of course, it is not that simple. There would be intermediate state to maintain and correctly return to and continue on from for each time a recursion to another level happened. The nesting extension does quite a bit already and this may not be the best way to solve my recursive structure handling problem. Then again, maybe it would make sense. I thought it was at least worth sharing the idea. - Mike Van Riper mailto:[EMAIL PROTECTED] -Original Message- From: Sri Sankaran [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 04, 2002 11:29 AM To: Struts Users Mailing List Subject: RE: iterate question Look at the nested extension @ http://www.keyboardmonkey.com/next/index.jsp. It is exactly for this purpose. It is included as part of Struts 1.1.x Sri -Original Message- From: Kirby Vandivort [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 04, 2002 12:13 PM To: [EMAIL PROTECTED] Subject: iterate question Hello, I'm new to struts, so please bear with me. I'm in the early stages of converting something to the struts framework and I've run into a situation that I'm not sure how to handle. I want to make a page that, as an example, looks like: - message 1 - message 2 * re: message 2 + re: re: message 2 * re: message 2 * re: message 2 - message 3 etc. So, I'm going to pass a collection to the jsp page, and the collection might contain collections. There can be any level of nesting. This seems like a common case, but I haven't found a way to do it using the struts tags as of yet. It really needs some sort of recursive solution since you don't know how many levels you will need to go down, and the presentation is something that clearly shouldn't be done on the business side, so any help or guidance that you have would be appreciated. Thanks! -- Kirby Vandivort Theoretical Biophysics Group Email: [EMAIL PROTECTED] 3051 Beckman Institute http://www.ks.uiuc.edu/~kvandivo/University of Illinois Phone: (217) 244-5711405 N. Mathews Ave Fax : (217) 244-6078Urbana, IL 61801, USA -- To unsubscribe, e-mail: mailto:struts-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: iterate question
Of course, I immediately found an example for handling dynamic nesting as soon as I posted that I hadn't. Figures. There are some example projects that use the nested custom tags in the resource section of the Jakarta Struts site. One of them uses a relatively simple trick (once you have seen it, it seems simple :-)) with dynamic inclusion of a JSP to handle node data. You will find it on this page: http://jakarta.apache.org/struts/resources/examples.html It is the one called Tree (dynamic nested fun). Duh. - Mike Van Riper mailto:[EMAIL PROTECTED] -Original Message- From: Van Riper, Mike Sent: Wednesday, September 04, 2002 3:21 PM To: Struts Users Mailing List Subject: RE: iterate question I have a similar need to the one expressed by Kirby. I have not used the nested extension, but, I have read through the online primer. I saw nothing there that would indicate it would handle *dynamic* tree structures. Yes, you can use the nesting custom tags to any depth you want. Yes, you don't need to know in advance how many items there are in a collection at a particular level. However, it looks like you need to know in advance what depth to go to. When the tree is being generated dynamically and the depth can not be known in advance, I don't see how to use the nesting extension to handle it. I hope that I am wrong about that because I'd love to just use the nesting extension rather than write something on my own. If the nesting extension can handle this situation, please point me to the right part of the docs or an existing example that will help me figure that out. Assuming I am right and the nesting extension doesn't handle what I need yet, my sense is there might be a way to enhance the nesting extension to handle this for recursive structures. For example, consider a Node object that had some instance data and a collection of child Node objects and a getChildNodes() method. What if nested:iterate took an additional parameter which was recurseProperty=childNodes? It should be possible to implement tail recursion in the implementation of nested:iterate that would repeat the execution of the body of the nested:iterate tag with the new collection being the one returned from the getChildNodes() call on the current node. This would do a depth first recursion of nodes outputting the same information for each node. Assuming there is a way to get depth information, I could use that information in the body of my nested:iterate and dynamically reflect that in the formatting of the nodes for display too. Of course, it is not that simple. There would be intermediate state to maintain and correctly return to and continue on from for each time a recursion to another level happened. The nesting extension does quite a bit already and this may not be the best way to solve my recursive structure handling problem. Then again, maybe it would make sense. I thought it was at least worth sharing the idea. - Mike Van Riper mailto:[EMAIL PROTECTED] -Original Message- From: Sri Sankaran [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 04, 2002 11:29 AM To: Struts Users Mailing List Subject: RE: iterate question Look at the nested extension @ http://www.keyboardmonkey.com/next/index.jsp. It is exactly for this purpose. It is included as part of Struts 1.1.x Sri -Original Message- From: Kirby Vandivort [mailto:[EMAIL PROTECTED]] Sent: Wednesday, September 04, 2002 12:13 PM To: [EMAIL PROTECTED] Subject: iterate question Hello, I'm new to struts, so please bear with me. I'm in the early stages of converting something to the struts framework and I've run into a situation that I'm not sure how to handle. I want to make a page that, as an example, looks like: - message 1 - message 2 * re: message 2 + re: re: message 2 * re: message 2 * re: message 2 - message 3 etc. So, I'm going to pass a collection to the jsp page, and the collection might contain collections. There can be any level of nesting. This seems like a common case, but I haven't found a way to do it using the struts tags as of yet. It really needs some sort of recursive solution since you don't know how many levels you will need to go down, and the presentation is something that clearly shouldn't be done on the business side, so any help or guidance that you have would be appreciated. Thanks! -- Kirby Vandivort Theoretical Biophysics Group Email: [EMAIL PROTECTED] 3051 Beckman Institute http://www.ks.uiuc.edu/~kvandivo/University of Illinois Phone: (217) 244-5711405 N. Mathews Ave Fax : (217) 244-6078Urbana, IL 61801, USA -- To unsubscribe, e-mail
RE: Multiple ApplicationResource Properties file with Struts
-Original Message- From: Declan O'Shanahan (CAPE) [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 05, 2002 4:31 AM To: [EMAIL PROTECTED] Subject: Multiple ApplicationResource Properties file with Struts Hi there, I have searched the list for information on multiple message resources properties files with Struts1-1b2. I have looked at the dtd for the struts-config.xml (http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd) and it says that there can be multiple message-resources elements. Yet when I include a second message-resources element in the struts-config.xml the application does not recognoise the new values. Does struts1.1b2 support multiple message resources properties files? Any hints or help on this would be appreciated. Yes. I'm using multiple resource properties files with 1.1b2. You must specify a key attribute in all but your default message-resources elements. In order to pull messages from non-default properties files, you have to specify this key attribute of the message-resources element as the bundle attribute of the bean:message tags you are using in your JSP pages. If you have this in your struts-config file: message-resources parameter=MyResources key=MY_RESOURCES_KEY/ You would insert messages from the specified properties file like this: bean:message bundle=MY_RESOURCES_KEY key=prompt.contact.name/ At least, this is how I am doing it and it is working for me. Struts does the lookup in your default properties file when no bundle attribute is specified in your bean:message tag. Regards, Declan O'Shanahan Cheers, Mike Van Riper -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Cross Site Scripting (XSS) issues with Struts 1.1-b2?
If you are not familiar with what I mean by cross site scripting (XSS), here are two links with information about it: http://www.cgisecurity.com/articles/xss-faq.shtml http://www.cert.org/advisories/CA-2000-02.html According to the first FAQ above, some of the things that should be done to protect your web application are: Never trust user input and always filter metacharacters. This will eliminate the majority of XSS attacks. Converting and to lt; and gt; is also suggested when it comes to script output. Remember XSS holes can be damaging and costly to your business if abused. Often attackers will disclose these holes to the public, which can erode customer and public confidence in the security and privacy of your organization's site. Filtering and alone will not solve all cross site scripting attacks and it is suggested you also attempt to filter out ( and ) by translating them to #40; and #41;, and also # and by translating them to #35 (#) and #38 (). I saw some old discussions on the Struts-Dev list about default behavior in the bean:write custom tag. Checking recent documentation, the default behavior is to do this sort of filtering/conversion now for bean:write. So, that particular aspect is covered as long as I don't explicitly set the filter attribute to false in my bean:write tags. I didn't see any discussion of how Struts processes request parameters when auto-populating form beans. Is similar filtering/conversion being done there as well? Are there any other aspects of this particular security issue that I need to be concerned about while developing my web application with Struts 1.1-b2? - Mike Van Riper mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Cross Site Scripting (XSS) issues with Struts 1.1-b2?
Some additional information, from reviewing the Struts 1.1-b2 source code, is interspersed below. -Original Message- From: Van Riper, Mike Sent: Sunday, September 08, 2002 9:29 PM To: List Struts-User (E-mail) Subject: Cross Site Scripting (XSS) issues with Struts 1.1-b2? If you are not familiar with what I mean by cross site scripting (XSS), here are two links with information about it: http://www.cgisecurity.com/articles/xss-faq.shtml http://www.cert.org/advisories/CA-2000-02.html According to the first FAQ above, some of the things that should be done to protect your web application are: Never trust user input and always filter metacharacters. This will eliminate the majority of XSS attacks. Converting and to lt; and gt; is also suggested when it comes to script output. Remember XSS holes can be damaging and costly to your business if abused. Often attackers will disclose these holes to the public, which can erode customer and public confidence in the security and privacy of your organization's site. Filtering and alone will not solve all cross site scripting attacks and it is suggested you also attempt to filter out ( and ) by translating them to #40; and #41;, and also # and by translating them to #35 (#) and #38 (). According to the Struts 1.1-b2 source code for ResponseUtils.filter(), it only converts , , and to the equivalent character entity references. Is the excerpt from the online XSS FAQ above mistaken, or is it necessary to filter for (, ) and # too? I saw some old discussions on the Struts-Dev list about default behavior in the bean:write custom tag. Checking recent documentation, the default behavior is to do this sort of filtering/conversion now for bean:write. So, that particular aspect is covered as long as I don't explicitly set the filter attribute to false in my bean:write tags. I didn't see any discussion of how Struts processes request parameters when auto-populating form beans. Is similar filtering/conversion being done there as well? I found in the 1.1-b2 source download that ResponseUtils.filter() is being called in all the html taglib tags that populate form fields with text values. Actually, it is called in BaseFieldTag.java for the text tags which extend from it and additionally in a few other tags that don't extend from it (e.g., TextareaTag.java). So, it doesn't matter so much whether the request parameters are filtered/converted when populating form beans because on the way back out to populate the form field values in the JSPs it will happen automatically as long as I am using the Struts html custom tags. FYI, ResponseUtils.filter() is the same method called in bean:write when the filter attribute is not explicitly set to false. Are there any other aspects of this particular security issue that I need to be concerned about while developing my web application with Struts 1.1-b2? Assuming the filtering of , , and and converting them to the equivalent character entity references is sufficient, it looks like the XSS vulnerability is being handled in the Struts custom tags by the usage of ResponseUtils.filter(). - Mike Van Riper mailto:[EMAIL PROTECTED] - Mike Van Riper -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: set a value from a form to a form
One way is to use the html:hidden tag in addition to whatever you are doing to display the uneditable form data. It works like all the other form tags. So, all you have to do is set the property attribute to match the name of the uneditable form property and it should work. This is the Struts custom tag equivalent for specifying input type=hidden ... directly in HTML. If you do decide to use an HTML form element to display the uneditable value and set the disabled attribute on it, you will want to also include a html:hidden element for the same property. From my own experimenting on this, I found that the value for my disabled text input fields were not being submitted with the form. Adding the hidden form element for the same property does preserve any incoming form data when the form is submitted. - Van -Original Message- From: Michael Lee [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 10, 2002 4:14 PM To: Struts Users Mailing List Subject: set a value from a form to a form I have a form object that populates html fields. The problem is, I want to display some of the form data and have it uneditable. When I submit the form loses all the data that is not in an html:.. tag. I've tried... bean:define id=userRole name=userForm property=userRole scope=request toScope=request/ but this doesnt seem to work thanks, Mike -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: [OT][FRIDAY] brain types
True credit goes to Carl Jung. He came up with the 4 dimensions and the two poles for each dimension. Kiersey Bates get the credit for marketing a relatively simple test that people can take to get a reasonable approximation of their personality type in this system. Oops! I'm sorry, this is supposed to be a humorous [FRIDAY] thread. I'm behind on my email and didn't see this until Tuesday. My bad. ;-) - Van -Original Message- From: Brad Rhoads [mailto:[EMAIL PROTECTED]] Sent: Friday, October 04, 2002 9:38 AM To: 'Struts Users Mailing List' Subject: RE: [OT][FRIDAY] brain types They ripped off Kiersey Bates and don't even seem to give them credit! See http://www.amazon.com/exec/obidos/tg/detail/-/0960695400/qid=1 033749305/sr=8 -2/ref=sr_8_2/002-7896442-4256040?v=glancen=507846 However, this is a great assesment. I've used it with a number of groups over the years. Most people find that the description of their personality is very accurate. It certainly helped me understand myself a lot better. -Original Message- From: Dan Cancro [mailto:[EMAIL PROTECTED]] Sent: Friday, October 04, 2002 11:27 AM To: '[EMAIL PROTECTED]' Subject: [OT][FRIDAY] brain types What types of brains do Struts users have? http://www.braintypes.com/news_from.htm#letters Mine's an ISTJ type -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
[ANNOUNCE] Struts-Silicon-Valley July 2nd meeting in Mountain View
The next Silicon Valley Struts User Group meeting is happening this week in Mountain View at 7pm on Wednesday, July 2nd. A demonstration of Exadel Struts Studio, by Igor Shabalov, will show why you need more than just a Java IDE to be a productive Struts User. This event is free and open to the public. Please refer to the online announcement for the details and directions to the meeting site: http://www.baychi.org/calendar/20030702/ It is important that I get an accurate headcount in advance for meeting facility planning purposes and for determining how much pizza and soft drinks to order. So, please do RSVP in advance per the instructions in the online announcement. I'll make sure that the facilities and food are adequate for all that RSVP by noon on the day of the event. Thanks, Van Mike Van Riper mailto:[EMAIL PROTECTED] http://www.baychi.org/bof/struts - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
International Struts Meetup Day
When I was looking into starting a Silicon Valley Struts User Group back in March, I put in a proposal to meetup.com for a new topic area for Struts. Meetups happen at local cafes (and other places) in 586 cities across 43 countries. When I didn't hear back from them after a few weeks, I went ahead on my own to get the Silicon Valley group up and running. Well, it turns out that they did accept my proposal and were just slow in getting around to it. I no longer need what they provide now that the Silicon Valley Struts User Group is up and running. However, I thought that people in other areas that do not yet have a local user group to participate in might find this interesting. The Meetup folks have established the 3rd Thursday of every month as an International Struts Meetup Day. You can register your interest in participating with other Struts Users from your local area and participate in an online vote for the local bar or restaurant where you will meet. See http://struts.meetup.com/ for details! That's all folks, Van Mike Van Riper mailto:[EMAIL PROTECTED] http://www.baychi.org/bof/struts - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] SF Bay Area Struts Intro (Free)
Hi everyone, I lead the Silicon Valley Struts User Group and we're having a Intro to Struts presentation being done by Sylvain Gibassier, a senior software engineer at BEA. If you will be in the San Francisco Bay Area and are interested in learning more about Struts, consider coming to this presentation. It's on August 6th, and you can get more info here: http://www.baychi.org/bof/struts/20030806/ No product demo, just an introduction to Struts. FYI, Van Mike Van Riper mailto:[EMAIL PROTECTED] http://www.baychi.org/bof/struts - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Button labels and DispatchActions mix?
Actually, I think the least amount of work (assuming you don't object to adding a small amount of trivial JavaScript logic to the JSP page) is to change your html:submit to an html:button and then add an onclick JavaScript event handler that sets a hidden form field with the desired submit action value before submitting the form. You can even embed the event handler logic directly in the HTML button definitions like so: html:hidden property=action value= / html:button property=dontCare1 onclick=this.form.action.value='reset1';this.form.submit(); bean:message key=search.button.reset / /html:button html:button property=dontCare2 onclick=this.form.action.value='reset2';this.form.submit(); bean:message key=search.button.reset / /html:button This should work even with two separate forms being used in the same JSP for the two identically named buttons. Of course, you would then need two instances of the html:hidden tag to include the action property in the two separate HTML forms. Note: I haven't tested this exact code snippet above. So, there could be some minor typo in it. However, I have used this technique successfully in the past. Cheers, Van Mike Van Riper mailto:[EMAIL PROTECTED] http://www.baychi.org/bof/struts -Original Message- From: Alex Shneyderman [mailto:[EMAIL PROTECTED] Sent: Thursday, August 07, 2003 6:12 AM To: 'Struts Users Mailing List' Subject: RE: Button labels and DispatchActions mix? I guees if you want to assign the meaning to your form based on the context where you placed it, it might make some sence. Todor, you can probably create another action and extend it from your original action, where you would override getKeyMethodMap (). This will probably the least amount of work. HTH, Alex. -Original Message- From: Paul McCulloch [mailto:[EMAIL PROTECTED] Sent: Thursday, August 07, 2003 9:06 AM To: 'Struts Users Mailing List' Subject: RE: Button labels and DispatchActions mix? I'm not sure I understand you. Why would you want multple buttons, with the same label doing different things? Surely this would just confuse the user? -Original Message- From: Todor Sergueev Petkov [mailto:[EMAIL PROTECTED] Sent: 07 August 2003 13:58 To: Struts Users Mailing List Subject: Re: Button labels and DispatchActions mix? Even DispatchLookupAction doesn't work if you want to use the same label eg. buttons.reset or buttons.search for two different buttons useing the same Action... Paul McCulloch wrote: I believe that the solution is to use a DispatchLookupAction rather than a dispatch action. See p226 in Struts in Action for a description. Paul -Original Message- From: Rohit Aeron [mailto:[EMAIL PROTECTED] Sent: 07 August 2003 13:27 To: Struts Users Mailing List Subject: RE: Button labels and DispatchActions mix? Its better you use javascript There you can append your action also with submit value Eg: Document.formbean.action=search.do+value; Regards Rohit -Original Message- From: Todor Sergueev Petkov [mailto:[EMAIL PROTECTED] Sent: Thursday, August 07, 2003 5:49 PM To: Struts Users Mailing List Subject: Re: Button labels and DispatchActions mix? It works with the button label But I have two Search buttons on the same page both labeled search.button.reset but they perform two different actions. So I need a way to distinguish which was pressed inside my DispatchAction Rohit Aeron wrote: This will work .. html:submit property=action value=bean:message key=search.button.reset / /html:submit -Original Message- From: Todor Sergueev Petkov [mailto:[EMAIL PROTECTED] Sent: Thursday, August 07, 2003 5:29 PM To: Struts Users Mailing List Subject: Button labels and DispatchActions mix? Hello people, I have the following code : html:submit property=action value=resetg bean:message key=search.button.reset / /html:submit What I am trying to do is have a Dispatch Action so that when this button is pressed the request is something like search.do?action=resetg But I don't want my button to have the resetg title on it. I want it to have the search.button.reset title from ApplicationResources bundle on it. It seems tha Struts html tag library mixes the two. Is there a way out of this? Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] *-- This message and any attachment(s) is intended only for the use of the addressee(s) and may contain information that is PRIVILEGED and CONFIDENTIAL. If you are not the intended addressee(s), you are hereby notified that
RE: Struts Validator-nextreleasewhen (was validwhen)
With great trepidation, I must inquire as to the likelihood of a next release of the commons-validator in the near term future. (ducking for cover now as the flames telling me to read the Apache release process policy on the web site are fired off in my direction ;-)). Seriously, I did look in the bug database already. If my search was setup correctly, I only saw 5 open bugs against Validator (amazingly low number given that it is supposed to be crap) and they were all categorized as enhancement requests. I suspect that not too much has changed since the version that shipped with Struts 1.1. So, you may not want to push out a new release at this time. However, it is unfortunate that the ability to modularize development of larger apps with multiple struts-config files and multiple application resource files is pretty much there in the Struts 1.1 release except for mutliple resource files support in Validator. Since it looks like the support for bundle attributes was added at least at the arg level, a dot release now of just the commons-validator would make it possible to use multiple resource files to some degree with the Validator in a Struts 1.1 webapp. I'm not looking for a fixed date commitment. I realize it is all volunteer efforts on this stuff that can't be held to any particular schedule. I'll totally understand if there are no plans to move towards a dot release of Validator anytime soon, but, I am curious as to whether plans to move towards a dot release are imminent or not even on the horizon. -Van Mike Van Riper mailto:[EMAIL PROTECTED] http://www.baychi.org/bof/struts -Original Message- From: Steve Raeburn [mailto:[EMAIL PROTECTED] Sent: Thursday, August 14, 2003 8:41 AM To: Struts Users Mailing List Subject: RE: Struts Validator-validwhen It's not in Struts 1.1 but it's available in the nightly build and will be in the next release. Steve -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: August 14, 2003 8:32 AM To: [EMAIL PROTECTED] Subject: Struts Validator-validwhen Hi, The struts Validator 'validwhen' I could not find anywhere in struts,even though it was mensioned in documentation. If it is available Could anybody please help me where exactly it is available? Thanks, Shailaja -- A . S . C . A . P.-- This message, including any attachments, is intended solely for the person or entity to which it is addressed and may contain information that is legally privileged, confidential or otherwise protected from disclosure. If you are not the intended recipient, please contact sender immediately by reply email and destroy all copies. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Reminder: August 6th meeting at 6:30pm in Mountain View, RSVP requested
The next meeting of the Silicon Valley Struts User BOF is being held at VeriSign in Mountain View on Wednesday, August 6th. You must arrive between 6:30 and 7:00pm to register with VeriSign security as a guest. Sylvain Gibassier, a BEA dev2dev Senior Software Engineer, will present an introduction to Struts for Java developers with little or no prior Struts experience. Please refer to the online announcement for the details and directions to the meeting site: http://www.baychi.org/bof/struts/20030806/ As usual, this meeting is free and open to the public. However, it is important that I get an accurate headcount in advance for meeting facility planning purposes. If you have not done so already, please RSVP for the meeting by sending an email to me with Struts User August Meeting as the subject. Thanks, Van Mike Van Riper mailto:[EMAIL PROTECTED] http://www.baychi.org/bof/struts - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: using modules versus simply using multiple struts-config files
-Original Message- From: Bailey, Shane C. [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 13, 2003 3:01 PM To: 'Struts Users Mailing List' Subject: RE: using modules versus simply using multiple struts-config files I think if you are going to use messages like that then one place you may run into problems is with the Validator. I can't remember if not all or none of the elements in the Validator (which had the key attribute) didn't have a bundle attribute (so I don't know how it would determine which bundle to look up and I can't imagine it goes through every one automatically). At least I ran into a problem when I first started using Validator and attempting something similar. If you are not using Validator (or it works differently now or I just was not using it right) then disregard, of course. I do plan to use Validator and you are right. I just checked and the commons version of validator that shipped with Struts 1.1 doesn't allow for the bundle attribute. Coincidentally, it appears that the DTD (and I assume the related source code too) in the commons validator project were updated within the last week to add the bundle attribute. So, I could probably pick this change up in a recent nightly build of the commons-validator.jar. Unfortunately, I can't use nightly builds of anything in my project. It was hard enough for me to get approval to use the 1.1-b2 release of Struts for a project last year. It worked out great by the way. WebApp has performed flawlessly in production since December of last year. I'm not even going to try to get approval to use an open source nightly build. :-( Which leads me to my next question. Are there plans for an official release of an updated commons validator module that could be used with Struts 1.1 where I'd be able to use the bundle attribute any time soon? I'm not expecting an answer to that question on this list. I think there is a separate commons-user list or some such thing like that where I will have to direct that question. In the meantime, I'll have to put all my field name prompts and any validation messages in the default resource file. This was exactly the kind of info I was looking for. Thanks, Van -Original Message- From: Van Riper, Mike [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 13, 2003 5:55 PM To: '[EMAIL PROTECTED]' Subject: RE: using modules versus simply using multiple struts-config file s -Original Message- From: Bailey, Shane C. [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 13, 2003 12:02 PM To: 'Struts Users Mailing List' Subject: RE: using modules versus simply using multiple struts-config file s Very interesting. I didn't know you could now have multiple struts-configs and no modules. The two problems I had with using modules was (at first) the switching between them as mentioned. I never took to the SwitchAction so I use global forwards which do my module prefixes for me. And second, having to duplicate my (commonly used) messages in each modules resource file (this problem is more of a problem of why can't I inherit them than anything else. It seems like multi configs with no modules solves problem 1. I take it that you will still have problem 2. But I did see a post recently about someone who made a code change so that resource files could inherit. My current plan is to have the default resource file contain common resources shared by all my modules (here I use module to refer to a subdirectory of my web root that has its own separate struts-config file for action mappings, form beans and anything else specific to that subsection of the webapp) and then have a separate resource file associated by module name with each specific module. A person working logically in only one module would access their module-specific resources using the module name and any common resources in the default manner that doesn't require specifying the name associated with the resource file in the struts-config file configuration for it. I am planning to have one struts-config for common configuration and a separate struts-config for each major subsection of my webapp. The common resource file configuration goes in the common struts-config file. The resource file specific to each subsection of the webapp would be configured in the separate struts-config file for that subsection. I think this is where one of the differences in my approach comes in. I believe each module can have its own default resource file configuration that can be different when modules are configured separately in the web.xml file. Since I don't use separate web.xml entries, I can only have one common default resource file configured across all my logical modules. This just means that for most resources, I will be specifying the module resources file by its associated configuration name
using modules versus simply using multiple struts-config files
I did search the archives and there is information about using multiple config files and separately about using full-blown modules too. There may have been a comparison of the two approaches somewhere in the archives too, but, I was not able to find it. Thus, my reason for posting this to the group. I'm setting up the webapp infrastructure for a new project. This is the first opportunity I have to use the new module support in Struts 1.1. As I am investigating it, it seems like the new capability to specify multiple struts-config files in your default module configuration in the web.xml file gets you most of the modularity advantages that multiple modules provide. Sure, you do get to leave the module leading subdirectory out of your action mapping definitions when you define separate modules in web.xml for each struts-config file. Other than that, I'm not seeing the advantages of using full-blown modules when I could just setup separate struts-config files for each logical module. On the flip side, you have to deal with properly switching between modules when you use modules. Also, every request must go through an action mapping to use modules. Right now, I'm leaning towards setting up separate struts-config files for each logical module and simply specifying them as a comma separated list in the default module configuration in my web.xml. This is a relatively small webapp which can be logically partitioned in to about 5 areas. Also, there will be three of us working in parallel on a tight schedule. So, it seems to me that I get the modularity benefits without the module restrictions by simply setting up separate struts-config files. Before going too far down this path, I was interested in any feedback from others on the list about this approach. Am I missing something about the differences between these two approaches? - Van Mike Van Riper mailto:[EMAIL PROTECTED] http://www.baychi.org/bof/struts - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts Validator-nextreleasewhen (was validwhen)
-Original Message- From: David Graham [mailto:[EMAIL PROTECTED] Sent: Thursday, August 14, 2003 11:01 AM To: Struts Users Mailing List Subject: RE: Struts Validator-nextreleasewhen (was validwhen) I suspect that not too much has changed since the version that shipped with Struts 1.1. A great deal of internal cleanup has happened in commons-validator since its 1.0.2 release as well as new features and a more extensible arg definition. I think Rob Leland is planning on getting a 1.1 release out soon. David Cool! My company won't let me ship with nightly builds, but, I'd be glad to test release candidates for an upcoming release against my webapp. If the timing was right, I might even be able to include the new release in my current project before it gets deployed. That won't be happening until the November/December timeframe. Thanks, Van - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: using modules versus simply using multiple struts-config file s
-Original Message- From: Bailey, Shane C. [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 13, 2003 12:02 PM To: 'Struts Users Mailing List' Subject: RE: using modules versus simply using multiple struts-config file s Very interesting. I didn't know you could now have multiple struts-configs and no modules. The two problems I had with using modules was (at first) the switching between them as mentioned. I never took to the SwitchAction so I use global forwards which do my module prefixes for me. And second, having to duplicate my (commonly used) messages in each modules resource file (this problem is more of a problem of why can't I inherit them than anything else. It seems like multi configs with no modules solves problem 1. I take it that you will still have problem 2. But I did see a post recently about someone who made a code change so that resource files could inherit. My current plan is to have the default resource file contain common resources shared by all my modules (here I use module to refer to a subdirectory of my web root that has its own separate struts-config file for action mappings, form beans and anything else specific to that subsection of the webapp) and then have a separate resource file associated by module name with each specific module. A person working logically in only one module would access their module-specific resources using the module name and any common resources in the default manner that doesn't require specifying the name associated with the resource file in the struts-config file configuration for it. I am planning to have one struts-config for common configuration and a separate struts-config for each major subsection of my webapp. The common resource file configuration goes in the common struts-config file. The resource file specific to each subsection of the webapp would be configured in the separate struts-config file for that subsection. I think this is where one of the differences in my approach comes in. I believe each module can have its own default resource file configuration that can be different when modules are configured separately in the web.xml file. Since I don't use separate web.xml entries, I can only have one common default resource file configured across all my logical modules. This just means that for most resources, I will be specifying the module resources file by its associated configuration name as a parameter to my resource file property lookups. Since there will be a direct one-to-one mapping between each subsection of the webapp and the resource file specific to that subsection, I think this will be something that will be easy to remember. For example, a logical report module would specify the report bundle in bean:message tag instances that used the report module resource file like so: bean:message key=report.header bundle=report / I am inferring this from the main Struts 1.1 example application where an alternate resource file is accessed like so in logon.jsp: bean:message key=prompt.password bundle=alternate / I think you should be able to do the inverse of this when using separate module configurations. For your module related property lookups, you could use the default resource file configured for that module. For the common ones that you wanted to use across all modules, you would have a configuration entry for the default resource file in each module struts-config file and make that your alternate resource file for the module. So, for you it would be the property lookup of a shared resource that would need to supply the bundle attribute to the bean:message tag. Assuming you used common as the key for your shared properties, your lookups in the common resource file would be the ones that needed to supply the bundle attribute: bean:message key=app.copyright bundle=common / This isn't as transparent as a patch to Struts that supports inheriting common properties into the default resource file for each module, but, it would allow reuse of common properties across multiple modules. At least, this is my understanding of how it could work. I haven't tried modules yet. So, I can't be certain of that. Sadly, since I am using modules, I can't think of any advantages of modules if you can have multiple struts config, tiles def and resource files and no modules. -Original Message- From: Van Riper, Mike [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 13, 2003 2:02 PM To: List Struts-User (E-mail) Subject: RE: using modules versus simply using multiple struts-config files -Original Message- From: Van Riper, Mike Sent: Tuesday, August 12, 2003 5:55 PM To: List Struts-User (E-mail) Subject: using modules versus simply using multiple struts-config files I did search the archives and there is information about using multiple config files and separately about using full-blown modules too. There may have been
RE: using modules versus simply using multiple struts-config files
-Original Message- From: Van Riper, Mike Sent: Tuesday, August 12, 2003 5:55 PM To: List Struts-User (E-mail) Subject: using modules versus simply using multiple struts-config files I did search the archives and there is information about using multiple config files and separately about using full-blown modules too. There may have been a comparison of the two approaches somewhere in the archives too, but, I was not able to find it. Thus, my reason for posting this to the group. I'm setting up the webapp infrastructure for a new project. This is the first opportunity I have to use the new module support in Struts 1.1. As I am investigating it, it seems like the new capability to specify multiple struts-config files in your default module configuration in the web.xml file gets you most of the modularity advantages that multiple modules provide. Sure, you do get to leave the module leading subdirectory out of your action mapping definitions when you define separate modules in web.xml for each struts-config file. Other than that, I'm not seeing the advantages of using full-blown modules when I could just setup separate struts-config files for each logical module. On the flip side, you have to deal with properly switching between modules when you use modules. Also, every request must go through an action mapping to use modules. Right now, I'm leaning towards setting up separate struts-config files for each logical module and simply specifying them as a comma separated list in the default module configuration in my web.xml. This is a relatively small webapp which can be logically partitioned in to about 5 areas. Also, there will be three of us working in parallel on a tight schedule. So, it seems to me that I get the modularity benefits without the module restrictions by simply setting up separate struts-config files. Before going too far down this path, I was interested in any feedback from others on the list about this approach. Am I missing something about the differences between these two approaches? I love talking to myself. ;-) I know that setting it up with separate modules in web.xml can be made to work, but, I've also seen recent postings about difficulties using tiles and difficulties switching between modules by other module newbies. I'd rather not have to deal with that myself let alone training the other Struts newbies on my current tightly scheduled project. So, I guess I'll go ahead with my current plan to use multiple struts-config files associated with one entry in my web.xml file. The way I'll be setting it up makes it easy to switch to true separate module definitions later on anyway. Each logical module will already have its own subdirectory below the web root. Based on other suggestions I've seen, I'll have a default struts-config file for shared configuration of plug-ins (e.g., tiles), global forwards, controller, etc... In addition, a separate struts-config file for each logical module. - Van Mike Van Riper mailto:[EMAIL PROTECTED] http://www.baychi.org/bof/struts - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Starting point for a little test app (was: Suggestions for Calendar Popup taglib?)
In working on this, I've come up with a couple of things that would be very handy to have: 1) A simple dummy struts app which would be ready for me to plugin my taglib to test. I know that creating a little app won't take long, but a nice little starting point would be convenient. For an Intro to Struts seminar at my work, I extricated the struts-example webapp sources from the full source release for Struts 1.1. You would have to configure one build.properties file with the location of the external jars required to build the webapp. This is mostly just the ones in the Struts 1.1 binary release plus the servlet API jar. However, I added logging support for a rolling log file using log4j. So, you would have to provide the location of your own local copy of the log4j jar file too (or change the build file). Also, I did tweak the sources slightly to make it a better example of using multiple struts-config and message resource files for my own purposes. Other than that, it is pretty much the same mail reader example that ships with Struts 1.1. The zip file is just under 100K in size. If that sounds interesting, please send email directly to me requesting the zip file at: [EMAIL PROTECTED] FYI, Van Mike Van Riper mailto:[EMAIL PROTECTED] http://www.baychi.org/bof/struts - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[ANNOUNCE] Introduction to Hibernate by Norman Klein: 6:30pm on September 3rd in Mountain View
The next meeting of the Silicon Valley Struts User BOF is scheduled to take place at VeriSign in Mountain View on Wednesday, September 3rd. You must arrive between 6:30 and 7:00pm to register with VeriSign security as a guest. Norman Klein, an independent software consultant, will present an introduction to Hibernate. Hibernate is an open source data persistence framework. Please refer to the online announcement for the details and directions to the meeting site: http://www.baychi.org/bof/struts/20030903/ It is important that I get an accurate headcount in advance for meeting facility planning purposes. So, please RSVP for the meeting by sending an email to me with Struts User September Meeting as the subject. Thanks, Van Mike Van Riper mailto:[EMAIL PROTECTED] http://www.baychi.org/bof/struts - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to set charset UTF-8
I added the following to test what encoding my Struts app is using % response.setContentType(text/html; charset=UTF-8); System.out.println(response.getCharacterEncoding()); % But it still print out the ISO-8859-1, why? How can I set the contentType to text/html; charset=UTF-8 This is just a hunch, but, I suspect you can't change the character encoding after you have started writing content to the stream. In that case, your best bet is to do this at the very top of the JSP page: %@ page contentType=text/html;charset=UTF-8 language=java % Also, there is another consideration if you are using Tiles. Again this is just a hunch, but, I suspect that you would have to have that directive as the first line of your Tiles master layout template JSP. The concept mentioned above for a single page applies to a Tiles page generated dynamically from multiple JSPs all writing to the same response stream. We ran into something like this using the Struts template custom tags with Struts 1.0 back in 2001. We were correctly setting the character encoding using the page directive on individual content JSPs, but, had left it off our master page layout template JSP. So, it never took until we tracked that down. Duh! Hope this helps, Van Mike Van Riper mailto:[EMAIL PROTECTED] http://www.baychi.org/bof/struts - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts User September Meeting - RE: Introduction to Hibernate by Norman Klein
-Original Message- From: Bill Chmura [mailto:[EMAIL PROTECTED] Sent: Monday, August 25, 2003 4:16 PM To: 'Struts Users Mailing List' Cc: [EMAIL PROTECTED] Subject: Struts User September Meeting - RE: [ANNOUNCE] Introduction to Hibernate by Norman Klein: 6:30pm on September 3rd in Mountain View Maybe the powerpoint (uggg) slides can be posted online after... Something would be cool because I am just starting to Eye hibernate as an option I can't promise this yet, but, I am going to ask the presenter to provide both slides and an example war (including sources) that embodies what is presented in the talk. This is what was done for our recent Intro to Struts talk: http://www.baychi.org/bof/struts/20030806/ If I can get this from the presenter, I'll post it as an update to the online meeting announcement after the meeting next week. FYI, Van Mike Van Riper mailto:[EMAIL PROTECTED] http://www.baychi.org/bof/struts - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: logic forward problem
-Original Message- From: David G Friedman [mailto:[EMAIL PROTECTED] Sent: Thursday, September 11, 2003 8:18 AM To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: RE: logic forward problem Your path looks like a tile. I wrote about this problem a week or two ago and you should've been able to find it in the archives of this group. It is documented on the logic forward tag as: Note: forwarding to Tiles definitions is not supported from this tag. You should forward to them from an Action subclass. Doing what the documentation suggests would work, but, it is not necessary to do the forward from an Action subclass. You can define an action mapping that your global forward points to that directly forwards to the tile definition without having to invoke an action class. This does work. I do this for the welcome JSP of my current webapp that needs to forward to the initial webapp tile definition like so: welcome.jsp: %@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic % logic:forward name=welcome / struts-config.xml: global-forwards forward name=welcome path=/welcome.do / /global-forwards action-mappings action path=/welcome forward=page.welcome/ /action-mappings The page.welcome reference is a tiles definition reference. Granted, it is annoying to have to define the global-forward/action pairing to make this work. However, this is much simpler than going to the trouble of defining an action subclass just to do this where you would still need to define an action mapping anyway. FYI, Van Mike Van Riper mailto:[EMAIL PROTECTED] http://www.baychi.org/bof/struts/ Regards, David -Original Message- From: koen boutsen [mailto:[EMAIL PROTECTED] Sent: Thursday, September 11, 2003 11:12 AM To: Struts Users Mailing List Subject: logic forward problem Hi I want to send my user to a .jsp page and immediately send him to the next, without having to click anything on the intermediate page, or even without having to see this page. I tried with : logic:forward name=scrollForwardOrganisation / I know this works when you put a global forward in the struts-config with as forward the target jsp. I have to use a definition where I want to send my user to, and when I put the definition as a forward in the global forwards, I get a pageNotFound error. This is my global forward forward name=scrollForwardOrganisation path=isisLayout.organisations.overview/ Does someone know what I can do ? Thanks Koen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Evil characters causing mischief in textarea and value attrib ute contents
Not 100% certain, but, I believe the default for the HTML form property tags was to *not* filter (i.e., filter=false) in Struts 1.0 and that was changed to default to do filtering (i.e., filter=true) in Struts 1.1. I am certain that the default for 1.1 is to do filtering. Original post did not say which version of Struts was being used. If my recollection of 1.0 behavior is correct, then that could explain the difference in behavior described here for similar JSP logic. In that case, you simply need to explicitly set filtering on in all your Struts 1.0 html:xxx form property tags. The filter utility function (can't recall from memory the class name/package, but, check the source for the html:xxx tags to find where it is defined in Struts sources) converts the quote character and less-than and greater-than characters to their character entity equivalents. FYI, Van Mike Van Riper mailto:[EMAIL PROTECTED] http://www.baychi.org/bof/struts/ -Original Message- From: Adam Hardy [mailto:[EMAIL PROTECTED] Sent: Thursday, September 18, 2003 4:38 AM To: Struts Users Mailing List Subject: Re: Evil characters causing mischief in textarea and value attribute contents Hi Andrew, I thought, man, you don't know that? Hahaha - and then I realised I don't know either. I just checked my app to make sure it's not happening to me too, and it's not. I have stuff like snowflake in the database and it gets encoded automatically into value=a html-busting quot;characterquot; via html:text. Presumably html:textarea is the same. If you have bean:write you can add filter=true. Adam On 09/18/2003 12:36 PM Andrew Hill wrote: We have some screens that allow users to edit some stuff stored in the db, and some of this stuff includes such characters as or \ or whatever, and also some of them have xml tags as there contents. When rendering such fields we are hitting some problems. ie: if the value is something like: my cats name is snowflake we end up with: input name=fieldname value=my cats name is snowflake/ ...which of course is not very good. Another one is textareas containing /textarea! Whats the technique for handling this nicely? Obviously I need to escape these somehow. What do I need to consider? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- struts 1.1 + tomcat 4.1.27 + java 1.4.2 Linux 2.4.20 RH9 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] Introduction to JDO by Ron Hitchens: 6:30pm on October 1st i n Mountain View
The next meeting of the Silicon Valley Struts User BOF will be held at VeriSign in Mountain View on Wednesday, October 1st. You must arrive between 6:30 and 7:00pm to register with VeriSign security as a guest. Ron Hitchens, a Bay Area computer consultant, will present an introduction to JDO. The Java Data Objects (JDO) API is a standard interface-based Java model abstraction of persistence, developed as Java Specification Request 12 under the auspices of the Java Community Process. Please refer to the online announcement for further details and directions to the meeting site: http://www.baychi.org/bof/struts/20031001a/ It is important that I get an accurate headcount in advance for meeting facility planning purposes. So, please RSVP for the meeting by sending an email to me with Struts User October Meeting as the subject. Thanks, Van Mike Van Riper mailto:[EMAIL PROTECTED] http://www.baychi.org/bof/struts/ P.S. The slides and example source code from last month's presentation (i.e., Introduction to Hibernate by Norman Klein) are available for download here: http://www.baychi.org/bof/struts/20030903/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tools for Testing
-Original Message- Though, my favorite approach is to do conventional unit testing of the business objects, and then use Canoo WebTest http://canoo.webtest.com on the front end. I think you meant: http://webtest.canoo.com/ It looks interesting, thanks for the info. Cheers, Van Mike Van Riper mailto:[EMAIL PROTECTED] http://www.baychi.org/bof/struts/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[ANN] Struts and JavaServer Faces talk by Craig McClanahan on 11/ 5
The next meeting of the Silicon Valley Struts User BOF will be held at Netscape in Mountain View on Wednesday, November 5th. Craig McClanahan, a senior staff engineer for Sun Microsystems, will make a presentation on this topic: Struts and JavaServer Faces -- Competition or Coexistence? Craig is uniquely qualified to give this talk, because he is both the original creator of the Struts Framework and co-specification lead for JavaServer Faces (JSR-127). You will find the full announcement including directions to Netscape here: http://www.baychi.org/bof/struts/20031105a/ (Please note the change of venue from VeriSign to Netscape for November) This meeting is being co-hosted by the Silicon Valley Java User Group (SVJUG) and the Java SIG of the East Bay I.T. Group (eBIG). Special thanks goes to SVJUG President Venki Seshaadri for arranging the meeting space at Netscape. SVJUG http://www.svjug.org/ eBIG http://www.ebig.org/sig/sig.aspx?SIGid=21 That's all folks, Van Mike Van Riper mailto:[EMAIL PROTECTED] http://www.baychi.org/bof/struts/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [ANN] Struts and JavaServer Faces talk by Craig McClanahan on 11/ 5
-Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 21, 2003 7:20 PM To: Struts Users Mailing List Subject: Re: [ANN] Struts and JavaServer Faces talk by Craig McClanahan on 11/ 5 Ruth, Brice wrote: Any chance of getting a webcast setup for this? For those of us not fortunate enough to be local to the 'Valley? :) You'll have to ask Van about broadcast facilities :-), I'll look into this, but, it will most likely not be happening. At my day job, I am on the critical path for completing and shipping a new product right now. So, it is not going to happen unless they have the facilities required for this at Netscape *and* I can find a volunteer with more free time than myself to set it up. Sorry, Van but I do plan to make my slides available after the talk. Craig Van Riper, Mike wrote: The next meeting of the Silicon Valley Struts User BOF will be held at Netscape in Mountain View on Wednesday, November 5th. Craig McClanahan, a senior staff engineer for Sun Microsystems, will make a presentation on this topic: Struts and JavaServer Faces -- Competition or Coexistence? Craig is uniquely qualified to give this talk, because he is both the original creator of the Struts Framework and co-specification lead for JavaServer Faces (JSR-127). You will find the full announcement including directions to Netscape here: http://www.baychi.org/bof/struts/20031105a/ (Please note the change of venue from VeriSign to Netscape for November) This meeting is being co-hosted by the Silicon Valley Java User Group (SVJUG) and the Java SIG of the East Bay I.T. Group (eBIG). Special thanks goes to SVJUG President Venki Seshaadri for arranging the meeting space at Netscape. SVJUG http://www.svjug.org/ eBIG http://www.ebig.org/sig/sig.aspx?SIGid=21 That's all folks, Van Mike Van Riper mailto:[EMAIL PROTECTED] http://www.baychi.org/bof/struts/ - 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: [ANN] Struts and JavaServer Faces talk by Craig McClanahan on 11/5
-Original Message- From: Ruth, Brice [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 22, 2003 12:31 PM To: Struts Users Mailing List Subject: Re: [ANN] Struts and JavaServer Faces talk by Craig McClanahan on 11/5 Any chance that someone could setup a DV camera, record the presentation, then post it somewhere as a small Quicktime movie? That would be excellent, too. I found a volunteer to record Craig's talk with a DV camera as you suggested. Assuming Craig gives us his permission to record the talk, we'll do that and make it available online afterwards. FYI, Van Van Riper, Mike wrote: -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 21, 2003 7:20 PM To: Struts Users Mailing List Subject: Re: [ANN] Struts and JavaServer Faces talk by Craig McClanahan on 11/ 5 Ruth, Brice wrote: Any chance of getting a webcast setup for this? For those of us not fortunate enough to be local to the 'Valley? :) You'll have to ask Van about broadcast facilities :-), I'll look into this, but, it will most likely not be happening. At my day job, I am on the critical path for completing and shipping a new product right now. So, it is not going to happen unless they have the facilities required for this at Netscape *and* I can find a volunteer with more free time than myself to set it up. Sorry, Van but I do plan to make my slides available after the talk. Craig Van Riper, Mike wrote: The next meeting of the Silicon Valley Struts User BOF will be held at Netscape in Mountain View on Wednesday, November 5th. Craig McClanahan, a senior staff engineer for Sun Microsystems, will make a presentation on this topic: Struts and JavaServer Faces -- Competition or Coexistence? Craig is uniquely qualified to give this talk, because he is both the original creator of the Struts Framework and co-specification lead for JavaServer Faces (JSR-127). You will find the full announcement including directions to Netscape here: http://www.baychi.org/bof/struts/20031105a/ (Please note the change of venue from VeriSign to Netscape for November) This meeting is being co-hosted by the Silicon Valley Java User Group (SVJUG) and the Java SIG of the East Bay I.T. Group (eBIG). Special thanks goes to SVJUG President Venki Seshaadri for arranging the meeting space at Netscape. SVJUG http://www.svjug.org/ eBIG http://www.ebig.org/sig/sig.aspx?SIGid=21 That's all folks, Van Mike Van Riper mailto:[EMAIL PROTECTED] http://www.baychi.org/bof/struts/ - 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] -- Brice D. Ruth Sr. IT Analyst Fiskars Brands, Inc. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] Slides from Craig's Struts/JSF Talk
The slides from Craig McClanahan's recent Struts/JSF talk are now available here: http://www.baychi.org/bof/struts/20031105a/ The talk was captured on digital video too. However, it may be several weeks before the video is available online. I'll send another announcement when the video is accessible online. That's all folks, Van Mike Van Riper Silicon Valley Struts User Group mailto:[EMAIL PROTECTED] http://www.baychi.org/bof/struts/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: No Keys Loaded For Validation
-Original Message- A really strange thing also is that if I copy the: registration.validation.missingCurrentCustomer=Please indicate if you are a current customer. into my default resource bundle, all messages display properly. Anyone have any idea what is going on? Since there is no way right now to specify the bundle for the message resource lookup, the default resource bundle is always used for these message resource lookups in the commons-validator packaged with the Struts 1.1 release. I'm not certain, but, one way around this in Struts 1.1 could be the use of modules. I do use multiple resource files, but, I don't use modules as of yet. I'm not suggesting you convert something to use modules just for this, but, you would have a separate default bundle for each module in that case. If that did work though, it would mean that you would have to replicate the common error message resources to the default bundle for each module. Which is the flip side of the same problem given the inability to specify the bundle for validations right now. What you really want is the bundle attribute in your validation elements that specify keys for message resources. I wouldn't be surprised if adding the ability to specify the bundle optionally when specifying message resources in your validation.xml is on the near future roadmap for the validation framework. I do know this issue has been raised before. Cheers, Van P.S. Heck, I'd even be willing to work on this particular feature myself in the commons-validator. I took great care in setting up my last project with separate config files and resource files for individual sections of the app only to find out that all validation messages had to go in the one default resource file for the app. :-( - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: RT expr value in custom tag
Eric, What you are trying to do doesn't really require the JSTL expression language. All you need to do is specify that runtime expressions are to be evaluated for the parameter attribute of your custom tag in your TLD file. If you were to look at any of the TLD files that come with Struts, you would see plenty of examples of this. For example, here is the html:base tag TLD definition that enables runtime expression evaluation for both the target and the server optional attributes for the tag: tag namebase/name tagclassorg.apache.struts.taglib.html.BaseTag/tagclass bodycontentempty/bodycontent attribute nametarget/name requiredfalse/required rtexprvaluetrue/rtexprvalue !-- This is what I think is needed! -- /attribute attribute nameserver/name requiredfalse/required rtexprvaluetrue/rtexprvalue /attribute /tag Runtime expression evaluation is what allows you to evaluate Java expressions inside of %= ...% for your custom tag parameters. If you use the JSTL expression language (EL), you don't use the Java expression tag. They are two separate ways to refer to dynamic content for custom tag attributes. To use the JSTL EL, you have to build your custom tag such that it has EL support in it. If you really want to go that route, I haven't done that yet myself. So, I can't help you with that. However, you can look at how the contributed taglib (html-el) that extends the HTML taglib of Struts 1.1 to add EL support for the parameters of the Struts HTML custom tags does just that. Also, your example used the %= ...% tag correctly for a custom tag parameter. However, many people initially stumble on getting this to work correctly even when runtime expression evaluation is enabled because they try to define only part of the custome tag attribute with the tag. For it to work even when properly enabled for the attribute in the TLD, you have to define the entire contents of the custom tag attribute value to be the %= ...% Java expression. If there is static content you want to include as part of the attribute value, you typically use string operations inside the JSP expression to concatenate and build up the final attribute value merging your dynamic and static data. Hope this helps, Van Mike Van Riper Silicon Valley Struts User Group mail: mike.vanriper at baychi.org http://www.baychi.org/bof/struts/ -Original Message- From: Eric SCHULTZ [mailto:[EMAIL PROTECTED] Sent: Friday, December 05, 2003 7:54 AM To: '[EMAIL PROTECTED]' Subject: RT expr value in custom tag Good morning... I'm trying to write my own custom tag library for Struts. I've had some initial success, but now I'm having some trouble. I want to set an attribute value from the value of a bean get. But what I end up with in my tag is JSP code, not the value in the bean. I.e.: v:properties template=inputmode parameter=%= UserSessionBean.getInputMode() %/ is not translated. How do I get the result of UserSessionBean.getInputMode() in my tag? Do I need to implement Expression Language? Is there already a utility class somewhere in Struts 1.1 that would evaluate something like ${UserSessionBean.inputMode} for me? Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problems Redirecting To Input Page After Vaildation Fails
Ciaran, When all else fails, cut and paste. :-) Seriously, I don't know of a way to make the input value dynamic. I wish it could be done like tile definitions with one action mapping extending another, but, I know that is not supported. So, the simplest solution is to have two separate action mappings for the one action class that supports both adds and updates like so: action path=/clientaction/add type=ie.sentenial.application.actions.ClientAction name=clientForm scope=request input=/pages/addClient.jsp attribute=clientForm /action action path=/clientaction/update type=ie.sentenial.application.actions.ClientAction name=clientForm scope=request input=/pages/updateClient.jsp attribute=clientForm /action You still get code reuse of your action class, but, you have to duplicate the action mapping specification. If you want to avoid duplicating the action mapping, the other way to go is to have a single JSP that supports both adds and updates with conditional logic in the JSP based on a mode parameter which indicates whether it is being used for an add or an update. - Van Mike Van Riper mailto:[EMAIL PROTECTED] http://www.baychi.org/bof/struts/ P.S. You don't need to specify both name and attribute values in your action mappings unless you want to store the form under a different name at request/session scope than the form configuration name. What you have done doesn't hurt anything, it is just not necessary to specify an attribute value unless the value specified for it is different than the name value. -Original Message- From: Ciaran Hanley [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 27, 2004 10:57 AM To: Struts User Mailing List Subject: Problems Redirecting To Input Page After Vaildation Fails Hello can anybody help me with this problem I'm having please? I am using the same action to perform two functions action path=/clientaction type=ie.sentenial.application.actions.ClientAction name=clientForm scope=request input=/pages/addClient.jsp attribute=clientForm /action This is called as follows from 2 different forms: html:form action=/clientaction?action=update focus=clientName onsubmit=return validateClientForm(this) and html:form action=/clientaction?action=add focus=clientName onsubmit=return validateClientForm(this) The problem is that because I have input=/pages/addClient.jsp ...that when a validation fails while doing an update it is directed back to the addClient.jsp rather than the updateClient.jsp As far as I know the input field will not take dynamic values. I am not sure how to resolve this problem. I need to be directed back to the correct page when validations fail Thanks Ciaran - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Question on Frames within Tiles
Shitij, You can't insert a frameset document inside of a DIV element in the middle of a regular HTML page. The fact that this is not working has nothing to do with Tiles. It is simply invalid HTML. You can nest frameset documents, but, you would still need to reference the nested frameset document as the SRC attribute for a frame in an outer frameset document. In case it might help, here is a brief explanation of how tiles and framesets are successfully used together in the webapp that I am currently working on. I use framesets with tiles in a limited fashion. The bulk of my current application doesn't require the use of frames, but, I need to use them to integrate a third party solution as if it were a part of our application. I do this by displaying the responses from their server in a frame where the body content tile would normally be for a regular page. I have a separate master layout tile definition for normal pages and a different master layout tile definition for frameset pages. The master layout tile definition for the frameset pages has a PATH attribute that refers to a frameset document. The tricky part is that the SRC attribute in your frame definitions within the frameset have to make a separate request. Obviously, you can't have a tile attribute referring to another tile to insert at that point. Plus, I do everything through action mappings with no direct JSP references client side. So, this means that I end up with a lot of cookie cutter action mappings for the various frames that then simply forward to the tile definition for each frame. I was able to at least get some code reuse by inserting the same tiles for menus, footer, etc... into a page tile for each frame. For example, inserting the same menu tile into the header frame of the frameset as I use to insert the menu into the master page layout for the rest of the regular pages. There is probably a more elegant solution, but, I haven't invested much time or energy into this because I only need to use it for this one special case. So, I wouldn't necessarily emulate what I have done. However, you clearly can mix the use of framesets with Tiles. Hope this helps, Van Mike Van Riper Silicon Valley Struts User Group http://www.baychi.org/bof/struts/ -Original Message- From: Mutreja, Shitij [mailto:[EMAIL PROTECTED] Sent: Thursday, February 05, 2004 10:08 AM To: 'Struts Users Mailing List' Subject: REPOST: Question on Frames within Tiles Any suggestions please. Am desperate at this point. Can framesets even be loaded from tiles? -Original Message- From: Mutreja, Shitij [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 04, 2004 2:16 PM To: '[EMAIL PROTECTED]' Subject: Question on Frames within Tiles Is there a good place/article/sample code to check out, for mixing framesets and tiles. The App that I am working on seems to need to use both. Basically, we have to display content such that there are 2 frames, the left one showing some text, while the right one accepts user input. Both these also need to be scrollable separately. My intention is to somehow include these frames within a Body tile. The other issue is that there is also a footer tile, which might need to include a frameset. The reason being the the control buttons need to always be visible(without having to scroll to view them). Here is what i tried: Layout used for the Body: div id=content-well tiles:insert attribute=quiz/ tiles:insert attribute=quizfooter/ /div quiz actually has a value in the tile-defs that points to the quizcontent.jsp shown below: frameset cols=20,720,* frame frameborder=0 frameset cols=360,* frame frameborder=0 src=/practicequizzes/quiz.jsp frame frameborder=0 src=/practicequizzes/quiz.jsp /frameset frame frameborder=0 /frameset The problem with this is that the /practicequizzes/quiz.jsp is never actually sourced and I just see nothing in the body tile. Thanks, Shitij Mutreja Shitij Mutreja The College Board 11911 Freedom Drive, Suite 300 Reston, VA 20190 571.262.5701 (Phone) 703.707.5596 (Fax) [EMAIL PROTECTED] http://www.collegeboard.com/highered/index.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] Rick Hightower on Thursday, March 18th in Mountain View, CA
Rick Hightower will be presenting at the March 18th meeting of the Silicon Valley Struts User Group. We are still working out the final details, but, it looks like Rick will make a presentation on the Tiles framework. A partial meeting announcement is already on the web. It will be updated soon with the full talk details. Here it is: http://www.baychi.org/bof/struts/20040318/ That's all folks, Mike Van Riper Silicon Valley Struts User BOF http://www.baychi.org/bof/struts/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] 3/18 Struts Tiles Talk by Rick Hightower at VeriSign
The Silicon Valley Struts User Group has a meeting next Thursday evening at VeriSign in Mountain View. Our meetings are always free and open to the general public. A speaker that is flying in for the Software Development conference next week has agreed to speak to our group while he is in town. Rick Hightower is the CTO of ArcMind http://www.arc-mind.com and one of the co-authors of Professional Jakarta Struts. If you would like to learn about the Tiles framework in Struts 1.1, this would be an excellent talk to attend. The full meeting announcement can be found online here: http://www.baychi.org/bof/struts/20040318/ To get an idea of what will be covered in this talk, you could look at an online tutorial previously created by Rick that is available at the IBM developerWorks web site: http://tinyurl.com/2uby6 Finally, I do need to know how many people to expect for planning purposes. I arrange the room differently depending upon the expected turnout. If you are going to attend this talk, please RSVP with me by noon on the day of the talk. Thanks, Van Mike Van Riper Silicon Valley Struts User Group http://www.baychi.org/bof/struts/ mailto:[EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Why is it so difficult to unsubscribe?
Kenneth, Did you get any replies to your unsubscribe emails? It is a two step process. You have to follow the instructions in the unsubscribe confirmation email to complete the process. As I recall, you simply need to reply to the confirmation email to make it stick. This is to prevent someone from spoofing your email address to send commands to the mailing list server. I recently (less than one week ago) converted my subscription from digest mode to regular mode which involved unsubscribing from the digest mode and had no problems doing so. Good luck, Van Mike Van Riper Silicon Valley Struts User Group http://www.baychi.org/bof/struts/ -Original Message- From: Kenneth Kalmer [mailto:[EMAIL PROTECTED] Sent: Sunday, March 14, 2004 8:30 PM To: [EMAIL PROTECTED] Subject: Why is it so difficult to unsubscribe? Guys I've been trying to get my name off the stuts user digest for more than a week now! How difficult can this be? For a foundation as big as Apache, something as simple as a mailing list must be nothing to manage. Admins: [EMAIL PROTECTED] must be removed from this list with immediate effect. I've contacted you several times over, even sent mail to the ASF directly. Now I'm publishing this in the main list to let the people know that you and your mailing systems are very incompetant. Thanks for all the info on the list, but our roads part now. Cheerz -- Kenneth Kalmer [EMAIL PROTECTED] http://clearplanet.co.za The great thing about a computer notebook is that no matter how much you stuff into it, it doesn't get bigger or heavier Bill Gates - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] 3/18 Struts Tiles Talk by Rick Hightower at VeriSign
-Original Message- From: Benz Lim [mailto:[EMAIL PROTECTED] Sent: Thursday, March 18, 2004 2:11 AM To: Struts Users Mailing List Subject: RE: [OT] 3/18 Struts Tiles Talk by Rick Hightower at VeriSign Will there meeting be video stream (stream cast) for other user? Benz, I wish that I could say yes, but, the answer is no. I don't have a volunteer to do this and I don't have the bandwidth to deal with it myself. I still hope to have a streaming video available for Craig's talk from last November, but, that is taking the volunteer involved longer to get into a compressed format that would be reasonable for hosting on his personal web site. This is the main reason why that earlier talk video is still not available online. Sorry, Van Mike Van Riper Silicon Valley Struts User Group http://www.baychi.org/bof/struts/ Best Regards, Benz Lim -Original Message- ... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Questions about debug and info messages
Eric, If you are using log4j, then you can configure it with a properties file. As an example (minus some of my project specific settings), here is a simple log4j configuration file that establishes a rolling log file. Notice near the bottom where I set the struts and commons packages to the WARN log level. This suppresses the INFO and DEBUG log messages for these packages. # Usage: Specifies the configuration properties for log4j. # # Notes: This properties file should be placed somewhere #inside the WEB-INF/classes directory. # Create two appenders, one called stdout and the other called rolling log4j.rootLogger=WARN, stdout, rolling # Configure the stdout appender to go to the Console log4j.appender.stdout=org.apache.log4j.ConsoleAppender # Configure the stdout appender to use the PatternLayout log4j.appender.stdout.layout=org.apache.log4j.PatternLayout # Pattern to output the caller's file name and line number. log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n # Configure the rolling appender to be a RollingFileAppender log4j.appender.rolling=org.apache.log4j.RollingFileAppender # Configure the name of the logout for the rolling appender # For Tomcat: # log4j.appender.rolling.File=../logs/app-rolling.log # For Weblogic: log4j.appender.rolling.File=/logs/app-rolling.log # Set up the maximum size of the rolling log file log4j.appender.rolling.MaxFileSize=5120KB # Keep two backup files of the rolling appender log4j.appender.rolling.MaxBackupIndex=2 # Configure the Layout pattern and conversion pattern for the rolling appender log4j.appender.rolling.layout=org.apache.log4j.PatternLayout log4j.appender.rolling.layout.ConversionPattern=%d{ISO8601} - %p %c - %m%n # Set Struts/Commons log level log4j.logger.org.apache.struts=WARN log4j.logger.org.apache.commons=WARN --- Of course, you have to configure your installation to read the properties file. The simplest way is to include it inside the war at the root of your class package structure where it gets picked up by default. However, you can explicitly point to a properties file outside the war using command line arguments to the JVM startup command for your servlet container. This is how we have it setup for our production webapps so that we can reconfigure the logging options without having to redeploy the war file again. See the log4j docs for more information: http://tinyurl.com/3hlrq Hope this helps, Van Mike Van Riper Silicon Valley Struts User Group http://www.baychi.org/bof/struts/ -Original Message- From: Eric Hodges [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 23, 2004 12:28 PM To: Struts Users Mailing List Subject: RE: Questions about debug and info messages Thanks for the advice, but I'm using log4j. The API doc you to which you linked doesn't offer much help. I hacked a solution by setting the message level on the struts logger to warning in one of my servlet's init method, but surely there's a configuration setting (like a parameter to the Action servlet?) that will set the message level. -Original Message- From: Pady Srinivasan [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 23, 2004 8:21 AM To: Struts Users Mailing List Subject: RE: Questions about debug and info messages If you are using JDK 1.4 and not using log4j, then look in JAVA_HOME/jre/lib for a file called logging.properties. Set the .level to OFF. The levels in descending order are: SEVERE (highest value) WARNING INFO CONFIG FINE FINER FINEST (lowest value) In addition there is a level OFF that can be used to turn off logging, and a level ALL that can be used to enable logging of all messages. I haven't used log4j. Here is the struts docs: http://jakarta.apache.org/commons/logging/api/org/apache/commo ns/logging/pac kage-summary.html#package_description Thanks -- pady [EMAIL PROTECTED] -Original Message- From: Eric Hodges [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 23, 2004 10:36 AM To: Struts Users Mailing List (E-mail) Subject: Questions about debug and info messages We have a torrent of debug and info messages coming out of struts. I can't find any documentation about how to turn them off. Two questions: 1. How do I turn off debug and info level messages? 2. Where is that documented? Thanks, Eric Hodges - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Pls help me in configuring common logger
-Original Message- From: sougata [mailto:[EMAIL PROTECTED] Sent: Thursday, March 25, 2004 9:15 PM To: Struts Users Mailing List Subject: Pls help me in configuring common logger Hi Guys I am facing a problem in configuration apaches common logger using weblogic8.1.I want to send all my log message to a perticular file.I am using Common logger for my logging message.How to configure Pls let me know The simple logger that is included in the commons logging package doesn't support logging to a file, just to the console. You need to understand that it is primarily intended to provide the common logging API (the simple logger is included just to get you started) and then you configure it to use whatever logging facility under the covers that you want to. Most people use log4j, but, you could also use the native logging support in JDK 1.4 or greater. I recommend configuring to use log4j. I also recommend taking the time to read the short intro manual to log4j found here: http://tinyurl.com/3hlrq I recently posted the contents of a simple log4j configuration file that does have an example of the necessary configuration to write log messages both to the console and to file. Check the list archives for a recent post on logging by me. I use this setup with Tomcat and Weblogic. The one configuration difference I found is that Weblogic doesn't like relative file paths for location of log files and Tomcat handles that just fine. Good luck, Van Mike Van Riper Silicon Valley Struts User Group http://www.baychi.org/bof/struts/ P.S. You can either remove the commons logging properties file or explicitly configure it to use log4j. As long as you setup log4j properly in your runtime environment, the commons logging logic will use it by default unless you have a commons logging properties file that explicitly specifies a different logger implementation. Thanks Sougata - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Pls help me in configuring common logger
Sougata, I can point you in the right direction, but, I don't have time to spell everything out for you. I think you need to do some work on your own reading the commons logging docs. You need to understand the commons logging package and how to configure it to use log4j or the native logging facilities in JDK 1.4. When I mentioned the simple logger, I was referring to this implementation of org.apache.commons.logging.Log: org.apache.commons.logging.impl.SimpleLog If you are using the commons logging package, it has a properties file you can use to specify which Log interface implementation to use. I could be wrong, but, when this file is not provided my experience has been that it will automatically detect the presence of a properly configured log4j and instantiate a org.apache.commons.logging.impl.Log4JLogger. If a properly configured log4j is not detected, it will default back to the SimpleLog implementation. Good Luck, Van -Original Message- From: sougata [mailto:[EMAIL PROTECTED] Sent: Friday, March 26, 2004 4:12 AM To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: RE: Pls help me in configuring common logger Hi Van I am not using simple logger.I am using apache's commons logger.Pls le me know how to do it Thanks Sougata -Original Message- From: Van Riper, Mike [mailto:[EMAIL PROTECTED] Sent: Friday, March 26, 2004 12:38 PM To: 'Struts Users Mailing List' Subject: RE: Pls help me in configuring common logger -Original Message- From: sougata [mailto:[EMAIL PROTECTED] Sent: Thursday, March 25, 2004 9:15 PM To: Struts Users Mailing List Subject: Pls help me in configuring common logger Hi Guys I am facing a problem in configuration apaches common logger using weblogic8.1.I want to send all my log message to a perticular file.I am using Common logger for my logging message.How to configure Pls let me know The simple logger that is included in the commons logging package doesn't support logging to a file, just to the console. You need to understand that it is primarily intended to provide the common logging API (the simple logger is included just to get you started) and then you configure it to use whatever logging facility under the covers that you want to. Most people use log4j, but, you could also use the native logging support in JDK 1.4 or greater. I recommend configuring to use log4j. I also recommend taking the time to read the short intro manual to log4j found here: http://tinyurl.com/3hlrq I recently posted the contents of a simple log4j configuration file that does have an example of the necessary configuration to write log messages both to the console and to file. Check the list archives for a recent post on logging by me. I use this setup with Tomcat and Weblogic. The one configuration difference I found is that Weblogic doesn't like relative file paths for location of log files and Tomcat handles that just fine. Good luck, Van Mike Van Riper Silicon Valley Struts User Group http://www.baychi.org/bof/struts/ P.S. You can either remove the commons logging properties file or explicitly configure it to use log4j. As long as you setup log4j properly in your runtime environment, the commons logging logic will use it by default unless you have a commons logging properties file that explicitly specifies a different logger implementation. Thanks Sougata - 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]