RE: Stripping Out Characters (Parenthesis)
Nobody can tell me why struts removes the parenthesis characters out of string entered into a text box? We have a work around but I've got to think somebody knows what I'm doing wrong here. -Original Message- From: Ratner Glenn A Sent: Thursday, July 09, 2009 10:39 AM To: 'Struts Users Mailing List' Subject: Stripping Out Characters I'm new to struts and work on an application with existing struts code. I have a text field in a .jsp and when doing the post struts seems to be automatically removing certain special characters from the string in the text field. In particular, it's removing these non-alpha characters: ( and ) Is there some configuration at the struts level to declare which characters to allow or not allow? I searched but could not find any info. Thanks, Glenn The information contained in this e-mail, and any attachment, is confidential and is intended solely for the use of the intended recipient. Access, copying or re-use of the e-mail or any attachment, or any information contained therein, by any other person is not authorized. If you are not the intended recipient please return the e-mail to the sender and delete it from your computer. Although we attempt to sweep e-mail and attachments for viruses, we do not guarantee that either are virus-free and accept no liability for any damage sustained as a result of viruses. Please refer to http://disclaimer.bnymellon.com/eu.htm for certain disclosures relating to European legal entities. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Stripping Out Characters
I'm new to struts and work on an application with existing struts code. I have a text field in a .jsp and when doing the post struts seems to be automatically removing certain special characters from the string in the text field. In particular, it's removing these non-alpha characters: ( and ) Is there some configuration at the struts level to declare which characters to allow or not allow? I searched but could not find any info. Thanks, Glenn The information contained in this e-mail, and any attachment, is confidential and is intended solely for the use of the intended recipient. Access, copying or re-use of the e-mail or any attachment, or any information contained therein, by any other person is not authorized. If you are not the intended recipient please return the e-mail to the sender and delete it from your computer. Although we attempt to sweep e-mail and attachments for viruses, we do not guarantee that either are virus-free and accept no liability for any damage sustained as a result of viruses. Please refer to http://disclaimer.bnymellon.com/eu.htm for certain disclosures relating to European legal entities. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
validwhen not working
Hi all, new to using validator. I have validator working on most of my applicaiton but having a problem doing a validwhen. I've been using the examples in the Jakarta Struts Cookbook. Here is my question(s): I've noticed that javascript code is generated unique to the form name. However, when I setup a validwhen for the form no form specific javascript code gets generated. If I include date in the depends attribute I do get javascript code to do the date validation but nothing to deal with the validwhen? So in my example, I have a page called Spiffs. The form name is SpiffsForm and I've included the html:javascript formName=SpiffsForm cdata=false/ tag in the page. I have two date/text fields (startDate,endDate) which are optional however, when one is populated the other date field needs to be populated. The validation.xml file reads form name=SpiffsForm field property=spiffFilter.startDateAsString depends=validwhen arg key=spiffs.prompt.startDate position=0/ var var-nametest/var-name var-value((spiffFilter.endDateAsString == null) or (*this* != null))/var-value /var /field field property=spiffFilter.endDateAsString depends=validwhen arg key=spiffs.prompt.endDate position=0/ var var-nametest/var-name var-value((spiffFilter.startDateAsString == null) or (*this* != null))/var-value /var /field /form I'm using Struts 1.3.5 with validator 1.3.0 on a Tomcat 5.5 instance. Any help would be appreciated. -Glenn _ Mortgage rates near historic lows. Refinance $200,000 loan for as low as $771/month* https://www2.nextag.com/goto.jsp?product=10035url=%2fst.jsptm=ysearch=mortgage_text_links_88_h27f8disc=yvers=689s=4056p=5117 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LazyLists
Thanks for the help its very appreciated. This code has been working for over a year without any problems in a Java 1.4 and J2EE 1.3. The LazyList hand cranking can be found here: http://wiki.apache.org/struts/StrutsCatalogLazyList Here are the plain methods in the InsuranceForm: private BeneficiaryVO beneficiary = new BeneficiaryVO(); /** * Methods to hand crank Beneficiary lazy list */ public List getBeneficiaries() { return beneficiaries; } public BeneficiaryVO getBeneficiaries(int index) { while (index = beneficiaries.size()) { beneficiaries.add(new BeneficiaryVO()); } return (BeneficiaryVO) beneficiaries.get(index); } public void setBeneficiaries(BeneficiaryVO beneficiaryVO) { beneficiaries.add(beneficiaryVO); } public void populateBeneficiaries(List beneficiaries) { this.beneficiaries.addAll(beneficiaries); } public void resetBeneficiaries(List beneficiaries) { this.beneficiaries = beneficiaries; } This is the error I get:[Servlet Error]-[action]: * javax.servlet.jsp.el.ELException*: Unable to find a value for beneficiaries in object of class hronline.secure.personal.insurances.InsuranceForm using operator . I have debugged the code in the debugger and there is data in the Beneficiaries list (just before exiting the ActionForm). Also, the InsuranceForm has other attributes that are displayable. Here is the wierd part... if I comment out this method: public BeneficiaryVO getBeneficiaries(int index) { while (index = beneficiaries.size()) { beneficiaries.add(new BeneficiaryVO()); } return (BeneficiaryVO) beneficiaries.get(index); } the page is now displayed, no error. However the application won't work since it needs the method to capture the submitted data. What is going on? Any clues? - Glenn
Re: Passing parameter through html:link
You can pass the map as a property in the link such as: html:link action=/dispatch.do name=nameOfYourFormBean property=map of key/values pairs Struts will build a query string with the values in the map. - maestro
LazyLists
Hi, I have an application that I'm moving over to J2SE1.5 and J2EE 1.4. I am getting an error when executing a JSP: javax.servlet.jsp.el.ELException: Unable to find a value for beneficiaries in object of class hronline.secure.personal.insurances.InsuranceForm using operator . If I remove the code that hand cranks the lazy list and just leave regular getter/setter methods the JSP page executes. However I need the methods that hand crank the lazy list in order for the application to capture submitted data. Am I missing any updated dependencies or ? Any suggestions would be greatly appreciated. - maestro
Struts, J2SE 1.5 and J2EE 1.4
Hi, The application is using Struts 1.2.7 with WebSphere Studio Application Developer 5.1.2 and WebSphere Application Server Express 5.1. I have been going thru some nasty problems getting the same project to run on Rational Application Developer v7.0.0.1 and WebSphere Application Server 6.1.0.5. [enough with the versions] When I import the code over it works fine. The only problem is when I have nested objects such as c:forEach items=${insuranceForm.beneficiaries} var=beneficiary varStatus=bnfStatus . /c:forEach I get this message when executing the JSP. Any help would be greatly appreciated! - maestro [28/02/07 15:14:04:454 EST] 0022 ServletWrappe E SRVE0068E: Uncaught exception thrown in one of the service methods of the servlet: /WEB-INF/personal/insurances/insurance.jsp. Exception thrown : javax.servlet.ServletException: Unable to find a value for beneficiaries in object of class hronline.secure.personal.insurances.InsuranceForm using operator . at org.apache.jasper.runtime.PageContextImpl.handlePageException( PageContextImpl.java:660) at com.ibm._jsp._insurance._jspService(_insurance.java:108) at com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:85) at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) at com.ibm.ws.webcontainer.servlet.ServletWrapper.service( ServletWrapper.java:989) at com.ibm.ws.webcontainer.servlet.ServletWrapper.service( ServletWrapper.java:930) at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter( WebAppFilterChain.java:118) at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter( WebAppFilterChain.java:87) at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter( WebAppFilterManager.java:761) at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter( WebAppFilterManager.java:673) at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest( ServletWrapper.java:498) at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest( ServletWrapper.java:464) at com.ibm.wsspi.webcontainer.servlet.GenericServletWrapper.handleRequest( GenericServletWrapper.java:122) at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper.handleRequest (AbstractJSPExtensionServletWrapper.java:196) at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionProcessor.handleRequest( AbstractJSPExtensionProcessor.java:275) at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward( WebAppRequestDispatcher.java:308) at org.apache.struts.action.RequestProcessor.doForward( RequestProcessor.java:1085) at org.apache.struts.action.RequestProcessor.processForwardConfig( RequestProcessor.java:398) at org.apache.struts.action.RequestProcessor.process( RequestProcessor.java:241) at org.apache.struts.action.ActionServlet.process(ActionServlet.java :1196) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414) at javax.servlet.http.HttpServlet.service(HttpServlet.java:743) at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) at com.ibm.ws.webcontainer.servlet.ServletWrapper.service( ServletWrapper.java:989) at com.ibm.ws.webcontainer.servlet.ServletWrapper.service( ServletWrapper.java:930) at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter( WebAppFilterChain.java:145) at hronline.secure.app.HROnlineFilter.doFilter(HROnlineFilter.java:183) at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter( FilterInstanceWrapper.java:190) at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter( WebAppFilterChain.java:130) at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter( WebAppFilterChain.java:87) at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter( WebAppFilterManager.java:761) at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter( WebAppFilterManager.java:673) at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest( ServletWrapper.java:498) at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest( ServletWrapper.java:464) at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3163) at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java :254) at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java :811) at com.ibm.ws.wswebcontainer.WebContainer.handleRequest( WebContainer.java:1433) at com.ibm.ws.webcontainer.channel.WCChannelLink.ready( WCChannelLink.java:100) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination( HttpInboundLink.java:465) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation( HttpInboundLink.java:394) at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete( HttpICLReadCallback.java:102) at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted (AioReadCompletionListener.java:152) at com.ibm.io.async.AbstractAsyncFuture.invokeCallback( AbstractAsyncFuture.java:213) at
Struts, J2SE 1.5 and J2EE 1.4
Hi, The application is using Struts 1.2.7 with WebSphere Studio Application Developer 5.1.2 and WebSphere Application Server Express 5.1. I have been going thru some nasty problems getting the same project to run on Rational Application Developer v7.0.0.1 and WebSphere Application Server 6.1.0.5. [enough with the versions] When I import the code over it works fine. The only problem is when I have nested objects such as c:forEach items=${insuranceForm.beneficiaries} var=beneficiary varStatus=bnfStatus . /c:forEach I get this message when executing the JSP. Any help would be greatly appreciated! - maestro [28/02/07 15:14:04:454 EST] 0022 ServletWrappe E SRVE0068E: Uncaught exception thrown in one of the service methods of the servlet: /WEB-INF/personal/insurances/insurance.jsp. Exception thrown : javax.servlet.ServletException: Unable to find a value for beneficiaries in object of class hronline.secure.personal.insurances.InsuranceForm using operator . at org.apache.jasper.runtime.PageContextImpl.handlePageException ( PageContextImpl.java:660) at com.ibm._jsp._insurance._jspService(_insurance.java:108) at com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:85) at javax.servlet.http.HttpServlet.service(HttpServlet.java :856) at com.ibm.ws.webcontainer.servlet.ServletWrapper.service( ServletWrapper.java:989) at com.ibm.ws.webcontainer.servlet.ServletWrapper.service( ServletWrapper.java:930) at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter ( WebAppFilterChain.java:118) at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter( WebAppFilterChain.java:87) at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter( WebAppFilterManager.java:761) at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter( WebAppFilterManager.java:673) at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest( ServletWrapper.java:498) at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest ( ServletWrapper.java:464) at com.ibm.wsspi.webcontainer.servlet.GenericServletWrapper.handleRequest( GenericServletWrapper.java:122) at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper.handleRequest( AbstractJSPExtensionServletWrapper.java:196) at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionProcessor.handleRequest( AbstractJSPExtensionProcessor.java:275) at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward ( WebAppRequestDispatcher.java:308) at org.apache.struts.action.RequestProcessor.doForward( RequestProcessor.java:1085) at org.apache.struts.action.RequestProcessor.processForwardConfig( RequestProcessor.java:398) at org.apache.struts.action.RequestProcessor.process( RequestProcessor.java:241) at org.apache.struts.action.ActionServlet.process(ActionServlet.java :1196) at org.apache.struts.action.ActionServlet.doGet (ActionServlet.java:414) at javax.servlet.http.HttpServlet.service(HttpServlet.java:743) at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) at com.ibm.ws.webcontainer.servlet.ServletWrapper.service ( ServletWrapper.java:989) at com.ibm.ws.webcontainer.servlet.ServletWrapper.service( ServletWrapper.java:930) at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter( WebAppFilterChain.java:145) at hronline.secure.app.HROnlineFilter.doFilter(HROnlineFilter.java:183) at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter( FilterInstanceWrapper.java:190) at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter ( WebAppFilterChain.java:130) at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter( WebAppFilterChain.java:87) at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter( WebAppFilterManager.java:761) at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter( WebAppFilterManager.java:673) at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest( ServletWrapper.java:498) at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest ( ServletWrapper.java:464) at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3163) at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java :254) at com.ibm.ws.webcontainer.WebContainer.handleRequest (WebContainer.java :811) at com.ibm.ws.wswebcontainer.WebContainer.handleRequest( WebContainer.java:1433) at com.ibm.ws.webcontainer.channel.WCChannelLink.ready( WCChannelLink.java:100) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination ( HttpInboundLink.java:465) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation( HttpInboundLink.java:394) at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete( HttpICLReadCallback.java :102) at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted (AioReadCompletionListener.java:152) at com.ibm.io.async.AbstractAsyncFuture.invokeCallback( AbstractAsyncFuture.java:213) at
Re: using html:option tag
The html:select tag has an attribute value. http://struts.apache.org/userGuide/struts-html.html#select The value to compare with for marking an option selected. [RT Expr] HTH, Glenn [EMAIL PROTECTED] 27/09/2005 12:08 PM Please respond to Struts Users Mailing List user@struts.apache.org To user@struts.apache.org cc Subject using html:option tag Hi All, I am using the html option tag embedded within the html select tag to select a value from a drop down list as follows: html:select property=title html:option value=MrMr/html:option html:option value=MrsMrs/html:option /html:select This works fine and I can save the correct value to the database. The question I have is how do I display the same option tag when updating the user and the details are returned from a database. So in plain English after the user has saved the client to the db he then wants to update the record. A search is done but how do I display on the JSP page the selected option with the option of seleting something else from the drop down list. Thanks in advance
Re: Forwarding to the previous page
You can always get from where the request is coming from by getting the Referer from the Request. String referer = request.getHeader(REFERER); I'm not sure that this is want you want. You must beware that the referrer can be blank when typing in the URL in the browser, plus the consequences of the ActionForm.validate() and errors. HTH, Glenn Tremal Naik [EMAIL PROTECTED] 07/09/2005 12:22 PM Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org cc Subject Re: Forwarding to the previous page 2005/9/7, Duane Rosengartner [EMAIL PROTECTED]: This works very well for me. a class=button href=javascript:history.back()Back/a aehm,probabily I didn't explain well my problem: I don't have to get back to the previous page from the actual. Look at this code: public class DisplayAboutAction extends Action { public ActionForward execute(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) { // do stuff. ActionForward af = new ActionForward(); af.setPath(previousPagePath); return af; } } I need to get a value for 'previousPagePath'. I'm trying something like : bean:page id=reqq property=request / html:link action=next.do paramId=old_page paramName=reqq paramProperty=servletPath but I'm using Tiles, so what I have as 'old_page' parameter is not the action 'previous.do' but '/jsplayout.jsp' instead thanks, TREMALNAIK - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Select Options Question
You can also build a javascript array of the descriptions. When the user selects the option from the list, execute a javascript function that will do a lookup for the description in the array and set a hidden form field with the description found in the array. It may happen that the character you use to delimit the key and value will end up in the value and then the fun starts ! HTH, Glenn [EMAIL PROTECTED] 01/09/2005 12:07 PM Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org cc Struts Users Mailing List user@struts.apache.org Subject Re: Select Options Question On the result page I only need the Label for the selected option. Not the entire list. The problem is that when you submit the form, you only submit the value in the form object and loose the label. I need to pass the label as well so that I do not have to requery for it. The way that i have it currently is that the value contains a comma delemited string containing both the label and key (overkill on the bandwidth I know). In my action class, I do a string.split on the comma and pass the first value to my DAO processor and the Second value I put in my form for display. It is the only way I could think of without iterating through the options or storing the initial results which populate the option list. Frank W. Zammetti [EMAIL PROTECTED] Frank W. Zammetti [EMAIL PROTECTED] 09/01/2005 11:28 AM Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org cc Subject Re: Select Options Question I'm not sure I understand... do you just need to have the group name when you display the detail for the selected item, or do you need the entire select list (to avoid getting it from the datavase each time?) If you just need the grou pname, could you simply put the group name in session? May or may not work depending on the flow of your app, but it would be a nice, simple solution if it'll work... just remember to clear it out at an appropriate time. The other option that comes to mind immediately is indeed to use Javascript... seems like all you'd need is a form with two hidden fields, groupName and value... onChange of the select, populate those two fields and submit() the form. You'd then have both pieces of information to render your detail page. Or maybe I don't understand the problem? Frank [EMAIL PROTECTED] wrote: I am sure there is a slick way to do this, but it escapes me at the moment. I have a Select Box that I am populating with the html:options tag The result is: select name=cmbGroup id=groupList option value=jk12341Group 1/option option value=34t1fv1Group 2/option option value=32fq21Group 3/option ... /select I need the value for DAO actions performed from the search which will return a detail bean for display on an output JSP. On the output JSP I need to Display the Group Name that I selected from the input. My Form holds the group id and a field for the group name. The options that I can see are: 1. Requery the Database for the output page to retrieve the name given I have the key. This would work, but seems like a lot of overhead to go to the database each time. 2. Create a delimited value (ie option value=jk12341, Group 1Group 1/option) and use the String Split to get the value and label. (I am leaning toward this) 3. use javascript to update the field each time the select changes. The problem with this is that the select box can be very large based on the users selections on previous entries. 4. Store the Value Label list in the session (Don't like this at all because the volume of users that will use this application). Any other suggestions? -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: logout problem
I have used the meta http-equiv=Refresh content=300; URL=../action/Logout.do/ tag in an application that is very information sensitive. The idea is that the sensitive information does not stay displayed unused for nothing. This was a user requirement. BTW, you don't need an iframe. Also, you can never catch all instances where a logout will occur, such as logging off the machine... or just pressing the power button. - Glenn Leon Rosenberg [EMAIL PROTECTED] 31/08/2005 08:17 AM Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org cc Subject Re: logout problem On Wed, 2005-08-31 at 12:46 +0100, Adam Hardy wrote: Emmanouil Batsis on 31/08/05 12:37, wrote: Sławek Tuleja wrote: question: but how to evoke Logoff action when user closes browser? In general you dont :-) You just wait for the session to expire using a session event listener. However, if the client supports javascript, you can catch the onclose event and perhaps submit an XMLHTTPRequest to the server (if the object is supported), but you cannot actually rely on this. If you're mad keen on the idea and wish to avoid javascript, put an invisible iframe in the page with a meta http-equiv=Refresh content=15; URL=../action/redirect.html/ in the header, so that the client's browser continually polls the server, and set a listener to do something when it stops. I would never do that myself though ;) why not? regards Leon - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: messages help
Did you read this ? http://www.niallp.pwp.blueyonder.co.uk/HelpTagsErrorsAndMessages.html Especially the section 4.2 Using a Custom Key. HTH, Glenn draegoon Z [EMAIL PROTECTED] 22/08/2005 02:19 PM Please respond to Struts Users Mailing List user@struts.apache.org To struts-user@jakarta.apache.org cc Subject messages help Sorry, but I've been reading archives all morning. Using Struts 1.2.7 Setting up a system to catch all errors/messages on a page. Getting the errors from my ActionForm: ActionErrors errors = new ActionErrors(); errors.add(system_name,new ActionError(errors.required,ar.getMessage(com.draegoonZ.social.label.system_name))); return(errors); Getting the ???bad_key??? from my ActionForm: ActionMessages errors = new ActionMessages(); errors.add(system_name,new ActionMessage(ar.getMessage(com.draegoonZ.social.password.lookup.no_user_name))); saveMessages(request,errors); return(mapping.getInputForward()); Results in: ???en_US.That username doesn't exist in our system. Please try again.??? Now I don't know what key it is telling me is missing, when it is displaying the value from my messages resource. I thought the problem was with using the property (system_name) instead of ActionMessages.GLOBAL_MESSAGE, but that gave the same results. Also, I want to use the property name, so I can display next to the html: input tag. A related question I have is: I read somewhere (this morning) that once html:message is read/accessed that it is removed/deleted. Is this true? How then could one list all the errors/messages at the top of a page, and then check for them to display next to the html: input tag? My jsp reads: %-- check for errors --% logic:messagesPresent html:messages id=message_id header=errors.header footer=errors.footer lic:out value=${message_id} //li /html:messages /logic:messagesPresent %-- If not errors present... --% logic:messagesNotPresent %-- check for messages (Globals.MESSAGE_KEY) --% logic:messagesPresent message=true html:messages id=message_id message=true header=errors.header footer=errors.footer lic:out value=${message_id} //li /html:messages /logic:messagesPresent /logic:messagesNotPresent Thanx in advance. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: logic:lessThan problem
Hi Peter, There seems to be a typo in the closing tag. logic:lessThan name=projectListSize value=5 Less than 5! /logicLessThan Should be /logic:lessThan - Glenn On 8/19/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi list! I have some problems comparing values with logic tags. I have searched the mailing list archive, but I only found solutions that look pretty the same as what I have done, but it still does not work. So perhaps someone can help. I have a bean which stores a list of projects. Because the size of this list can vary, I get it like this: bean:size id=projectListSize name=myBean property=projectList / When I write out the size bean bean:write name=projectListSize /, the correct size is shown. But when I try to do the following: logic:lessThan name=projectListSize value=5 Less than 5! /logicLessThan logic:greaterEqual name=projectListSize value=5 Greater or equal 5! /logic:greaterEqual always both messages are shown! Is there something I am missing? Thanks, Peter - 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-el:messages - bis
Thanks so much for your reply!!! I will certainly try your suggestions out. Greatly appreciated, Glenn On 8/18/05, Laurie Harper [EMAIL PROTECTED] wrote: Heh: even more of a hack, provided you're OK keeping with lists rather than tables as in your original example: logic:messagesPresent message=true c:set var=count value=0/ ul id=msgs html:messages id=msg c:set var=count value=${count + 1}/ lic:out value=${msg}//li /html:messages /ul c:if test=${count gt 1}/ style #msgs { list-style: none; } /style /c:if /logic:messagesPresent/ Laurie Harper wrote: I can't think of a way to find out how many messages are queued for display, but you could do something like this (ugly, and untested): c:set var=first value=true/ c:set var=prev value=/ html:messages id=msg c:if test=${not empty prev} %-- 2nd or subsequent messsage --% c:if test=${first} %-- This is the 2nd message of N; start the list --% c:set var=first value=false/ ul /c:if %-- output previous message --% lic:out value=${prev}//li /c:if %-- Store current message --% c:set var=prev value=${msg}/ /html:messages c:if test=${not empty prev} %-- There was at least one message --% c:if test=${first} %-- There was only one message; show it --% c:out value=${prev}/ /c:if c:if test=${not first} %-- There was more than one message; output final message and end list. --% lic:out value=${prev}//li/ul /c:if /c:if [EMAIL PROTECTED] wrote: Greetings, I have sent this post more almost 2 days ago without one response. I hope it was simply lost with other posts but still worthy of attention. Here is the original post: I am unable to find a solution... even after searching... and waiting for the espresso to kick in. I have messages and would like to determine the number of messages in the bean. If there is more than one message format the output as a list or else just display the message. Unable to come up with something. This is what I am currently using: logic:messagesPresent message=true tr td colspan=5 class=informationalMessage html-el:messages id=message message=true bean: write name=message filter=false/br /html-el:messages /td td/td /tr tr td colspan=6 height=5/td /tr /logic:messagesPresent Any ideas would be greatly appreciated ! - Glenn -- Laurie Harper Open Source advocate, Java geek: http://www.holoweb.net/laurie Founder, Zotech Software: http://www.zotechsoftware.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]
html-el:messages - bis
Greetings, I have sent this post more almost 2 days ago without one response. I hope it was simply lost with other posts but still worthy of attention. Here is the original post: I am unable to find a solution... even after searching... and waiting for the espresso to kick in. I have messages and would like to determine the number of messages in the bean. If there is more than one message format the output as a list or else just display the message. Unable to come up with something. This is what I am currently using: logic:messagesPresent message=true tr td colspan=5 class=informationalMessage html-el:messages id=message message=true bean: write name=message filter=false/br /html-el:messages /td td/td /tr tr td colspan=6 height=5/td /tr /logic:messagesPresent Any ideas would be greatly appreciated ! - Glenn
html:messages
Greetings, I am unable to find a solution... even after searching... and waiting for the espresso to kick in. I have messages and would like to determine the number of messages in the bean. If there is more than one message format the output as a list or else just display the message. Unable to come up with something. This is what I am currently using: logic:messagesPresent message=true tr td colspan=5 class=informationalMessage html-el:messages id=message message=true bean: write name=message filter=false/br /html-el:messages /td td/td /tr tr td colspan=6 height=5/td /tr /logic:messagesPresent Any ideas would be greatly appreciated ! - Glenn
Re: Token element wrapped with a div tag
This is the JSP code snippet: html-el:form action=/personal/BeneficiarySubmit method=post focus= ${HTMLFocusElement.elementName} html-el:hidden property=bid value= ${beneficiaryForm.beneficiary.beneficiaryId}/ html-el:hidden property=beneficiaryAdd/ Here is the HTML source: form name=beneficiaryForm method=post action=/hronline/secure/personal/BeneficiarySubmit.dodivinput type=hidden name=org.apache.struts.taglib.html.TOKEN value=0e4c64c9eeefb8cf6be7f6f09cb183df/div input type=hidden name=bid value=D00 input type=hidden name=beneficiaryAdd value=true Here is code in my Action class: // set the synchronization token String token = generateToken(request); httpSession.setAttribute(Globals.TRANSACTION_TOKEN_KEY, token); - Glenn Laurie Harper [EMAIL PROTECTED] Sent by: news [EMAIL PROTECTED] 14/07/2005 06:29 PM Please respond to Struts Users Mailing List user@struts.apache.org To user@struts.apache.org cc Subject Re: Token element wrapped with a div tag [EMAIL PROTECTED] wrote: Just curious as to why in the JSP the token is wrapped in a div tag? divinput type=hidden name=org.apache.struts.taglib.html.TOKEN value=383952ea7a0093448e02f3f0d635865b/div I'm using v1.2.7. What does your JSP look like? L. -- Laurie, Open Source advocate, Java geek and novice blogger: http://www.holoweb.net/~laurie/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Token element wrapped with a div tag
Thanks Niall. It did not occur to me to check the ASF Bugzilla for Struts [I will remember for the next time]. I'm not familiar with the Status... since it is not yet closed.. this means that the bug is not yet fixed in version 1.2.7 ? - Glenn Niall Pemberton [EMAIL PROTECTED] 18/07/2005 08:38 AM Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org cc Subject Re: Token element wrapped with a div tag http://issues.apache.org/bugzilla/show_bug.cgi?id=32016 Niall - Original Message - From: [EMAIL PROTECTED] Sent: Thursday, July 14, 2005 4:11 PM Hi, Just curious as to why in the JSP the token is wrapped in a div tag? divinput type=hidden name=org.apache.struts.taglib.html.TOKEN value=383952ea7a0093448e02f3f0d635865b/div I'm using v1.2.7. Regards, Glenn - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Token element wrapped with a div tag
Thanks Niall for your time and patience. - Glenn Niall Pemberton [EMAIL PROTECTED] 18/07/2005 10:33 AM Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org cc Subject Re: Token element wrapped with a div tag Sorry, my reply wasn't very verbose. That bug is fixed in Version 1.2.7 - which is why you're seeing the div elements. Generally we're not very good at actually closing bugs - once they're marked as RESOLVED they don't generally get any more attention. So if you see RESOLVED FIXED then it means its been done. Finding out whether a fix has made it into a released version or is just currently in the current svn repository is another matter. The release notes usually contain details of fixed bugs so thats probably the easiest way, if you know the bug number. http://struts.apache.org/userGuide/release-notes.html Niall - Original Message - From: [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Monday, July 18, 2005 1:55 PM Subject: Re: Token element wrapped with a div tag Thanks Niall. It did not occur to me to check the ASF Bugzilla for Struts [I will remember for the next time]. I'm not familiar with the Status... since it is not yet closed.. this means that the bug is not yet fixed in version 1.2.7 ? - Glenn Niall Pemberton [EMAIL PROTECTED] 18/07/2005 08:38 AM http://issues.apache.org/bugzilla/show_bug.cgi?id=32016 Niall - Original Message - From: [EMAIL PROTECTED] Sent: Thursday, July 14, 2005 4:11 PM Hi, Just curious as to why in the JSP the token is wrapped in a div tag? divinput type=hidden name=org.apache.struts.taglib.html.TOKEN value=383952ea7a0093448e02f3f0d635865b/div I'm using v1.2.7. Regards, Glenn - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Token element wrapped with a div tag
Hi, Just curious as to why in the JSP the token is wrapped in a div tag? divinput type=hidden name=org.apache.struts.taglib.html.TOKEN value=383952ea7a0093448e02f3f0d635865b/div I'm using v1.2.7. Regards, Glenn
Re: I18N by pages
What you can do is have a jsp for each locale language such as page_fr.jsp and page_en.jsp. Your application can store the locale in the user's session object. Your application can update the session locale when the user switches between en fr. You can have the following forwards for the action in the struts-config.xml: forward name=en path=/WEB-INF/page_en.jsp /forward forward name=fr path=/WEB-INF/page_fr.jsp /forward In your ActionForm you can: return mapping.findForward(get the locale language from the session); HTH, Glenn On 6/24/05, Yaroslav Novytskyy [EMAIL PROTECTED] wrote: Hello, all! I just wonder if there is an existing (tested, prooved) way (a kind of development pattern) for Struts to make internationalization not by message resources but by pages (JSPs, templates)? The point is that using message resources deleloper can only define a string value for different locales. For example for en welcome=aaa for fr welcome=bbb, and you include it like titleout welcome/title. This produces titleaaa/title for en and titlebbb/title for fr. That makes you limited to localizing only strings, but not the format. E.G. I would like to output titleaaa/title for en and h1bbb/h1 for fr. And this not the matter of defining this strings (h1bbb/h1) in message bundles, but I would like to use separate JSPs for en and fr and that is the point. I would like have two jsp files: page1.en.jsp with content of titleaaa/title and page1.fr.jsp with h1bbb/h1. (P.S. this reduces much (maybe even terminates) the mess with message bundles). Please write all your suggestions and thoughts. Best regards Yaroslav Novytskyy - 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: I18N by pages
I'm confused here. You have 2 resource bundles called: resource_fr.properties resource_en.properties They both have the same keys but different values. The Struts framework will load the appropriate value from the correct bundle based on the locale language. That's it !! One jsp can obtain all of its string values from the bundle. In your example, you had mentioned that you'd like the title to be different based on the locale. You can also include the HTML in the resource file but IMHO this not the most efficient way. French is usually more verbose than English. At times the HTML page must be really different to accomodate the French. In general, I always design the page in French first as for it will work out fine in English afterwards. - Glenn [Martin: très bien !] On 6/24/05, Yaroslav Novytskyy [EMAIL PROTECTED] wrote: Hi! This is exactli what I'd like to avoid and use l10n on pages level not level of defined strings in message bundles for different languages. I don't want to use the english (html) design and to translate english phrases to french, which will be included into english design. I want to use french _page_. That meens french design with includes french text - standalone french jsp. Martin Gainty wrote: Glenn et al Another option for Struts localisation is to embed your language specific strings typically with key=string defined within your ApplicationResources_language_country.Properties file struts-config.xml will reference message-resources for key-based tag or param-value (initialisation param) for your servlet for ApplicationResources (properties) file When these elements are configured properly in struts-config.xml then your bean-write will work with html-messages Take a look at this excellent tutorial located at http://www.systemmobile.com/articles/strutsMessageResources.html#creating-bundle Bon Chance, Martin- Etats Unis 001-617-852-7822 - Original Message - From: Glenn Deschênes [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Friday, June 24, 2005 9:52 AM Subject: Re: I18N by pages What you can do is have a jsp for each locale language such as page_fr.jsp and page_en.jsp. Your application can store the locale in the user's session object. Your application can update the session locale when the user switches between en fr. You can have the following forwards for the action in the struts-config.xml: forward name=en path=/WEB-INF/page_en.jsp /forward forward name=fr path=/WEB-INF/page_fr.jsp /forward In your ActionForm you can: return mapping.findForward(get the locale language from the session); HTH, Glenn On 6/24/05, Yaroslav Novytskyy [EMAIL PROTECTED] wrote: Hello, all! I just wonder if there is an existing (tested, prooved) way (a kind of development pattern) for Struts to make internationalization not by message resources but by pages (JSPs, templates)? The point is that using message resources deleloper can only define a string value for different locales. For example for en welcome=aaa for fr welcome=bbb, and you include it like titleout welcome/title. This produces titleaaa/title for en and titlebbb/title for fr. That makes you limited to localizing only strings, but not the format. E.G. I would like to output titleaaa/title for en and h1bbb/h1 for fr. And this not the matter of defining this strings (h1bbb/h1) in message bundles, but I would like to use separate JSPs for en and fr and that is the point. I would like have two jsp files: page1.en.jsp with content of titleaaa/title and page1.fr.jsp with h1bbb/h1. (P.S. this reduces much (maybe even terminates) the mess with message bundles). Please write all your suggestions and thoughts. Best regards Yaroslav Novytskyy - 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: I18N by pages
Yaroslav, You just threw in Tiles into the mix ! Can't suggest anything haven't used it yet. Perhaps you can rephrase exactly what you'd like to do and use. - Glenn On 6/24/05, Yaroslav Novytskyy [EMAIL PROTECTED] wrote: Wow! meanwhile I've had the same idea. Posted simultaniosly :) But I doubt, that this solution will be compatible with tiles :( What do you think about that? Best regards Yaroslav Novytskyy Jeff Beal wrote: Probably your best bet would be to use a custom ActionMapping and override the findForward() method to return a Locale-specific JSP page. On 6/24/05, Yaroslav Novytskyy [EMAIL PROTECTED] wrote: Hi! This is exactli what I'd like to avoid and use l10n on pages level not level of defined strings in message bundles for different languages. I don't want to use the english (html) design and to translate english phrases to french, which will be included into english design. I want to use french _page_. That meens french design with includes french text - standalone french jsp. Martin Gainty wrote: Glenn et al Another option for Struts localisation is to embed your language specific strings typically with key=string defined within your ApplicationResources_language_country.Properties file struts-config.xml will reference message-resources for key-based tag or param-value (initialisation param) for your servlet for ApplicationResources (properties) file When these elements are configured properly in struts-config.xml then your bean-write will work with html-messages Take a look at this excellent tutorial located at http://www.systemmobile.com/articles/strutsMessageResources.html#creating-bundle Bon Chance, Martin- Etats Unis 001-617-852-7822 - Original Message - From: Glenn Deschênes [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Friday, June 24, 2005 9:52 AM Subject: Re: I18N by pages What you can do is have a jsp for each locale language such as page_fr.jsp and page_en.jsp. Your application can store the locale in the user's session object. Your application can update the session locale when the user switches between en fr. You can have the following forwards for the action in the struts-config.xml: forward name=en path=/WEB-INF/page_en.jsp /forward forward name=fr path=/WEB-INF/page_fr.jsp /forward In your ActionForm you can: return mapping.findForward(get the locale language from the session); HTH, Glenn On 6/24/05, Yaroslav Novytskyy [EMAIL PROTECTED] wrote: Hello, all! I just wonder if there is an existing (tested, prooved) way (a kind of development pattern) for Struts to make internationalization not by message resources but by pages (JSPs, templates)? The point is that using message resources deleloper can only define a string value for different locales. For example for en welcome=aaa for fr welcome=bbb, and you include it like titleout welcome/title. This produces titleaaa/title for en and titlebbb/title for fr. That makes you limited to localizing only strings, but not the format. E.G. I would like to output titleaaa/title for en and h1bbb/h1 for fr. And this not the matter of defining this strings (h1bbb/h1) in message bundles, but I would like to use separate JSPs for en and fr and that is the point. I would like have two jsp files: page1.en.jsp with content of titleaaa/title and page1.fr.jsp with h1bbb/h1. (P.S. this reduces much (maybe even terminates) the mess with message bundles). Please write all your suggestions and thoughts. Best regards Yaroslav Novytskyy - 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] - 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: reponse commited
Quickly glancing at your code I believe you need to return null such as ostr.close(); return null; HTH, Glenn Karthika L V somayajula [EMAIL PROTECTED] 14/06/2005 10:35 AM Please respond to Struts Users Mailing List user@struts.apache.org To user@struts.apache.org cc Subject reponse commited I hope am into the right group I have a problem with downloading files using struts. I am using J2SDK 1.4.2_06 Struts 1.2.4 Jboss 4.0.1RC2 My download Action is : public ActionForward executeAction( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response ) throws BusinessDelegateException,IOException { ReportGenerateForm rform = (ReportGenerateForm) form ; ActionForward forward = mapping.findForward(Constant.DOWNLOAD_REPORT); ReportGenerateDelegate reportGenerateDelegate = new ReportGenerateDelegate(); int empId = getIntranetUser( request ).getEmployeeID(); String reportId = request.getParameter(rid); String companyId = String.valueOf(getIntranetUser(request).getCompanyId()); String companyName = getIntranetUser(request).getCompanyName(); String projectId = Constant.STRING_ZERO; String projectName = Constant.BLANK; String fn = reportGenerateDelegate.getFileName(reportId); //prepend employee Id to file Name StringBuffer file = new StringBuffer(String.valueOf(empId)); file.append(Constant.FILENAME_SEPERATOR_LITERAL).append(fn); String fileName = new String(file); // scrub the company name ArrayList arr = new ArrayList(); arr.add(companyName); arr = (ArrayList)rform.validateData( arr ) ; String scrubbedCompanyName = (String)arr.get(0); IntranetLogger.logInfo(Scrubbed Comapny Name is +scrubbedCompanyName); arr = null; if( fileName != null ) { File fname = new File(fileName); FileUpload fileUpload = new FileUpload(); String default_folder = Constant.REPORTS_FOLDER; String relativePath = FileUpload.getPathName (companyId,scrubbedCompanyName,projectId,projectName,default_folder); // append relative path to the Document Root defined in FileUpload.properties file String downloadPath = FileUpload.getPath(Constant.BLANK) + relativePath; IntranetLogger.logInfo(In DownloadReportAction FULL PATH of the file. + downloadPath); FileInputStream istr = null ; OutputStream ostr = null; try { IntranetLogger.logInfo(TOTAL DOWNLOAD PATH IS: +(downloadPath + fname)); istr = new FileInputStream( downloadPath + fname); IntranetLogger.logInfo(File available? + istr.available()); IntranetLogger.logInfo(File name +fileName); if ( istr.available() == 0 ) { IntranetLogger.logInfo(File Not available + fileName); addErrors(error.document.empty, fileName,request); } else { // set content type of the response object to Application/octet-stream. By setting this // we can download any type of file like txt, pdf, doc, xls etc response.setContentType(APPLICATION/OCTET-STREAM); response.setHeader(Content-Disposition, attachment;filename=\ + fname.getName() +\;); IntranetLogger.logInfo(Reponse content type set); // the following line is required to send a pop-up open-save-cancel file dialog box ostr = response.getOutputStream(); int bytesRead = 0; byte[] buffer = new byte[8192]; while( (bytesRead = istr.read(buffer, 0, 8192)) != -1) { ostr.write(buffer, 0, bytesRead); } //ostr.flush(); istr.close(); ostr.close(); addMessages(download.success, fileName, request); } }//try catch(Exception ex) { IntranetLogger.logInfo(Error in flushing out the Streams: +ex.toString()); // if file already exists, then gives the proper messeage. addErrors(error.document.empty, fileName,request); //forward = mapping.findForward( Constant.GENERATE_REPORT) ; forward = mapping.findForward(Constant.DOWNLOAD_REPORT); } finally { try { istr.close(); ostr.close(); } catch(Exception ex) { IntranetLogger.logInfo(Major Error Releasing Streams: +ex.toString()); addErrors(error.document.empty, fileName,request); } } try { response.flushBuffer(); } catch(Exception ex) { IntranetLogger.logInfo(Error flushing the Response: +ex.toString()); addErrors(error.document.empty, fileName, request); } } return forward; } My jsp includes meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 I get the list of file name with links in my JSP, one of which I click i should get a open, save file dialog box Now, when i click on the the filename on link I get the exception StandardWrapperValve[action]: cannot forward,reponse already commited Please reply if you find mistakes or errors in my action Thank you advance Karthika - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Confused
Pierre, Struts is no longer a sub-project of Jakarta but is now on its own. Struts is alive and kicking: http://struts.apache.org/ You can look at section 6 [this might help]: http://struts.apache.org/userGuide/index.html As for JBoss... the last time I used it (can't exactly remember when)... JBoss has a version that is already bundled with Tomcat. As for the Mac, I cannot really help. HTH, Glenn Pierre Thibault [EMAIL PROTECTED] 13/06/2005 12:01 AM Please respond to Struts Users Mailing List user@struts.apache.org To user@struts.apache.org cc Subject Confused Hello, I am new to Struts and I am a bit confused. I would like some light. I have just installed Tomcat 5 for Java WSDP. Do I need this version to make Struts development or can I use the regular 5.5 version too? I have installed both. I also saw that Struts is listed in the Ex-Jakarta section of the Jakarta web site. Is this mean that Struts is now replaced by Tapestry? Also, I would like to know how can I have access to J2EE? I am on Mac OS 10.4 and as I know I need JBoss to have access to J2EE. I have installed JBoss on my machine too. But I don't understand how can I use Tomcat, JBoss and Struts altogether. Can you help me? Regards. - Pierre
RE: Return key pressed and default submit form
Hello, The return-key functionality of forms is part of the web browser...if you're in a form and there's a submit button, and you hit enter, it will submit that form. My recommendation would be to change your submit button to a regular input type=button and that should disable the functionality (assuming that button doesn't get focus at some point): input type=button value=Submit Me onClick=this.form.submit(); Hope that helps, Glenn -Original Message- From: Gaet [mailto:[EMAIL PROTECTED] Sent: Thursday, March 17, 2005 9:18 AM To: Struts Users Mailing List Subject: Re: Return key pressed and default submit form Nobody knows about this simple question? TIA - Original Message - From: Gaet [EMAIL PROTECTED] To: Mailing List Struts user@struts.apache.org Sent: Thursday, March 17, 2005 9:03 AM Subject: Return key pressed and default submit form Hi, I a have a page with a form and when I click the return button of my keyboard it submits the first button of my form... how to change the default button or disable the return key action? Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] === This email message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. If you are the intended recipient, please be advised that the content of this message is subject to access, review and disclosure by the sender's Email System Administrator. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] WinCVS problem (free beer!)
Hi Frank, I've run into this problem before myself. The problem I ran into was caused by the focus of my directory browser (that left-hand side browsing area) being on the root directory (C:\), and I had it set to recursively display all files in the file browser (that right-hand side listing) -- so it was trying to display my entire hard drive and its status, or lack thereof, in CVS! You may be having a different problem, but you may want to check that your recursive-display (View - Flat Mode?, i believe) You may have to wait until it's done crunching to change the setting, though. Regards, Glenn -Original Message- From: Frank W. Zammetti [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 05, 2005 2:11 PM To: Commons User; Struts User Subject: [OT] WinCVS problem (free beer!) Ok, no free beer, I lied ;) Got your attention though! I'm just now trying to use CVS for the first time, and I'm having a problem I haven't been able to figure out, and I'm sure at least some of you here are using WinCVS, so I hope no one minds an OT question (FYI, I couldn't find a WinCVS support forum)... I've installed WinCVS 1.3 (the latest from the WinCVW.org site, downloaded today) on Windows XP. I haven't however installed Python or TCL, as they are optional. The install went fine. But, when I try to run it, it freezes. I see the splash screen, and the popup mentioning Python. I click OK, and it's just frozen, can't do anything. I can close it via right-clicking the taskbar item, but nothing else. It works on my work PC by the way, although I can't do anything with it there because of firewall restrictions, so I really need it working at home. I've checked to be sure the CvsNT and CvsNT Locking services are running, and they are (not even sure that's necassery, but still). I've spent 30 minutes or so Googling for an answer but haven't had any luck. Any ideas from anyone around here? Again, sorry for the OT post, but I couldn't resist tapping the expertise of these lists. Thanks a lot! -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] === This email message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. If you are the intended recipient, please be advised that the content of this message is subject to access, review and disclosure by the sender's Email System Administrator. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: RE [OT]: onsubmit form ERROR
Also be sure you don't have another object named submit in your form. It's common to see input type=submit name=submit Change its name to something else. This will kill any form of document.{form}.submit(); -Original Message- From: Barnett, Brian W. [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 14, 2004 1:08 PM To: 'Struts Users Mailing List' Subject: RE [OT]: onsubmit form ERROR Hmm. I've never seen that syntax, but that doesn't mean much. Here are the syntaxes I've seen: document.MonitorForm.submit() document.forms[0].submit() document.forms[MonitorForm].submit() I've seen something as simple as a semi-colon at the end of javascript work wonders too :) -Original Message- From: Isaac Mosquera [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 14, 2004 2:01 PM To: Struts Users Mailing List Subject: RE: onsubmit form ERROR thanks, but that didn't work, it seems as though i'm getting a valid form object because if use: alert( document.forms.MonitorForm.name ) and alert( document.forms.MonitorForm.action ) they both return the right output, however its just the submit() function which gives me errors. -isaac At 12:45 PM 7/14/2004 -0700, you wrote: Try document.MonitorForm.submit() -Original Message- From: Isaac Mosquera [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 14, 2004 1:47 PM To: [EMAIL PROTECTED] Subject: onsubmit form ERROR i have the following piece of HTML/JavaScript and this problem happens quite frequently but i dont know how to fix it. select name=application_monitor_id onchange=document.forms.MonitorForm.submit() although there is a valid form with the name MonitorForm in the html page i get this error: object doesn't support this property or method -isaac - 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] === This email message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. If you are the intended recipient, please be advised that the content of this message is subject to access, review and disclosure by the sender's Email System Administrator. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Newbie question
this.servlet.getServletContext(); HTH, Glenn -Original Message- From: Chaikin, Yaakov Y (US SSA) [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 19, 2004 3:22 PM To: [EMAIL PROTECTED] Subject: Newbie question Hi, How do you get at ServletContext object inside an Action? Thanks. Yaakov Chaikin Software Engineer BAE SYSTEMS 301-838-6899 (ph) 301-838-6802 (fax) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] === This email message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. If you are the intended recipient, please be advised that the content of this message is subject to access, review and disclosure by the sender's Email System Administrator. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Indexed properties working formbean-htmlform, not working ht mlform-formbean
I think the id attribute on the iterate tag must match the getter on the get row (index) method of your form bean. For example I have:- logic:iterate id=rows name=RCF property=rows indexId=counter and my form bean is:- private List rows = null; public FormRow getRows (int index) { return (RenamePDFFormRow)rows.get(index); } When the form is submitted, the getRows(int) method is called to retrieve the relevant entry in the collection, which is then reflected to set the individual properties. So try adding this to your form:- public FundamentalsInfo getIsf (int index) { return fundInfo.get(index); } Hope that helps, Scott. -Original Message- From: Berke, Wayne [IT] [mailto:[EMAIL PROTECTED] Sent: 30 April 2004 15:50 To: Struts Users Mailing List Subject: Indexed properties working formbean-htmlform, not working htmlform-formbean I've been tearing my hair out trying to get indexed properties to work. Apparently, there is some correspondence between the HTML fields and the ActionForm indexed properties because when the ActionForm is initialized, it does correctly populate the default HTML form fields. However, when I modify an HTML field that corresponds to an indexed property and submit the form, that change does not get reflected in the ActionForm. I tried turning on log4j trace in BeanUtils and PropertyUtils and it seems like the correct setProperty calls are being made, but printing out the ActionForm fields shows no change from the defaults. Any information, including suggestions for how to further debug this would be greatly appreciated. My JSP looks like this: table width=770 border=0 cellspacing=0 cellpadding=0 class=bglt3 html:form action=/IS logic:iterate name=isForm id=isf property=fundInfo indexId=ix tr td width=45% valign=middleNM:/strongnbsp; html:text name=isf property=colName indexed=true size=10 styleClass=t11 / nbsp;nbsp; td width=45% valign=middleDISP:/strongnbsp; html:text name=isf property=displayName indexed=true size=10 styleClass=t11 / nbsp;nbsp; /tr /logic:iterate trtd html:submit //td/td /html:form /table The ActionForm is: public class ISF extends ActionForm { private List fundInfo = new ArrayList(); { System.out.println(INITIALIZING!); fundInfo.add(new FundamentalsInfo(ONE, 1)); fundInfo.add(new FundamentalsInfo(TWO, 2)); fundInfo.add(new FundamentalsInfo(THREE, 3)); } public List getFundInfo() { return fundInfo; } public void setFundInfo(List fi) { fundInfo = fi; } public FundamentalsInfo getFundInfo(int index) { return (FundamentalsInfo) fundInfo.get(index); } public void setFundInfo(int index, FundamentalsInfo fi) { fundInfo.set(index, fi); } public void reset(ActionMapping mapping, HttpServletRequest request) { } } A FundamentalsInfo object is just a simple bean with two attributes, colName and displayName. The associated Action simply prints out the contents of the fundInfo list and it shows that the fields never change from the values they were initialized with. Wayne - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]