RE: [OT] - JSTL Parameter Conventions
Well, I briefly looked at it. It might not be what I am looking for if I cannot use it within my Actions, and not just on the JSP. Like I said, I haven't look at it too much yet though. Daniel -Original Message- From: David Durham [mailto:[EMAIL PROTECTED] Sent: Thursday, May 11, 2006 1:41 PM To: Struts Users Mailing List Subject: Re: [OT] - JSTL Parameter Conventions Kalcevich, Daniel wrote: > Dang, I must have been spacing when I was looking on the Jakarta Site > earlier. Thanks Dave. I wasn't sure if that's what you needed or not. Good to hear that it is. -Dave - 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] - JSTL Parameter Conventions
Dang, I must have been spacing when I was looking on the Jakarta Site earlier. Thanks Dave. Daniel -Original Message- From: David Durham [mailto:[EMAIL PROTECTED] Sent: Thursday, May 11, 2006 1:15 PM To: Struts Users Mailing List Subject: Re: [OT] - JSTL Parameter Conventions Kalcevich, Daniel wrote: > Everyone, > > Does anyone know of a tool or library that can be used to perform > similar operations as JSTL does with arguments like ${object.method}? I > need to build a String that has to have arguments replaced on the fly > and thought if I could find something like how JSTL does it, that it > would work for me. Thanks in advance. Commons-EL, right? http://jakarta.apache.org/commons/el/ -Dave - 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]
[OT] - JSTL Parameter Conventions
Everyone, Does anyone know of a tool or library that can be used to perform similar operations as JSTL does with arguments like ${object.method}? I need to build a String that has to have arguments replaced on the fly and thought if I could find something like how JSTL does it, that it would work for me. Thanks in advance. Daniel
Struts DTD on Classpath
Everyone, Someone told me about this feature, but I am not sure if/where it exists. Is it possible to tell Struts to use the DTD for the Struts-config file from the classpath (as I see it in the Struts.jar), and not from the URL? I want to avoid the dependencies on the Struts website, in the event that it is down. (as it is down at the time of this writing) I am running on Struts 1.2.8. Any help is appreciated. Thanks. Daniel
RE: Mask validation
You could use the minlength validation then as well, and then if you use Struts HTML Tags, set the maxlength=8 on the text box. That way the user would be required to entered in at least 8 (as dictated by the minlength) and no more than 8 (as dictated by the maxlength on the input box). Does that do what you are looking for? Daniel -Original Message- From: Marisol Opreni [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 25, 2006 7:40 AM To: 'Struts Users Mailing List' Subject: RE: Mask validation I need to be 8 characters, nor more neither less... -Mensaje original- De: Kalcevich, Daniel [mailto:[EMAIL PROTECTED] Enviado el: Martes, 25 de Abril de 2006 11:33 a.m. Para: Struts Users Mailing List Asunto: RE: Mask validation Remove the {8} from the Mask and also include the maxlength validation on that field. Something like this: maxlength 8 mask ^[a-zA-Z0-9\]*$ Daniel -Original Message- From: Marisol Opreni [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 25, 2006 7:30 AM To: 'Struts Users Mailing List' Subject: Mask validation Hi. How can I specify a mask with letters, underscores and numbers with only 8 charaters in total? Something like this? [a-zA-Z0-9]{8}$ Thanks! Marisol. - 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: Mask validation
Remove the {8} from the Mask and also include the maxlength validation on that field. Something like this: maxlength 8 mask ^[a-zA-Z0-9\]*$ Daniel -Original Message- From: Marisol Opreni [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 25, 2006 7:30 AM To: 'Struts Users Mailing List' Subject: Mask validation Hi. How can I specify a mask with letters, underscores and numbers with only 8 charaters in total? Something like this? [a-zA-Z0-9]{8}$ Thanks! Marisol. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: ArrayList & html:options
I think maybe using the LabelValueBean is the most realistic option. I have several places where I am using that now anyways. Thanks Wendy. Daniel -Original Message- From: Wendy Smoak [mailto:[EMAIL PROTECTED] Sent: Monday, April 17, 2006 2:32 PM To: Struts Users Mailing List Subject: Re: ArrayList & html:options On 4/17/06, Kalcevich, Daniel <[EMAIL PROTECTED]> wrote: > Changing that to: > > > > > > Now produces this error: > > 15:55:34,494 ERROR [action]:253 - Servlet.service() for servlet action > threw exception > javax.servlet.jsp.JspException: ServletException in > '/jsp/templates/tab_content_template.jsp': ServletException in > '/jsp/fine_export.jsp': No name specified ... > Could it have something to do with not specifying the label or the value > as well? Possibly. http://struts.apache.org/struts-el/tagreference-struts-html-el.html#html :options Getting the options tag to do what I want it to has always been a matter of trial and error. I usually use Maps, so none of my examples is relevant. You might want to look at the 'optionsCollection' tag, or even consider doing the iteration yourself with and . -- Wendy - 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: ArrayList & html:options
Changing that to: Now produces this error: 15:55:34,494 ERROR [action]:253 - Servlet.service() for servlet action threw exception javax.servlet.jsp.JspException: ServletException in '/jsp/templates/tab_content_template.jsp': ServletException in '/jsp/fine_export.jsp': No name specified at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTa g.java:923) at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:462) at org.apache.jsp.jsp.templates.main_005ftemplate_jsp._jspx_meth_tiles_inse rt_1(org.apache.jsp.jsp.templates.main_005ftemplate_jsp:160) at org.apache.jsp.jsp.templates.main_005ftemplate_jsp._jspService(org.apach e.jsp.jsp.templates.main_005ftemplate_jsp:88) Could it have something to do with not specifying the label or the value as well? Daniel -Original Message- From: Wendy Smoak [mailto:[EMAIL PROTECTED] Sent: Monday, April 17, 2006 1:52 PM To: Struts Users Mailing List Subject: Re: ArrayList & html:options On 4/17/06, Kalcevich, Daniel <[EMAIL PROTECTED]> wrote: > request.setAttribute( "exportDates", exportDates ); //exportDates = > ArrayList > > JSP: > > > > > > Error: > 15:38:53,106 ERROR [action]:253 - Servlet.service() for servlet action > threw exception > javax.servlet.jsp.JspException: ServletException in > '/jsp/templates/tab_content_template.jsp': ServletException in > '/jsp/fine_export.jsp': Cannot find bean under name [04/17/2006, > 04/16/2006] You don't need the expression in the 'collection' attribute. It wants the _name_ of the bean. You can see from the error message that the String representation of the ArrayList is getting passed into the tag. Try using just: -- Wendy - 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]
ArrayList & html:options
Everyone, I am trying to use the htm-el:options tag to write out the value of a Select box. I am using an ArrayList of Strings that I am trying to iterate over. I want the value and option to be the same on the output. Here is how I am calling my code... Action: request.setAttribute( "exportDates", exportDates ); //exportDates = ArrayList JSP: Error: 15:38:53,106 ERROR [action]:253 - Servlet.service() for servlet action threw exception javax.servlet.jsp.JspException: ServletException in '/jsp/templates/tab_content_template.jsp': ServletException in '/jsp/fine_export.jsp': Cannot find bean under name [04/17/2006, 04/16/2006] at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTa g.java:923) at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:462) at org.apache.jsp.jsp.templates.main_005ftemplate_jsp._jspx_meth_tiles_inse rt_1(org.apache.jsp.jsp.templates.main_005ftemplate_jsp:160) at org.apache.jsp.jsp.templates.main_005ftemplate_jsp._jspService(org.apach e.jsp.jsp.templates.main_005ftemplate_jsp:88) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) Any ideas would be greatly appreciated. Thanks. Daniel
RE: forwarding vs redirecting issue
You can use tokens within the Action classes to help prevent multiple submits. Take a look at the Action Servlet Java Doc for the following methods: isTokenValid( request ) resetToken( request ) saveToken( request ) We are using tokens in our app right now. We do something like the following: If( isTokenValid( request ) ) { //Insert to DB resetToken( request ); } else { //select from DB } saveToken( request ); HTH, Daniel -Original Message- From: Chris Cheshire [mailto:[EMAIL PROTECTED] Sent: Monday, March 27, 2006 10:11 AM To: Struts Users Mailing List Subject: forwarding vs redirecting issue Hi, I have a design issue based around form submission, protecting against resubmission etc. I have seen a couple of design "guidelines" that seem to conflict. 1) Use the session as little as possible (memory issues etc) 2) Use forwards where possible as requests can be passed along, with original information preserved, as well as speeding up communication. Now the only problem I face is after an action is complete, if I forward to a JSP, that action is open to resubmission when the user starts playing with the reload and back buttons on their browser. Redirects, because of the URL changing, can help protect against this. So the solution seems to be to place the beans required by the JSP page in displaying the result of the action in the session instead. So now there is an issue of when do the objects for the action that was just performed get removed from the session? Do I just put something in the start of each action to remove from the session all objects not associated with that action? Thanks Chris - 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]
Struts-EL Tag Question
I have a collection in the Request called "processes" which is an array list of a Transfer Object I use in my application. I am trying to make the following call from my JSP: I am getting the following error: javax.servlet.jsp.JspException: No valid collection specified for size tag at org.apache.struts.taglib.bean.SizeTag.doStartTag(SizeTag.java:165) at org.apache.strutsel.taglib.bean.ELSizeTag.doStartTag(ELSizeTag.java:137) at org.apache.jsp.jsp.batch_005fprocesses_jsp._jspService(org.apache.jsp.js p.batch_005fprocesses_jsp:133) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) Any ideas why the collection cannot be resolved? I'm on Tomcat 5.5.12 using JSTL 1.1. Daniel
[OT] JSTL question
I am trying to access a session object where the key is the field "ACCOUNT_PROFILE_SESSION_ATTRIBUTE" in a Constants JAVA file called "GlobalConstants". I created a wrapper around it that extends Map (JSTLConstants) to contain all the constants so I could access it via JSTL. I am trying to do the following: My question is, how can I use the GlobalConstants.ACCOUNT_PROFILE_SESSION_ATTRIBUTE value to lookup my object in the Session using JSTL? Dan
RE: Using saveToken and isTokenValid
What about putting the saveToken(request) at the bottom of the second action as well? This will put a new token into the request in the event you want to submit again. Dan -Original Message- From: starki78 [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 14, 2006 7:08 AM To: user Subject: Using saveToken and isTokenValid Hi, I try to create a solution that prevents several submits. Therefore I place at the end of the first action: saveToken(request); and in the second: if (!isTokenValid(request,true)) { // duplicate submit, return some error message to user ActionMessage msg = new ActionMessage("errors.DuplicateSubmit","Don't submit twice"); messages.add("msg", msg); saveMessages(request, messages); return mapping.findForward("error"); } else { normal processing } The result is that then I click three times I get the warning that I would like to know but the first request isn't executed excecuted anymore. Can you help me? Has someone a similar solution? Nice greetings Starky - 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: html:errors
Try using the tag if you wish to check for the existence of errors on a JSP page. Or this link provides some help info regarding the errors object. http://husted.com/struts/tips/017.html -Original Message- From: fea jabi [mailto:[EMAIL PROTECTED] Sent: Friday, March 10, 2006 9:48 AM To: user@struts.apache.org Subject: html:errors is returning an how to determine the length of the list? would like to check if it has more than one error for this property? Thanks. _ Don't just search. Find. Check out the new MSN Search! http://search.msn.click-url.com/go/onm00200636ave/direct/01/ - 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]How Come My Image File is Surrounded by a Box?
Try specifying border="0" on the image tag. -Original Message- From: Caroline Jen [mailto:[EMAIL PROTECTED] Sent: Thursday, March 09, 2006 2:02 PM To: user@struts.apache.org Subject: [OT]How Come My Image File is Surrounded by a Box? I am trying to display an image. The image is displayed successfully; however, there is a box (I do not have a clue where the box comes from) surrounding the image. I cannot get rid of the box. The image is a link; therefore, it leads me to think that the box may be the 'underline' of the link (I can be wrong on this.) But I am having difficult time with the problem. OKay, I have a JSP page and a Master.css file. In the Master.css file, I changed color of some background color and text color of the JSP page. Those color changes reflect in my JSP page. Therefore, I believe the JSP page has found the Master.css. Am I correct? In the same Master.css file, I also have: code: --- A:link{ text-decoration:none;} --- but, all the links in my JSP page still have an 'underline'. Does the box around my image have something to do with the 'underline'? Why my JSP page cannot pick up the {text-decoration:none;} in the Master.css file? If the box has nothing to do with the 'underline', then, where does the box come from? How do I suppress it? Thank you very much. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.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: WARNING: No FormBeanConfig found under 'CustomerOpen'. --- What is this?
Do you have a formBean named "CustomerOpen" defined in the your Struts Config File? If not, that would probably be the cause of the warning. -Original Message- From: Morten Egelund Rasmussen [mailto:[EMAIL PROTECTED] Sent: Monday, March 06, 2006 11:41 AM To: user@struts.apache.org Subject: WARNING: No FormBeanConfig found under 'CustomerOpen'. --- What is this? Hi all! I am using Struts 1.2.8 on an Oracle Application Server (OC4J) with the following excerpt in my struts-config.xml: . .. My CustomerOpenAction looks something like this: -- public class CustomerOpenAction extends Action { public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { return mapping.findForward("success"); } } -- Every time I execute this action, I get this warning in my log-file: > [timestamp here] org.apache.struts.util.RequestUtils createActionForm > WARNING: No FormBeanConfig found under 'CustomerOpen' I've been googling the web for a while now, and it seems like lots of people have encountered this warning, but I cannot find any solution to it. What does this mean, and how do I avoid it? ~Morten - 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: How To Use Existing Tags to Test and Write Out the Value of the Size of a Collection?
You can use the , , or tags. http://struts.apache.org//struts-doc-1.2.8/userGuide/struts-logic.html#g reaterThan -Original Message- From: Caroline Jen [mailto:[EMAIL PROTECTED] Sent: Monday, March 06, 2006 11:06 AM To: user@struts.apache.org Subject: How To Use Existing Tags to Test and Write Out the Value of the Size of a Collection? I have a Collection called 'remarks'. I can use the or tags to test out if the Collection has some elements in it or not. 1. Is there any tag I can use to test the size value of that Collection to be zero or greater than zero? Or I have to use the Java code in my JSP page? 2. Is there any tag I can use to output the remarks.size(); to the browser? I simply think that it should not be too much Java code in a JSP page. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.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: Struts-EL
Wendy, That was it. My taglib definition was wrong. But for reference purposes, I am using Tomcat 5.5.12 and whatever JSTL version came with Struts 1.2.8, which is 1.0 (I think?). Daniel -Original Message- From: Wendy Smoak [mailto:[EMAIL PROTECTED] Sent: Monday, March 06, 2006 9:09 AM To: Struts Users Mailing List Subject: Re: Struts-EL On 3/6/06, Kalcevich, Daniel <[EMAIL PROTECTED]> wrote: > I would like to setup Struts-EL in my application. I am currently > running Struts 1.2.8 with Spring. I did the following: > > 1. Added the Struts-el.jar, jstl.jar, and standard.jar to my > WEB-INF/lib. > 2. Added the line "<%@ taglib prefix="c" > uri="http://java.sun.com/jsp/jstl/core"; %>" to my JSP Page > 3. Changed the Struts tag library to refer to the logic-el one. > > When I try to use the tag in my page, it is not evaluating the > expression correctly. It just writes it out as is, with the ${expr} > dollar sign and bracket around it. What am I missing? Thanks for stating what version of Struts you're using. :) We also need to know what version of the Servlet specification (or what version of what container if you're not sure). If youre using Servlet 2.3 and JSTL 1.0, then it should be: <%@ taglib uri="http://java.sun.com/jstl/core"; prefix="c" %> (No 'jsp' in the uri.) If you're using Servlet 2.4, the answer changes. -- Wendy - 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]
Struts-EL
I would like to setup Struts-EL in my application. I am currently running Struts 1.2.8 with Spring. I did the following: 1. Added the Struts-el.jar, jstl.jar, and standard.jar to my WEB-INF/lib. 2. Added the line "<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"; %>" to my JSP Page 3. Changed the Struts tag library to refer to the logic-el one. When I try to use the tag in my page, it is not evaluating the expression correctly. It just writes it out as is, with the ${expr} dollar sign and bracket around it. What am I missing? Daniel
RE: Logic Tag Question
Laurie, I changed the code to be: Any it still does not write out the value that matches the accountProfile.getTimeZone() field. Any other ideas? -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Laurie Harper Sent: Saturday, March 04, 2006 6:01 PM To: user@struts.apache.org Subject: Re: Logic Tag Question Change "${tz}.value" to "${tz.value}". Kalcevich, Daniel wrote: > The is fine. I know that works. The problem is with the > logic:equal comparion. > > >value="${tz}.value"> > > > > > How can I say that the value I want to check against if the getValue() > method from the "tz" variable? > > -Original Message- > From: Michael Jouravlev [mailto:[EMAIL PROTECTED] > Sent: Friday, March 03, 2006 1:29 PM > To: Struts Users Mailing List > Subject: Re: Logic Tag Question > > On 3/3/06, Kalcevich, Daniel <[EMAIL PROTECTED]> wrote: >> >> But the problem is that the "value" that I want to compare in the >> logic:equal tag is really ${tz}.value. But how can I set the value to >> the "getValue()" from the "tz" variable. > > None of these works? > > > > > > Michael. > > - > 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: Logic Tag Question
The is fine. I know that works. The problem is with the logic:equal comparion. How can I say that the value I want to check against if the getValue() method from the "tz" variable? -Original Message- From: Michael Jouravlev [mailto:[EMAIL PROTECTED] Sent: Friday, March 03, 2006 1:29 PM To: Struts Users Mailing List Subject: Re: Logic Tag Question On 3/3/06, Kalcevich, Daniel <[EMAIL PROTECTED]> wrote: > > But the problem is that the "value" that I want to compare in the > logic:equal tag is really ${tz}.value. But how can I set the value to > the "getValue()" from the "tz" variable. None of these works? Michael. - 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: Logic Tag Question
OK, I am now able to get the iterate tag to work, but the comparison is still not working. I have this now: But the problem is that the "value" that I want to compare in the logic:equal tag is really ${tz}.value. But how can I set the value to the "getValue()" from the "tz" variable. Daniel -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, March 03, 2006 12:52 PM To: Struts Users Mailing List Subject: Re: Logic Tag Question If I am not mistaking you will use either the collection or the property attribute but not both. http://struts.apache.org/struts-taglib/tagreference-struts-logic.html#lo gic:iterate For each iteration of the loop you should be able to compare the value of the id property in you logic:equal tag to the forms value by saying //do something Bryan LaPlante -- Original Message --- From: "Kalcevich, Daniel" <[EMAIL PROTECTED]> To: user@struts.apache.org Sent: Fri, 3 Mar 2006 12:21:18 -0800 Subject: Logic Tag Question > I have the following: > > - An ArrayList in the ServletContext called > "timezones" > > - A Form Bean in the request scope called "accountProfileForm" > > I want to be able to loop through the values in the "timezones" > attribute and compate the "value" to the value of the "timeZone" in the > "accountProfileForm". Here is what I am trying: > > > >value="timeZones.value"> > > > > > > > > I get the following error: > > 12:16:59,031 ERROR [action]:253 - Servlet.service() for servlet action > threw exception > > javax.servlet.jsp.JspException: ServletException in > '/jsp/templates/tab_content_template.jsp': ServletException in > '/jsp/account/account_profile_form.jsp': Cannot create iterator for this > collection > > at > org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTa > g.java:923) > > Can someone point me in the right direction or let me know what is wrong > with the above? Thanks. > > Daniel --- End of Original Message --- - 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]
Logic Tag Question
I have the following: - An ArrayList in the ServletContext called "timezones" - A Form Bean in the request scope called "accountProfileForm" I want to be able to loop through the values in the "timezones" attribute and compate the "value" to the value of the "timeZone" in the "accountProfileForm". Here is what I am trying: I get the following error: 12:16:59,031 ERROR [action]:253 - Servlet.service() for servlet action threw exception javax.servlet.jsp.JspException: ServletException in '/jsp/templates/tab_content_template.jsp': ServletException in '/jsp/account/account_profile_form.jsp': Cannot create iterator for this collection at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTa g.java:923) Can someone point me in the right direction or let me know what is wrong with the above? Thanks. Daniel
Modules Problem
Everyone, I have two modules: / & /app. /app is protected by a Servlet Filter and is used for all actions after you have authenticated yourself. I am having a problem when I try to declare a form in a JSP page that is referenced by an action within the /app module. I am trying to define the following in the JSP: In my config file for the / module, I have the following definitions: ... ... ... I am getting the following exception: javax.servlet.jsp.JspException: Cannot retrieve mapping for action /logout at org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:753) at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:443) at org.apache.jsp.jsp.nav.header_jsp._jspx_meth_html_form_0(org.apache.jsp. jsp.nav.header_jsp:144) at org.apache.jsp.jsp.nav.header_jsp._jspService(org.apache.jsp.jsp.nav.hea der_jsp:86) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja va:322) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica tionFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt erChain.java:173) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatc her.java:672) at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDisp atcher.java:574) at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispat cher.java:499) at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.ja va:966) at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:6 04) at org.apache.struts.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:99) at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:135) at org.apache.struts.taglib.tiles.InsertTag.doInclude(InsertTag.java:760) at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTa g.java:892) at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:462) at org.apache.jsp.jsp.templates.main_005ftemplate_jsp._jspx_meth_tiles_inse rt_0(org.apache.jsp.jsp.templates.main_005ftemplate_jsp:142) at org.apache.jsp.jsp.templates.main_005ftemplate_jsp._jspService(org.apach e.jsp.jsp.templates.main_005ftemplate_jsp:82) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja va:322) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica tionFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt erChain.java:173) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatc her.java:672) at org.apache.catalina.core.ApplicationDispatcher.processRequest(Applicatio nDispatcher.java:463) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDisp atcher.java:398) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispat cher.java:301) at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.jav a:1063) at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProc essor.java:263) at org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(Til esRequestProcessor.java:239) at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(Tiles RequestProcessor.java:302) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java: 229) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414) at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
Logic Tag Question
Everyone, I have two modules defined (/ & /app). I want to use the logic tag (either redirect or forward) to take me to the URL "/myApp/index.htm" when I enter in just "/myApp/". I have defined an action within the "/" module Struts Config File that is called "/index" and forwards to a Tiles Definition. My question is, what syntax can I use on the index.jsp page at the root of my site to forward to that URL? Thanks. daniel
validWhen - checkbox question
Everyone, I have two fields: 1. trackingEnabled - checkbox 2. repeatOffendersDaysBack - text (int) for number of days going back to check The rule for these fields are this: if trackingEnabled is checked, then the repeatOffendersDaysBack is required. Otherwise, repeatOffendersDaysBack is not. I am trying to write my validation for this. I have something like the following: test ((trackingEnabled == null) or (*this* != null)) My question is do I need to do anything special for checkbox comparisons in the validwhen? I have seen people saying to use null, or 'false', 'on', etc. and I am just trying to verify. Thanks. Daniel
RE: Validator Question
This would be useful to indicate on the Validator portion of the Struts User guide on the website. I think knowing that information is an important aspect of the email validation. -Original Message- From: Tom Ansley [mailto:[EMAIL PROTECTED] Sent: Monday, February 06, 2006 8:33 AM To: Struts Users Mailing List Subject: Re: Validator Question The email rule does that for you. If you do not enter an email address the rule is not applied. If you enter an email address the rule is applied to make sure the email is valid. Cheers Tom On 2/6/06, Tom Ansley <[EMAIL PROTECTED]> wrote: > > The email rule does that for you. If you do not enter an email address > the > rule is not applied. If you enter an email address the rule is applied to > make sure the email is valid. > > Cheers > Tom > > -Original Message- > From: Kalcevich, Daniel [mailto:[EMAIL PROTECTED] > Sent: Monday, February 06, 2006 8:32 AM > To: Struts Users Mailing List > Subject: RE: Validator Question > > So then how would you test a field that is not required to enter a value > into, but if the user does, it must be a valid email address? That is > what > I am ultimately looking for. Is there a way to achieve this using the > validators that exist already, or do I need to create my own? > > Daniel > > -Original Message- > From: Niall Pemberton [mailto:[EMAIL PROTECTED] > Sent: Friday, February 03, 2006 5:02 PM > To: Struts Users Mailing List > Subject: Re: Validator Question > > You shouldn't need to use validwhen to do what you describe - try just > using > email... > > > > > > If however you do have reasons for using validwhen then the thing to > remember is that the "test" variable specifies the condition when the > field > is valid. So what you have specified is that this field is valid when > "notificationBcc" is null - otherwise it is invalid. So any value you > enter > in that field will cause a validation error. More recent versions of > Struts > (from 1.2.7 I think) include a "validwhen" examples page in the > struts-examples webapp - which is included in the binary distro. > > Niall > > - Original Message - > From: "Kalcevich, Daniel" <[EMAIL PROTECTED]> > Sent: Friday, February 03, 2006 11:26 PM > > > Everyone, > > I am using the validator to validate an email address in a text field. > The field is not required, but when there is a value in there, I want it > to be a valid email address. Here is my XML, > > > > > > > > > > test > > (*this* == null) > > > > > > But when I enter the value '[EMAIL PROTECTED]' I get an error > message saying the field is required. Any ideas? Thanks. > > Daniel > > > > > > > - > 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: Validator Question
So then how would you test a field that is not required to enter a value into, but if the user does, it must be a valid email address? That is what I am ultimately looking for. Is there a way to achieve this using the validators that exist already, or do I need to create my own? Daniel -Original Message- From: Niall Pemberton [mailto:[EMAIL PROTECTED] Sent: Friday, February 03, 2006 5:02 PM To: Struts Users Mailing List Subject: Re: Validator Question You shouldn't need to use validwhen to do what you describe - try just using email... If however you do have reasons for using validwhen then the thing to remember is that the "test" variable specifies the condition when the field is valid. So what you have specified is that this field is valid when "notificationBcc" is null - otherwise it is invalid. So any value you enter in that field will cause a validation error. More recent versions of Struts (from 1.2.7 I think) include a "validwhen" examples page in the struts-examples webapp - which is included in the binary distro. Niall ----- Original Message - From: "Kalcevich, Daniel" <[EMAIL PROTECTED]> Sent: Friday, February 03, 2006 11:26 PM Everyone, I am using the validator to validate an email address in a text field. The field is not required, but when there is a value in there, I want it to be a valid email address. Here is my XML, test (*this* == null) But when I enter the value '[EMAIL PROTECTED]' I get an error message saying the field is required. Any ideas? Thanks. Daniel - 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]
Validator Question
Everyone, I am using the validator to validate an email address in a text field. The field is not required, but when there is a value in there, I want it to be a valid email address. Here is my XML, test (*this* == null) But when I enter the value '[EMAIL PROTECTED]' I get an error message saying the field is required. Any ideas? Thanks. Daniel
RE: Valid When Question
That worked perfectly. Thank you! -Original Message- From: Niall Pemberton [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 31, 2006 8:26 AM To: Struts Users Mailing List Subject: Re: Valid When Question Maybe something like the following test ((*this* != null) or ((phone2 == null) and (phone3 == null))) test ((*this* != null) or ((phone1 == null) and (phone3 == null))) test ((*this* != null) or ((phone1 == null) and (phone2 == null))) Niall - Original Message - From: "Kalcevich, Daniel" <[EMAIL PROTECTED]> To: Sent: Tuesday, January 31, 2006 4:06 PM Subject: Valid When Question Everyone, I have a question regarding the Valid When. I have 3 fields for phone number (declared as phone1, phone2, phone3). Now, the field as a whole is not required, however, if a user enters in some data, I want to make sure they enter in values for all 3. So, on a validWhen I would want the logic to be "its required when data is entered in either of the other two fields". Can someone give any advice into how I can declare this in my validator XML file? Thanks. Daniel - 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]
Valid When Question
Everyone, I have a question regarding the Valid When. I have 3 fields for phone number (declared as phone1, phone2, phone3). Now, the field as a whole is not required, however, if a user enters in some data, I want to make sure they enter in values for all 3. So, on a validWhen I would want the logic to be "its required when data is entered in either of the other two fields". Can someone give any advice into how I can declare this in my validator XML file? Thanks. Daniel