How to check an action variable with s:if
Hi, I've been trying for some time to get the following logic to work: s:if test=freshSmigFlag == false s:checkbox key=overwriteCheckbox name=overwriteCheck/s:checkbox /s:if where freshSmigFlag is a variable in my action, and there is a getter and setter defined for it. I also tried to surround the variable with the property tag as such: s:if test=s:property id='freshSmigFlag'/ == false But that didn't work either. Any ideas how we're suppose to write this? Thanks, Session - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [struts2]: maturity / production experience : thanks!
Thanks very much , Ted, tom tom, Oleg, for your helpful replies. - Pinpoint customers who are looking for what you sell.
Re: Handling Session Objects
Thanks a lot Dave for the detail explanation. I have checked the META-INF/context.xml of my web application for cookies and found that it does not have cookies attribute. ?xml version=1.0 encoding=UTF-8? Context path=/myWebApplication/ It means I have cookie enabled session. http://jf.omnis.ch/log/archives/2004/12/disabling-session-cookie-in-tomcat.html But still I am seeing ;jsessionid=XXX in the url. Please suggest me for any possibility for this. Thanks Regards Sawan newton.dave wrote: --- Sawan [EMAIL PROTECTED] wrote: Don't type it in / paste it when you test on the other machine. Can you please explain me in detail. That what is \, What I don't type in \, etc. ... \, which I assume is a misspelling of / (the character I used) is used to separate two words, in my case in and paste. I'll do my best to explain it in detail. When you test on the other machine do not include the ;jsessionid=XXX in the URL. Note that the XXX in the previous sentence should not be taken literally; it is a placeholder for whatever the session id is. jsessionid is used by the servlet container for servlet tracking; it's normally found under circumstances when you do not have cookies enabled or on the first request to the application when it (the application) still doesn't know if you have cookies enabled. d. Shape Yahoo! in your own image. Join our Network Research Panel today! http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Handling-Session-Objects-tf4211020.html#a12047967 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to check an action variable with s:if
Hi, I think you have to write it like this. s:if test=%{freshSmigFlag==false} s:checkbox key=overwriteCheckbox name=overwriteCheck/s:checkbox /s:if Thanks, Nuwan Session A Mwamufiya wrote: Hi, I've been trying for some time to get the following logic to work: s:if test=freshSmigFlag == false s:checkbox key=overwriteCheckbox name=overwriteCheck/s:checkbox /s:if where freshSmigFlag is a variable in my action, and there is a getter and setter defined for it. I also tried to surround the variable with the property tag as such: s:if test=s:property id='freshSmigFlag'/ == false But that didn't work either. Any ideas how we're suppose to write this? Thanks, Session - 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]
Problem in AJAX tag in Struts2
Hi I am using ajax s:div tag in s:iterator tag to get status on systems at the time of loading but when i am doing this through AJAX then s:div tag sending continuous request and at once time my explorer gives system error. There are 3 elements(systems) in my list so at the time of iterating three ajax request would be generate but instead contious request is generating and whole page is loading in s:div tag. but i want only image in place of div tag. so please help me to solve this problem. I am here giving code within s:iterator tag of my working JSP. s:iterator status=systemStatus value=systemList td width=20% height=84 s:url id=editsystem action= getSystemInfoSystemManagementAction.action s:param name=systemName value=%{systemName}/ s:param name=systemIP value=%{systemIP}/ /s:url s:url id=systemstatus action=SystemStatusAction.action s:param name=systemName value=%{systemName}/ /s:url p img id=indicator${systemStatus.count} src=images/sys_load.gif alt =Loading Info style=display:none/ s:div theme=ajax href=%{systemstatus} indicator=indicator${ systemStatus.count} s:a href=%{editsystem} cssClass=homelink onmouseout=MM_swapImgRestore() onmouseover=MM_swapImage('Image${systemStatus.count}','','${ hoverImagePath}',1)img src=${imagePath} name=Image${systemStatus.count} width=61 height=61 border=0br s:property value=systemName//s:a /s:div /p /td s:if test=#systemStatus.count % 5 == 0 /tr tr td align=center valign=bottomnbsp;/td /tr tr align=center valign=middle /s:if /s:iterator Thank you, Vijay
Re: [struts2]: maturity / production experience ?
Can you describe more about what is it that the AJAX theme is not mature? Maybe I should consider to use DOJO manually? On 8/8/07, Oleg Mikheev [EMAIL PROTECTED] wrote: sol myr wrote: 1. Have you used struts2 in production, and did you feel it was mature and stable? We used it. It's AJAX theme is not very mature, the rest is. If you know how to use DOJO manually - you're pretty safe. Oleg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Hez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] validation continue even if there is an error
Hi, my validation file is: !DOCTYPE validators PUBLIC -//OpenSymphony Group//XWork Validator 1.0.2//EN http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd; validators field name=nome field-validator type=requiredstring message key=requiredstring/ /field-validator /field field name=indirizzo field-validator type=requiredstring message key=requiredstring/ /field-validato /field field name=comune field-validator type=requiredstring message key=requiredstring/ /field-validator /field field name=provincia field-validator type=requiredstring message key=requiredstring/ /field-validator /field field name=cap field-validator type=requiredstring message key=requiredstring/ /field-validator /field field name=piva field-validator type=requiredstring message key=requiredstring/ /field-validator /field field name=telefono field-validator type=requiredstring message key=requiredstring/ /field-validator /field /validators I placed the DTD but when I try to validate my form I see in the log: ... 09:47:13,501DEBUG AnnotationValidationInterceptor:134 - Validating /app/anagrafiche/modify with method e xecute. 09:47:13,564FATAL DomHelper:353 - The element type field-validator must be terminated by the matching end-tag /field-validator. at (null:14:11) org.xml.sax.SAXParseException: The element type field-validator must be terminated by the matching end -tag /field-validator. at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHand lerWrapper.java:236) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.ja va:215) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:38 6) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:31 6) at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1438) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanEndElement(XMLNSDocument ScannerImpl.java:696) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatc her.dispatch(XMLDocumentFragmentScannerImpl.java:1685) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocume ntFragmentScannerImpl.java:368) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:8 34) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:7 64) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:124 2) ... and then struts2 execute my action (processing my not validated data from the form ...). Maybe have I to do something to caught the exception and not to excecute the action when the validation-file is not wellformed? Thanks to reply. Stefano -- mihel wrote: nodep wrote: and it's wrong because there's a tag field-validator not closed. Struts2 doesn't stop the flow and go to my action: for me it's not logic, it should stop with some error and return to the prev page ... What do you think? We think that XML validity check is a task of DTD attached. Please put DTD (or Schema) to the XMLs and it will cure your issues. (In 2.0.9 DTDs became required for validator XMLs I think) Oleg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/-S2--validation-continue-even-if-there-is-an-error-tf4230757.html#a12048767 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Disabling struts UI objects
Hi, I tried to set some UI elements (button, select, ...) to be disabled, but they are still clickable. I would like to disable certain UI objects from an action code, where some logical verification will occur as the form is prepared. Any ideas about how this can be done? Thanks, Session - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Binding a Java 5 Enumeration to a Select Tag
Hi, I'd like to bind an enumeration directly to a select tag, so that all possible values appear in the ui and I don't need to change the JSP if the enumeration changes. Does anybody have a code snippet how to do this? I could not find anything about it in the documentation. Cheers, Thorsten - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
maven error
I have my working copy updated, revision 563485. The maven run has build failure. The log-file in attachment. http://www.nabble.com/file/p12049328/log0708081004.txt log0708081004.txt -- View this message in context: http://www.nabble.com/maven-error-tf4234956.html#a12049328 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: maven error
vadocz wrote: I have my working copy updated, revision 563485. The maven run has build failure. The log-file in attachment. http://www.nabble.com/file/p12049328/log0708081004.txt log0708081004.txt Sorry, I have missed clean. (mvn clean ...). So my question is not relevant. -- View this message in context: http://www.nabble.com/maven-error-tf4234956.html#a12049492 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] Re: Handling Session Objects
--- Sawan [EMAIL PROTECTED] wrote: But still I am seeing ;jsessionid=XXX in the url. Please suggest me for any possibility for this. - On the first request the server has no way of knowing if you have cookies enabled. - Server configuration doesn't know if your browser has cookies enabled. - It doesn't matter: the issue you had was that you went to a different machine, used the same session id, and were surprised when you got the same data. Now that you know not to type in or paste the session id you won't have that problem any more. d. Pinpoint customers who are looking for what you sell. http://searchmarketing.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: how to forward some action from javascritp
Hi, You can use the below given statements in javascripts to forward the control to the action. document.forms[0].action='myAction.do'; document.forms[0].submit(); Thanks Regards Rajam Thirunavukkarasu -Original Message- From: msg2ajay [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 08, 2007 8:47 AM To: user@struts.apache.org Subject: how to forward some action from javascritp hi i have to forward to controller with javascritp my script is as below. html head function fwd(field){ var val=field.value; if(val == 1){ [b]mypage.do[/b] //--- this is how i needed } } /head body html:select property=myPage onchange=fwd(this) html:option value=1one/html:option html:option value=2one/html:option html:option value=3one/html:option /body /html thx in Adv Ajay -- View this message in context: http://www.nabble.com/how-to-forward-some-action-from-javascritp-tf4234069.html#a12046424 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS*** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Localizing the list in a s:select-tag?
Hello, Is it possible to localize the options in the list attribute of the s:select-tag? I've tried several approaches but none of them seem to work. What I'm aiming at is something like the following: s:select name=somename list=#{ '01' : 'this should be some localized text from a bundle', '02' : 'this text should be localized too', } value=x / For some reason it seems to be impossible to use double quotes () for the elements in the map, unless escaped, and the escaping means that the expression inside won't be evaluated.
RE: [S2] Error Message display
Thanks for that. This is what I have ended up doing. It was more straightforward than I thought it would be anyway. Kind regards, Martin -Original Message- From: Zoran Avtarovski [mailto:[EMAIL PROTECTED] Sent: 08 August 2007 06:16 To: Struts Users Mailing List Subject: Re: [S2] Error Message display I know you mentioned it but I would suggest that the simplest method is to override the simple theme error tag template filederror.ftl and create a base that you're happy with. You then have something that is independent of the core libraries and can easily modify later. I've had to do this for a number of the simple themed templates and it works well. My only issue is that I'm not a huge fan of freemarker and would prefer to have the templates in jstl or velocity (There's only so much room in my little skull) Z. Hi, Short of modifying the template for s:fielderror is there a way to retrieve just the text of the error message on a JSP? Even with the theme set to simple I get the following on my jsp: ullispan class=errorMessageAn Error Message/span/li/ul What I want is just the message: An Error Message And then I am free to decorate it as I wish. Equally if you think I am taking the wrong approach to this please let me know. The goal is to just display an error message - to the right of the field and to decorate it with CSS classes of our choice. Ending up with something like this: input type=text name=myBean.name value= id=name/ span class=myErrorClassAn Error Message/span Many thanks! Martin Capgemini is a trading name used by the Capgemini Group of companies which includes Capgemini UK plc, a company registered in England and Wales (number 943935) whose registered office is at No. 1 Forge End, Woking, Surrey, GU21 6DB. This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Accessing ActionForm from JSP
How can I do that from the Scriplet ? TIA, Oleg. On 8/2/07, Aram Mkhitaryan [EMAIL PROTECTED] wrote: Try this ${actionFormName.propertyName} Best, Aram Aram Mkhitaryan 52, 25 Lvovyan, Yerevan 375000, Armenia Mobile: +374 91 518456 E-mail: [EMAIL PROTECTED]
How to list a property in a display:table (Struts 2)
Hi all! I've created a display table to show a list of things and their attributes. But one of those attributes is another list of objects. I don't know how to print their names. Let's see what I have: display:table name=usersBase class=displaytag pagesize=10 defaultsort=1 defaultorder=ascending export=true id=row requestURI=/user/list.mpch display:caption title=global.users/ display:column property=id titleKey=global.id sortable=true headerClass=sortable/ display:column property=login titleKey=global.login sortable=true headerClass=sortable/ display:column property=name titleKey=global.name sortable=true headerClass=sortable/ display:column property=cif titleKey=global.cif sortable=true headerClass=sortable/ display:column property=email titleKey=global.email sortable=true headerClass=sortable/ display:column property=roles titleKey=global.roles sortable=true headerClass=sortable/ display:column title=Roles s:iterator value=${row.roles} ITERATE /s:iterator /display:column display:column title=getTextglobal.provider sortable=true headerClass=sortable s:if test=${row.provider}==true Is provider /s:if s:else Is not provider /s:else /display:table Look at the roles property column. That property is a ListRoleVO which have an attribute RoleBaseVO wich have the String name. I'm trying to show the list of that names. (Now only prints: [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED] ) I thought to use an iterator as you can see, but the ITERATE!!! string is never shown. Any ideas? Thanks in advance, and sorry about my English. -- View this message in context: http://www.nabble.com/How-to-list-a-property-in-a-display%3Atable-%28Struts-2%29-tf4236011.html#a12052184 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to list a property in a display:table (Struts 2)
Set the uid attribute in the display:table -tag like this: display:table uid=row name=... id=... ... after that you can refer to the row from struts tags by using #attr.row so the iterator should now works like this: s:iterator value=#attr.row.roles On 8/8/07, fergunet [EMAIL PROTECTED] wrote: Hi all! I've created a display table to show a list of things and their attributes. But one of those attributes is another list of objects. I don't know how to print their names. Let's see what I have: display:table name=usersBase class=displaytag pagesize=10 defaultsort=1 defaultorder=ascending export=true id=row requestURI=/user/list.mpch display:caption title=global.users/ display:column property=id titleKey=global.id sortable=true headerClass=sortable/ display:column property=login titleKey=global.login sortable=true headerClass=sortable/ display:column property=name titleKey=global.name sortable=true headerClass=sortable/ display:column property=cif titleKey=global.cif sortable=true headerClass=sortable/ display:column property=email titleKey=global.email sortable=true headerClass=sortable/ display:column property=roles titleKey=global.roles sortable=true headerClass=sortable/ display:column title=Roles s:iterator value=${row.roles} ITERATE /s:iterator /display:column display:column title=getTextglobal.provider sortable=true headerClass=sortable s:if test=${row.provider}==true Is provider /s:if s:else Is not provider /s:else /display:table Look at the roles property column. That property is a ListRoleVO which have an attribute RoleBaseVO wich have the String name. I'm trying to show the list of that names. (Now only prints: [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED] ) I thought to use an iterator as you can see, but the ITERATE!!! string is never shown. Any ideas? Thanks in advance, and sorry about my English. -- View this message in context: http://www.nabble.com/How-to-list-a-property-in-a-display%3Atable-%28Struts-2%29-tf4236011.html#a12052184 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Extending ActionConfig in Struts2
Any clues?? Thanks, Vinod Original Message Subject: Extending ActionConfig in Struts2 From: Vinod Singh [EMAIL PROTECTED] To: user@struts.apache.org user@struts.apache.org Date: Tuesday, August 07, 2007 3:05:36 PM Hi All, The Struts 1.x provides a facility to extend the ActionMapping by defining it in web.xml in following manner- init-param param-namemapping/param-name param-valueCustomActionMapping/param-value /init-param In Struts 2.x I don't see anyway to extend ActionConfig. The ActionConfig class is hard coded in addAction(...) method of com.opensymphony.xwork2.config.providers.XmlConfigurationProvider. Can anyone guide me in extending ActionConfig, if I am missing something? Thanks, Vinod
S2 : Parameterized error messages
Hi, Is there a way to customize the error message with multiple keys provided from the resource bundle, using the XML/annotation approach ? In S1, we could do : field property=primaryApplicant.firstName depends=required arg0 key=error.pleaseenter / arg1 key=error.firstapplicantName.required / /field In S2 ; we use message to denote the error message ; but to what level can we customize it? ; can it be partially constant and varying? This could be useful if we use Visitor field validation, reuse the domain model for different actions and want the message to be different when invoked by each action or if the model is used in different instances (which i'm yet to figure out!) Thanks, Joseph
Re: Ajax submit button executeScripts=true evaluates javascript before DOM elements are defined
Thanks for your help. I don´t understand your answer, can you explain me with more detail? mihel wrote: rrecoba wrote: i have an ajax submit button that replaces the div specified by the targets attribute with the result from an action, and the result returned by the action has some javascript to be executed that uses the document.getElementById(). I´ve read that this is a known issue (WW-1951) that will be fixed in v2.1.0. How can i solve this problem while v2.1.0 is released.´ Thanks. Define a function with your JS and execute it once page is loaded. Try putting smth like _container_.addOnLoad(function() {alert('hi');}); inside the result. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Ajax-submit-button-executeScripts%3D%22true%22-evaluates-javascript-before-DOM-elements-are-defined-tf4232440.html#a12054786 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Extending ActionConfig in Struts2
Have you tried overriding the struts.configuration property with a new Confguration class that builds and returns your new ActionConfig? Vinod Singh wrote: Any clues?? Thanks, Vinod Original Message Subject: Extending ActionConfig in Struts2 From: Vinod Singh [EMAIL PROTECTED] To: user@struts.apache.org user@struts.apache.org Date: Tuesday, August 07, 2007 3:05:36 PM Hi All, The Struts 1.x provides a facility to extend the ActionMapping by defining it in web.xml in following manner- init-param param-namemapping/param-name param-valueCustomActionMapping/param-value /init-param In Struts 2.x I don't see anyway to extend ActionConfig. The ActionConfig class is hard coded in addAction(...) method of com.opensymphony.xwork2.config.providers.XmlConfigurationProvider. Can anyone guide me in extending ActionConfig, if I am missing something? Thanks, Vinod - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: struts1 or struts 2?
On 8/7/07, Frank W. Zammetti [EMAIL PROTECTED] wrote: Then again, if I *really* had my druthers, I'd use DWR for everything on the back-end and pick best-of-breed widgets on the UI to construct my own client-side framework... the last project I did more or less did this, although we used S1 and not DWR, but it worked out tremendously well, so in my mind the approach is more than sound, it's close to ideal... standard enough that a decent developer can get up to speed quick, but custom enough to fit the problem domain like a glove. +1 My team did our last project using the same sort of architecture, but since the backend was on .NET, we used Jayrock instead of DWR. Works great, and it also seems like the ideal mix to me. We had to roll our own solution for the server-side validation and type conversion, but we based that work on a chain of command, and it's layered so we can reuse it with multiple front end applications. -Ted. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
getting the value of a s:checkbox
Hi, I have the following checkbox in my jsp: s:checkbox key=overwriteCheckbox name=overwriteFlag labelposition=left onclick=if (this.checked) {javascript:return confirm('%{getText('elementOverwriteConfirmation')}')} / In my action, I have defined overwriteFlag as a String variable, and have a getter and a setter for it. Nevertheless, when I submit the form, I always get null when I try to check the value. Any ideas what I could be doing wrong? Thanks, Session - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: getting the value of a s:checkbox
Session A Mwamufiya wrote: s:checkbox key=overwriteCheckbox name=overwriteFlag Isn't key a shorthand for name, value, and label? If so, I'm not sure which of name and key will win. Look in the generated html--is the name attribute of the corresponding input tag overwriteCheckbox or overwriteFlag? -Dale - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: getting the value of a s:checkbox
The name appears as overwriteFlag, so the name took precedence. I used the key to get the label text from a properties file. Interestingly, the html source code shows the value as true, even if it is not checked when displayed. The action variable should be a String or a boolean? I tried both, and neither worked. Thanks, Session Session A Mwamufiya wrote: s:checkbox key=overwriteCheckbox name=overwriteFlag Isn't key a shorthand for name, value, and label? If so, I'm not sure which of name and key will win. Look in the generated html--is the name attribute of the corresponding input tag overwriteCheckbox or overwriteFlag? -Dale - 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: struts1 or struts 2?
Hi Ted/Frank, Is there a more detailed post/article that you have done regarding this architecture? Thanks Rahul -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Ted Husted Sent: Wednesday, August 08, 2007 12:27 PM To: Struts Users Mailing List Subject: Re: struts1 or struts 2? On 8/7/07, Frank W. Zammetti [EMAIL PROTECTED] wrote: Then again, if I *really* had my druthers, I'd use DWR for everything on the back-end and pick best-of-breed widgets on the UI to construct my own client-side framework... the last project I did more or less did this, although we used S1 and not DWR, but it worked out tremendously well, so in my mind the approach is more than sound, it's close to ideal... standard enough that a decent developer can get up to speed quick, but custom enough to fit the problem domain like a glove. +1 My team did our last project using the same sort of architecture, but since the backend was on .NET, we used Jayrock instead of DWR. Works great, and it also seems like the ideal mix to me. We had to roll our own solution for the server-side validation and type conversion, but we based that work on a chain of command, and it's layered so we can reuse it with multiple front end applications. -Ted. - 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: getting the value of a s:checkbox
--- Session A Mwamufiya wrote: Interestingly, the html source code shows the value as true, even if it is not checked when displayed. Not relevant; the only time the value matters is on submission--The value has to be set so the browser knows what to send on submission. d. Park yourself in front of a world of choices in alternative vehicles. Visit the Yahoo! Auto Green Center. http://autos.yahoo.com/green_center/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: getting the value of a s:checkbox
Session A Mwamufiya wrote: I used the key to get the label text from a properties file. If that's the only reason you used it, then the label attribute is more appropriate. Interestingly, the html source code shows the value as true, even if it is not checked when displayed. That means the value passed for the checkbox *when checked* will be true. When checkboxes are not checked the parameter is simply missing in the request. There's an interceptor called checkbox that does some hidden magic to make it appear that the checkbox sends true or false depending upon whether or not it is checked. (Make sure this is before parameters in the stack.) The action variable should be a String or a boolean? I tried both, and neither worked. The problem is that you don't break down the problems before posting. There are lots of places you can get clues as to what's happening, but you have to understand that different parts of the process happen on different machines. Request cycle: (Let's start with a form already being viewed in a browser) This page only contains (x)html components, and maybe javascript. The browser handles getting all the right data into the right parameters and submits the values. You can look at the generated html (view source) to see if it contains what you expect. If you're using complicated tools (like ajax components), those might be added to the page after it's initially generated, and the firebug extension might help you see what's really there. The page info option in firefox can help you see what the form's current values are. OK--the browser submits the form. Often this is sent using post (look in the form tag) which hides the values, but if you want to see what was submitted right in the url, you can (temporarily) change this to get. OK--now this request goes to your server. Hopefully eventually to struts. Struts then steps through the interceptors and eventually calls your action. The action does it's thing and selects a result. The result often is a .jsp page, which may have s:FOO tags in it. These get executed on the server and output the html that is sent to the browser. The browser gets this html, executes any javascript, and displays the results. The cycle is complete. At any point in the cycle you should be able to verify that things are doing what you expect, but you need to know where to expect them. For example, you asked last week about having the action pop up alert boxes for validation. You probably didn't get any responses because the question doesn't make sense. By the time the action is running it is already too late for the browser to do what you wanted. The popups you wanted must be generated by the browser before submitting the request to the server, and so must be handled by javascript. There are some tools in struts to generate client side validation which means javascript to verify stuff before submitting, but there's no magic--that validation logic must be in the page being displayed, and therefore debugable separately from the rest. -Dale - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: struts1 or struts 2?
Not specifically, no... although, both of my books go into this sort of thing, and the first one includes a DWR-based project. I'm also in the midst of a third book which will very definitely cover this topic in detail right lots of practical examples... due out in, roughly, this coming January. Frank -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com AIM/Yahoo: fzammetti MSN: [EMAIL PROTECTED] Author of Practical Ajax Projects With Java Technology (2006, Apress, ISBN 1-59059-695-1) and JavaScript, DOM Scripting and Ajax Projects (2007, Apress, ISBN 1-59059-816-4) Java Web Parts - http://javawebparts.sourceforge.net Supplying the wheel, so you don't have to reinvent it! On Wed, August 8, 2007 12:58 pm, Asthana, Rahul wrote: Hi Ted/Frank, Is there a more detailed post/article that you have done regarding this architecture? Thanks Rahul -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Ted Husted Sent: Wednesday, August 08, 2007 12:27 PM To: Struts Users Mailing List Subject: Re: struts1 or struts 2? On 8/7/07, Frank W. Zammetti [EMAIL PROTECTED] wrote: Then again, if I *really* had my druthers, I'd use DWR for everything on the back-end and pick best-of-breed widgets on the UI to construct my own client-side framework... the last project I did more or less did this, although we used S1 and not DWR, but it worked out tremendously well, so in my mind the approach is more than sound, it's close to ideal... standard enough that a decent developer can get up to speed quick, but custom enough to fit the problem domain like a glove. +1 My team did our last project using the same sort of architecture, but since the backend was on .NET, we used Jayrock instead of DWR. Works great, and it also seems like the ideal mix to me. We had to roll our own solution for the server-side validation and type conversion, but we based that work on a chain of command, and it's layered so we can reuse it with multiple front end applications. -Ted. - 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: getting the value of a s:checkbox
Dale Newfield wrote: OK--now this request goes to your server. Hopefully eventually to struts. Struts then steps through the interceptors and eventually calls your action. The action does it's thing and selects a result. And this whole process can generate as many logs as you have log4j set up to generate. For example, here's a piece from a log (in this case generated because the request was multipart/included an upload) in my app showing that there were two parameters found in the request corresponding with the form's single checkbox: MultiPartRequest.parse(94) | Found item user.commentsPlain MultiPartRequest.parse(96) | Item is a normal form field MultiPartRequest.parse(94) | Found item __checkbox_user.commentsPlain MultiPartRequest.parse(96) | Item is a normal form field Why were there two? Because s:checkbox generated not only an input of type checkbox, but also an input of type hidden. These are both visible in the html of the page with the form. How does having the __checkbox_user.commentsPlain parameter help? Well, the checkbox interceptor notices that it's there, and if user.commentsPlain is not, it does whatever it needs to to make the rest of the process do the right thing. -Dale - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Possible to package struts2 actions/code in a reusable jar?
We have several projects that will have many common actions and links to common JSP names. For example, all of our projects will have a Welcome action and a related welcome.jsp. I'd like to be able to create a common-actions.jar that would essentially contain all of the source code needed for each common action to run (Action classes, beans, DAOs, Entity objects, etc). The hope would be that I could put the struts.xml in the jar as well as .properties files and then override them as necessary under each project's src folder. So here's what I've done so far, my directory structure looks like this: src arson/ action/ biz/ model/ META-INF/ arson.properties log4j.properties struts.xml I tried jarring up everything under src. Then in eclipse, I added the external jar to the project, and put it at the very top of my buildpath. When I try to access my Welcome action, it couldn't find it, giving me this error: There is no Action mapped for namespace / and action name Welcome. - [unknown location] Any idea if what I want to do is even possible, or what I could be doing wrong? Thanks! Aaron -- View this message in context: http://www.nabble.com/Possible-to-package-struts2-actions-code-in-a-reusable-jar--tf4238026.html#a12058541 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: struts1 or struts 2?
I have JavaScript, DOM Scripting and Ajax Projects -- good book for people who want to get into AJAX. On 8/8/07, Frank W. Zammetti [EMAIL PROTECTED] wrote: Not specifically, no... although, both of my books go into this sort of thing, and the first one includes a DWR-based project. I'm also in the midst of a third book which will very definitely cover this topic in detail right lots of practical examples... due out in, roughly, this coming January. Frank -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com AIM/Yahoo: fzammetti MSN: [EMAIL PROTECTED] Author of Practical Ajax Projects With Java Technology (2006, Apress, ISBN 1-59059-695-1) and JavaScript, DOM Scripting and Ajax Projects (2007, Apress, ISBN 1-59059-816-4) Java Web Parts - http://javawebparts.sourceforge.net Supplying the wheel, so you don't have to reinvent it!
Re: struts1 or struts 2?
Thanks Paul... The envelope is in the mail! wink-wink/ :) Frank -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com AIM/Yahoo: fzammetti MSN: [EMAIL PROTECTED] Author of Practical Ajax Projects With Java Technology (2006, Apress, ISBN 1-59059-695-1) and JavaScript, DOM Scripting and Ajax Projects (2007, Apress, ISBN 1-59059-816-4) Java Web Parts - http://javawebparts.sourceforge.net Supplying the wheel, so you don't have to reinvent it! On Wed, August 8, 2007 2:03 pm, Paul Benedict wrote: I have JavaScript, DOM Scripting and Ajax Projects -- good book for people who want to get into AJAX. On 8/8/07, Frank W. Zammetti [EMAIL PROTECTED] wrote: Not specifically, no... although, both of my books go into this sort of thing, and the first one includes a DWR-based project. I'm also in the midst of a third book which will very definitely cover this topic in detail right lots of practical examples... due out in, roughly, this coming January. Frank -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com AIM/Yahoo: fzammetti MSN: [EMAIL PROTECTED] Author of Practical Ajax Projects With Java Technology (2006, Apress, ISBN 1-59059-695-1) and JavaScript, DOM Scripting and Ajax Projects (2007, Apress, ISBN 1-59059-816-4) Java Web Parts - http://javawebparts.sourceforge.net Supplying the wheel, so you don't have to reinvent it! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
S2- How to use Constants in s:select tag
Hi, I am having trouble using my constants class in my jsp. I defined a service for lookup list of values for my select box. This in my jsp works fine s:select name=type value=myVO.type list=%{lookupService.getList('type')} listKey=id listValue=type / But when I tried to change the list=%{lookupService.getList('type')} to list=%{lookupService.getList(MyConstants.Type)} I got this error: The requested list key '{%lookupService.getList(MyConstants.Type)}' could not be resolved as a collection/array/map/enumberation/iterator type. I did import the constants class in the jsp. What is the right syntax for this? Many thanks for your help, Jane - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: struts1 or struts 2?
Thanks Paul and Frank for the books. I used some AJAX in a project, and I had made a mental note to myself(though I dont remember why,exactly, hehe) that for data calls that do not change the content of the page = ajax.For calls that may result in the way a page can be rendered = new left nav, new tables , new html elements etc..=go to UI controller\ servlet or whatever. Besides,I was also interested in how things like workflow are handled in an AJAX based framework, as opposed to a webapp that happens to use AJAX . -Original Message- From: Frank W. Zammetti [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 08, 2007 2:13 PM To: Struts Users Mailing List Cc: Struts Users Mailing List Subject: Re: struts1 or struts 2? Thanks Paul... The envelope is in the mail! wink-wink/ :) Frank -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com AIM/Yahoo: fzammetti MSN: [EMAIL PROTECTED] Author of Practical Ajax Projects With Java Technology (2006, Apress, ISBN 1-59059-695-1) and JavaScript, DOM Scripting and Ajax Projects (2007, Apress, ISBN 1-59059-816-4) Java Web Parts - http://javawebparts.sourceforge.net Supplying the wheel, so you don't have to reinvent it! On Wed, August 8, 2007 2:03 pm, Paul Benedict wrote: I have JavaScript, DOM Scripting and Ajax Projects -- good book for people who want to get into AJAX. On 8/8/07, Frank W. Zammetti [EMAIL PROTECTED] wrote: Not specifically, no... although, both of my books go into this sort of thing, and the first one includes a DWR-based project. I'm also in the midst of a third book which will very definitely cover this topic in detail right lots of practical examples... due out in, roughly, this coming January. Frank -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com AIM/Yahoo: fzammetti MSN: [EMAIL PROTECTED] Author of Practical Ajax Projects With Java Technology (2006, Apress, ISBN 1-59059-695-1) and JavaScript, DOM Scripting and Ajax Projects (2007, Apress, ISBN 1-59059-816-4) Java Web Parts - http://javawebparts.sourceforge.net Supplying the wheel, so you don't have to reinvent it! - 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: S2- How to use Constants in s:select tag
Jiang, Jane (NIH/NCI) [C] wrote: But when I tried to change the list=%{lookupService.getList('type')} to list=%{lookupService.getList(MyConstants.Type)} Try list=%{lookupService.getList(@[EMAIL PROTECTED])} http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/staticFields.html -Dale - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
S2: HashMap - from jsp to action
I'm iterating a collection (keys) from s:action to get corresponding hashmap (values) from aforementioned s:action then creating multiple s:select. Does anyone know how to construct a hashmap with ognl on a jsp? What type is then needed on the action to populate the hashmap? James
RE: S2- How to use Constants in s:select tag
That works. Thanks a lot, Dale! -Original Message- From: Dale Newfield [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 08, 2007 2:25 PM To: Struts Users Mailing List Subject: Re: S2- How to use Constants in s:select tag Jiang, Jane (NIH/NCI) [C] wrote: But when I tried to change the list=%{lookupService.getList('type')} to list=%{lookupService.getList(MyConstants.Type)} Try list=%{lookupService.getList(@[EMAIL PROTECTED])} http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/staticFields. html -Dale - 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: getting the value of a s:checkbox
I appreciate the explanation on how it's all supposed to work, but given my limited experience with struts 2 and this type of framework as a whole, I am not yet proficient enough to figure out where things are being generated. I use log4j to log a number of events in my code, but I don't even know how to display this type of request object logging you're presenting. I need examples to run with and understand how things work; going through this was helpful to get a big view, and I don't mean to be rude, but it still doesn't help me read the checkbox value. Is there a simple example I can follow? That's the best way I learn. Thanks, Session Dale Newfield wrote: OK--now this request goes to your server. Hopefully eventually to struts. Struts then steps through the interceptors and eventually calls your action. The action does it's thing and selects a result. And this whole process can generate as many logs as you have log4j set up to generate. For example, here's a piece from a log (in this case generated because the request was multipart/included an upload) in my app showing that there were two parameters found in the request corresponding with the form's single checkbox: MultiPartRequest.parse(94) | Found item user.commentsPlain MultiPartRequest.parse(96) | Item is a normal form field MultiPartRequest.parse(94) | Found item __checkbox_user.commentsPlain MultiPartRequest.parse(96) | Item is a normal form field Why were there two? Because s:checkbox generated not only an input of type checkbox, but also an input of type hidden. These are both visible in the html of the page with the form. How does having the __checkbox_user.commentsPlain parameter help? Well, the checkbox interceptor notices that it's there, and if user.commentsPlain is not, it does whatever it needs to to make the rest of the process do the right thing. -Dale - 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]
How to generate an ANCHOR tag dynamically?
Hi all. Is there any way to make a dynamic anchor tag in a struts link? I'm also using tiles. The following does not work as the JSP interpreter can't... html:link action=showsitehelp.do anchor=tiles:getAsString name=helppointer / I'm trying to have a link to a help page that's context sensitive, so where ever you are pressing help takes you to the appropriate point on the help page. Is there any other way of doing this please? Thanks in advance. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to generate an ANCHOR tag dynamically?
Use the Tiles tag that can expose the tiles attribute as a page attribute. Maybe getAsString can do it. But once it is a page attribute, you can do: html:link anchor=${myvar} / Paul On 8/8/07, Paul Uszak [EMAIL PROTECTED] wrote: Hi all. Is there any way to make a dynamic anchor tag in a struts link? I'm also using tiles. The following does not work as the JSP interpreter can't... html:link action=showsitehelp.do anchor=tiles:getAsString name=helppointer / I'm trying to have a link to a help page that's context sensitive, so where ever you are pressing help takes you to the appropriate point on the help page. Is there any other way of doing this please? Thanks in advance. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: getting the value of a s:checkbox
Session A Mwamufiya wrote: Is there a simple example I can follow? That's the best way I learn. http://struts.apache.org/2.x/docs/using-checkboxes.html includes a detailed example. -Dale - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Possible to package struts2 actions/code in a reusable jar?
Looks like you are talking about creating a plugin. I think the issue is that struts.xml needs to be renamed to the plugin specific name. WiltOnTilt wrote: We have several projects that will have many common actions and links to common JSP names. For example, all of our projects will have a Welcome action and a related welcome.jsp. I'd like to be able to create a common-actions.jar that would essentially contain all of the source code needed for each common action to run (Action classes, beans, DAOs, Entity objects, etc). The hope would be that I could put the struts.xml in the jar as well as .properties files and then override them as necessary under each project's src folder. So here's what I've done so far, my directory structure looks like this: src arson/ action/ biz/ model/ META-INF/ arson.properties log4j.properties struts.xml I tried jarring up everything under src. Then in eclipse, I added the external jar to the project, and put it at the very top of my buildpath. When I try to access my Welcome action, it couldn't find it, giving me this error: There is no Action mapped for namespace / and action name Welcome. - [unknown location] Any idea if what I want to do is even possible, or what I could be doing wrong? Thanks! Aaron
Re: Possible to package struts2 actions/code in a reusable jar?
The JSPs cannot be accessed if they are inside a jar.I could be wrong on this, but I don't think that putting struts.xml inside the jar will work. If you package it as a plugin, and map the actions in the plugin xml, and use FreeMarker for the viewer you will be fine. musachy On 8/8/07, WiltOnTilt [EMAIL PROTECTED] wrote: We have several projects that will have many common actions and links to common JSP names. For example, all of our projects will have a Welcome action and a related welcome.jsp. I'd like to be able to create a common-actions.jar that would essentially contain all of the source code needed for each common action to run (Action classes, beans, DAOs, Entity objects, etc). The hope would be that I could put the struts.xml in the jar as well as .properties files and then override them as necessary under each project's src folder. So here's what I've done so far, my directory structure looks like this: src arson/ action/ biz/ model/ META-INF/ arson.properties log4j.properties struts.xml I tried jarring up everything under src. Then in eclipse, I added the external jar to the project, and put it at the very top of my buildpath. When I try to access my Welcome action, it couldn't find it, giving me this error: There is no Action mapped for namespace / and action name Welcome. - [unknown location] Any idea if what I want to do is even possible, or what I could be doing wrong? Thanks! Aaron -- View this message in context: http://www.nabble.com/Possible-to-package-struts2-actions-code-in-a-reusable-jar--tf4238026.html#a12058541 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Hey you! Would you help me to carry the stone? Pink Floyd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts Url Validator
Does anybody know if I can use Struts Url Validator for intranet url? For exampe: http://intranet or http://localhost:8080 Thanks, semaj -- View this message in context: http://www.nabble.com/Struts-Url-Validator-tf4238692.html#a12060732 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
get properties action for theme ajax
How I get the properties (variable result) when the for is submit with Ajax theme, look: Form: s:div theme=ajax id=success loadingText=Loading information... errorText=Unable to contact server href=${pageContext.request.contextPath}/success.jsp listenTopics=/refresh /s:div s:form action=Person_save id=person s:textfield name=person.firstName id=person.firstName label=FirstName / s:textfield name=person.lastName id=person.lastName label=LastName / s:textfield name=person.age id=person.age label=age / s:submit theme=ajax notifyTopics=/save,/refresh/ /s:form The Person_save is a action that return success or error and set one var names msg when some message to the user, I want to show that message, if I don't use the Ajax Theme, everything is fine. public String save(){ try{ personDAO.persist(person); System.out.println(person-+person.getId()); msg = The data was save in DB; return Action.SUCCESS; }catch(Exception e){ msg = Error saving Data!!; return Action.ERROR; } } Manuel Correa.
RE: get properties action for theme ajax
Ok, I found, targets property in the submit button. Thanks. Manuel Correa. -Original Message- From: Manuel Correa [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 08, 2007 4:04 PM To: Struts Users Mailing List Subject: get properties action for theme ajax How I get the properties (variable result) when the for is submit with Ajax theme, look: Form: s:div theme=ajax id=success loadingText=Loading information... errorText=Unable to contact server href=${pageContext.request.contextPath}/success.jsp listenTopics=/refresh /s:div s:form action=Person_save id=person s:textfield name=person.firstName id=person.firstName label=FirstName / s:textfield name=person.lastName id=person.lastName label=LastName / s:textfield name=person.age id=person.age label=age / s:submit theme=ajax notifyTopics=/save,/refresh/ /s:form The Person_save is a action that return success or error and set one var names msg when some message to the user, I want to show that message, if I don't use the Ajax Theme, everything is fine. public String save(){ try{ personDAO.persist(person); System.out.println(person-+person.getId()); msg = The data was save in DB; return Action.SUCCESS; }catch(Exception e){ msg = Error saving Data!!; return Action.ERROR; } } Manuel Correa. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
struts 2.0.9 disable automatic session creation
Hi there, I am looking for ways to prevent automatic session creation on certain monitoring pages of my site. The rest of the application will indeed have regular session support. Any one has any recipes they want to share? I'm using struts 2.0.9 with sitemesh decorators and freemarker as the view. I remember with struts 1, it wasn't exactly easy. There was a checklist that had to be followed. Something like: 1. Make sure controller element has locale=false 2. Use %@ page session=false % in JSPs 3. etc... Thanks in advance, -- Haroon Rafique [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
portlet jasper report example
Greetings to all, i am trying to use jasper reports under liferay. I think that i managed to add successfully my portlet to liferay although i had issues with the struts.xml file (had to manually add the result type jasper pointing to the plugin class). The problem is that now i get an uncaught exception from class JasperReportsResult.java at line 222: File directory = new File(systemId.substring(0, systemId.lastIndexOf(File.separator))); Has anyone come across this issue before ? or if someone has a struts 2.0.9 Working tutorial (a..z) can you please send me a link ? Thank you very much Regards, Leonidas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: portlet jasper report example
Hi! Jasper reports is, as far as I know, not tested in the portlet framework. I'm not too familiar with Jasper, but if it's something that should be generated and displayed on the fly (that is of binary type), this cannot be done in a portlet in a portable manner. You might have better luck dispatching your request to a servlet that does the job. There's no problem combining servlets and portlets in your application. Nils-H On 8/8/07, Leonidas Papadakis [EMAIL PROTECTED] wrote: Greetings to all, i am trying to use jasper reports under liferay. I think that i managed to add successfully my portlet to liferay although i had issues with the struts.xml file (had to manually add the result type jasper pointing to the plugin class). The problem is that now i get an uncaught exception from class JasperReportsResult.java at line 222: File directory = new File(systemId.substring(0, systemId.lastIndexOf(File.separator))); Has anyone come across this issue before ? or if someone has a struts 2.0.9 Working tutorial (a..z) can you please send me a link ? Thank you very much Regards, Leonidas - 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 2.0.9 disable automatic session creation
On Today at 4:16pm, HR=Haroon Rafique [EMAIL PROTECTED] wrote: HR [..snip..] HR HR Any one has any recipes they want to share? I'm using struts 2.0.9 HR with sitemesh decorators and freemarker as the view. HR Since I use sitemesh, I think I know the culprit is sitemesh. I found the following at the bottom of: http://cwiki.apache.org/WW/performance-tuning.html Do not create sessions unless you need them. Struts 2 does not create sessions unless asked to (for example, by having the createSession interceptor in your interceptor stack). Note that when you use SiteMesh however, a session will always be created (See http://forums.opensymphony.com/thread.jspa?messageID=5688 for details). Later, -- Haroon Rafique [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[2] Changing xwork.default.invalid.fieldvalue to report type
The default value for a type mismatch error (when doing conversion) is: xwork.default.invalid.fieldvalue=Invalid field value for field {0}. I'd like to change it to render something like Please enter a valid date. or Please enter a valid number.. Is it possible to decipher the type of the field and print that out? I realize I can customize the invalid messages on a per-field basis, but I'd like to do it on a per-type basis. Thanks, Matt -- View this message in context: http://www.nabble.com/-2--Changing-xwork.default.invalid.fieldvalue-to-report-type-tf4239378.html#a12062895 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Possible to package struts2 actions/code in a reusable jar?
I believe by default, Struts will load multiple struts.xml files on the classpath, so creating jars, each with their own struts.xml, should work. As mentioned, JSP's won't work, but you could put the in the usual places, leaving the jars for config and Java code. Don On 8/9/07, Ian Roughley [EMAIL PROTECTED] wrote: Looks like you are talking about creating a plugin. I think the issue is that struts.xml needs to be renamed to the plugin specific name. WiltOnTilt wrote: We have several projects that will have many common actions and links to common JSP names. For example, all of our projects will have a Welcome action and a related welcome.jsp. I'd like to be able to create a common-actions.jar that would essentially contain all of the source code needed for each common action to run (Action classes, beans, DAOs, Entity objects, etc). The hope would be that I could put the struts.xml in the jar as well as .properties files and then override them as necessary under each project's src folder. So here's what I've done so far, my directory structure looks like this: src arson/ action/ biz/ model/ META-INF/ arson.properties log4j.properties struts.xml I tried jarring up everything under src. Then in eclipse, I added the external jar to the project, and put it at the very top of my buildpath. When I try to access my Welcome action, it couldn't find it, giving me this error: There is no Action mapped for namespace / and action name Welcome. - [unknown location] Any idea if what I want to do is even possible, or what I could be doing wrong? Thanks! Aaron - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Extending ActionConfig in Struts2
The bigger question is why you would want to do this. In Struts 1, it was one of the few ways to pass configuration information to an Action. In Struts 2, you can pass values directly to an action via setters, which is a better solution imo. Don On 8/9/07, Ian Roughley [EMAIL PROTECTED] wrote: Have you tried overriding the struts.configuration property with a new Confguration class that builds and returns your new ActionConfig? Vinod Singh wrote: Any clues?? Thanks, Vinod Original Message Subject: Extending ActionConfig in Struts2 From: Vinod Singh [EMAIL PROTECTED] To: user@struts.apache.org user@struts.apache.org Date: Tuesday, August 07, 2007 3:05:36 PM Hi All, The Struts 1.x provides a facility to extend the ActionMapping by defining it in web.xml in following manner- init-param param-namemapping/param-name param-valueCustomActionMapping/param-value /init-param In Struts 2.x I don't see anyway to extend ActionConfig. The ActionConfig class is hard coded in addAction(...) method of com.opensymphony.xwork2.config.providers.XmlConfigurationProvider. Can anyone guide me in extending ActionConfig, if I am missing something? Thanks, Vinod - 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: [2] Changing xwork.default.invalid.fieldvalue to report type
Hmm...could you use a custom TextProvider impl that recognizes that error key, checks the type of the parameter, then looks up a new error key, say 'xwork.default.invalid.fieldvalue.number'? Don On 8/9/07, mraible [EMAIL PROTECTED] wrote: The default value for a type mismatch error (when doing conversion) is: xwork.default.invalid.fieldvalue=Invalid field value for field {0}. I'd like to change it to render something like Please enter a valid date. or Please enter a valid number.. Is it possible to decipher the type of the field and print that out? I realize I can customize the invalid messages on a per-field basis, but I'd like to do it on a per-type basis. Thanks, Matt -- View this message in context: http://www.nabble.com/-2--Changing-xwork.default.invalid.fieldvalue-to-report-type-tf4239378.html#a12062895 Sent from the Struts - User mailing list archive at Nabble.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: how to forward some action from javascritp
hi, I have used that it is working, but the problem is I need to re-load the page freame newly. In my present case, Iam getting data from database. All the values will be displayed on the textbox's. When i used the code which u have given it is reloading but the values are not getting lost, I mean the page is getting reloaded but not getting the textboxes blank. It is carrying previous data. can u help me rgds this. Rajam T. wrote: Hi, You can use the below given statements in javascripts to forward the control to the action. document.forms[0].action='myAction.do'; document.forms[0].submit(); Thanks Regards Rajam Thirunavukkarasu -Original Message- From: msg2ajay [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 08, 2007 8:47 AM To: user@struts.apache.org Subject: how to forward some action from javascritp hi i have to forward to controller with javascritp my script is as below. html head function fwd(field){ var val=field.value; if(val == 1){ [b]mypage.do[/b] //--- this is how i needed } } /head body html:select property=myPage onchange=fwd(this) html:option value=1one/html:option html:option value=2one/html:option html:option value=3one/html:option /body /html thx in Adv Ajay -- View this message in context: http://www.nabble.com/how-to-forward-some-action-from-javascritp-tf4234069.html#a12046424 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS*** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/how-to-forward-some-action-from-javascritp-tf4234069.html#a12065110 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts Url Validator
I can validate http://www.google.com, https://www.google.com, but not http://google Is this the limitation of struts url validator? I would really appreciate if someone would reply. Thank you, semaj semaj.najraham wrote: Does anybody know if I can use Struts Url Validator for intranet url? For exampe: http://intranet or http://localhost:8080 Thanks, semaj -- View this message in context: http://www.nabble.com/Struts-Url-Validator-tf4238692.html#a12065552 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
WARNings from OgnlUtil during normal use of redirect-action result
Hi I believe I'm using the redirect-action result type in the recommended way, but I'm seeing warnings from OgnlUtil in my log4j logs. Is there a way to avoid the warnings, short of adjusting log4j.xml? The stack traces are very deep, so they spam the logs. But I don't really want to exclude all warnings from OgnlUtil from my logs, because I want the application to be as easy to maintain as possible. The current exception is correct: there is no property 'pageName' on 'org.apache.struts2.dispatcher.ServletActionRedirectResult'. I want the 'pageName' parameter passed as a parameter to the next action. The struts documentation at http://struts.apache.org/2.x/docs/redirect-action-result.html suggests that my struts config file is following the correct usage to achieve this effect. Here's a snippet from my struts.xml: action name=savePagePart5 class=com.zzz.actions.SaveApplicationAction result name=success type=redirect-action param name=actionNameviewPage.action/param param name=pageName${page.nextPage}/param /result /action And an excerpt from the resulting stack trace: [2007-08-09 12:41:40,246] WARN [SocketListener0-0] com.opensymphony.xwork2.util.OgnlUtil:369 - Caught OgnlException while setting property 'pageName' on type 'org.apache.struts2.dispatcher.ServletActionRedirectResult'. ognl.NoSuchPropertyException: org.apache.struts2.dispatcher.ServletActionRedirectResult.pageName at ognl.ObjectPropertyAccessor.setProperty(ObjectPropertyAccessor.java:132) at com.opensymphony.xwork2.util.OgnlValueStack$ObjectAccessor.setProperty(O gnlValueStack.java:68) at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:1656) at ognl.ASTProperty.setValueBody(ASTProperty.java:101) at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177) at ognl.SimpleNode.setValue(SimpleNode.java:246) at ognl.Ognl.setValue(Ognl.java:476) at com.opensymphony.xwork2.util.OgnlUtil.setValue(OgnlUtil.java:186) at com.opensymphony.xwork2.util.OgnlUtil.internalSetProperty(OgnlUtil.java: 360) at com.opensymphony.xwork2.util.OgnlUtil.setProperties(OgnlUtil.java:76) at com.opensymphony.xwork2.util.OgnlUtil.setProperties(OgnlUtil.java:49) at org.apache.struts2.impl.StrutsObjectFactory.buildResult(StrutsObjectFact ory.java:95) at com.opensymphony.xwork2.DefaultActionInvocation.createResult(DefaultActi onInvocation.java:195) at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultAct ionInvocation.java:342) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvo cation.java:253) .. at org.mortbay.http.HttpConnection.handle(HttpConnection.java:837) at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:245 ) at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357) at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534) Cheers! Dave This e-mail and any attachments to it (the Communication) is, unless otherwise stated, confidential, may contain copyright material and is for the use only of the intended recipient. If you receive the Communication in error, please notify the sender immediately by return e-mail, delete the Communication and the return e-mail, and do not read, copy, retransmit or otherwise deal with it. Any views expressed in the Communication are those of the individual sender only, unless expressly stated to be those of Australia and New Zealand Banking Group Limited ABN 11 005 357 522, or any of its related entities including ANZ National Bank Limited (together ANZ). ANZ does not accept liability in connection with the integrity of or errors in the Communication, computer virus, data corruption, interference or delay arising from or in respect of the Communication. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Binding a Java 5 Enumeration to a Select Tag
S1 or S2? On 8/8/07, Thorsten Schäfer [EMAIL PROTECTED] wrote: Hi, I'd like to bind an enumeration directly to a select tag, so that all possible values appear in the ui and I don't need to change the JSP if the enumeration changes. Does anybody have a code snippet how to do this? I could not find anything about it in the documentation. Cheers, Thorsten - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]