RE: out tag inside html:text tag
Try using the struts-el tag library It's an extension of the struts taglib that allows you to use JSTL EL So you example becomes... html-el:text style=${styleVar} .../ -Original Message- From: Rahul Mohan [mailto:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 2:48 AM To: struts Subject: c:out tag inside html:text tag Hi...I am facing some problems with using JSTL tags inside struts tags. This is the piece of code I wrote for my application: html:text name=Customer property =Name maxlength=256 size=256 style=c:out value=${styleVar}/ / the problem is that it is getting traslated to html:text name=w_CustomerWin property =wca_Name maxlength=256 size=256 style=width:100;height:22;position:absolute;top:20;left:56;display:none; / in the final html page!! can anybody please tell me why the html:text tag is not getting translated to input type=text . ? thank you.. Rahul Mohan ~~~ MasterCraft Group Tata Consultancy Services Tata Research Development and Design Center 54B, Hadapsar Industrial Estate Pune - 411 013 Phone: +91 4042333 or 4031122 Extn 2541 +91 471 3129787 ( Mobile ) Fax: +91 20 4042399 email : [EMAIL PROTECTED] ~~~ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT]CVS client
if you don't need a GUI, you can install cygwin and use the cvs client from that. -Original Message- From: Ramadoss Chinnakuzhandai [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 03, 2004 3:17 PM To: [EMAIL PROTECTED] Subject: [OT]CVS client Importance: High Hi, can anybody suggest me any better CVS client other than WinCVS and JCVS? Tnx in advance, -Ramadoss - 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]
iteration and EL help needed
This is the problem I am trying to solve. I want to submit a DynaValidatorForm with multiple hidden/text inputs that have the same name. This is a list of items and quantities that I am trying to update with one submit (e.g. itemId, quantity). Is this what the 'indexed' input attribute is supposed to help with? Will the validator understand how to apply the rule for itemId to every indexed instance of itemId? Will DynaValidatorForm receive an array of itemIds and quantities? Since the items are stored in a collection, I want to iterate over them, outputting the input fields. With c:forEach, I get an exception that the indexed attribute is not supported. With logic-el:iterate, I get a name attribute that looks like name=org.apache.struts.taglib.html.BEAN[1].itemId - that doesn't look right at all. I am using Struts 1.1rel (and the struts-el JAR in the contrib dir) with JSTL 1.0 in Resin 2.x.x. Has anyone seen behavior like this and know how I can fix it? Or am I barking up the wrong tree trying to submit my form in this fashion? Here's a bit of the JSP code... %--c:forEach var=item items=${context_tray.items} varStatus=idx--% logic-el:iterate id=item name=context_tray property=items indexId=idx html-el:hidden property=itemId value=${item.id} indexed=true/ html-el:text property=quantity value=${context_tray.itemQuantityMap[item]} size=2 indexed=true/ br /logic-el:iterate %--/c:forEach--% thx Andy Kriger | Software Mechanic | Greater Than One, Inc. 28 West 27th Street | 7th Floor | New York, NY 10001 P: 212.252.7197 | F: 212.252.7364 | E: [EMAIL PROTECTED]
RE: form validation question
It didn't make any difference if I used an action or the JSP for the input attribute. -Original Message- From: Geeta Ramani [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 27, 2004 6:55 PM To: Struts Users Mailing List Subject: Re: form validation question Ok, maybe, I'd have to check into struts code to really be certain(input surely has some significance is what i'm thinking..) So just for the heck of it though, what happens if you do say /web/forms/orderForm.jsp instead? Andy Kriger wrote: OrderForm.do = /web/forms/orderForm.jsp That shouldn't make a difference. I like to refer to actions rather than JSPs to minimize the number of things I have to change if a JSP changes to a different JSP or to another action. -Original Message- From: Geeta Ramani [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 27, 2004 3:27 PM To: Struts Users Mailing List Subject: Re: form validation question Andy: Any reason why you have the unusual input param..? action path=/SubmitOrder type=MyClass name=orderForm validate=true input=/OrderForm.do scope=request forward name=success path=/OrderThanks.do/ /action I woud have thought you'd use this instead: action path=/SubmitOrder type=MyClass name=orderForm validate=true input=/web/forms/orderForm.jsp scope=request forward name=success path=/OrderThanks.do/ /action Regards, Geeta Andy Kriger wrote: I am having a curious problem with form validation. I submit a form, see in the logs that the form fails to validate, however, the webapp does not return to the input page (I get a blank page with no HTML in it), so I do not see the form with error messages as expected. If I put text in the field, the form does submit correctly and I see the JSP specified in the resulting action chain. The log files have no error messages indicating something is amiss. When validation fails, the subsequent action is definitely not running (I do not see the logging in the execute method). Does anyone have any ideas what could be happening here? Or how I can track down the problem? Below is the relevant info... === STRUTS CONFIG === action path=/OrderForm forward=/web/forms/orderForm.jsp / action path=/SubmitOrder type=MyClass name=orderForm validate=true input=/OrderForm.do scope=request forward name=success path=/OrderThanks.do/ /action action path=/OrderThanks parameter=/web/orderThanks.jsp type=org.apache.struts.actions.ForwardAction/ === orderForm.jsp === logic:messagesPresent html:messages id=err %=err%br/ /html:messages /logic:messagesPresent html:form action=SubmitOrder.do html:text property=firstName styleId=firstName size=20/ html:submit value=Press Me/ /html:form === VALIDATION CONFIG === form name=orderForm field property=firstName depends=required arg0 key=orderForm.firstName.label name=required / /field /form === LOG MESSAGES === [org.apache.struts.action.RequestProcessor][RequestProcessor] Validating input form properties [org.apache.struts.action.RequestProcessor][RequestProcessor] Validation failed, returning to '/OrderForm.do' Andy Kriger | Software Mechanic | Greater Than One, Inc. 28 West 27th Street | 7th Floor | New York, NY 10001 P: 212.252.7197 | F: 212.252.7364 | E: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: form validation question
Looks like there is a functional change or bug in the action input attribute in Struts 1.1 - a forward name must be used instead of the location of a JSP or Action. Not sure why this change happened between 1.1RC and 1.1rel - maybe someone on the Struts dev team can answer? -Original Message- From: Andy Kriger [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 27, 2004 2:46 PM To: Struts Users Mailing List Subject: form validation question I am having a curious problem with form validation. I submit a form, see in the logs that the form fails to validate, however, the webapp does not return to the input page (I get a blank page with no HTML in it), so I do not see the form with error messages as expected. If I put text in the field, the form does submit correctly and I see the JSP specified in the resulting action chain. The log files have no error messages indicating something is amiss. When validation fails, the subsequent action is definitely not running (I do not see the logging in the execute method). Does anyone have any ideas what could be happening here? Or how I can track down the problem? Below is the relevant info... === STRUTS CONFIG === action path=/OrderForm forward=/web/forms/orderForm.jsp / action path=/SubmitOrder type=MyClass name=orderForm validate=true input=/OrderForm.do scope=request forward name=success path=/OrderThanks.do/ /action action path=/OrderThanks parameter=/web/orderThanks.jsp type=org.apache.struts.actions.ForwardAction/ === orderForm.jsp === logic:messagesPresent html:messages id=err %=err%br/ /html:messages /logic:messagesPresent html:form action=SubmitOrder.do html:text property=firstName styleId=firstName size=20/ html:submit value=Press Me/ /html:form === VALIDATION CONFIG === form name=orderForm field property=firstName depends=required arg0 key=orderForm.firstName.label name=required / /field /form === LOG MESSAGES === [org.apache.struts.action.RequestProcessor][RequestProcessor] Validating input form properties [org.apache.struts.action.RequestProcessor][RequestProcessor] Validation failed, returning to '/OrderForm.do' Andy Kriger | Software Mechanic | Greater Than One, Inc. 28 West 27th Street | 7th Floor | New York, NY 10001 P: 212.252.7197 | F: 212.252.7364 | E: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
form validation question
I am having a curious problem with form validation. I submit a form, see in the logs that the form fails to validate, however, the webapp does not return to the input page (I get a blank page with no HTML in it), so I do not see the form with error messages as expected. If I put text in the field, the form does submit correctly and I see the JSP specified in the resulting action chain. The log files have no error messages indicating something is amiss. When validation fails, the subsequent action is definitely not running (I do not see the logging in the execute method). Does anyone have any ideas what could be happening here? Or how I can track down the problem? Below is the relevant info... === STRUTS CONFIG === action path=/OrderForm forward=/web/forms/orderForm.jsp / action path=/SubmitOrder type=MyClass name=orderForm validate=true input=/OrderForm.do scope=request forward name=success path=/OrderThanks.do/ /action action path=/OrderThanks parameter=/web/orderThanks.jsp type=org.apache.struts.actions.ForwardAction/ === orderForm.jsp === logic:messagesPresent html:messages id=err %=err%br/ /html:messages /logic:messagesPresent html:form action=SubmitOrder.do html:text property=firstName styleId=firstName size=20/ html:submit value=Press Me/ /html:form === VALIDATION CONFIG === form name=orderForm field property=firstName depends=required arg0 key=orderForm.firstName.label name=required / /field /form === LOG MESSAGES === [org.apache.struts.action.RequestProcessor][RequestProcessor] Validating input form properties [org.apache.struts.action.RequestProcessor][RequestProcessor] Validation failed, returning to '/OrderForm.do' Andy Kriger | Software Mechanic | Greater Than One, Inc. 28 West 27th Street | 7th Floor | New York, NY 10001 P: 212.252.7197 | F: 212.252.7364 | E: [EMAIL PROTECTED]
RE: form validation question
I see an empty page - no HTML, no nothing. It's as if the handoff to the input path never happens, even though the logging informs me that validation failed and the input path is being returned to. When you say 'a question of display not working right', what do you have in mind? -Original Message- From: Geeta Ramani [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 27, 2004 3:05 PM To: Struts Users Mailing List Subject: Re: form validation question Andy: What do you see in the source of the html page..? Maybe it is just a question of display not working right..? Geeta Andy Kriger wrote: I am having a curious problem with form validation. I submit a form, see in the logs that the form fails to validate, however, the webapp does not return to the input page (I get a blank page with no HTML in it), so I do not see the form with error messages as expected. If I put text in the field, the form does submit correctly and I see the JSP specified in the resulting action chain. The log files have no error messages indicating something is amiss. When validation fails, the subsequent action is definitely not running (I do not see the logging in the execute method). Does anyone have any ideas what could be happening here? Or how I can track down the problem? Below is the relevant info... === STRUTS CONFIG === action path=/OrderForm forward=/web/forms/orderForm.jsp / action path=/SubmitOrder type=MyClass name=orderForm validate=true input=/OrderForm.do scope=request forward name=success path=/OrderThanks.do/ /action action path=/OrderThanks parameter=/web/orderThanks.jsp type=org.apache.struts.actions.ForwardAction/ === orderForm.jsp === logic:messagesPresent html:messages id=err %=err%br/ /html:messages /logic:messagesPresent html:form action=SubmitOrder.do html:text property=firstName styleId=firstName size=20/ html:submit value=Press Me/ /html:form === VALIDATION CONFIG === form name=orderForm field property=firstName depends=required arg0 key=orderForm.firstName.label name=required / /field /form === LOG MESSAGES === [org.apache.struts.action.RequestProcessor][RequestProcessor] Validating input form properties [org.apache.struts.action.RequestProcessor][RequestProcessor] Validation failed, returning to '/OrderForm.do' Andy Kriger | Software Mechanic | Greater Than One, Inc. 28 West 27th Street | 7th Floor | New York, NY 10001 P: 212.252.7197 | F: 212.252.7364 | E: [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: form validation question
OrderForm.do = /web/forms/orderForm.jsp That shouldn't make a difference. I like to refer to actions rather than JSPs to minimize the number of things I have to change if a JSP changes to a different JSP or to another action. -Original Message- From: Geeta Ramani [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 27, 2004 3:27 PM To: Struts Users Mailing List Subject: Re: form validation question Andy: Any reason why you have the unusual input param..? action path=/SubmitOrder type=MyClass name=orderForm validate=true input=/OrderForm.do scope=request forward name=success path=/OrderThanks.do/ /action I woud have thought you'd use this instead: action path=/SubmitOrder type=MyClass name=orderForm validate=true input=/web/forms/orderForm.jsp scope=request forward name=success path=/OrderThanks.do/ /action Regards, Geeta Andy Kriger wrote: I am having a curious problem with form validation. I submit a form, see in the logs that the form fails to validate, however, the webapp does not return to the input page (I get a blank page with no HTML in it), so I do not see the form with error messages as expected. If I put text in the field, the form does submit correctly and I see the JSP specified in the resulting action chain. The log files have no error messages indicating something is amiss. When validation fails, the subsequent action is definitely not running (I do not see the logging in the execute method). Does anyone have any ideas what could be happening here? Or how I can track down the problem? Below is the relevant info... === STRUTS CONFIG === action path=/OrderForm forward=/web/forms/orderForm.jsp / action path=/SubmitOrder type=MyClass name=orderForm validate=true input=/OrderForm.do scope=request forward name=success path=/OrderThanks.do/ /action action path=/OrderThanks parameter=/web/orderThanks.jsp type=org.apache.struts.actions.ForwardAction/ === orderForm.jsp === logic:messagesPresent html:messages id=err %=err%br/ /html:messages /logic:messagesPresent html:form action=SubmitOrder.do html:text property=firstName styleId=firstName size=20/ html:submit value=Press Me/ /html:form === VALIDATION CONFIG === form name=orderForm field property=firstName depends=required arg0 key=orderForm.firstName.label name=required / /field /form === LOG MESSAGES === [org.apache.struts.action.RequestProcessor][RequestProcessor] Validating input form properties [org.apache.struts.action.RequestProcessor][RequestProcessor] Validation failed, returning to '/OrderForm.do' Andy Kriger | Software Mechanic | Greater Than One, Inc. 28 West 27th Street | 7th Floor | New York, NY 10001 P: 212.252.7197 | F: 212.252.7364 | E: [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: form validation question
orderForm was extending DynaValidatorForm. I changed this to DynaValidatorActionForm - now the form validates (though it shouldn't - there's a required field missing). Looks like I'm one step closer to a solution. Thank you for the idea. -Original Message- From: Barnett, Brian W. [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 27, 2004 5:10 PM To: 'Struts Users Mailing List' Subject: RE: form validation question Your orderForm does extend ValidatorForm instead of ActionForm right? The struts validator plug-in relies on your forms extending ValidatorForm in order to do server-side validations. Out of curiosity, you may want to see if client-side validation works first. html:form action=SubmitOrder.do onsubmit=return validateOrderForm(this) ... /html:form validator:javascript formName=orderForm/ When the submit button is pressed, if the required field is empty, you should get a message window indicating the field is required. Brian Barnett -Original Message- From: Andy Kriger [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 27, 2004 1:16 PM To: 'Struts Users Mailing List' Subject: RE: form validation question I see an empty page - no HTML, no nothing. It's as if the handoff to the input path never happens, even though the logging informs me that validation failed and the input path is being returned to. When you say 'a question of display not working right', what do you have in mind? -Original Message- From: Geeta Ramani [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 27, 2004 3:05 PM To: Struts Users Mailing List Subject: Re: form validation question Andy: What do you see in the source of the html page..? Maybe it is just a question of display not working right..? Geeta Andy Kriger wrote: I am having a curious problem with form validation. I submit a form, see in the logs that the form fails to validate, however, the webapp does not return to the input page (I get a blank page with no HTML in it), so I do not see the form with error messages as expected. If I put text in the field, the form does submit correctly and I see the JSP specified in the resulting action chain. The log files have no error messages indicating something is amiss. When validation fails, the subsequent action is definitely not running (I do not see the logging in the execute method). Does anyone have any ideas what could be happening here? Or how I can track down the problem? Below is the relevant info... === STRUTS CONFIG === action path=/OrderForm forward=/web/forms/orderForm.jsp / action path=/SubmitOrder type=MyClass name=orderForm validate=true input=/OrderForm.do scope=request forward name=success path=/OrderThanks.do/ /action action path=/OrderThanks parameter=/web/orderThanks.jsp type=org.apache.struts.actions.ForwardAction/ === orderForm.jsp === logic:messagesPresent html:messages id=err %=err%br/ /html:messages /logic:messagesPresent html:form action=SubmitOrder.do html:text property=firstName styleId=firstName size=20/ html:submit value=Press Me/ /html:form === VALIDATION CONFIG === form name=orderForm field property=firstName depends=required arg0 key=orderForm.firstName.label name=required / /field /form === LOG MESSAGES === [org.apache.struts.action.RequestProcessor][RequestProcessor] Validating input form properties [org.apache.struts.action.RequestProcessor][RequestProcessor] Validation failed, returning to '/OrderForm.do' Andy Kriger | Software Mechanic | Greater Than One, Inc. 28 West 27th Street | 7th Floor | New York, NY 10001 P: 212.252.7197 | F: 212.252.7364 | E: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
getServlet?
The ServletContext.getServlet() method has been deprecated. Is it possible to get a Servlet (or the ServletConfig, which is what I'm really after) in a Struts Action? thx andy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Valid Regexp for MM/dd/yyyy matching in a string?
Looks like it should work, you might need to escape the slashes. It's easy enough to test either by using grep on the command line (which is not the best test since there are differences btw Unix regexp and Java regexp) or by writing a test class that uses the ORO library (Validator doesn't use the Java regexp package) or by using the ORO test applet at http://jakarta.apache.org/oro/demo.html. -Original Message- From: David Erickson [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 10, 2003 16:28 To: Struts Mailing List Subject: Valid Regexp for MM/dd/ matching in a string? Here is what I came up with.. I don't know if its valid or not but I'd like it to match a date in the format MM/dd/ for parsing. var-namemask/var-name var-value^[0-1]{1}[0-9]{1}/[0-3]{1}[0-9]{1}/[1-2]{1}[0-9]{3}$/var-value Thanks! -David - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] TLD question
does putting an external URI on a page mean that webapp container is going to make a request to that URI when it loads the page? -Original Message- From: Kris Schneider [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 06, 2003 15:14 To: Struts Users Mailing List Subject: Re: [OT] TLD question You don't need the TLD files, they're already packaged in the JAR files for the tags. You also don't need to add taglib entries to your web.xml file. You *do* need taglib directive(s) in your JSP: %@ taglib prefix=c uri=http://java.sun.com/jstl/core; % %@ taglib prefix=fmt uri=http://java.sun.com/jstl/fmt; % %@ taglib prefix=sql uri=http://java.sun.com/jstl/sql; % %@ taglib prefix=x uri=http://java.sun.com/jstl/xml; % Quoting Andy Kriger [EMAIL PROTECTED]: I downloaded the JSTL from Sun. In the tld directory there are 2 TLDs for each taglib. Example: c.tld and c-rt.tld Do I need to copy both of these to my WEB-INF dir? Do I need to reference both of these in the JSP [EMAIL PROTECTED] directive? thx andy -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] Resin does not work with Struts 1.1 Final
Resin definitely does work with RC2 and 1.1 so there's probably a configuration issue either in Resin or in Struts that is causing your error. -Original Message- From: Barry Volpe [mailto:[EMAIL PROTECTED] Sent: Friday, August 08, 2003 17:33 To: Struts Users Mailing List Subject: [OT] Resin does not work with Struts 1.1 Final Resin does not work with Struts 1.1 Final Question by Barry on Fri, 08 Aug 2003 14:05:26 -0700 (PDT) [ edit | delete ] When upgrading to Struts RC2 or 1.1 Final the following error occurs: (further description of problem below) 500 Servlet Exception javax.servlet.jsp.JspException: Can't get definitions factory from context. at org.apache.struts.taglib.tiles.InsertTag.processDefinitionName(InsertTag.jav a:583) at org.apache.struts.taglib.tiles.InsertTag.createTagHandler(InsertTag.java:487 ) at org.apache.struts.taglib.tiles.InsertTag.doStartTag(InsertTag.java:451) at _index__jsp._jspService(/childrencare/index.jsp:9) at com.caucho.jsp.JavaPage.service(JavaPage.java:75) at com.caucho.jsp.Page.subservice(Page.java:506) at com.caucho.server.http.FilterChainPage.doFilter(FilterChainPage.java:182) at com.caucho.server.http.Invocation.service(Invocation.java:315) at com.caucho.server.http.RunnerRequest.handleRequest(RunnerRequest.java:344) at com.caucho.server.http.RunnerRequest.handleConnection(RunnerRequest.java:274 ) at com.caucho.server.TcpConnection.run(TcpConnection.java:139) at java.lang.Thread.run(Thread.java:536) Resin 2.1.9 (built Tue Apr 15 14:28:40 PDT 2003) Although the message indicates a tiles problem the real problem appears to be in initializing a datasource. If I remove the datasource from the struts-config the error goes away (of course cannot connect to a datasource but the jsp comes up). In versions RC1 or earlier the problem does not exist. The main difference from RC2,1.1 Final and earlier versions starting from RC1 is (from release notes): In RC2, the Commons-DBCP and Commons-Pool dependencies have been removed. These are replaced with a dependency on the Struts-Legacy package, containing the GenericDataSource and GenericConnection classes from Struts 1.0.2. These are distributed for J2SE 1.3 but may be recompiled for J2SE 1.4. Other DataSource implementations may be plugged in (recommended). RC2 is dependent upon Commons FileUpload RC1. The final release of Struts 1.1 cannot happen until this dependency is updated to a final release of FileUpload. All other dependencies are in their final release. Other changes since RC1 have been routine fixes and refactorings. I have tried using DBCP and General methods of connecting using the mysql driver and both will not work. The RC2 and Struts Final 1.1 work fine in Tomcat 4.1 but do not work in Resin. I am using J2SE 1.4 on Tomcat and Resin Any suggestions? Thanks, Barry - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] TLD question
I downloaded the JSTL from Sun. In the tld directory there are 2 TLDs for each taglib. Example: c.tld and c-rt.tld Do I need to copy both of these to my WEB-INF dir? Do I need to reference both of these in the JSP [EMAIL PROTECTED] directive? thx andy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] ServletResponse question
I would like to call a JSP (using jsp:include) passing it some parameters, have that included JSP do its dynamic stuff, and then get the response as a String or byte[] so that I can do some further manipulation with the resulting HTML. Is there any way to get a String or byte[] from a response.getWriter() or response.getOutputStream()? If not, does anyone have any suggestions on how I can accomplish my goal? thx andy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] TLD question
So it looks in the WEB-INF dir first for TLDs then goes to that URI? -Original Message- From: Alex Shneyderman [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 06, 2003 15:34 To: 'Struts Users Mailing List' Subject: RE: [OT] TLD question This is easy to check if you run your server localy. Unplug your machine and look what happens. But the short answer is 'no' it does not. It goes thru your TLD and finds that URL. -Original Message- From: Andy Kriger [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 06, 2003 3:29 PM To: Struts Users Mailing List Subject: RE: [OT] TLD question does putting an external URI on a page mean that webapp container is going to make a request to that URI when it loads the page? - 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]
risk of upgrading?
Can someone with a bit of in-depth Struts experience comment on the risks of upgrading a project from Struts 1.0 to Struts 1.1? Should my project work without any modifications? Are there any issues I need to be aware of (changes in behavior and the like)? thx andy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
form validation question
I have a validation rule that looks like this... field property=phoneExt depends=mask arg0 key=phone/ arg1 key=phone.ext/ var var-namemask/var-name var-value^\s*\d*\s*$/var-value /var /field However, it considers the phoneExt field required. Can anyone tell me why? I want the phoneExt field to be optional, and if filled out, to use the given mask. thx andy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [Q] Log Viewing tool for Windows environment?
log4j also includes logfactor5 - a GUI log viewer that you activate in the log4j.properties -Original Message- From: Gord Tomlin [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 12, 2003 9:49 To: Struts Users Mailing List Subject: Re: [Q] Log Viewing tool for Windows environment? Log4j now includes Chainsaw, which I haven't played with but is supposed to provide real-time log viewing. There is also an Appender that writes to the NT event log, which can then be viewed with the NT event viewer. Gord Tomlin - Original Message - From: Scott Barr [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Tuesday, March 11, 2003 20:58 Subject: RE: [Q] Log Viewing tool for Windows environment? Try cygwin, many useful tools there. Then again, you could always try Linux.. :) Scott Barr www.exergonic.com.au On Wed, 2003-03-12 at 12:20, Mark Galbreath wrote: VIM Mark -Original Message- From: Jeff Smith [mailto:[EMAIL PROTECTED] Sent: Monday, March 10, 2003 12:02 PM To: Struts Users Mailing List Subject: [Q] Log Viewing tool for Windows environment? To date I have been using the brute-force log viewer: notepad. Is anybody aware of a tool that monitors text log files (like output from log4j) and automatically refreshes and scrolls to the end of the file? Such functionality would make my test-debug cycle less mouse intensive. :-) In the UN*X world, I had the tail command for such purposes. But I've never seen anything like this for Windows. Any suggestions? Jefficus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: is Component a reserved word?
java.awt.Component is also in your classpath maybe c:out is trying to cast your object as that instead of x.y.z.Component? -Original Message- From: John Thorhauer [mailto:[EMAIL PROTECTED] Sent: Thursday, February 27, 2003 15:18 To: Struts Users Mailing List Subject: is Component a reserved word? Hi, I am not sure if this is a struts, taglib, or jstl issue but I will start here. I am using Struts/JSP's and am running into an error when I try and reference my own object called Component.class with c:out tag. I first load my test objects into the session in the jsp page like this: % x.y.z.Component component = new x.y.z.Component(); x.y.z.Xomponent xomponent = new x.y.z.Xomponent(); session.setAttribute(comp2,component); session.setAttribute(xomp2,xomponent); % Next I try and view the value of the name like this: c:out value=${comp2.name}/ Here is the error I am getting: org.apache.jasper.JasperException: An error occurred while evaluating custom action attribute value with value ${comp2.name}: An error occurred while getting property name from an instance of class x.y.z.Component (java.lang.IllegalArgumentException: object is not an instance of declaring class) I have played around with this a bit and set up a small test environment. Here is my application list: Tomcat 4.1.18 Struts 1.1 rc1 Java 1.3.1_06-b01 I have found that I can use the Runtime JSTL core tag like this and it works fine: crt:out value=%=((Component)session.getAttribute(comp2)).getName()%/ I can also use the jsp:useBean tag like this and it works fine: jsp:getProperty name=comp1 property=name/ I have also found that if I take the exact same class and simply rename it to Xomponent instead of Component and keep it in the same x.y.z package, it works. So I can then do: c:out value=${xomp2.name}/ Any ideas on this? I have my very small test beans and jsp page if someone needs them. Thanks, John -- ** John Thorhauer ** Web Developer ** Phoenix Color Corp. ** [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: is Component a reserved word?
java.awt.Component would be looked for first (since it is part of the bootclasspath) - you'd need a way to tell the reflection what class comp2 is. you might have to workaround this with a scriplet instead of the ${comp2.name} -Original Message- From: Derek Richardson [mailto:[EMAIL PROTECTED] Sent: Thursday, February 27, 2003 15:51 To: Struts Users Mailing List Subject: RE: is Component a reserved word? A coworker claims this is a bug in reflection when used to introspect any class called Component - it always thinks it's java.awt.Component. YMMV. -Original Message- From: Chen, Gin [mailto:[EMAIL PROTECTED] Sent: Thursday, February 27, 2003 3:38 PM To: 'Struts Users Mailing List' Subject: RE: is Component a reserved word? Will it is in his classpath indirectly it is not in his jsp unless he did a import of it. So it looks like this is another issue. Unless there is a component besides java.awt.Component that I don't know of. -Tim -Original Message- From: Andy Kriger [mailto:[EMAIL PROTECTED] Sent: Thursday, February 27, 2003 3:33 PM To: Struts Users Mailing List Subject: RE: is Component a reserved word? java.awt.Component is also in your classpath maybe c:out is trying to cast your object as that instead of x.y.z.Component? -Original Message- From: John Thorhauer [mailto:[EMAIL PROTECTED] Sent: Thursday, February 27, 2003 15:18 To: Struts Users Mailing List Subject: is Component a reserved word? Hi, I am not sure if this is a struts, taglib, or jstl issue but I will start here. I am using Struts/JSP's and am running into an error when I try and reference my own object called Component.class with c:out tag. I first load my test objects into the session in the jsp page like this: % x.y.z.Component component = new x.y.z.Component(); x.y.z.Xomponent xomponent = new x.y.z.Xomponent(); session.setAttribute(comp2,component); session.setAttribute(xomp2,xomponent); % Next I try and view the value of the name like this: c:out value=${comp2.name}/ Here is the error I am getting: org.apache.jasper.JasperException: An error occurred while evaluating custom action attribute value with value ${comp2.name}: An error occurred while getting property name from an instance of class x.y.z.Component (java.lang.IllegalArgumentException: object is not an instance of declaring class) I have played around with this a bit and set up a small test environment. Here is my application list: Tomcat 4.1.18 Struts 1.1 rc1 Java 1.3.1_06-b01 I have found that I can use the Runtime JSTL core tag like this and it works fine: crt:out value=%=((Component)session.getAttribute(comp2)).getName()%/ I can also use the jsp:useBean tag like this and it works fine: jsp:getProperty name=comp1 property=name/ I have also found that if I take the exact same class and simply rename it to Xomponent instead of Component and keep it in the same x.y.z package, it works. So I can then do: c:out value=${xomp2.name}/ Any ideas on this? I have my very small test beans and jsp page if someone needs them. Thanks, John -- ** John Thorhauer ** Web Developer ** Phoenix Color Corp. ** [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] database access philosophy
Check out this article http://www.javaworld.com/javaworld/jw-05-2002/jw-0524-sql.html A nice to way to keep the ResultSet in yr db classes and allow your other classes to remain ignorant of db access. -Original Message- From: Kirby Vandivort [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 26, 2003 12:59 To: [EMAIL PROTECTED] Subject: [OT] database access philosophy Hello, I'm in the process of converting an old webapp over to using struts and, in the process, I decide to clean up the database access. Old Way: I had written a connection pool and instantiated an instance of this that was passed to all methods that needed the db, and they they had the sql code embedded in the methods. New Way that I'm working on: I've set up a DataSource for my jdbc connection, and I'm partitioning off all of the database access code into it's own package. If my business logic needs database info, it calls a method from the database access package to get it. My problem: Many methods from the database access return simple data. However, I currently have it written so that some of the more complex ones return a ResultSet, which I'm not really happy with. This exposes the DB layer to the business logic, but I'm not totally sure what the best way to avoid this is. In addition, this doesn't work :( because the underlying connection gets closed when the database access method exists, and the ResultSet is no longer valid. SO, I am wondering what people do when they need to return all of the data in a ResultSet to their business layer. Do you have to go to the hassle of copying everything to some sort of data structure, or is there a better, cleaner, faster way to handle this? (I'm kind of assuming that the ResultSet will be small enough to fit in memory and there won't be issues with pulling it in in pieces; how would that be handled, though?) Thanks, -- Kirby Vandivort Theoretical and Computational Biophysics 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: When i18n isn't Needed
Second that recommendation. If you use a resource file, changes to text strings require a text file mod and a webapp reload. No compilation necessary. That's a big plus. -Original Message- From: David Graham [mailto:[EMAIL PROTECTED]] Sent: Monday, February 03, 2003 10:30 To: [EMAIL PROTECTED] Subject: Re: When i18n isn't Needed One of the original reasons Struts was created was to handle I18N. That's why it's tied into the framework so closely. Even if you don't need to support multiple languages you should still use a resource file to store messages to make changes *much* easier. David From: Dave Ford [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: When i18n isn't Needed Date: Sun, 2 Feb 2003 23:57:17 -0800 It seems to me that for apps that do not need i18n, i18n constructs shouldn't be forced upon the user. Is there a way to return an error message from ActionForm.validate(..) without dealing with a resource file? Dave Ford Smart Soft - The Developer Training Company http://www.smart-soft.com _ The new MSN 8: advanced junk mail protection and 2 months FREE* http://join.msn.com/?page=features/junkmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
using images and modules
I would like to use modules but keep my images directory in the same place for the whole webapp. I have no problem getting images into JSPs used by main module actions. They use relative paths where src=images/ This resolves to webapp/images. In order to use the same relative paths with modules, I have to modify my JSPs to use src=../images since my modules are down one level in the hierarchy. Is there a way to avoid needing to do this by telling the module it's root is the root of the webapp (not the root of the module)? html:base is not the answer since that's page specific I tried using src=/images/... but that ignored the webapp in the URL (so images were being looked for in server/images instead of server/webapp/images). My structure Main module: webapp/*.do Another module: webapp/admin/*.do Pages used by modules: webapp/web/*.jsp Images: webapp/images/*.gif This also applies to CSS and JS files which I have in their own dirs. I saw several questions about this in the archives but no answers. Anyone? thx andy kriger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[validator] ignore whitespace?
Is it possible to have the validator ignore whitespace? Especially in Struts. It'd be nice to not have to pad my regexps with \s* in order to account for this. thx andy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: how do i use a mapped value in bean:write?
I want to followup to my own message since I finally found a solution to this problem (after many postings with no response) and it might be of interest to the community. The BeanUtils lib was out-of-date and had fixed a bug around this. Updating that solved the problem. Just a caveat - watch those dependent libraries, the problem may be there and not in Struts or your code. -a -Original Message- From: Andy Kriger [mailto:[EMAIL PROTECTED]] Sent: Friday, January 24, 2003 10:26 To: Struts Users Mailing List Subject: how do i use a mapped value in bean:write? I am trying to use mapped values in bean:write but not having any success. * I have a bean named theBean in the session and it defines a method public Item getItem() { ... } * Item defines a method that returns a Map public java.util.Map get Properties() { ... } * The map contains key value pairs e.g. prop1 So, I want to get the value prop1 using bean:write bean:write name=theBean property=item.properties(prop1) scope=session/ I get a Servlet Exception when I try to load the page java.lang.IllegalArgumentException: object is not an instance of declaring class at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39 ) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl .java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.commons.beanutils.PropertyUtils.getMappedProperty(PropertyUtils.j ava:626) at org.apache.commons.beanutils.PropertyUtils.getMappedProperty(PropertyUtils.j ava:555) at org.apache.commons.beanutils.PropertyUtils.getNestedProperty(PropertyUtils.j ava:747) at org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:78 0) at org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:728) at org.apache.struts.taglib.bean.WriteTag.doStartTag(WriteTag.java:290) I've been trying different permutations of single/double quotes around the property name without success. Can anyone point me in the right direction? thx a -- 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]
RE: Struts productivity metrics?
I'll take a stab @ yr questions: 1) What's the typical ramp-up time for an average developer? How long until they become fully productive vs. 'just capable'? What's the most effective way to bring someone up-to-speed? I started with Struts as a skilled Java dev with JSP/servlet experience and no Struts experience. It took me less than a week to get up to speed (a couple days to get the jist a few more days to get things really working, since then I've just been improving my understanding of how things work under-the-hood and how to maximize the benefits from Struts). When I started there weren't any books out yet. Now that there are, throw the O'Reilly bk at them (or yr fav) and have them read the chapters about the architectural design. Then they can use existing projects or book examples to see how it's done. 2) What's the suggested team size / structure and experience mix? Our team is 3 devs, 2 doing work on a single (but separate) Struts projects, the 3rd co-ordinating and adding to both. 3) On a per page or use case basis, how long does it take for an easy/medium/complex module to be developed? How does that compare with other frameworks/approaches you've used in the past? A little less time since the foundation is laid for you. The real benefit comes when you have to add functionality to the app - it becomes much easier since you just add another action or modify the flow in action x. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
how do i use a mapped value in bean:write?
I am trying to use mapped values in bean:write but not having any success. * I have a bean named theBean in the session and it defines a method public Item getItem() { ... } * Item defines a method that returns a Map public java.util.Map get Properties() { ... } * The map contains key value pairs e.g. prop1 So, I want to get the value prop1 using bean:write bean:write name=theBean property=item.properties(prop1) scope=session/ I get a Servlet Exception when I try to load the page java.lang.IllegalArgumentException: object is not an instance of declaring class at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39 ) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl .java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.commons.beanutils.PropertyUtils.getMappedProperty(PropertyUtils.j ava:626) at org.apache.commons.beanutils.PropertyUtils.getMappedProperty(PropertyUtils.j ava:555) at org.apache.commons.beanutils.PropertyUtils.getNestedProperty(PropertyUtils.j ava:747) at org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:78 0) at org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:728) at org.apache.struts.taglib.bean.WriteTag.doStartTag(WriteTag.java:290) I've been trying different permutations of single/double quotes around the property name without success. Can anyone point me in the right direction? thx a -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: SSL
Are you using the sslext package? -Original Message- From: McRobb, John [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 22, 2003 8:16 To: '[EMAIL PROTECTED]' Subject: SSL We are using struts 1.1 and tiles. How do we specify if a tiled page should be served using ssl or not? i.e like we do for a jsp in the web.xml Thanks John John McRobb Tesco Personal Finance 52 West Register Street, Edinburgh, EH2 2AA *: mailto:[EMAIL PROTECTED] *: 0131 523 9382 (Internal: x29382) Tesco Personal Finance Limited is a joint venture between The Royal Bank of Scotland plc and Tesco PLC. Tesco Personal Finance Limited is registered in Scotland No 173199. Registered Office: 42 St Andrew Square, Edinburgh EH2 2YE. This e-mail message is confidential and for use by the addressee only. If you are not the addressee, please return the message to the sender by replying to it and then delete the message from your computer. Internet e-mails are not necessarily secure. Tesco Personal Finance Limited does not accept responsibility for changes made to this message after it was sent. -- 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]
problem with messagesPresent?
I'm using logic:messagesPresent to test for messages when displaying errors (standard stuff described in the docs). logic:messagesPresent p class=errorThere are form errors/p ul html:messages id=msg li class=errorbean:write name=msg//li /html:messages /ul /logic:messagesPresent However, I am seeing 'There are form errors' on my page even when there are no ActionMessages or ActionErrors (like when the page is first loaded). I test for that on my JSP using some scriplet code that is outputting 'no messages'/'no errors': Object msgobj = request.getAttribute(org.apache.struts.Globals.MESSAGE_KEY); if(msgobj == null) { response.getWriter().println(no messagesbr); } Object errobj = request.getAttribute(org.apache.struts.Globals.ERROR_KEY); if(errobj == null) { response.getWriter().println(no errorsbr); } Any ideas what's going on here? thx andy -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: problem with messagesPresent?
Ignore this message. I found the problem and I'm ashamed (missing logic taglib declaration). -a -Original Message- From: Andy Kriger [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 16, 2003 10:44 To: Struts Users Mailing List Subject: problem with messagesPresent? I'm using logic:messagesPresent to test for messages when displaying errors (standard stuff described in the docs). logic:messagesPresent p class=errorThere are form errors/p ul html:messages id=msg li class=errorbean:write name=msg//li /html:messages /ul /logic:messagesPresent However, I am seeing 'There are form errors' on my page even when there are no ActionMessages or ActionErrors (like when the page is first loaded). I test for that on my JSP using some scriplet code that is outputting 'no messages'/'no errors': Object msgobj = request.getAttribute(org.apache.struts.Globals.MESSAGE_KEY); if(msgobj == null) { response.getWriter().println(no messagesbr); } Object errobj = request.getAttribute(org.apache.struts.Globals.ERROR_KEY); if(errobj == null) { response.getWriter().println(no errorsbr); } Any ideas what's going on here? thx andy -- 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]
RE: Active users in a struts web application.
You could also use HttpSessionAttributeListener for a 3rd party to note when objects are put into/removed from session -Original Message- From: David Graham [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 15, 2003 12:19 To: [EMAIL PROTECTED] Subject: Re: Active users in a struts web application. HttpSessionListener might not work because (AFAIK) it gets notified when a session is created but before you get a chance to put anything in the session (like a User object identifing the person). This would work if you just wanted a count of online users but not their info. David From: V. Cekvenich [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: Active users in a struts web application. Date: Wed, 15 Jan 2003 12:12:20 -0500 Try a session listener, store it in a db table. .V VEDRE, RANAPRATAP REDDY wrote: Not a struts specific question, but i know where the experts are... I am tring to show the users currently logged into a web application, so that anybody who logs in can see who else is logged in. This functionality is similar to a standard chat program. i am using ServletContextListener and HttpSessionAttributeListener classes in the server API. Struts 1.1b2, so i can use Plugins if needed. Any help/ideas about tracking users currently logged into a web application are most welcome. Thanks, Rana. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ 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] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: [OT] Re: responding to session timeouts
Follow up question... I setup an object that implements HttpSessionListener and prints out a message when sessionDestroyed is called. However, if I also have an object that implements HttpSessionBindingListener and prints out a message when valueUnbound is called, I only get a message during valueUnbound. I never see the sessionDestroyed message called. Any idea why? thx andy -Original Message- From: David Graham [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 08, 2003 17:54 To: [EMAIL PROTECTED] Subject: [OT] Re: responding to session timeouts Look at HttpSessionListener here: http://java.sun.com/j2ee/sdk_1.3/techdocs/api/ Prefix off topic posts with [OT] in the future. Dave From: Andy Kriger [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: responding to session timeouts Date: Wed, 8 Jan 2003 18:00:22 -0500 This isn't a Struts-specific question, but i'm figuring someone here might know the answer... Is there a way to know when a session times-out and respond to that? (like an event being fired or and having a servlet acting as a listener) There's some cleanup that I need to do in the case that a user does not complete their transaction (e.g. they shut their browser down leaving the system state incomplete). In this case, I'd like to have a background object (servlet, thread, whatever) do some cleaning up when the session times-out. Any ideas? thx andy -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ 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] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
ActionErrors question
I have 2 message-resources defined in my webapp (one has a key defined the other does not). In one action, I am getting messages from the non-default message-resource (the one with a key defined). In that action I also create an errors object and add errors to it... getResource(request, key) ActionErrors errors = new ActionErrors(); errors.add(ActionErrors.GLOBAL_ERROR, new ActionError(key, val1, val2); saveErrors(request, errors); mapping.findForward(...); In the JSP I display the errors... html:errors / However, this displays nothing _unless_ I do html:errors bundle=key/ Why are the errors added in the 'key' bundle instead of the default bundle? This is with Struts 1.1b2. thx andy -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: ActionErrors question
So the bundle that holds the errors depends on the bundle that the keys come from? Is there any way to separate this so that all errors always go to one bundle regardless of where the message keys are stored? (that design seems out-of-line with the rest of Struts which usually has good -Original Message- From: Alvarado, Juan (c) [mailto:[EMAIL PROTECTED]] Sent: Friday, January 10, 2003 15:32 To: 'Struts Users Mailing List' Subject: RE: ActionErrors question It sounds to me like the keys that you are using in your action errors are in the non-default message resource file in your application; the one with the key defined. If you don't want to use the bundle attribute in your call to html:errors... I suggest you move those keys to the default message resource file in your app. -Original Message- From: Andy Kriger [mailto:[EMAIL PROTECTED]] Sent: Friday, January 10, 2003 3:34 PM To: Struts Users Mailing List Subject: ActionErrors question I have 2 message-resources defined in my webapp (one has a key defined the other does not). In one action, I am getting messages from the non-default message-resource (the one with a key defined). In that action I also create an errors object and add errors to it... getResource(request, key) ActionErrors errors = new ActionErrors(); errors.add(ActionErrors.GLOBAL_ERROR, new ActionError(key, val1, val2); saveErrors(request, errors); mapping.findForward(...); In the JSP I display the errors... html:errors / However, this displays nothing _unless_ I do html:errors bundle=key/ Why are the errors added in the 'key' bundle instead of the default bundle? This is with Struts 1.1b2. thx andy -- 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] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: ActionErrors question
(oops - sloppy fingers on a friday afternoon - ignore that last message) So the bundle that holds the errors depends on the bundle that the keys come from? Is there any way to separate this so that all errors always go to one bundle regardless of where the message keys are stored? (that design seems out-of-line with the rest of Struts which usually has good separation of functionality) thx -Original Message- From: Alvarado, Juan (c) [mailto:[EMAIL PROTECTED]] Sent: Friday, January 10, 2003 15:32 To: 'Struts Users Mailing List' Subject: RE: ActionErrors question It sounds to me like the keys that you are using in your action errors are in the non-default message resource file in your application; the one with the key defined. If you don't want to use the bundle attribute in your call to html:errors... I suggest you move those keys to the default message resource file in your app. -Original Message- From: Andy Kriger [mailto:[EMAIL PROTECTED]] Sent: Friday, January 10, 2003 3:34 PM To: Struts Users Mailing List Subject: ActionErrors question I have 2 message-resources defined in my webapp (one has a key defined the other does not). In one action, I am getting messages from the non-default message-resource (the one with a key defined). In that action I also create an errors object and add errors to it... getResource(request, key) ActionErrors errors = new ActionErrors(); errors.add(ActionErrors.GLOBAL_ERROR, new ActionError(key, val1, val2); saveErrors(request, errors); mapping.findForward(...); In the JSP I display the errors... html:errors / However, this displays nothing _unless_ I do html:errors bundle=key/ Why are the errors added in the 'key' bundle instead of the default bundle? This is with Struts 1.1b2. thx andy -- 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] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
responding to session timeouts
This isn't a Struts-specific question, but i'm figuring someone here might know the answer... Is there a way to know when a session times-out and respond to that? (like an event being fired or and having a servlet acting as a listener) There's some cleanup that I need to do in the case that a user does not complete their transaction (e.g. they shut their browser down leaving the system state incomplete). In this case, I'd like to have a background object (servlet, thread, whatever) do some cleaning up when the session times-out. Any ideas? thx andy -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: JDBC development
The Jakarta project's Torque is another good option. It can generate an XML representation of your db and then from that generated Java objects that represent your dB. If you have FKs setup, it'll even handle object associations (for example, one object containing another object). -Original Message- From: Louis Proyect [mailto:[EMAIL PROTECTED]] Sent: Monday, December 16, 2002 13:02 To: Struts Users Mailing List Subject: Re: JDBC development If you are using sybase, you can read the sysobjects and syscolumns tables and generate bean codes automatically. I imagine that Oracle works similarly. At 07:50 PM 12/16/2002 +0200, you wrote: I wonder what type of utilities you're using to simplify your development with JDBC. I'm in a project that has more than 30 tables in the DB with field counts up to 20. I fed up writing setXXX statements surrounded with try/catch/finally blocks. I'm not very experienced with JDBC bounded Java projects but.. there *must* be some other ways to simplfy/shorten my development time. Are there any nodes on the net about designing such applications in a better way or some open source utility packages dealing with these issues? /tb. -- 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]
RE: JDBC development
They're separated from Turbine - you just dload Torque. And they just release v3 so they must be a little active :) I was able to get it set up and working pretty quickly. My hardest thing was getting FKs setup in psql so I could mirror object relationships. There's properties tweaking you need to do to make things work right, but it's pretty easy. -Original Message- From: Eddie Bush [mailto:[EMAIL PROTECTED]] Sent: Monday, December 16, 2002 14:24 To: Struts Users Mailing List Subject: Re: JDBC development Has torque ever had it's umbilical cord properly severed from Turbine? The last time I tried it (it's been quite some time) it wasn't exactly easy to use. I also seem to recall hearing there wasn't a great deal of activity on the project - all heresey, so I can't say for certain. Any idea how valid that is? OJB is under very active development. Andy Kriger wrote: The Jakarta project's Torque is another good option. It can generate an XML representation of your db and then from that generated Java objects that represent your dB. If you have FKs setup, it'll even handle object associations (for example, one object containing another object). -- Eddie Bush -- 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]
a question about transaction tokens
I'm wondering how these are used. They're not mentioned in the O'Reilly book or in the docs. After calling generateToken, do I need to wrap my action's execute code in an isTokenValid block to check for an existing token? For example... execute(...) { generateToken(request); if(!isTokenValid(request)) { // do action stuff } else return ???what??? } thx andy -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: a question about transaction tokens
i'd love to do that however whenever i text search i get an error 'Text search not available for this list'. i reported this on the mailing list a few days ago but got no response. so, can someone answer my question here? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, December 13, 2002 10:05 To: [EMAIL PROTECTED] Subject: RE: a question about transaction tokens search the mailing list archive for Token mechanism in Struts: U will find teh answers...a few very good mails... -Original Message- From: akriger [mailto:[EMAIL PROTECTED]] Sent: Friday, December 13, 2002 4:09 PM To: struts-user Cc: akriger Subject: a question about transaction tokens I'm wondering how these are used. They're not mentioned in the O'Reilly book or in the docs. After calling generateToken, do I need to wrap my action's execute code in an isTokenValid block to check for an existing token? For example... execute(...) { generateToken(request); if(!isTokenValid(request)) { // do action stuff } else return ???what??? } thx andy -- 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] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
how do i set the HTML name attribute of an input element?
I would like to set the HTML name attribute of an input element (e.g. image). The name attribute in Struts html-tag land refers to the form bean backing the HTML form. Is there a different attribute that handles the HTML name attribute? thx andy -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: a question about transaction tokens
When you say 'In action B' call isTokenValid, do mean wrap action B's code with an if block. And if you do that, what do you do for else (since you have to return some kind of ActionForward from the execute method. In this case, I just want to ignore subsequent clicks to submit the form. -a -Original Message- From: Brian DeLuca [mailto:[EMAIL PROTECTED]] Sent: Friday, December 13, 2002 10:33 To: [EMAIL PROTECTED] Subject: RE: a question about transaction tokens To implement is pretty straight forward Action A -- generate token route to JSP A JSP A routes to Action B -- In action B call isTokenValid if you want to continue Token validation call saveToken then route to JSP C. JSP C then routes to Action C -- call isTokenValid then call saveToken route to JSP D If you want to stop validation at anytime call resetToken. HTH b- --- On Fri 12/13, Andy Kriger wrote:From: Andy Kriger [mailto: [EMAIL PROTECTED]]To: [EMAIL PROTECTED]: Fri, 13 Dec 2002 10:09:27 -0500Subject: a question about transaction tokensI'm wondering how these are used. They're not mentioned in the O'Reilly bookor in the docs. After calling generateToken, do I need to wrap my action'sexecute code in an isTokenValid block to check for an existing token?For example...execute(...) { generateToken(request); if(!isTokenValid(request)) { // do action stuff } else return ???what???}thxandy--To unsubscribe, e-mail: For additional commands, e-mail: ___ Can a Web portal forever change your life? Win up to $25 Million on iWon - click here! -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Best way to handle this in Struts/MVC ?
I put data storage beans that need to be displayed into the request or session and use bean:write and logic:iterate on the JSP. I don't see the sense in creating extra objects targeted to display; just keeping the get/set methods generic (return a Date, not a formatted Date String) should be enough. For date formatting, I use the datetime custom tags for dates (http://jakarta.apache.org/taglibs/doc/datetime-doc/intro.html) - a caveat the format tag uses long values so if your obj has a method Date getDate() the property in the tag should be date.time (which will call the Date obj's getTime() method that returns a long). For number formatting, I use my own custom tag (that wraps java.text.DecimalFormat). -Original Message- From: Rick Reumann [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 12, 2002 13:17 To: Struts List Cc: model struts Subject: Best way to handle this in Struts/MVC ? For all of my forms I have an appropriate DynaValidatorForm bean defined in my struts-config file. This form eventually populates a bean (Data Transfer Object) that corresponds to the form bean but with the correct data types (ie java.util.Date birthDate vs String birthDate ). The question I have is when generating a List to display the beans is it really that bad to use the actual Data Transfer objects beans in the display (vs a List of the DynaFormBeans)? The reason I ask is it seems like a lot of overhead to convert a Collection of data transfer objects into a whole new collection of DynaFormBeans, especially if the List is quite large. The problem though is if you use the DTOs you have to code in those beans proper formats for displaying such things as Dates. How do others handle this situation? Thanks, -- Rick mailto:[EMAIL PROTECTED] -- 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]
sslext problem
I'm using SSLExt to rewrite HTTP/HTTPS links. Sometimes the link from HTTPS to HTTP is being rewritten http://serverhref;sessionID as opposed to http://server/webapp/href;sessionID (not the missing webapp and slash). Not sure what's going on. The links work fine on HTTP-HTTP pages. The actions in question have set-property property=secure value=false/ in struts-config.xml. Since I'm new to sslext, I figure I'm misunderstanding something here. Any ideas? thx andy -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Why no text search on the mailing list archives?
Why doesn't text searching work any more for the mailing list archives at http://nagoya.apache.org/eyebrowse/SearchList?[EMAIL PROTECTED] pache.org You get a message 'Text search not available for this list' -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
any way to turn a checkbox on based on a request value?
I want to have a checkbox checked when a given request attribute is true. The attribute value is not a bean, it is a Boolean object (which makes sense for an on/off control). Is there any way to do this? thx andy -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: any way to turn a checkbox on based on a request value?
Since this is a Struts ML, I mean with Struts tags. The form itself is a DynaActionForm and whether the checkbox is turned on or not depends on the Action that preceeds the form display. Looking at the src, it appears that html:checkbox only work with beans (a shortcoming of the tag, imho). To get this work, I had to add a boolean field to a model bean. -Original Message- From: Wendy Smoak [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 17:23 To: 'Struts Users Mailing List' Subject: RE: any way to turn a checkbox on based on a request value? I want to have a checkbox checked when a given request attribute is true. The attribute value is not a bean, it is a Boolean object (which makes sense for an on/off control). Is there any way to do this? So the boolean value is not a property of an ActionForm? It's just a Boolean object sitting in the session and it has nothing to do with Struts? When you ask, 'is there any way to do this?' do you mean with struts tags? It's certainly possible without them. -- Wendy Smoak Applications Systems Analyst, Sr. Arizona State University PA Information Resources Management -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
1.1b3?
I noticed that the nightly docs are labelled 1.1-b3-dev (maybe this is nothing new and I'm just unobservant). Is there a b3 milestone build coming soon? Is there a changes file that docs functional changes btw milestones? (as opposed to the diffs btw nightly builds) thx andy -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
logic:iterate question
I have a JSP. I have some scriplet code that defines an object and then I want to iterate over that object, but I keep getting an error that the object is not defined in the page scope. Looking at the docs I don't understand what I'm doing wrong. --- % pageContext.setAttribute(myObj, myObj, PageContext.PAGE_SCOPE); % logic:iterate id=ele name=myObj property=records scope=page !-- do stuff -- /logic:iterate --- myObj has a getRecords() method that returns the array i want to iterate over When i load the page i get 'Cannot find bean myObj in scope page' Any ideas? thx andy -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: logic:iterate question
Yes - I store some data in it and then want to use that data later in the page. -Original Message- From: Sri Sankaran [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 03, 2002 15:32 To: Struts Users Mailing List Subject: RE: logic:iterate question Dumb question: Is the object reference 'myObj' pointing at anything before set it to the name 'myObj'? That sounds confusing -- too many myObjs floating around. Suppose you had pageContext.setAttribute(myObj, foo, PageContext.PAGE_SCOPE); My question is whether 'foo' is set before this call. Sri -Original Message- From: Andy Kriger [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 03, 2002 3:24 PM To: Struts Users Mailing List Subject: logic:iterate question I have a JSP. I have some scriplet code that defines an object and then I want to iterate over that object, but I keep getting an error that the object is not defined in the page scope. Looking at the docs I don't understand what I'm doing wrong. --- % pageContext.setAttribute(myObj, myObj, PageContext.PAGE_SCOPE); % logic:iterate id=ele name=myObj property=records scope=page !-- do stuff -- /logic:iterate --- myObj has a getRecords() method that returns the array i want to iterate over When i load the page i get 'Cannot find bean myObj in scope page' Any ideas? thx andy -- 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] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
validator question
I have an app with multiple forms. Some fields appear on multiple forms (e.g. email). Instead of copy-pasting the field validataion definition, is there a way to define a field element once and refer to it multiple time in the validation.xml file? thx andy -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: [ANNOUNCE] O'Reilly Struts Book Now Available
According to a response from O'Reilly customer service 'in the next few days' -Original Message- From: Wendy Smoak [mailto:[EMAIL PROTECTED]] Sent: Sunday, November 24, 2002 22:20 To: 'Struts Users Mailing List' Subject: RE: [ANNOUNCE] O'Reilly Struts Book Now Available Chuck wrote: I just wanted to let everyone know that my Struts book published by O'Reilly is now available and shipping. You can get it from Amazon, Bookpool, etc. Any idea if/when they will put it on Safari (http://safari.oreilly.com)? Technical books go out of date so fast that I like to make sure it's truly classic before adding it to the collection. Besides, work pays for the Safari subscription. ;) -- Wendy Smoak Application Systems Analyst, Sr. ASU IA Information Resources Management -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: RE: [ANNOUNCE] O'Reilly Struts Book Now Available
right on - just added it to my books i hope you get a decent cut of Safari subscriptions :) -Original Message- From: Chuck Cavaness [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 26, 2002 10:59 To: Struts Users Mailing List Subject: Re: RE: [ANNOUNCE] O'Reilly Struts Book Now Available The book is now available on Safari. I worked with them to get it up yesterday. Here's a link to Safari - http://safari.oreilly.com Chuck From: Andy Kriger [EMAIL PROTECTED] Date: 2002/11/26 Tue AM 10:48:34 EST To: Struts Users Mailing List [EMAIL PROTECTED] Subject: RE: [ANNOUNCE] O'Reilly Struts Book Now Available According to a response from O'Reilly customer service 'in the next few days' -Original Message- From: Wendy Smoak [mailto:[EMAIL PROTECTED]] Sent: Sunday, November 24, 2002 22:20 To: 'Struts Users Mailing List' Subject: RE: [ANNOUNCE] O'Reilly Struts Book Now Available Chuck wrote: I just wanted to let everyone know that my Struts book published by O'Reilly is now available and shipping. You can get it from Amazon, Bookpool, etc. Any idea if/when they will put it on Safari (http://safari.oreilly.com)? Technical books go out of date so fast that I like to make sure it's truly classic before adding it to the collection. Besides, work pays for the Safari subscription. ;) -- Wendy Smoak Application Systems Analyst, Sr. ASU IA Information Resources Management -- 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] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Can anybody tell how to setup struts in Netbeans IDE
Out of curiosity, how well does Eclipse run on old hardware. I have a Pentium laptop w/96M RAM - NB is my usual IDE but that's right out, even JEdit is a bit painful to work it. thx -Original Message- From: James Mitchell [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 21, 2002 13:31 To: [EMAIL PROTECTED] Cc: Struts Users Mailing List Subject: RE: Can anybody tell how to setup struts in Netbeans IDE For working on the distribution itself: 1. Create a new project (from the Project Manager window) 2. Download the struts source distribution (or use built-in cvs to get the module) 3. Extract to a local drive (if on windoze, try not to have spaces in the directory (such as C:\My Documents) 4. Mount the directory you unzipped to 5. Copy build.properties.sample to build.properties and customize to point to where you keep those jars 6. Mount each of the source directories that you wish to work in For me, I use: jakarta-struts/src/share jakarta-struts/src/example 7. Mount each jar referenced in the build.properties file * Note - NetBeans has built in support for auto-mounting these if your build.xml specifies the jars in the project.classpath, but that's not the case for the default struts distribution. For doing your own thing: 1. Create a new project (from the Project Manager window) 2. Download (or build for yourself) the required jars *See the jakarta-struts-1.1-b2/webapps/struts-example.war 3. Create a directory (I use a structure similar to how the webapp will exist) +-/my-project | +-/WEB-INF | +-/classes | +-/lib | +-/src 4. Create a build.xml for your project (so ant can build and war it for you). I recommend you use an existing file to get a jump start on development. Actually, I recommend you re-use someone's entire existing project. That will surely get you ahead of the game. 5. Mount that directory * If you specified the build classpath and the jars are there, NetBeans will mount the jars for you automatically. 6. Mount each of the source directories that you wish to work in /myproject/WEB-INF/src 7. Always work in the node in #6 when modifying your java files. I'll also take this opportunity to tell you that I recommend using Eclipse. I was a NetBeans advocate for the longest time, but a few weeks ago several discussion had prompted me to try out Eclipse, and I can say without a doubt, that it is much more mature an IDE than NetBeans. And since they are both Open Source.heywhy not? One definite advantage Eclipse has over NetBeans is that Eclipse is built using SWT (Standard Widget Toolkit). That means that the IDE is written in Java, but the underlying framework uses native JNDI calls the OS API.or, in other words..its fast as Hell on windows. Anyone who has left NetBeans running in the background overnight on a laptop knows the pain of doing an Alt+Tab back to the IDE and seeing how Swing pulls its rather large A## up from the swap fileheh heh :) Hope that will help you get started. I was planning to post a how-to for doing this and a few other tasks with NetBeans, Eclipse, and JBuilder. I even have quite a few screenshots taken, but I just haven't finished it. Good Luck with it!!! -- James Mitchell Software Engineer/Struts Evangelist http://www.open-tools.org If you were plowing a field, which would you rather use? Two strong oxen or 1024 chickens? - Seymour Cray (1925-1996), father of supercomputing -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of [EMAIL PROTECTED] Sent: Thursday, November 21, 2002 12:01 PM To: [EMAIL PROTECTED] Subject: [MVC-Programmers] RE: MVC-Programmers digest, Vol 1 #94 - 7 msgs Hi, I am new to struts framework. Can anybody tell how to setup struts in Netbean IDE.. Thanks Kaja. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 20, 2002 3:00 PM To: [EMAIL PROTECTED] Subject: MVC-Programmers digest, Vol 1 #94 - 7 msgs Send MVC-Programmers mailing list submissions to [EMAIL PROTECTED] To subscribe or unsubscribe via the World Wide Web, visit http://www.netbean.net/mailman/listinfo/mvc-programmers or, via email, send a message with subject or body 'help' to [EMAIL PROTECTED] You can reach the person managing the list at [EMAIL PROTECTED] When replying, please edit your Subject line so it is more specific than Re: Contents of MVC-Programmers digest... Today's Topics: 1. How to access the Struts Connection Pool from an ActionForm (Steven Citron-Pousty) 2. Re: How to access the Struts Connection Pool from an ActionForm (V. Cekvenich) 3. Re: How to access the Struts Connection Pool from an ActionForm (V. Cekvenich) 4. [Fwd: ANNOUNCE: FormsPlayer beta for IE 6 is now based on Candidate Recommendation] (V.
RE: Can anybody tell how to setup struts in Netbeans IDE
How about Eclipse on old hdwr? I already know how much NB struggles :) (though in its defense, it's really Swing that struggles, NB does more working w/in Swings performance constraints than any app I've seen) -Original Message- From: James Mitchell [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 21, 2002 13:46 To: Struts Users Mailing List Subject: RE: Can anybody tell how to setup struts in Netbeans IDE Well, I would know. When I bought this laptop months ago, I gave my old one away. It was a PII 233 w/64MB. I ran NetBeans on it one time..and never tried it againLOL. That was about the most painful thing I've watched in quite a while. I thought I was smelling smoke for a few minutes. So my new laptop is a 1 gig with 128 (which I upgraded about 2 weeks ago to 512), so Eclipse is now SCREEMING -- James Mitchell Software Engineer/Struts Evangelist http://www.open-tools.org If you were plowing a field, which would you rather use? Two strong oxen or 1024 chickens? - Seymour Cray (1925-1996), father of supercomputing -Original Message- From: Andy Kriger [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 21, 2002 1:42 PM To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: RE: Can anybody tell how to setup struts in Netbeans IDE Out of curiosity, how well does Eclipse run on old hardware. I have a Pentium laptop w/96M RAM - NB is my usual IDE but that's right out, even JEdit is a bit painful to work it. thx -Original Message- From: James Mitchell [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 21, 2002 13:31 To: [EMAIL PROTECTED] Cc: Struts Users Mailing List Subject: RE: Can anybody tell how to setup struts in Netbeans IDE For working on the distribution itself: 1. Create a new project (from the Project Manager window) 2. Download the struts source distribution (or use built-in cvs to get the module) 3. Extract to a local drive (if on windoze, try not to have spaces in the directory (such as C:\My Documents) 4. Mount the directory you unzipped to 5. Copy build.properties.sample to build.properties and customize to point to where you keep those jars 6. Mount each of the source directories that you wish to work in For me, I use: jakarta-struts/src/share jakarta-struts/src/example 7. Mount each jar referenced in the build.properties file * Note - NetBeans has built in support for auto-mounting these if your build.xml specifies the jars in the project.classpath, but that's not the case for the default struts distribution. For doing your own thing: 1. Create a new project (from the Project Manager window) 2. Download (or build for yourself) the required jars *See the jakarta-struts-1.1-b2/webapps/struts-example.war 3. Create a directory (I use a structure similar to how the webapp will exist) +-/my-project | +-/WEB-INF | +-/classes | +-/lib | +-/src 4. Create a build.xml for your project (so ant can build and war it for you). I recommend you use an existing file to get a jump start on development. Actually, I recommend you re-use someone's entire existing project. That will surely get you ahead of the game. 5. Mount that directory * If you specified the build classpath and the jars are there, NetBeans will mount the jars for you automatically. 6. Mount each of the source directories that you wish to work in /myproject/WEB-INF/src 7. Always work in the node in #6 when modifying your java files. I'll also take this opportunity to tell you that I recommend using Eclipse. I was a NetBeans advocate for the longest time, but a few weeks ago several discussion had prompted me to try out Eclipse, and I can say without a doubt, that it is much more mature an IDE than NetBeans. And since they are both Open Source.heywhy not? One definite advantage Eclipse has over NetBeans is that Eclipse is built using SWT (Standard Widget Toolkit). That means that the IDE is written in Java, but the underlying framework uses native JNDI calls the OS API.or, in other words..its fast as Hell on windows. Anyone who has left NetBeans running in the background overnight on a laptop knows the pain of doing an Alt+Tab back to the IDE and seeing how Swing pulls its rather large A## up from the swap fileheh heh :) Hope that will help you get started. I was planning to post a how-to for doing this and a few other tasks with NetBeans, Eclipse, and JBuilder. I even have quite a few screenshots taken, but I just haven't finished it. Good Luck with it!!! -- James Mitchell Software Engineer/Struts Evangelist http://www.open-tools.org If you were plowing a field, which would you rather use? Two strong oxen or 1024 chickens? - Seymour Cray (1925-1996), father of supercomputing -Original Message- From
how do i set a checkbox as checked w/o referring to a bean?
I want to have a checkbox use the HTML checked attribute. I want to do this without referring to a bean or a property or a value, separate from the Struts architecture (except that I still want to have Struts fill in my form values). Is it possible? I have tried many things. In the form object, I set the field's default value to true, but this meant that the field was always checked - if the form was submitted with the box unchecked and there was an error, the box would be checked again when the user returned to the form. I cannot figure out how to have a box selected the 1st time the page loads and then use the user's setting after that (without getting tangled up in the form object). Any help? thx andy -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
iterate tag - can you set an increment?
Is there any way to set an iteration increment on the iterate tag? For example, iterate through the array returning every 2nd item. If not, can anyone tell me how I might do this without resorting to scriplets (or only using them minimally)? Here's the code I'm trying to use. The first TD is the long_desc field of array[idx] in myBean. How can I increment idx so I can get the next item? (maybe I'm being slow since I haven't had my coffee yet) logic:iterate id=idx name=myBean property=array scope=session tr tdbean:write name=idx property=long_desc//td tdbean:write name=??? property=long_desc//td /tr /logic:iterate thx andy -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: iterate tag - can you set an increment?
Then idx won't increment correctly, no? idx=0, idrow=0,1 idx=1, idrow=1,2 (repetition of elemtent 1) ...etc... -Original Message- From: Quentin.Cope [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 19, 2002 11:54 To: Struts Users Mailing List Subject: RE: iterate tag - can you set an increment? Andy How about logic:iterate id=idx name=myBean property=array scope=session indexId=index tr logic:iterate id=idrow name=myBean property=array scope=session offset=index length=2 tdbean:write name=idrow property=long_desc//td /logic:iterate /tr /logic:iterate Quentin -Original Message- From: Andy Kriger [mailto:[EMAIL PROTECTED]] Sent: 19 November 2002 16:44 To: Struts Users Mailing List Subject: iterate tag - can you set an increment? Is there any way to set an iteration increment on the iterate tag? For example, iterate through the array returning every 2nd item. If not, can anyone tell me how I might do this without resorting to scriplets (or only using them minimally)? Here's the code I'm trying to use. The first TD is the long_desc field of array[idx] in myBean. How can I increment idx so I can get the next item? (maybe I'm being slow since I haven't had my coffee yet) logic:iterate id=idx name=myBean property=array scope=session tr tdbean:write name=idx property=long_desc//td tdbean:write name=??? property=long_desc//td /tr /logic:iterate thx andy -- 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] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: iterate tag - can you set an increment?
Is it possible to access the idx variable in a scriplet during iteration? -Original Message- From: Quentin.Cope [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 19, 2002 11:54 To: Struts Users Mailing List Subject: RE: iterate tag - can you set an increment? Andy How about logic:iterate id=idx name=myBean property=array scope=session indexId=index tr logic:iterate id=idrow name=myBean property=array scope=session offset=index length=2 tdbean:write name=idrow property=long_desc//td /logic:iterate /tr /logic:iterate Quentin -Original Message- From: Andy Kriger [mailto:[EMAIL PROTECTED]] Sent: 19 November 2002 16:44 To: Struts Users Mailing List Subject: iterate tag - can you set an increment? Is there any way to set an iteration increment on the iterate tag? For example, iterate through the array returning every 2nd item. If not, can anyone tell me how I might do this without resorting to scriplets (or only using them minimally)? Here's the code I'm trying to use. The first TD is the long_desc field of array[idx] in myBean. How can I increment idx so I can get the next item? (maybe I'm being slow since I haven't had my coffee yet) logic:iterate id=idx name=myBean property=array scope=session tr tdbean:write name=idx property=long_desc//td tdbean:write name=??? property=long_desc//td /tr /logic:iterate thx andy -- 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] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: iterate tag - can you set an increment?
And last but not least, is it possible to do test in logic:equal that involve equations? For example, is index%2==0? (or do I need JSTL for this)? -Original Message- From: Karr, David [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 19, 2002 12:34 To: Struts Users Mailing List Subject: RE: iterate tag - can you set an increment? Certainly. It's available as a scripting variable within the loop (and as a page-scoped attribute). -Original Message- From: Andy Kriger [mailto:[EMAIL PROTECTED]] Is it possible to access the idx variable in a scriplet during iteration? -Original Message- From: Andy Kriger [mailto:[EMAIL PROTECTED]] Is there any way to set an iteration increment on the iterate tag? For example, iterate through the array returning every 2nd item. If not, can anyone tell me how I might do this without resorting to scriplets (or only using them minimally)? Here's the code I'm trying to use. The first TD is the long_desc field of array[idx] in myBean. How can I increment idx so I can get the next item? (maybe I'm being slow since I haven't had my coffee yet) logic:iterate id=idx name=myBean property=array scope=session tr tdbean:write name=idx property=long_desc//td tdbean:write name=??? property=long_desc//td /tr /logic:iterate -- 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]
RE: iterate tag - can you set an increment?
Is logic-el in 1.1b2? Or do I need a more recent build? (and if I do, what is the most stable recent build :) - I'm mid-project and don't want to deal with finicky dev builds right now) -Original Message- From: Karr, David [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 19, 2002 13:11 To: Struts Users Mailing List Subject: RE: iterate tag - can you set an increment? You can either use the JSTL for this, or Struts-EL, using the logic-el:match tag, which is the ONLY tag (ok, along with logic-el:notMatch) which I added additional attributes to in the Struts-EL port. I added an expr attribute to those tags, to make it convenient to specify an arbitrary EL expression. Using this, you could do something like: logic-el:match expr=${idx mod 2} value=0 -Original Message- From: Andy Kriger [mailto:[EMAIL PROTECTED]] And last but not least, is it possible to do test in logic:equal that involve equations? For example, is index%2==0? (or do I need JSTL for this)? -Original Message- From: Karr, David [mailto:[EMAIL PROTECTED]] Certainly. It's available as a scripting variable within the loop (and as a page-scoped attribute). -Original Message- From: Andy Kriger [mailto:[EMAIL PROTECTED]] Is it possible to access the idx variable in a scriplet during iteration? -Original Message- From: Andy Kriger [mailto:[EMAIL PROTECTED]] Is there any way to set an iteration increment on the iterate tag? For example, iterate through the array returning every 2nd item. If not, can anyone tell me how I might do this without resorting to scriplets (or only using them minimally)? Here's the code I'm trying to use. The first TD is the long_desc field of array[idx] in myBean. How can I increment idx so I can get the next item? (maybe I'm being slow since I haven't had my coffee yet) logic:iterate id=idx name=myBean property=array scope=session tr tdbean:write name=idx property=long_desc//td tdbean:write name=??? property=long_desc//td /tr /logic:iterate -- 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]
bean:write, mapped properties and Struts1.0.2?
In Struts 1.0.2, is it possible to do bean:write name=myBean property=property(key)/ where myBean has methods public String getProperty(String key) public void setProperty(String key, Object value) and there is a map backing the (get|set)Property? thx andy -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: giving biz classes access to MessageResources?
I'm talking about a generic class outside of the struts architecture that knows nothing about where the strings are coming from (except that they come from a properties file). So I don't have knowledge of Action or MessageResources or pageContext. -Original Message- From: edgar [mailto:edgar;blue-moose.net] Sent: Friday, November 15, 2002 14:50 To: 'Struts Users Mailing List' Subject: RE: giving biz classes access to MessageResources? You can get the app.properties as long as you have the request MessageResources mr = (MessageResources) pageContext.findAttribute( Action.MESSAGES_KEY ); The MESSAGES_KEY is static so you don't need the action. -Original Message- From: Andy Kriger [mailto:akriger;greaterthanone.com] Sent: Friday, November 15, 2002 2:24 PM To: 'Struts Users Mailing List' Subject: giving biz classes access to MessageResources? I have an organizational question. On my current project, we keep SQL queries in our App.properties file to allow us to update the queries without recomiling code. However, this means that (afaik) only the Action can access the query Strings. So, whenever calls are made to our dB class, we have to pass the query as a parameter. Or do we? The dB is a bunch of static methods (could be a singleton just as easily). Is there a better way to set this up that allows the dB class to know about the message resources? Will a call to System.getResource work here? How are other folks handling this kind of thing? thx andy -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
RE: giving biz classes access to MessageResources?
to answer my own question - yes, using PropertyResourceBundle.getBundle(appResFile) and i'm guessing if i look further MessageResources has a static utility method that does this -Original Message- From: Andy Kriger [mailto:akriger;greaterthanone.com] Sent: Friday, November 15, 2002 14:57 To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: RE: giving biz classes access to MessageResources? I'm talking about a generic class outside of the struts architecture that knows nothing about where the strings are coming from (except that they come from a properties file). So I don't have knowledge of Action or MessageResources or pageContext. -Original Message- From: edgar [mailto:edgar;blue-moose.net] Sent: Friday, November 15, 2002 14:50 To: 'Struts Users Mailing List' Subject: RE: giving biz classes access to MessageResources? You can get the app.properties as long as you have the request MessageResources mr = (MessageResources) pageContext.findAttribute( Action.MESSAGES_KEY ); The MESSAGES_KEY is static so you don't need the action. -Original Message- From: Andy Kriger [mailto:akriger;greaterthanone.com] Sent: Friday, November 15, 2002 2:24 PM To: 'Struts Users Mailing List' Subject: giving biz classes access to MessageResources? I have an organizational question. On my current project, we keep SQL queries in our App.properties file to allow us to update the queries without recomiling code. However, this means that (afaik) only the Action can access the query Strings. So, whenever calls are made to our dB class, we have to pass the query as a parameter. Or do we? The dB is a bunch of static methods (could be a singleton just as easily). Is there a better way to set this up that allows the dB class to know about the message resources? Will a call to System.getResource work here? How are other folks handling this kind of thing? thx andy -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
RE: giving biz classes access to MessageResources?
I agree absolutely - however, MessageResources has been pulled into commons-messages which lends to using it more freely (though I haven't found a reason to use that yet over ResourceBundle.getBundle() - since it doesn't do any sort of automatic discovery of property files you still have to provide a filename in your code). -Original Message- From: David Graham [mailto:dgraham1980;hotmail.com] Sent: Friday, November 15, 2002 15:27 To: [EMAIL PROTECTED] Subject: RE: giving biz classes access to MessageResources? But you don't want to use MessageResources in your business class because then you're tied to struts. Never import javax.servlet.* or org.apache.struts.* in business logic classes. David From: Andy Kriger [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: RE: giving biz classes access to MessageResources? Date: Fri, 15 Nov 2002 15:16:10 -0500 to answer my own question - yes, using PropertyResourceBundle.getBundle(appResFile) and i'm guessing if i look further MessageResources has a static utility method that does this -Original Message- From: Andy Kriger [mailto:akriger;greaterthanone.com] Sent: Friday, November 15, 2002 14:57 To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: RE: giving biz classes access to MessageResources? I'm talking about a generic class outside of the struts architecture that knows nothing about where the strings are coming from (except that they come from a properties file). So I don't have knowledge of Action or MessageResources or pageContext. -Original Message- From: edgar [mailto:edgar;blue-moose.net] Sent: Friday, November 15, 2002 14:50 To: 'Struts Users Mailing List' Subject: RE: giving biz classes access to MessageResources? You can get the app.properties as long as you have the request MessageResources mr = (MessageResources) pageContext.findAttribute( Action.MESSAGES_KEY ); The MESSAGES_KEY is static so you don't need the action. -Original Message- From: Andy Kriger [mailto:akriger;greaterthanone.com] Sent: Friday, November 15, 2002 2:24 PM To: 'Struts Users Mailing List' Subject: giving biz classes access to MessageResources? I have an organizational question. On my current project, we keep SQL queries in our App.properties file to allow us to update the queries without recomiling code. However, this means that (afaik) only the Action can access the query Strings. So, whenever calls are made to our dB class, we have to pass the query as a parameter. Or do we? The dB is a bunch of static methods (could be a singleton just as easily). Is there a better way to set this up that allows the dB class to know about the message resources? Will a call to System.getResource work here? How are other folks handling this kind of thing? thx andy -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org _ Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
help needed with DynaActionForm
I am trying to set properties of an object using DynaActionForm. In my struts-config.xml I have in the form-bean form-property name='creditCard' type='my.package.CreditCard' / In my JSP I try html:text property='creditCard.type' / The CreditCard class has a no-arg ctor and get/set methods for all of its fields. When I load the JSP I get an error Null property value for 'creditCard' I'm guessing that DynaActionForm is not initializing the CreditCard object, but I don't know why (I thought that was the point of DynaActionForm - to be able to use any object and initialize it from the form automatically). Can anyone who has done this successfully point me in the right direction? thx andy -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
RE: help needed with DynaActionForm
Currently the first action in my webapp is an ForwardAction that takes you to the JSP. So, if I understand you right, I could make this work by replacing that with an Initalization action that creates the objects for use in the form. I'll try that and report back. I'm guessing it wouldn't be that hard to extend the form to handle any old Object, maybe someone more in the know with the src can comment on this? thx andy -Original Message- From: Drew Zimber [mailto:drew.zimber;shaws.com] Sent: Thursday, November 14, 2002 10:35 To: 'Struts Users Mailing List' Subject: RE: help needed with DynaActionForm from: http://jakarta.apache.org/struts/userGuide/building_controller.html#dyna_act ion_form_classes The list of types supported by DynaActionForm beans includes: java.lang.BigDecimal java.lang.BigInteger boolean and java.lang.Boolean byte and java.lang.Byte char and java.lang.Character java.lang.Class double and java.lang.Double float and java.lang.Float int and java.lang.Integer long and java.lang.Long short and java.lang.Short java.lang.String java.sql.Date java.sql.Time java.sql.Timestamp now, with that being said. I have used my own classes in the DynaForms, but they wil lbe initialized to null UNLESS you do the following: 1) in the Action class, cast the form to a DynaActionForm 2) do an explicit myForm.set(myProperty, new myObject()) type call all in all, i did alot of research on dynaforms and they are pretty useful, but in my opinion they arent versatile enough yet for complex applications/valdation...In the end we choose to retain mostly traditional forms. drew -Original Message- From: Andy Kriger [mailto:akriger;greaterthanone.com] Sent: Thursday, November 14, 2002 10:25 AM To: Struts Users Mailing List Subject: help needed with DynaActionForm I am trying to set properties of an object using DynaActionForm. In my struts-config.xml I have in the form-bean form-property name='creditCard' type='my.package.CreditCard' / In my JSP I try html:text property='creditCard.type' / The CreditCard class has a no-arg ctor and get/set methods for all of its fields. When I load the JSP I get an error Null property value for 'creditCard' I'm guessing that DynaActionForm is not initializing the CreditCard object, but I don't know why (I thought that was the point of DynaActionForm - to be able to use any object and initialize it from the form automatically). Can anyone who has done this successfully point me in the right direction? thx andy -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
RE: help needed with DynaActionForm
I'm speaking at the edge of understanding here, but... If BeanUtils is underlying this whole thing, then you should be able to create the user-objects instead of defaulting them to null (using the JavaBean no-arg ctor). And following on that you could use the property referencing struture used by the rest of Struts (e.g. object.field or object[0].object.field) to handle the validation. At first at least, one could implement this by handling user-objects but requiring that the last value in the property referencing be a primitive or Strings (for validation and returning objects to the form). Then I guess it could be expanded to user-objects using a Validatable interface (similar to the Comparable interface used by Arrays.sort). -Original Message- From: Drew Zimber [mailto:drew.zimber;shaws.com] Sent: Thursday, November 14, 2002 11:00 To: 'Andy Kriger'; 'Struts Users Mailing List' Subject: RE: help needed with DynaActionForm ...I'm guessing it wouldn't be that hard to extend the form to handle any old Object, maybe someone more in the know with the src can comment on this? actually, i found some documentation about this on the web. You can subclass DynaActionForm and add your own attributes, but it sort of defeats the purpose of having a DynaForm. You'll sort of have a half and half form and im not sure how i feel about that. for the DynaForms, you can put ANY object into the form, because it stores all objects in a HashMap. However, when you get to validation and returning objects to the form on submit, it gets messy. The DynaForms still need some time to mature... dz -Original Message- From: Andy Kriger [mailto:akriger;greaterthanone.com] Sent: Thursday, November 14, 2002 10:45 AM To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: RE: help needed with DynaActionForm Currently the first action in my webapp is an ForwardAction that takes you to the JSP. So, if I understand you right, I could make this work by replacing that with an Initalization action that creates the objects for use in the form. I'll try that and report back. I'm guessing it wouldn't be that hard to extend the form to handle any old Object, maybe someone more in the know with the src can comment on this? thx andy -Original Message- From: Drew Zimber [mailto:drew.zimber;shaws.com] Sent: Thursday, November 14, 2002 10:35 To: 'Struts Users Mailing List' Subject: RE: help needed with DynaActionForm from: http://jakarta.apache.org/struts/userGuide/building_controller.html#dyna_act ion_form_classes The list of types supported by DynaActionForm beans includes: java.lang.BigDecimal java.lang.BigInteger boolean and java.lang.Boolean byte and java.lang.Byte char and java.lang.Character java.lang.Class double and java.lang.Double float and java.lang.Float int and java.lang.Integer long and java.lang.Long short and java.lang.Short java.lang.String java.sql.Date java.sql.Time java.sql.Timestamp now, with that being said. I have used my own classes in the DynaForms, but they wil lbe initialized to null UNLESS you do the following: 1) in the Action class, cast the form to a DynaActionForm 2) do an explicit myForm.set(myProperty, new myObject()) type call all in all, i did alot of research on dynaforms and they are pretty useful, but in my opinion they arent versatile enough yet for complex applications/valdation...In the end we choose to retain mostly traditional forms. drew -Original Message- From: Andy Kriger [mailto:akriger;greaterthanone.com] Sent: Thursday, November 14, 2002 10:25 AM To: Struts Users Mailing List Subject: help needed with DynaActionForm I am trying to set properties of an object using DynaActionForm. In my struts-config.xml I have in the form-bean form-property name='creditCard' type='my.package.CreditCard' / In my JSP I try html:text property='creditCard.type' / The CreditCard class has a no-arg ctor and get/set methods for all of its fields. When I load the JSP I get an error Null property value for 'creditCard' I'm guessing that DynaActionForm is not initializing the CreditCard object, but I don't know why (I thought that was the point of DynaActionForm - to be able to use any object and initialize it from the form automatically). Can anyone who has done this successfully point me in the right direction? thx andy -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
RE: help needed with DynaActionForm
If only there were time on my current project to explore this and get it done right by extending the existing Struts architecture. For the while I'll have to go back to Strings and convert them to objects in the Action. -Original Message- From: Drew Zimber [mailto:drew.zimber;shaws.com] Sent: Thursday, November 14, 2002 11:36 To: 'Struts Users Mailing List' Subject: RE: help needed with DynaActionForm interesting idea, but i dont think beanUtils is driving the whole dynaforms thing. I think its just a big HashMap they stick stuff into (for the moment). The big problem is that DynaForms requires you to specify the initial values in the form-property as that initial value. So, with complex value objects and Collections, its not smart enough (yet) to instantiate even an empty object. It only knows how to create Wrapper classes with values in them. That's why i started toying with the direct DynaActionForm.set() in the action class. As far as i explored, that was the only way to get around this. And if you are using the XML validation in conjuction, it gets even messier my friend. dz -Original Message- From: Andy Kriger [mailto:akriger;greaterthanone.com] Sent: Thursday, November 14, 2002 11:19 AM To: Struts Users Mailing List Subject: RE: help needed with DynaActionForm I'm speaking at the edge of understanding here, but... If BeanUtils is underlying this whole thing, then you should be able to create the user-objects instead of defaulting them to null (using the JavaBean no-arg ctor). And following on that you could use the property referencing struture used by the rest of Struts (e.g. object.field or object[0].object.field) to handle the validation. At first at least, one could implement this by handling user-objects but requiring that the last value in the property referencing be a primitive or Strings (for validation and returning objects to the form). Then I guess it could be expanded to user-objects using a Validatable interface (similar to the Comparable interface used by Arrays.sort). -Original Message- From: Drew Zimber [mailto:drew.zimber;shaws.com] Sent: Thursday, November 14, 2002 11:00 To: 'Andy Kriger'; 'Struts Users Mailing List' Subject: RE: help needed with DynaActionForm ...I'm guessing it wouldn't be that hard to extend the form to handle any old Object, maybe someone more in the know with the src can comment on this? actually, i found some documentation about this on the web. You can subclass DynaActionForm and add your own attributes, but it sort of defeats the purpose of having a DynaForm. You'll sort of have a half and half form and im not sure how i feel about that. for the DynaForms, you can put ANY object into the form, because it stores all objects in a HashMap. However, when you get to validation and returning objects to the form on submit, it gets messy. The DynaForms still need some time to mature... dz -Original Message- From: Andy Kriger [mailto:akriger;greaterthanone.com] Sent: Thursday, November 14, 2002 10:45 AM To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: RE: help needed with DynaActionForm Currently the first action in my webapp is an ForwardAction that takes you to the JSP. So, if I understand you right, I could make this work by replacing that with an Initalization action that creates the objects for use in the form. I'll try that and report back. I'm guessing it wouldn't be that hard to extend the form to handle any old Object, maybe someone more in the know with the src can comment on this? thx andy -Original Message- From: Drew Zimber [mailto:drew.zimber;shaws.com] Sent: Thursday, November 14, 2002 10:35 To: 'Struts Users Mailing List' Subject: RE: help needed with DynaActionForm from: http://jakarta.apache.org/struts/userGuide/building_controller.html#dyna_act ion_form_classes The list of types supported by DynaActionForm beans includes: java.lang.BigDecimal java.lang.BigInteger boolean and java.lang.Boolean byte and java.lang.Byte char and java.lang.Character java.lang.Class double and java.lang.Double float and java.lang.Float int and java.lang.Integer long and java.lang.Long short and java.lang.Short java.lang.String java.sql.Date java.sql.Time java.sql.Timestamp now, with that being said. I have used my own classes in the DynaForms, but they wil lbe initialized to null UNLESS you do the following: 1) in the Action class, cast the form to a DynaActionForm 2) do an explicit myForm.set(myProperty, new myObject()) type call all in all, i did alot of research on dynaforms and they are pretty useful, but in my opinion they arent versatile enough yet for complex applications/valdation...In the end we choose to retain mostly traditional forms. drew -Original Message- From: Andy Kriger [mailto:akriger;greaterthanone.com] Sent: Thursday, November 14, 2002 10:25 AM To: Struts Users Mailing List Subject: help needed with DynaActionForm I am trying to set
RE: indexed properties and form help needed
According to the docs for DynaActionForm, you indicate a property is indexed by putting [] after the type name. What I think is going on is that the property is not initalized when the iterator tries to access it, thus the 'No collection found'. But I don't know how to set this up so it works correctly. Since Struts seems to handle just about everything else, it'd surprise me if you couldn't iterate over a dynamic form property in order to setup inputs. thx -Original Message- From: Karr, David [mailto:david.karr;attws.com] Sent: Wednesday, November 13, 2002 18:02 To: Struts Users Mailing List Subject: RE: indexed properties and form help needed At end. -Original Message- From: Andy Kriger [mailto:akriger;greaterthanone.com] I have a DynaActionForm collecting credit card info. A user can enter up to 3 credit cards on the form. I want to collect this info in the text fields and create new CreditCard objects automatically; ideally, I would get a CreditCard[3] once the form is submitted (optionally an ArrayList would be fine). I would like to use indexed properties (right now I'm using hard coded property names), but I cannot figure out how to set this up. I am getting either a 'No collection found' error or a 'Cannot iterate over collection' error (depending on how I mess with this). What follows is rough code of what I'm trying to do. A CreditCard object has 5 fields with get/set methods for each: type, name, number, expMonth, expYear. !-- JSP -- html:form method='post' action='doSomething' logic:iterate id='index' property='creditCard' name='registrationForm' length='3' html:select property='creditCard.type' name='index' indexed='true' !-- some options -- /html:select html:text property='creditCard.name' name='index' indexed='true' html:text property='creditCard.number' name='index' indexed='true' html:text property='creditCard.expMonth' name='index' indexed='true' html:text property='creditCard.expYear' name='index' indexed='true' /logic:iterate /html:form !-- Note: I have tried html:text with property='creditCard.field' and property='field' Neither worked -- !-- struts-config.xml -- form-bean name='registrationForm' type='DynaValidatorForm dynamic='true' form-property name='creditCard' type='my.package.CreditCard[]'/ /form-bean Note that I haven't compiled or run any of this. I would first expect my loop to look more like this: logic:iterate id='creditCard' property='creditCards' name='registrationForm' length='3' html:select name='creditCard' property='type' indexed='true' !-- some options -- /html:select html:text name='creditCard' property='name' indexed='true'/ html:text name='creditCard' property='number' indexed='true'/ html:text name='creditCard' property='expMonth' indexed='true'/ html:text name='creditCard' property='expYear' indexed='true'/ /logic:iterate I would have accessors for name, number, expMonth and expYear in the CreditCard class. At that point, I scratch my head, because I don't know how to represent indexed properties in DynaActionForms. With a regular ActionForm, I would have the following in my registrationForm bean: public CreditCard getCreditCard(int index) { return (creditCards[index]); } public void setCreditCard(int index, CreditCard creditCard) { creditCard[index] = creditCard; } public CreditCard[] getCreditCards() { return (creditCards); } -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
form component reuse best practices?
(this is a refinement of a question i asked yesterday) If you have common form components that can be reused multiple times on a page or between projects (e.g. a list of months for date entry, a list of states for address entry), what is the best way to share this code (the html:select/html:option items)? Do you use a backing static bean and html:options to point to that bean? Any ideas would be appreciated. thanks andy kriger -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
reuse select/options?
I have a form that repeats a credit card validation portion multiple times. What is the best way to only have to write html:select/html:options once? Is there a way to give the first use an id and then refer to that by reference? thx andy kriger -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
question about Action overhead and best practice
I have the current setup JSP (behind an Action) - Action - JSP (behind an Action) The Action in the middle does several things, none particularly large (let's say 10 lines of code each). It would probably be cleaner design to separate the tasks into separate actions. However, I am curious about the overhead attached to this within the Struts system. Right now there is one Action called which either returns to the first JSP or continues to the second JSP. Breaking that Action up increases the number of messges passed around in the system, however, I don't know how Struts works under-the-hood, so I don't know how much extra Struts work would take place. Can anyone tell me how much extra activity is generated by each additional Action? thx andy -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
RE: Question - DynaActionForm and indexed property
does that type format of class[] apply to Arrays and Lists? -Original Message- From: Taylor, Jason [mailto:jtaylor;cobaltgroup.com] Sent: Friday, October 25, 2002 10:42 To: 'Struts Users Mailing List' Subject: RE: Question - DynaActionForm and indexed property hope you're using struts 1.1-- you're going to need the indexed attribute. Here's the basic idea: logic:iterate id=creditCard name=myForm property=creditCards Type: html:text name=creditCard property=type indexed=true / Name: html:text name=creditCard property=name indexed=true / ... /logic:iterate and form-bean name=myForm type=o.a.s.a.DynaActionForm form-property name=creditCards type=com.ra.ic.model.CreditCard[] / /form-bean Note: this will be this simple only if all your creditCard attributes are Strings, otherwise you'll need to resort to PropertyUtils.copyProperties() or some homegrown conversion method, I believe. -JT -Original Message- From: Andy Kriger [mailto:akriger;greaterthanone.com] Sent: Friday, October 25, 2002 7:15 AM To: Struts Users Mailing List Subject: Question - DynaActionForm and indexed property I am trying to setup a DynaActionForm to use indexed and named properties. But I'm getting an error and, not knowing BeanUtils very well, I'm wondering if someone can guide me in what I need to do to make this work. In my form... html:text property='creditCard[0].type' / html:text property='creditCard[0].name' / html:text property='creditCard[0].number' / html:text property='creditCard[0].expDate' / In my struts-config.xml... form-property name='creditCard[0].type' type='com.ra.ic.model.CreditCard' / form-property name='creditCard[0].name' type='com.ra.ic.model.CreditCard' / form-property name='creditCard[0].number' type='com.ra.ic.model.CreditCard' / form-property name='creditCard[0].expDate' type='com.ra.ic.model.CreditCard' / CreditCard has get/set methods for type, name, number, expDate. The error I'm getting is... javax.servlet.jsp.JspException: No getter method for property creditCard[0].type of bean org.apache.struts.taglib.html.BEAN at org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:742) -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
question about Action overhead and best practice
I have the current setup JSP (behind an Action) - Action - JSP (behind an Action) The Action in the middle does several things, none particularly large (let's say 10 lines of code each). It would probably be cleaner design to separate the tasks into separate actions. However, I am curious about the overhead attached to this within the Struts system. Right now there is one Action called which either returns to the first JSP or continues to the second JSP. Breaking that Action up increases the number of messges passed around in the system, however, I don't know how Struts works under-the-hood, so I don't know how much extra Struts work would take place. Can anyone tell me how much extra activity is generated by each additional Action? thx andy -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
Question - DynaActionForm and indexed property
I am trying to setup a DynaActionForm to use indexed and named properties. But I'm getting an error and, not knowing BeanUtils very well, I'm wondering if someone can guide me in what I need to do to make this work. In my form... html:text property='creditCard[0].type' / html:text property='creditCard[0].name' / html:text property='creditCard[0].number' / html:text property='creditCard[0].expDate' / In my struts-config.xml... form-property name='creditCard[0].type' type='com.ra.ic.model.CreditCard' / form-property name='creditCard[0].name' type='com.ra.ic.model.CreditCard' / form-property name='creditCard[0].number' type='com.ra.ic.model.CreditCard' / form-property name='creditCard[0].expDate' type='com.ra.ic.model.CreditCard' / CreditCard has get/set methods for type, name, number, expDate. The error I'm getting is... javax.servlet.jsp.JspException: No getter method for property creditCard[0].type of bean org.apache.struts.taglib.html.BEAN at org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:742) -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
how do i get a Field object in Validator?
I am writing a custom rule and I need to know how I can get a handle to a different Field object? (not the one passed into the method in the first place) thx a -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
testing your Struts JSPs
What JUnit extension or JUnit-like tools do folks use to test their JSPs? I am aware of StrutsTestCase but in this instance I need to test form validation on an action that uses an ActionForward directly (no associated Action class). So direct JSP testing makes more sense. -a -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
RE: how do i get a Field object in Validator?
That much I understand - but is it possible to get a reference to the Field objec that represents that 2nd property? For example, if you wanted to get message arguments from the other field. -Original Message- From: Jerry Jalenak [mailto:Jerry.Jalenak;LABONE.com] Sent: Tuesday, October 22, 2002 14:19 To: 'Struts Users Mailing List' Subject: RE: how do i get a Field object in Validator? In your validator-rules.xml file, add the following for each form field you need access to: form name=yourForm field property=firstProperty depends=yourCustomRoutine var var-namesecondProperty-Label/var-name var-valuesecondProperty-Value/var-name /var /field /form secondProperty-Label would be what you want to call the variable in your custom routine; secondProperty-Value would be the actual form field name that contains the entered value. Then in your custom routine you can access these values by public static boolean yourCustomRoutine(Object object, ValidatorAction va, Field field, ActionErrors errors, HttpServletRequest request) { String fp = ValidatorUtil.getValueAsString(object, field.getProperty()); String sp = ValidatorUtil.getValueAsString(object, field.getVarValue(secondProperty-Label)); ... do something ... return true; // or false if the validation fails } HTH, Jerry -Original Message- From: Andy Kriger [mailto:akriger;greaterthanone.com] Sent: Tuesday, October 22, 2002 11:33 AM To: Struts Users Mailing List Subject: how do i get a Field object in Validator? I am writing a custom rule and I need to know how I can get a handle to a different Field object? (not the one passed into the method in the first place) thx a -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org This transmission (and any information attached to it) may be confidential and is intended solely for the use of the individual or entity to which it is addressed. If you are not the intended recipient or the person responsible for delivering the transmission to the intended recipient, be advised that you have received this transmission in error and that any use, dissemination, forwarding, printing, or copying of this information is strictly prohibited. If you have received this transmission in error, please immediately notify LabOne at (800)388-4675. -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
RE: how do i get a Field object in Validator?
Thanks - I've got code like that to validate that 2 fields are equal (sounds like we could all donate some code to expand the basic rules available to Validator). But what I want is the actual Field object (like the one you pass into a validate method) for another field. I need this so I can get a message resource from that field (as opposed to passing them in using a var, which I am now, but don't like because the code is uglier and it duplicates other validation.xml settings). -Original Message- From: Dave Derry [mailto:dderry;acm.org] Sent: Tuesday, October 22, 2002 15:18 To: Struts Users Mailing List Subject: Re: how do i get a Field object in Validator? Heres a method that I use to validate that one date entered by the user is earlier than another. public static boolean validateDateBefore( Object bean, ValidatorAction va, Field field, ActionErrors errors, HttpServletRequest request ) { // verify that the bean contains a valid date in the specified 'field' Date targetDate = StrutsValidator.validateDate( bean, va, field, errors, request ); if( targetDate == null ) return false; // get the date to compare to String later = field.getVarValue( dateBefore ); if( GenericValidator.isBlankOrNull( later ) ) { errors.add( field.getKey(), StrutsValidatorUtil.getActionError(request, va, field) ); return false; } String lDate = ValidatorUtil.getValueAsString( bean, later ); Date laterDate = StrutsValidator.validateDate( lDate, va, field, errors, request ); if( lDate == null ) return false; // now we can compare the 2 dates if( ! isDateAfter( laterDate, targetDate ) ) { StringBuffer buffer = new StringBuffer( field.getProperty() ); buffer.append( must be earlier than ).append( lDate ); errors.add( field.getKey(), StrutsValidatorUtil.getActionError(request, va, field) ); return false; } return true; } And this is the entry from validation.xml field property=auditDate depends=date, dateBefore msg name=date key=Please enter a valid date, if any, that the audit will be done. resource =false/ msg name=dateBefore key=Audit date must occur before the final date. resource=false/ var var-namedateBefore/var-name var-valuefinalDate/var-value /var /field The finalDate referenced by var-value is another attribute of my ValidatorForm. Does this help? Dave Derry - Original Message - From: Andy Kriger [EMAIL PROTECTED] That much I understand - but is it possible to get a reference to the Field objec that represents that 2nd property? For example, if you wanted to get message arguments from the other field. -Original Message- From: Jerry Jalenak [mailto:Jerry.Jalenak;LABONE.com] In your validator-rules.xml file, add the following for each form field you need access to: form name=yourForm field property=firstProperty depends=yourCustomRoutine var var-namesecondProperty-Label/var-name var-valuesecondProperty-Value/var-name /var /field /form secondProperty-Label would be what you want to call the variable in your custom routine; secondProperty-Value would be the actual form field name that contains the entered value. Then in your custom routine you can access these values by public static boolean yourCustomRoutine(Object object, ValidatorAction va, Field field, ActionErrors errors, HttpServletRequest request) { String fp = ValidatorUtil.getValueAsString(object, field.getProperty()); String sp = ValidatorUtil.getValueAsString(object, field.getVarValue(secondProperty-Label)); ... do something ... return true; // or false if the validation fails } HTH, Jerry -Original Message- From: Andy Kriger [mailto:akriger;greaterthanone.com] I am writing a custom rule and I need to know how I can get a handle to a different Field object? (not the one passed into the method in the first place) thx a -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
RE: how do i get a Field object in Validator?
Essentially, yes. Lets say I have 2 fields A B. I am validating A but it requires B. If B fails, I'd like to get the arg0 value from B's Field object and use that in the error message (since there's a key to the display name in that arg). I've worked around this by passing in keys as a separate var but like I said earlier, it's ugly. -Original Message- From: Jerry Jalenak [mailto:Jerry.Jalenak;LABONE.com] Sent: Tuesday, October 22, 2002 15:29 To: 'Struts Users Mailing List' Subject: RE: how do i get a Field object in Validator? Not quite sure I understand your question then. Are you wanting to manipulate the error message that is being returned? In other words, if one of the 'other' variables fails, then return a message for that failure ? Jerry -Original Message- From: Andy Kriger [mailto:akriger;greaterthanone.com] Sent: Tuesday, October 22, 2002 1:45 PM To: Struts Users Mailing List Subject: RE: how do i get a Field object in Validator? That much I understand - but is it possible to get a reference to the Field objec that represents that 2nd property? For example, if you wanted to get message arguments from the other field. -Original Message- From: Jerry Jalenak [mailto:Jerry.Jalenak;LABONE.com] Sent: Tuesday, October 22, 2002 14:19 To: 'Struts Users Mailing List' Subject: RE: how do i get a Field object in Validator? In your validator-rules.xml file, add the following for each form field you need access to: form name=yourForm field property=firstProperty depends=yourCustomRoutine var var-namesecondProperty-Label/var-name var-valuesecondProperty-Value/var-name /var /field /form secondProperty-Label would be what you want to call the variable in your custom routine; secondProperty-Value would be the actual form field name that contains the entered value. Then in your custom routine you can access these values by public static boolean yourCustomRoutine(Object object, ValidatorAction va, Field field, ActionErrors errors, HttpServletRequest request) { String fp = ValidatorUtil.getValueAsString(object, field.getProperty()); String sp = ValidatorUtil.getValueAsString(object, field.getVarValue(secondProperty-Label)); ... do something ... return true; // or false if the validation fails } HTH, Jerry -Original Message- From: Andy Kriger [mailto:akriger;greaterthanone.com] Sent: Tuesday, October 22, 2002 11:33 AM To: Struts Users Mailing List Subject: how do i get a Field object in Validator? I am writing a custom rule and I need to know how I can get a handle to a different Field object? (not the one passed into the method in the first place) thx a -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org This transmission (and any information attached to it) may be confidential and is intended solely for the use of the individual or entity to which it is addressed. If you are not the intended recipient or the person responsible for delivering the transmission to the intended recipient, be advised that you have received this transmission in error and that any use, dissemination, forwarding, printing, or copying of this information is strictly prohibited. If you have received this transmission in error, please immediately notify LabOne at (800)388-4675. -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org This transmission (and any information attached to it) may be confidential and is intended solely for the use of the individual or entity to which it is addressed. If you are not the intended recipient or the person responsible for delivering the transmission to the intended recipient, be advised that you have received this transmission in error and that any use, dissemination, forwarding, printing, or copying of this information is strictly prohibited. If you have received this transmission in error, please immediately notify LabOne at (800)388-4675. -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
RE: ChoiceFormat for message formatting?
I'm getting 'java.lang.IllegalArgumentException: Cannot format given Object as a Number' when I use the message format below. I tried simplifying to just {1} characters instead of {1,number,integer} but no luck -Original Message- From: Karr, David [mailto:david.karr;attws.com] Sent: Monday, October 21, 2002 13:01 To: 'Struts Users Mailing List' Subject: RE: ChoiceFormat for message formatting? -Original Message- From: Andy Kriger [mailto:akriger;greaterthanone.com] Sent: Monday, October 21, 2002 9:21 AM Can ChoiceFormat be used to format messages in the app properties file? For example, the validator error.maxlength is {0} can not be greater than {1} characters. This will produce 'field can not be greater than 1 characters' I am trying to use the ChoiceFormat to work so this can be grammatically correct, but this is not working... {0} can not be more than {1,choice,1#one character|1{1,number,integer} characters}. Should it work? Do I have a format string problem? You should be able to do this, yes. Are you certain your message is on a single line in the properties file, or uses continuation characters for multiple lines? -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
validator questions
1) Is it possible to override the validator error message when a field fails validation? For example, I have a required field that is missing. I display the default error message at the top of the page. I would also like to change the color of the form field label red. Can I do something like html:errors property=fieldName key=message.style/ to override the default app properties entry used by validator rule? If not, has anyone come up with a way of using multiple error messages for one property? 2) Is there any documentation on the 'errors exist' and 'messages exist' tags? I can't find any mention in the 1.1b2 docs or APIs. thx andy -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
ChoiceFormat for message formatting?
Can ChoiceFormat be used to format messages in the app properties file? For example, the validator error.maxlength is {0} can not be greater than {1} characters. This will produce 'field can not be greater than 1 characters' I am trying to use the ChoiceFormat to work so this can be grammatically correct, but this is not working... {0} can not be more than {1,choice,1#one character|1{1,number,integer} characters}. Should it work? Do I have a format string problem? thx J2SE API for ChoiceFormat http://java.sun.com/j2se/1.4.1/docs/api/java/text/MessageFormat.html -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
shopping carts with struts?
Is there a robust open-source shopping cart implementation using Struts? Or failing that, using JSP/Java? -a -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
difference between forward and include?
The DTD specifies for attributes named 'forward' and 'include' for action. These have the same documentation. Is there any difference? -a -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
action include or forward attribute not working?
I am setting up the following: a JSP containing a form; the submit action of the JSP calls a Struts Action class. Since I don't really need an action simply to forward to the JSP, I thought I'd use the action include or foward attribute which seems to accomplish this. But I can't make it work. Here is the struts-config entry... action path=/Registration forward=/registration.jsp /action I would expect that /Registration.do would open registration.jsp Instead I get '500 No action instance for path /Registration could be created' Any ideas? thx andy -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
standard beans library?
Are there any libraries of common beans like Birthday, Address, etc.? This seems like something that would come up a lot (I know I'm encountering it a bit across projects) and could be reused widely. thx a -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Struts forms best practice
Does this mean that you will have an ActionForm with String fields and a ModelBean that basically has all the same fields but with the correct types? And that ModelBean is passed around the struts framework? If so, how do folks reduce code duplication between the utility ActionForm and the data modelling ModelBean? -a -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] Sent: Friday, October 11, 2002 13:00 To: Struts Users Mailing List Subject: Re: Struts forms best practice On Fri, 11 Oct 2002, rainer juenger wrote: Date: Fri, 11 Oct 2002 18:38:40 +0200 From: rainer juenger [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Struts forms best practice Hi, I was wondering what the best data type for Struts ActionForm class is. According to the design I would say it should be the same as the data type in the application. (e.g. float) But then the associated form already comes with a 0 filed in the form. That's something I don't wont at all! As I found out, the only solution is to use String as data type an convert it later. Is there a more elegant way? Form bean properties should generally be Strings, so that you can redisplay whatever the user actually typed. Do your conversions in the Action after validation is complete -- in 1.1b2 and later, you can use BeanUtils.copyProperties() to copy the form bean properties into a coresponding business object, complete with doing the conversions as needed. Raine Craig -- 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]
[OT] which object-relational mapping framework?
I'm embarking on a project for which I'd like to use an ORM to abstract the dB access. Since there are so many out there (e.g. I'm considering Castor, Torque, and OJB just from mentions in various Java articles), I'm wondering which frameworks people have had experience with and your opinions on them. thx a -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: [OT] which object-relational mapping framework?
that table is amazing - thx -Original Message- From: Dan Cancro [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 10, 2002 14:43 To: 'Struts Users Mailing List' Subject: RE: [OT] which object-relational mapping framework? This page has some comparison info: http://c2.com/cgi-bin/wiki?CayenneVsOther So does this Excel file http://members.telocity.com/dcancro/docs/web_dev_products.zip -Original Message- From: Andy Kriger [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 10, 2002 11:29 AM To: Struts Users Mailing List Subject: [OT] which object-relational mapping framework? I'm embarking on a project for which I'd like to use an ORM to abstract the dB access. Since there are so many out there (e.g. I'm considering Castor, Torque, and OJB just from mentions in various Java articles), I'm wondering which frameworks people have had experience with and your opinions on them. thx a -- 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] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: [OT] Container Wars - Resin and sessions
have you tried... session-config enable-url-rewriting='true'/ this enables Resin to track the session in the URL -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 08, 2002 9:23 To: Struts Users Mailing List Subject: RE: [OT] Container Wars - Resin and sessions We are using tomcat 4.04 and have tried 4.1.12 with out problems. When I drop my working Struts app into Resin 2.1.5 it seems that it does not keep the session. (I can login, place a user bean in session then the next action looks for that bean and when null, kicks us of the app) I have not looked any deeper but I guess I expected it to deploy the same way it does in Tomcat. Cliff Rowley [EMAIL PROTECTED] on 10/08/2002 07:02:34 AM Please respond to Struts Users Mailing List [EMAIL PROTECTED] To:'Struts Users Mailing List' [EMAIL PROTECTED] cc: Subject:RE: [OT] Container Wars Resin does it for me! -Original Message- From: Shreyas, Kumar [mailto:[EMAIL PROTECTED]] Sent: 08 October 2002 12:57 To: 'Struts Users Mailing List' Subject: RE: [OT] Container Wars Should JRun be used for large projects? -Original Message- From:[EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]] Sent:Tuesday, October 08, 2002 5:19 PM To: [EMAIL PROTECTED] Subject: RE: [OT] Container Wars Jrun, Best of breed?? -Original Message- From: Galbreath, Mark [mailto:[EMAIL PROTECTED]] Sent: 08 October 2002 11:55 To: 'Struts Users Mailing List' Subject: RE: [OT] Container Wars No way, dude! Jetty sucks! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 08, 2002 6:48 AM Prove it. Jetty could be the best or even a bucket! -Original Message- From: Galbreath, Mark [mailto:[EMAIL PROTECTED]] Sent: 08 October 2002 11:44 Resin is much better than Tomcat. Andrew Hill wrote: (Or tell em they can have any container so long as its Tomcat? (This would be my choice if I was dictator for life ;-)) -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- -- --- Copyright material and/or confidential and/or privileged information may be contained in this e-mail and any attached documents. The material and information is intended for the use of the intended addressee only. If you are not the intended addressee, or the person responsible for delivering it to the intended addressee, you may not copy, disclose, distribute, disseminate or deliver it to anyone else or use it in any unauthorised manner or take or omit to take any action in reliance on it. To do so is prohibited and may be unlawful. The views expressed in this e-mail may not be official policy but the personal views of the originator. If you receive this e-mail in error, please advise the sender immediately by using the reply facility in your e-mail software, or contact [EMAIL PROTECTED] Please also delete this e-mail and all documents attached immediately. Many thanks for your co-operation. BMW Financial Services (GB) Limited is registered in England and Wales under company number 01288537. Registered Offices : Europa House, Bartley Way, Hook, Hants, RG27 9UF --- --- -- -- -- 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] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:struts-user-[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.393 / Virus Database: 223 - Release Date: 30/09/2002 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.393 / Virus Database: 223 - Release Date: 30/09/2002 -- 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] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
1.1 release date?
I am interested in using Struts 1.1 for an upcoming project because of the added features (especially validation). However, I don't want to use beta software in a production release. Is there a target date for 1.1rel? thx andy -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: 1.1 release date?
That's what I like to hear. Thx for the info. What is the process for contributing to the Struts project? Is there a doc that lays out what one needs to do (e.g. to setup CVS, to claim bugs in Bugzilla, that sort of thing)? -Original Message- From: David Graham [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 02, 2002 12:13 To: [EMAIL PROTECTED] Subject: Re: 1.1 release date? I understand not wanting to use a beta version but it has really worked well for me. All the stuff I was using in 1.0.2 still works and the new stuff I've tried works as well (plugins, map backed form fields, exception handling). Dave From: Eddie Bush [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: 1.1 release date? Date: Wed, 02 Oct 2002 10:54:52 -0500 Well said, David! While there is no date set, there are bugs to be squashed. If you find yourself able to contribute patches to fix things that are wrong, you will be able to hurry the final release ;-) These Jakarta folk don't release on a time-line, but, instead, on a merit-line. When the software is decided to be worthy of the Jakarta name, it will be stamped final - not before. Craig said at some point in the past how final releases are just nightly builds that the developers think have been tested enough (that's a misquote, but you get the jist). Hop right in and put your heel down on a bug or two! That's the best way you can ensure a quicker release :-D If you're close to release and don't feel secure using the 1.1 code-base, by all means, use 1.0.2. If you're not so close to release, probably 1.1 would be best. In the end, it's a judgement call only you can make ;-) Have you actually tried a nightly build? There's a *lot* of added functionality there. If you're on a container adhering to jsp specification 1.2, the addition of the Struts-EL taglib could save you a lot of hassle! David Graham wrote: no From: Andy Kriger [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: 1.1 release date? Date: Wed, 2 Oct 2002 11:20:08 -0400 I am interested in using Struts 1.1 for an upcoming project because of the added features (especially validation). However, I don't want to use beta software in a production release. Is there a target date for 1.1rel? thx andy -- Eddie Bush -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ Chat with friends online, try MSN Messenger: http://messenger.msn.com -- 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]
logic:iterate question
I have two vectors of the same length. I can iterate over one and retrieve values. How can I use the index of that iteration to reference the other vector? For example vOne = { 1,2,3,4 } vTwo = { a,b,c,d } I iterate over vOne producing 1,2,3,4, logic:iterate id='item' name='vOne' indexId='idx' bean:write name='item'/, /logic:iterate How can I get the output to produce 1:a,2:b,3:c,4:d,? (note the formatting is not important, just interested in how to reference vTwo using vOne's idx) thx -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
can ActionError be returned by Action?
Is there any way that an ActionErrors object can be returned by Action.perform (in the same way it can be returned by ActionForm.validate)? I would like to use the html:errors tags in my JSP to handle output from exceptions received in the Action.perform method. But I'm not sure how to set the html:errors property since I can't return the ActionErrors object directly. Is there a way to make this work? thx andy -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: can ActionError be returned by Action?
never mind - found it for those wondering - in an Action class... ActionErrors errors = new ActionErrors(); request.setAttribute(this.ERROR_KEY, errors); -Original Message- From: Andy Kriger [mailto:[EMAIL PROTECTED]] Sent: Friday, September 27, 2002 12:40 To: Struts Users Mailing List Subject: can ActionError be returned by Action? Is there any way that an ActionErrors object can be returned by Action.perform (in the same way it can be returned by ActionForm.validate)? I would like to use the html:errors tags in my JSP to handle output from exceptions received in the Action.perform method. But I'm not sure how to set the html:errors property since I can't return the ActionErrors object directly. Is there a way to make this work? thx andy -- 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]
form validation text coloring question
I would like to have our form change text color of field labels to red if they are required fields that were not filled out when the form was submitted (a common feature of forms). Currently, we are doing custom validation that sets a flag. The JSP checks this flag in logic:present tags and creates the a font/font wrapper around the field label that sets the text color to red. This is quite cumbersome as it puts a lot of logic tags into the code. The html:errors does not work since it just adds additional text and it can't wrap existing text. What solutions have folks come up with for this problem? thx andy -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: dynamic img src attribute
That is neat - but I'm not talking about query parameters. I'm talking about the src string itself. -Original Message- From: Danny Mui [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 19, 2002 15:39 To: Struts Users Mailing List Subject: Re: dynamic img src attribute html:img ... / accepts a page (context sensitive) or a src (no mucking around). similar to the html:link / tag you can provide a map to have it generate the URL components for you, Map linkMap = new HashMap(); linkMap.put(image, image222311.jpg); linkMap.put(application, photos); html:img page=/image.do name=someBean property=linkMapProperty / and it will generate : /image.do?image=image222311.jpgapplication=photos I find that neat :) danny Andy Kriger wrote: I tried asking this few days ago when my understanding of struts was significantly less than it is now (and I didn't phrase my question very well at that). Here's what I'd like to do... img src='dynamically generated path stored in a bean' / with the constraint that I'd like to avoid the % % syntax (i want to keep the JSP free of these things completely for the sake of the content generating folks that don't know Java/JSP code). Is there a struts taglib or other taglib that allows you to do something like... img param name='src' bean='myBean' property='beanProp' scope='beanScope' /img thx andy -- 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] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]