Re: Random ClassCastException : I'm expecting Long, Struts gives me String on some servers...
I put some @Conversion(), @Element(value = java.lang.Long.class) and @TypeConversion(rule = ConversionRule.COLLECTION, converter = "java.lang.Long") in my Action and it's not working better. So I set the convertion in a properties file with : Element_idsCommerciaux=java.lang.Long and it is working, thanks Ralf. I tried to put v2.1.6 but I had a lot of trouble with EL expression (s:if test="${}", s:if test="#session...") which seemed to have changed, but I see nothing in the docs, release ntoes or migration guide, so I gave up (600 JSP to change and no time to do it) Thanks for your help. -- View this message in context: http://www.nabble.com/Random-ClassCastException-%3A-I%27m-expecting-Long%2C-Struts-gives-me-String-on-some-servers...-tp21722894p21743689.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Random ClassCastException : I'm expecting Long, Struts gives me String on some servers...
Hi, Thanks for your reply. What I can't understand is why it works in some environments, and no others. The war is the same. And why do you say that the "generic type of the idsCommerciaux list is not available at runtime" ? I defined it as a List in the Action. So Struts should know that it has to convert the data submitted to Long, doesn't it ? Ralf Fischer-2 wrote: > > Hi, > > This seems like a type erasure problem. Reflection is used to set the > entries into the list. As the generic type of the idsCommerciaux list > is not available at runtime the no convertion to Long takes place for > the List elements. So a List containing Strings is injected. Check out > the Collection and Map Support portion from the type conversion > documentation[1]. You might want use an ObjectTypeDeterminer I think. > >> Struts2 version : 2.1.0 > > You should think about upgrading to 2.1.6, as it became GA recently. > > Cheers, > -Ralf > > [1] http://struts.apache.org/2.0.14/docs/type-conversion.html > > > -- View this message in context: http://www.nabble.com/Random-ClassCastException-%3A-I%27m-expecting-Long%2C-Struts-gives-me-String-on-some-servers...-tp21722894p21729390.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Random ClassCastException : I'm expecting Long, Struts gives me String on some servers...
Hi all, I have a very strange thing. I have a multiple select in my JSP, and a List of ids in my Action. When I submit the form, I iterate on that List of Long, and I have this error : java.lang.ClassCastException: java.lang.String Struts has String in the List instead of Long. The strange thing is that it appends on some servers (TomCat 5.5) but not on other : it works on my local computer, bug on the test server, works on the production server, and works on all other servers. I first thought it was a Struts dtd cache version problem on the Eclipse of the person building the WAR, but I have the same problem on my Eclipse (which build working WAR for other servers). We copied all jars files from shared/lib of a working TomCat to the bugging TomCat, but it doesn't fix the problem. Did someone already see such a thing ? Do you have an idea of where it could bug ? Thanks a lot. Here is my code : JSP : (id is a long, nomComplet is a String) Action : private List idsCommerciaux; public List getIdsCommerciaux() { return idsCommerciaux; } public void setIdsCommerciaux(List idsCommerciaux) { this.idsCommerciaux = idsCommerciaux; } for (Long unCommercial : idsCommerciaux) { //ClassCastException here Struts2 version : 2.1.0 -- View this message in context: http://www.nabble.com/Random-ClassCastException-%3A-I%27m-expecting-Long%2C-Struts-gives-me-String-on-some-servers...-tp21722894p21722894.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Firefox 3 and JSON random errors
Sometimes I got this errors to : symbol 'dojo.rpc' is not defined after loading '__package__.js' Fichier Source : http://localhost:8080/crm/struts/dojo/dojo.js Ligne : 1 -- View this message in context: http://www.nabble.com/Firefox-3-and-JSON-random-errors-tp20249211p20249553.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Firefox 3 and JSON random errors
Hi all, I'm getting erros with my Struts 2 web application using Firefox 3. Everything is ok with others navigators. With FF3, it shows randomly javascript errors saying my JS var is undefined. here is a sample of code : // Dojo configuration djConfig = { isDebug: false, bindEncoding: "ISO-8859-1" ,baseRelativePath: "struts/dojo/" ,baseScriptUri: "struts/dojo/" ,debugAtAllCosts: false }; //variable pour cti var pop = null; var idUserLocal = '<%=idUserLocal%>'; // load dojo RPC dojo.require("dojo.rpc.*"); // create service object(proxy) using SMD (generated by the json result) var serviceRights = new dojo.rpc.JsonService("${ajaxRightsUrl}"); var serviceCti = new dojo.rpc.JsonService("${ajaxCtiUrl}"); var serviceAjaxCti = new dojo.rpc.JsonService("${ajaxMainLayoutUrl}"); Sometimes it says "serviceRights" is undefined, sometimes it's ok. I am in Struts 2.1.0 snapshot version (June 23th 2008 I guess), jsonplugin 0.30, and I put the /struts files in my webContent repository. I put dojo debug option, and no error occured : DEBUG: DEPRECATED: dojo.event replaced by dojo.event.* -- will be removed in version: 0.5 DEBUG: DEPRECATED: dojo.io replaced by dojo.io.* -- will be removed in version: 0.5 DEBUG: RpcService: Attempting to load SMD document from: /crm/ajaxRightsAction.action?etat=-1&onglet=20 DEBUG: RpcService: Processing returned SMD. DEBUG: RpcService: Creating Method: this. hasNotificationEditRight () DEBUG: RpcService: Successfully created hasNotificationEditRight () DEBUG: RpcService: Creating Method: this. hasUserDeleteRightOnObject () DEBUG: RpcService: Successfully created hasUserDeleteRightOnObject () DEBUG: RpcService: Creating Method: this. hasUserDeleteRightOnTypeObjet () DEBUG: RpcService: Successfully created hasUserDeleteRightOnTypeObjet () DEBUG: RpcService: Creating Method: this. hasUserEditRightOnObject () DEBUG: RpcService: Successfully created hasUserEditRightOnObject () DEBUG: RpcService: Creating Method: this. hasUserEditRightOnTypeObjet () DEBUG: RpcService: Successfully created hasUserEditRightOnTypeObjet () DEBUG: RpcService: Creating Method: this. hasUserReadRightOnObject () DEBUG: RpcService: Successfully created hasUserReadRightOnObject () DEBUG: RpcService: Creating Method: this. hasUserReadRightOnObjectWithTrId () DEBUG: RpcService: Successfully created hasUserReadRightOnObjectWithTrId () DEBUG: RpcService: Creating Method: this. hasUserReadRightOnTypeObjet () DEBUG: RpcService: Successfully created hasUserReadRightOnTypeObjet () DEBUG: RpcService: Dojo RpcService is ready for use. ... DEBUG: JsonService: JSON-RPC Request: {"params":[],"method":"getSeparateurNumTel","id":1} DEBUG: JsonService: JSON-RPC Request: {"params":["error.authorized.characters"],"method":"getMessage","id":2} DEBUG: JsonService: JSON-RPC Request: {"params":[],"method":"getSeparateurNumTel","id":1} DEBUG: JsonService: JSON-RPC Request: {"params":["Prospect","7507","4"],"method":"hasUserEditRightOnObject","id":1} Does someone as problems with Firefox 3 too ? Do you have any solutions ? Thanks a lot. Michaël. -- View this message in context: http://www.nabble.com/Firefox-3-and-JSON-random-errors-tp20249211p20249211.html 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: [S2] Display Tag? (2.0.11)
Or you can use Decorators : public class MyDecorator extends TableDecorator { public String getAttrNameNotInBean() { MyBean bean = (MyBean) getCurrentRowObject(); return ""; } } Michaël "Musachy Barroso" <[EMAIL PROTECTED]> 01/11/2007 22:12 Veuillez répondre à "Struts Users Mailing List" A "Struts Users Mailing List" cc Objet Re: [S2] Display Tag? (2.0.11) You can access the values published by displaytag using "#attr", like: musachy On 11/1/07, Jake Robb <[EMAIL PROTECTED]> wrote: > I've used DisplayTag with S1 before, with excellent results. I'm also > using it in S2 in a few cases, and it's working fine. > > However, now I want to use it to render a form. Each row in the table > will contain a couple of input tags, and the table as a whole represents > a single List on my action. > > Without DisplayTag, I can accomplish that as follows: > > > > > > > > size="90" /> > > > > > > I converted the code above as follows: > > > > > > > > > > > > But that didn't work, because DisplayTag doesn't push rule_rowNum onto > the stack. So I added a push tag: > > > > > > > > > > > > > Then I discovered that s:push doesn't accept runtime expressions, just > like everything else in 2.0.11. > > So, how do I accomplish this? I guess I could keep it the old way, but > I'd really rather be consistent. > > -Jake > > - > 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]
Re: datetimepicker tag
In the lasts versions (since 2.0.9 I guess), all AJAX are in dojo plugin. So you need to include <%@ taglib uri="/struts-dojo-tags" prefix="sx"%> and and call : Michaël dipti RealSoftInc <[EMAIL PROTECTED]> 16/10/2007 08:09 Veuillez répondre à "Struts Users Mailing List" A user@struts.apache.org cc Objet Re: datetimepicker tag I m using Struts2 and the tag which m using is: and regarding the taglib declaration it is not declared in it hence it is giving the exception: No tag "datetimepicker" defined in tag library imported with prefix "s".. Struts2 does not support datetimepicker?? or some other reason.. please reply back soon.. Laurie Harper wrote: > > dipti RealSoftInc wrote: >> >> hello, >> >> I am using struts 2.0.1 and want to use datetimepicker tag... but it is >> giving an exception that it is not defined in the tld file i.e >> struts-tag.tld please help me out... > > What version of Struts are you using? What does your taglib declaration > look like? And what does you tag usage look like? > > L. > > ObWhine: please don't post unrelated questions to an existing thread. Be > sure to start a new thread (with an appropriate subject) by sending a > fresh message to the list, rather than using Reply To. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Struts-Application-is-not-working-tf4560069.html#a13227362 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: [S2] How to apply a Java method on a ${myVarInStack} in a JSP ?
Ok sorry for stupid question, I have found :) mleneveut wrote: > > Thanks for your answer. > > The s:date tag is fine, but how to pass it to a s:textfield tag ? > >size="10" maxlength = "10" > value=""/> > > > > maxmil wrote: >> >> You can call a static method using the OGNL syntax. >> >> . >> >> (More info can be found here >> http://www.opensymphony.com/ognl/html/LanguageGuide/) >> >> However i suggest you have a look at the s:date tag. >> >> max >> > > -- View this message in context: http://www.nabble.com/-S2--How-to-apply-a-Java-method-on-a-%24%7BmyVarInStack%7D-in-a-JSP---tf4598988.html#a13132034 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: [S2] How to apply a Java method on a ${myVarInStack} in a JSP ?
Thanks for your answer. The s:date tag is fine, but how to pass it to a s:textfield tag ? "/> maxmil wrote: > > You can call a static method using the OGNL syntax. > > . > > (More info can be found here > http://www.opensymphony.com/ognl/html/LanguageGuide/) > > However i suggest you have a look at the s:date tag. > > max > -- View this message in context: http://www.nabble.com/-S2--How-to-apply-a-Java-method-on-a-%24%7BmyVarInStack%7D-in-a-JSP---tf4598988.html#a13131826 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] How to apply a Java method on a ${myVarInStack} in a JSP ?
Hi all, I just give up the datetimepicker component, due to a 2s more page load time. I put anoter JS calendar (YUI calendar), but the problem is that in my Actions I have java.util.Date attributes. So I need to format my Date into a String that the calendar will understand (dd/MM/ in my case). When I submit the form I have no problem, Struts converts the dd/MM/ String into a java.util.Date. So my question is : How to apply a Java method on a ${myDate} in the JSP ? Without Struts I would have done : <% Date myDate = (Date)request.getAttribute("myDate");%> <%=com.myorg.util.DateManipulation.format(myDate)%> Or another question : What is the best (most beautiful) way to format all java.util.Date to dd/MM/ String from Actions to JSP ? Interceptor ? Overide Struts Converters ? The point is that I will need localization. Thanks for your help. Michaël -- View this message in context: http://www.nabble.com/-S2--How-to-apply-a-Java-method-on-a-%24%7BmyVarInStack%7D-in-a-JSP---tf4598988.html#a13130629 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: [S2] Conditional Validation (test if field is present in JSP)
Sorry I did'nt understand your answer. I was talking about some fileds in my JSP (present in some JPS, not in others), and how to write my XML validator file, like : true ... cilquirm <[EMAIL PROTECTED]> 17/09/2007 16:50 Veuillez répondre à "Struts Users Mailing List" A user@struts.apache.org cc Objet Re: [S2] Conditional Validation (test if field is present in JSP) somewhat hackish, but you can accomplish this by using expressions : #params['attrib'] != null ? attrib in ('a','list','of','values') (this is just an example stating that you can check for the existence of the variable in the parameter and then execute an expression like you normally would ) mleneveut wrote: > > Hi all, > > We have an Action redirecting to several JSP, depending on the customer. > But the forms of these JSP are different : some fields are added/removed > in some JSP. > > So the automatic validation fails for those fields not existing in some > JSP. > > We bypass the problem by copying the Action method to others Actions > (exactly the same code...). We have now one Action for one JSP, so we > could have different validation XML file name. But it is not very nice... > > Do we have another solution, like one Action, several JSP, one XML > validation file testing if the fields "exist" and if yes doing the field > validation ? Or setting a flag (hidden field) in the JSPs and doing > differents sets of validation depending of this flag ? > > Thanks for your tips. > > Regards, > > Michaël > -- View this message in context: http://www.nabble.com/-S2--Conditional-Validation-%28test-if-field-is-present-in-JSP%29-tf4465421.html#a12737286 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] Conditional Validation (test if field is present in JSP)
Hi all, We have an Action redirecting to several JSP, depending on the customer. But the forms of these JSP are different : some fields are added/removed in some JSP. So the automatic validation fails for those fields not existing in some JSP. We bypass the problem by copying the Action method to others Actions (exactly the same code...). We have now one Action for one JSP, so we could have different validation XML file name. But it is not very nice... Do we have another solution, like one Action, several JSP, one XML validation file testing if the fields "exist" and if yes doing the field validation ? Or setting a flag (hidden field) in the JSPs and doing differents sets of validation depending of this flag ? Thanks for your tips. Regards, Michaël
CN=Michaël LENEVEUT/OU=DEVELOPPEMENT/OU=GUNDER /O=ABW/C=FR is out of the office.
Je serai absent(e) du 24/08/2007 au 12/09/2007.
RE Sending value stack from Action A to Action B
>1) How can values in the value stack be sent among actions, so that they are >available in the final web page? Put your values in HttpSession wild_oscar <[EMAIL PROTECTED]> 22/08/2007 16:48 Veuillez répondre à "Struts Users Mailing List" A user@struts.apache.org cc Objet Sending value stack from Action A to Action B Being new to Struts2, I was searching for an answer to a use case I developed: - Welcome page has login form (send to LoginAction) - LoginAction reads username and password and sends to ListStuffAction - ListStuffAction reads stuff from database and sends to Stuff page - Stuff page lists the stuff. In Suff page, I also have a "welcome *username*, your password is *password*" Now, in LoginAction the username and password are in the value Stack and I can access them. But when I reach the Stuff page, I get an odd "Welcome, < . Your password is <". I'm guessing the value stack isn't sent among actions. I tried making LoginAction's result to be of type ServletActionRedirectResult and ActionChainResult, but both failed. My questions are: 1) How can values in the value stack be sent among actions, so that they are available in the final web page? 2) Isn't this a common scenario in struts2's web development? The reason I was trying this approach is the fact that I want to use the ListStuffAction repeatedly: when a user logs in, after a user inserts a new record so that the list can be updated with the new value, etc. Thank you for your answers! -- View this message in context: http://www.nabble.com/Sending-value-stack-from-Action-A-to-Action-B-tf4312075.html#a12276288 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 use confirm dialog box
Google ? Search in nabble's forum ? http://www.nabble.com/how-to-use-confirmdialog-box-tf4303548.html#a12249806 kushi <[EMAIL PROTECTED]> 22/08/2007 08:56 Veuillez répondre à "Struts Users Mailing List" A user@struts.apache.org cc Objet how to use confirm dialog box Hello experts, please suggest how to use confirmation dialog box in web application. i want to use this box in my application, where i list multiple files in JSP page. if i want to delete any file then first i want to show confirmation dialog like "are u sure to delete?" with yes or no option. if i click on yes then it will call action class "delete". & if i click no then it have to on the same page. please give me solution as soon as possible. thanks in advance. -- View this message in context: http://www.nabble.com/how-to-use-confirm-dialog-box-tf4309759.html#a12269061 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: RE Action within Action result
action2 ${myVarContainingTheValue} stringHardCoded Sawan <[EMAIL PROTECTED]> 21/08/2007 14:23 Veuillez répondre à "Struts Users Mailing List" A user@struts.apache.org cc Objet Re: RE Action within Action result Thanks mleneveut, Its working for simple action calling, But I have a request variable in my URL and if I simply redirect to the specified action then I lost the variable. E.G.. I have following URL http://localhost:8080/Action1.action?Argument=Sawan Now if simply call the action then I got... http://localhost:8080/Action2.action I want to preserve "?Argument=Sawan" too and wants the URL like... http://localhost:8080/Action2.action?Argument=Sawan Thanks Sawan mleneveut wrote: > > Add the result type : > > action2 > > > ... > > > (redirect-action if you are in version before 2.0.9) > > > > > > Sawan <[EMAIL PROTECTED]> > 21/08/2007 08:50 > Veuillez répondre à > "Struts Users Mailing List" > > > A > user@struts.apache.org > cc > > Objet > Action within Action result > > > > > > > > Hello Experts, > > I want to call an Action within the Action result and I am trying > following > Struts XML. > > > /Action2.action > > > But its not working. > > How can I fulfill this requirement..? > > I am really looking forward to get any solution as soon as possible... > > Thanks > > Sawan > -- > View this message in context: > http://www.nabble.com/Action-within-Action-result-tf4303336.html#a12249191 > Sent from the Struts - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > -- View this message in context: http://www.nabble.com/Action-within-Action-result-tf4303336.html#a12253535 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 use confirmdialog box
Delete function delete(id) { if(confirm('sure ?')) { document.forms[0].bucket.value = id; document.forms[0].action = deletebucketaction.action; document.forms[0].submit(); } else { document.forms[0].bucket.value = id; document.forms[0].action = browsebucketaction.action; document.forms[0].submit(); } } Sawan <[EMAIL PROTECTED]> 21/08/2007 09:41 Veuillez répondre à "Struts Users Mailing List" A user@struts.apache.org cc Objet how to use confirmdialog box hello, i want to use confirm dialog box in my application, but i faces some problem. so please let me know how i can do my work " " onclick="confirm('sure to delete')" >Delete " i have done this , it will show confimdialog box and if i click on ok or cancel then deletebucket action is called. but my need is that if i click on OK then it have to call deletebucketaction & when i click on cancel then it have to call browsebucketaction. -- View this message in context: http://www.nabble.com/how-to-use-confirmdialog-box-tf4303548.html#a12249806 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 Action within Action result
Add the result type : action2 ... (redirect-action if you are in version before 2.0.9) Sawan <[EMAIL PROTECTED]> 21/08/2007 08:50 Veuillez répondre à "Struts Users Mailing List" A user@struts.apache.org cc Objet Action within Action result Hello Experts, I want to call an Action within the Action result and I am trying following Struts XML. /Action2.action But its not working. How can I fulfill this requirement..? I am really looking forward to get any solution as soon as possible... Thanks Sawan -- View this message in context: http://www.nabble.com/Action-within-Action-result-tf4303336.html#a12249191 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 Evaluating a javascript expression in order to set the readonly attribute
In your Action, add an String attribute named editingFlag with a getter and a setter. Set the value ("true" or "false") of editingFlag in the method forwarding to your JSP. In the JSP : "Session A Mwamufiya" <[EMAIL PROTECTED]> 13/08/2007 12:46 Veuillez répondre à "Struts Users Mailing List" A user@struts.apache.org cc Objet Evaluating a javascript expression in order to set the readonly attribute Hi, I would like to set a textbox to readonly when a flag is set in my action. I have the following jsp call: but the textfield is not readonly, and the page source reflects it. BTW, editingFlag is set in the prepare() method of my action. Any idea on how to write the evaluation? Thanks, Session - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE [S2] autowiring with hand rolled factory
Did you set this in your struts.xml ? or For Autowiring, it's enable by default. But you can customise it : http://struts.apache.org/2.0.9/docs/spring-plugin.html The framework enables "autowiring" by default. (Autowiring means to look for objects defined in Spring with the same name as your object property). To change the wiring mode, modify the spring.autowire property. Wiring Mode struts.objectFactory.spring.autoWire = type The autowire property can be set to several options. name Auto-wire by matching the name of the bean in Spring with the name of the property in your action. This is the default type Auto-wire by looking for a bean registered with Spring of the same type as the property in your action. This requires you to have only one bean of this type registered with Spring auto Spring will attempt to auto-detect the best method for auto-wiring your action constructor Spring will auto-wire the parameters of the bean's constructor By default, the framework will at least try to use Spring to create all its objects. If the object cannot be created by Spring, then the framework will create the object itself. Adam Hardy <[EMAIL PROTECTED]> 12/08/2007 11:25 Veuillez répondre à "Struts Users Mailing List" A Struts Users Mailing List cc Objet [S2] autowiring with hand rolled factory I'm sure I saw some references to this in the documentation before but I can't find it again now that I need it. I have my own context factory for Spring which I want to plug into the struts framework, but I can't work out how to set up the autowiring interceptor . It seems I must replace ActionAutoWiringInterceptor and configure it as 'anotherAutowiring' or similar. Would that be correct? While I'm on the subject, I'm not planning on setting up my actions in Spring, so I assume that struts2 will use its own ObjectFactory to do this. What is the reasoning behind the functionality that allows me to set up my actions in Spring? Is it just the rich configuration possibilities that Spring offers which struts wants to harness? Thanks Adam - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE taking control of the struts 2 layout in a jsp
Hi, Copy the struts.jar templates into your application (at the root, WebContent/templates for exemple), and modify the WebContent/template/simple/*.ftl files at your convenience. "Session A Mwamufiya" <[EMAIL PROTECTED]> 13/08/2007 08:57 Veuillez répondre à "Struts Users Mailing List" A user@struts.apache.org cc Objet taking control of the struts 2 layout in a jsp Hi, Struts displays the jsp objects the way it likes, for example, aligning buttons on the right even if I put them inside a tag. Is there a way to take control of how the layout is displayed without using the simple theme (that doesn't have a nice UI by the way)? Thanks, Session - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE Preventing validation when form is first displayed
Hi, I had the same problem, and added in my struts.xml : execute, input,back,cancel,browse, detail, delete, goAdd, goModif, view execute,input,back,cancel,browse, detail, delete, goAdd, goModif, view So add the name of your first method in the excludeMethods, and the validation will not occures. "Session A Mwamufiya" <[EMAIL PROTECTED]> 13/08/2007 08:58 Veuillez répondre à "Struts Users Mailing List" A user@struts.apache.org cc Objet Preventing validation when form is first displayed Hi, I have an action that is validateable and uses the validate method to ensure that an element isn't added to the database if it already exists in there. Unfortunately, the validation occurs as soon as my form is launched. I tried to follow the approach from the helloworld example to not have this happen, but it doesn't work. I would rather avoid using annotations for maintainability reasons. Would someone give me directions to how to stop validation from occurring when the form is launched. Thanks, - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] ExecAndWait interceptor : request.getSession() null
Hi, I try to add the execAndWait interceptor in my application. But now the request.getSession() returns null so my app crash in the first Action. What did I miss ? dojo\..* 1000 100 /jsp/login.jsp /jsp/error.jsp /jsp/error.jsp /jsp/error.jsp /jsp/wait.jsp My wait.jsp : <%@ taglib prefix="s" uri="/struts-tags" %> "/> Please wait while we process your request. Click http://www.nabble.com/-S2--ExecAndWait-interceptor-%3A-request.getSession%28%29-null-tf4248436.html#a12090487 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: RE
By setting the requestURI="myAction.action" pointing to your current action (which you used to come to this page), you will have no problem. DisplayTag will just add some parameters (page, sort, ...). You just have to map this action method to this div/tab/... (so one action or method for each div/tab/or whatever) "Manuel Correa" <[EMAIL PROTECTED]> 09/08/2007 18:40 Veuillez répondre à "Struts Users Mailing List" A "Struts Users Mailing List" cc Objet RE: RE mailto:[EMAIL PROTECTED] Sent: Thursday, August 09, 2007 12:01 PM To: Struts Users Mailing List Subject: RE Regards, "Manuel Correa" <[EMAIL PROTECTED]> 09/08/2007 17:54 Veuillez répondre à "Struts Users Mailing List" A "Struts Users Mailing List" cc Objet
RE
I use displaytag too. All works fine. Did you set the requestUri param ? Regards, "Manuel Correa" <[EMAIL PROTECTED]> 09/08/2007 17:54 Veuillez répondre à "Struts Users Mailing List" A "Struts Users Mailing List" cc Objet
Re: [S2] Error datetimepicker when erase input and click again calendar
Here is a sample application containing the test pages : http://oughacom.free.fr/Java/Test.war mleneveut wrote: > > The whole string. > > If I clicked the date 06/08/2007, I have "06/08/2007" in the input, I > delete all to have an empty string "", I click on the calendar, it appears > with all days as "NaN" > > > > > > "Musachy Barroso" <[EMAIL PROTECTED]> > 06/08/2007 17:28 > Veuillez répondre à > "Struts Users Mailing List" > > > A > "Struts Users Mailing List" > cc > > Objet > Re: [S2] Error datetimepicker when erase input and click again calendar > > > > > > > When you delete the date in the input, do you delete the whole thing? > or juts a part of it? > > musachy > > On 8/6/07, mleneveut <[EMAIL PROTECTED]> wrote: >> >> Hi, >> >> When I click the calendar picture of my datetimepicker tag (the input is >> empty), the calendar shows up normally. I pick a date, all is ok. >> >> But if I then delete the choosen date in the input, and click again on > the >> calendar, all the dates are NaN. As if the displayFormat was in trouble. >> >> Is that normal ? What I missed ? >> >> I'm in the last 2.1.0-SNAPSHOT SVN version (updated all yesterday) >> >> <%@ taglib uri="/struts-dojo-tags" prefix="sx"%> >> >> > cssClass="filtreInput" displayFormat="dd/MM/" toggleType="explode" >> toggleDuration="500"/> >> -- >> View this message in context: > http://www.nabble.com/-S2--Error-datetimepicker-when-erase-input-and-click-again-calendar-tf4223764.html#a12015179 > >> 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] > > > > -- View this message in context: http://www.nabble.com/-S2--Error-datetimepicker-when-erase-input-and-click-again-calendar-tf4223764.html#a12020795 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: [S2] Bug v2.1.0 for double and int validation
Here is a sample application containing the test pages : http://oughacom.free.fr/Java/Test.war mleneveut wrote: > > Hi, > > I try to validate a double, but it generates this in my JSP : > > // field name: familleProduit.chargeTravail > // validator name: double > if (form.elements['familleProduit.chargeTravail']) { > field = form.elements['familleProduit.chargeTravail']; > var error = "Le champ doit être un décimal"; > if (field.value != null) { > var value = parseFloat(field.value); > if (false || > false || > false || > false) { > addError(field, error); > errors = true; > } > } > } > > So the double is not tested. > > my xxAction-validation.xml : > > > > true > > > > > > > > > > > true > > > > > > > Same error occures with int validation. > > > > > > > > generates : > // field name: familleProduit.chargeTravail > // validator name: int > if (form.elements['familleProduit.chargeTravail']) { > field = form.elements['familleProduit.chargeTravail']; > var error = "Le champ doit être un entier"; > if (field.value != null) { > var value = parseFloat(field.value); > if (false || > false) { > addError(field, error); > errors = true; > } > } > } > > I created an issue : https://issues.apache.org/struts/browse/WW-2084 > > If someone has an idea on how to bypass this error... > > Thanks. > -- View this message in context: http://www.nabble.com/-S2--Bug-v2.1.0-for-double-and-int-validation-tf4222645.html#a12020794 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: [S2] Problem of validation with a select in my form
Here is a sample application containing the test pages : http://oughacom.free.fr/Java/Test.war mleneveut wrote: > > The Change() method is rather doing nothing, just modifying a flag : > > function Change(){ > document.forms[0].change.value = '1'; > } > > > My validattion xml is simple, it is just a requiredstring on the select > item : > > > > true > > > > > > > > > > > true > > > > > > > > > Laurie Harper <[EMAIL PROTECTED]> > Envoyé par : news <[EMAIL PROTECTED]> > 04/08/2007 00:50 > Veuillez répondre à > "Struts Users Mailing List" > > > A > user@struts.apache.org > cc > > Objet > Re: [S2] Problem of validation with a select in my form > > > > > > > Sounds like an error in your validation rules, which you haven't listed, > or possibly a result of whatever your Change() JavaScript function is > doing. Without seeing all the pieces, it's difficult to diagnose. > > L. > > [EMAIL PROTECTED] wrote: >> Hi, >> >> I have a select list in my form, and when I submit the form, the >> javascript client validation passes, but the server validation failed. > It >> comes back to my JSP with the "required field" error message. >> >> The weird thing is that in my action the field is well filled (I put a >> breakpoint in an empty validate() method), and when it comes back to the > >> JSP the selected option of my select is what I submitted. So why the >> server validation doesn't see that the select is filled ? >> >> >> > id="familleProduit.gamme.idGamme" >> list="gammes" >> listKey="idGamme" >> listValue="libelle" >> emptyOption="true" >> required="true" >> onchange="javascript: Change();"/> >> >> >> public class FamilleProduitVO extends CRUDVO { >> private long idFamille; >> private String nomFamille = ""; >> private Double chargeTravail; >> private String urlFamille = ""; >> private GammeVO gamme; >> >> ... >> } >> public class GammeVO extends CRUDVO { >> private long idGamme; >> private String libelle; >> private String urlGamme; >> >> ... >> } >> public class FamilleProduitGererAction extends CRMAction { >> private FamilleProduitVO familleProduit; >> private List gammes; >> >> ... >> } >> >> Thanks for your help. >> > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > -- View this message in context: http://www.nabble.com/-S2--Problem-of-validation-with-a-select-in-my-form-tf4211424.html#a12020792 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: [S2] Error datetimepicker when erase input and click again calendar
The whole string. If I clicked the date 06/08/2007, I have "06/08/2007" in the input, I delete all to have an empty string "", I click on the calendar, it appears with all days as "NaN" "Musachy Barroso" <[EMAIL PROTECTED]> 06/08/2007 17:28 Veuillez répondre à "Struts Users Mailing List" A "Struts Users Mailing List" cc Objet Re: [S2] Error datetimepicker when erase input and click again calendar When you delete the date in the input, do you delete the whole thing? or juts a part of it? musachy On 8/6/07, mleneveut <[EMAIL PROTECTED]> wrote: > > Hi, > > When I click the calendar picture of my datetimepicker tag (the input is > empty), the calendar shows up normally. I pick a date, all is ok. > > But if I then delete the choosen date in the input, and click again on the > calendar, all the dates are NaN. As if the displayFormat was in trouble. > > Is that normal ? What I missed ? > > I'm in the last 2.1.0-SNAPSHOT SVN version (updated all yesterday) > > <%@ taglib uri="/struts-dojo-tags" prefix="sx"%> > > cssClass="filtreInput" displayFormat="dd/MM/" toggleType="explode" > toggleDuration="500"/> > -- > View this message in context: http://www.nabble.com/-S2--Error-datetimepicker-when-erase-input-and-click-again-calendar-tf4223764.html#a12015179 > 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]
[S2] Error datetimepicker when erase input and click again calendar
Hi, When I click the calendar picture of my datetimepicker tag (the input is empty), the calendar shows up normally. I pick a date, all is ok. But if I then delete the choosen date in the input, and click again on the calendar, all the dates are NaN. As if the displayFormat was in trouble. Is that normal ? What I missed ? I'm in the last 2.1.0-SNAPSHOT SVN version (updated all yesterday) <%@ taglib uri="/struts-dojo-tags" prefix="sx"%> -- View this message in context: http://www.nabble.com/-S2--Error-datetimepicker-when-erase-input-and-click-again-calendar-tf4223764.html#a12015179 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: populating input fields on page load
You could do redirection after your first action. myFirstAction.jsp : form + submit buton to MyFirstAction.process() MyFirstAction { private String myAttribute; execute() : initialize myAttribute and redirect to "success" = myFirstAction.jsp process() : do stuff on myAtrribute submitted in myFirstAction.jsp, store it in session, redirect to "second" getter/setter for myAttribute } MySecondAction { private String myAttribute; execute() : initialize myAttribute with what has been store in session for exemple, return "success" getter/setter for myAttribute } the struts.xml: /jsp/myFirstAction.jsp goSecond /jsp/mySecondAction.jsp Session A Mwamufiya wrote: > > Hi, > > I have a page with input fields, and would like my action to populate > those fields before they get displayed. This page is handled by a certain > action, but it is the result page from a different action (I click on a > button in the previous action form, and this one gets called up). I put > some logging in my code, and see that the execute() method never gets > called before the page is displayed. > > This is what my form looks like: > > > > > > > Any ideas? > > Thanks, > Session > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/populating-input-fields-on-page-load-tf4223102.html#a12014964 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] Submitting a Double => problem of Locale
Hi, When I submit a numeric in a form, the validation accepts only comma numbers (12,34) (I'm with a French locale). If a set 12.34, the validation failed and I have the message : "Invalid field value for field "xx"" But when a submit 12,34 and another field has an error, it comes back to my JSP with 12.34 as my number's value. So when I correct the field with the error and re-submit, the numeric field has now an error. Where is the problem ? My field is a Double in my bean. How can I correct the problem ? In an Intercetor ? (extending ParametersInterceptor ?) And How could I change the default message "Invalid field value for field "xx"" ? What is the key to override in my package_xx.properties ? Thanks a lot. -- View this message in context: http://www.nabble.com/-S2--Submitting-a-Double-%3D%3E-problem-of-Locale-tf4222693.html#a12012216 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] Bug v2.1.0 for double and int validation
Hi, I try to validate a double, but it generates this in my JSP : // field name: familleProduit.chargeTravail // validator name: double if (form.elements['familleProduit.chargeTravail']) { field = form.elements['familleProduit.chargeTravail']; var error = "Le champ doit être un décimal"; if (field.value != null) { var value = parseFloat(field.value); if (false || false || false || false) { addError(field, error); errors = true; } } } So the double is not tested. my xxAction-validation.xml : true true Same error occures with int validation. generates : // field name: familleProduit.chargeTravail // validator name: int if (form.elements['familleProduit.chargeTravail']) { field = form.elements['familleProduit.chargeTravail']; var error = "Le champ doit être un entier"; if (field.value != null) { var value = parseFloat(field.value); if (false || false) { addError(field, error); errors = true; } } } I created an issue : https://issues.apache.org/struts/browse/WW-2084 If someone has an idea on how to bypass this error... Thanks. -- View this message in context: http://www.nabble.com/-S2--Bug-v2.1.0-for-double-and-int-validation-tf4222645.html#a12012115 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: [S2] Problem of validation with a select in my form
The Change() method is rather doing nothing, just modifying a flag : function Change(){ document.forms[0].change.value = '1'; } My validattion xml is simple, it is just a requiredstring on the select item : true true Laurie Harper <[EMAIL PROTECTED]> Envoyé par : news <[EMAIL PROTECTED]> 04/08/2007 00:50 Veuillez répondre à "Struts Users Mailing List" A user@struts.apache.org cc Objet Re: [S2] Problem of validation with a select in my form Sounds like an error in your validation rules, which you haven't listed, or possibly a result of whatever your Change() JavaScript function is doing. Without seeing all the pieces, it's difficult to diagnose. L. [EMAIL PROTECTED] wrote: > Hi, > > I have a select list in my form, and when I submit the form, the > javascript client validation passes, but the server validation failed. It > comes back to my JSP with the "required field" error message. > > The weird thing is that in my action the field is well filled (I put a > breakpoint in an empty validate() method), and when it comes back to the > JSP the selected option of my select is what I submitted. So why the > server validation doesn't see that the select is filled ? > > > id="familleProduit.gamme.idGamme" > list="gammes" > listKey="idGamme" > listValue="libelle" > emptyOption="true" > required="true" > onchange="javascript: Change();"/> > > > public class FamilleProduitVO extends CRUDVO { > private long idFamille; > private String nomFamille = ""; > private Double chargeTravail; > private String urlFamille = ""; > private GammeVO gamme; > > ... > } > public class GammeVO extends CRUDVO { > private long idGamme; > private String libelle; > private String urlGamme; > > ... > } > public class FamilleProduitGererAction extends CRMAction { > private FamilleProduitVO familleProduit; > private List gammes; > > ... > } > > Thanks for your help. > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] Problem of validation with a select in my form
Hi, I have a select list in my form, and when I submit the form, the javascript client validation passes, but the server validation failed. It comes back to my JSP with the "required field" error message. The weird thing is that in my action the field is well filled (I put a breakpoint in an empty validate() method), and when it comes back to the JSP the selected option of my select is what I submitted. So why the server validation doesn't see that the select is filled ? public class FamilleProduitVO extends CRUDVO { private long idFamille; private String nomFamille = ""; private Double chargeTravail; private String urlFamille = ""; private GammeVO gamme; ... } public class GammeVO extends CRUDVO { private long idGamme; private String libelle; private String urlGamme; ... } public class FamilleProduitGererAction extends CRMAction { private FamilleProduitVO familleProduit; private List gammes; ... } Thanks for your help.
[S2] Submitting a Double => pb of locale
Hi, When I submit a numeric in a form, the validation accepts only dotted numbers (12,34) (I'm with a French locale). If a set 12.34, the validation failed and I have the message : "Invalid field value for field "xx"" But when a submit 12,34 and another field has an error, I come back to my JSP with 12.34 has my number's value. So when correct the error and re-submit, the numeric field has now an error. Where is the problem ? My field is a Double in my bean. How can I correct the problem ? In an Intercetor ? (extending ParametersInterceptor ?) And How could I change the default message "Invalid field value for field "xx"" ? What is the key to put in my package_xx.properties ? Thanks a lot.
RE [S2] Bug v2.1.0 for double and int validation
Same with int validation. generates : // field name: familleProduit.chargeTravail // validator name: int if (form.elements['familleProduit.chargeTravail']) { field = form.elements['familleProduit.chargeTravail']; var error = "Le champ doit être un entier"; if (field.value != null) { var value = parseFloat(field.value); if (false || false) { addError(field, error); errors = true; } } } [EMAIL PROTECTED] 02/08/2007 16:52 Veuillez répondre à "Struts Users Mailing List" A "Struts Users Mailing List" cc Objet [S2] Bug v2.1.0 double validation Hi, I try to validate a double, but it generates this in my JSP : // field name: familleProduit.chargeTravail // validator name: double if (form.elements['familleProduit.chargeTravail']) { field = form.elements['familleProduit.chargeTravail']; var error = "Le champ doit être un décimal"; if (field.value != null) { var value = parseFloat(field.value); if (false || false || false || false) { addError(field, error); errors = true; } } } So the double is not tested. my xxAction-validation.xml : true true
[S2] Bug v2.1.0 double validation
Hi, I try to validate a double, but it generates this in my JSP : // field name: familleProduit.chargeTravail // validator name: double if (form.elements['familleProduit.chargeTravail']) { field = form.elements['familleProduit.chargeTravail']; var error = "Le champ doit être un décimal"; if (field.value != null) { var value = parseFloat(field.value); if (false || false || false || false) { addError(field, error); errors = true; } } } So the double is not tested. my xxAction-validation.xml : true true
[S2] No more Tabbedpanel in v2.1.0 ?
Hi, There is a Tabbedpanel in the UI Tag's doc (http://struts.apache.org/2.x/docs/tabbedpanel.html) but this seems to have disappeard in v2.1.0. Is there a new "packaged" way of handeling tabs in JSP ? Thanks.
RE How to display the ' character from a .properties file
I had the same problem, and I put ’ instead of ' in my .properties. Ragards, Michaël TonyD <[EMAIL PROTECTED]> 12/07/2007 14:29 Veuillez répondre à "Struts Users Mailing List" A user@struts.apache.org cc Objet How to display the ' character from a .properties file If in my .properties file I have text with the ' character my.properties (file) mylabel=I don't know how ... The output doesn't display the ' character I dont know how Do I need a special character before the ' character? Which one? Thanks. -- View this message in context: http://www.nabble.com/How-to-display-the-%27-character-from-a-.properties-file-tf4067655.html#a11558490 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: [S2 v2.1.0] DateTimePicker : Dojo javascript error
I have some kind of errors in the showcase app I just cleaned/recompiled : in IE 6 : DEBUG: DEPRECATED: dojo.event replaced by dojo.event.* -- will be removed in version: 0.5 DEBUG: DEPRECATED: dojo.io replaced by dojo.io.* -- will be removed in version: 0.5 DEBUG: failed loading /struts2-showcase/struts/dojo/struts/widget/StrutsTreeSelector.js with error: [SyntaxError: Identificateur, chaîne ou nombre attendu] FATAL exception raised: Could not load 'struts.widget.StrutsTreeSelector'; last tried '__package__.js' DEBUG: failed loading /struts2-showcase/struts/dojo/struts/widget/__package__.js with error: [Error: Could not load 'struts.widget.StrutsTreeSelector'; last tried '__package__.js'] FATAL exception raised: symbol 'struts.widget' is not defined after loading '__package__.js' in FF 2 : DEBUG: DEPRECATED: dojo.event replaced by dojo.event.* -- will be removed in version: 0.5 DEBUG: DEPRECATED: dojo.io replaced by dojo.io.* -- will be removed in version: 0.5 Regards, Michaël "Musachy Barroso" <[EMAIL PROTECTED]> 24/05/2007 19:38 Veuillez répondre à "Struts Users Mailing List" A "Struts Users Mailing List" cc Objet Re: [S2 v2.1.0] DateTimePicker : Dojo javascript error the "/struts" folder is inside the struts-core jar, and no, you shouldn't have to specify anything else. I'm clueless about this one, even more weird is that you said the datepicker was showing up, even with the error. musachy On 5/24/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Hi, > > I updated the source code, done a "mvn clean" and recompile > ("mvn")/redeploy the jars, and I have the same errors : > XP/IE 6 : > DEBUG: DEPRECATED: dojo.event replaced by dojo.event.* -- will be removed > in version: 0.5 > DEBUG: DEPRECATED: dojo.io replaced by dojo.io.* -- will be removed in > version: 0.5 > DEBUG: failed loading /crm/struts/dojo/struts/widget/StrutsTreeSelector.js > with error: [SyntaxError: Identificateur, chaîne ou nombre attendu] > FATAL exception raised: Could not load 'struts.widget.StrutsTreeSelector'; > last tried '__package__.js' > DEBUG: failed loading /crm/struts/dojo/struts/widget/__package__.js with > error: [Error: Could not load 'struts.widget.StrutsTreeSelector'; last > tried '__package__.js'] > FATAL exception raised: symbol 'struts.widget' is not defined after > loading '__package__.js' > > XP/FF 2 : > DEBUG: DEPRECATED: dojo.event replaced by dojo.event.* -- will be removed > in version: 0.5 > DEBUG: DEPRECATED: dojo.io replaced by dojo.io.* -- will be removed in > version: 0.5 > > Generated HTML : > > // Dojo configuration > djConfig = { > isDebug: true > ,bindEncoding: "UTF-8" > ,baseRelativePath: "/crm/struts/dojo/" > ,baseScriptUri: "/crm/struts/dojo/" > }; > >src="/crm/struts/dojo/dojo.js"> > > src="/crm/struts/ajax/dojoRequire.js"> > > type="text/css"/> > type="text/javascript"> > type="text/javascript"> > type="text/javascript"> > > > action="/crm/contacts.action" method="POST"> > > > > Date > de début > : > > dojoType="struts:StrutsDatePicker"id="contacts_dateDeb" > name="dateDeb"inputName="dojo.dateDeb"displayFormat="dd/MM/" > saveFormat="rfc"> > > > > > > > I don't have any folder named /crm/struts/... Is that normal that the > head.ftl generates this ? Do I have to copy some files from > dojo-plugin/resources to /crm/struts ? Or specify another baseRelativePath > ? > > Thanks for your help. > > Regards, > > Michaël > > > > [EMAIL PROTECTED] > 23/05/2007 17:43 > Veuillez répondre à > "Struts Users Mailing List" > > > A > "Struts Users Mailing List" > cc > > Objet > Re: [S2 v2.1.0] DateTimePicker : Dojo javascript error > > > > > > > I get all the SVN workspace this morning, I didn't have it before... > > I resolved the javascript bug saying "unterminated string" by modifing the > > head.ftl : I set the "," before each parameter, elsewhere whe have a "," > for the last parameter. > > // Dojo configuration > djConfig = { > isDebug: ${parameters.debug?default(false)?string} > ,bindEncoding: "${parameters.encoding}" > <#if parameters.baseRelativePath?if_exists != ""> > ,baseRelativePath: "<@s.url value= > '${parameters.baseRelativePath}' includeParams='none' encode='false' />" > ,baseScriptUri: "<@s.url value='${parameters.baseRelativePath}' > includeParams='none' encode='false' />" > <#else> > ,baseRelativePath: "${base}/struts/dojo/" > ,baseScriptUri: "${base}/struts/dojo/" > #if> > <#if parameters.locale?if_exists != ""> > ,locale: "${parameters.locale}" > #if> > <#if parameters.extraLocales?exists> > ,extraLocale: [ > <#list parameters.extraLocales as locale> > "${locale}", > #list> > ] > #if> > }; > > > Now I
Re: [S2 v2.1.0] DateTimePicker : Dojo javascript error
Hi, I updated the source code, done a "mvn clean" and recompile ("mvn")/redeploy the jars, and I have the same errors : XP/IE 6 : DEBUG: DEPRECATED: dojo.event replaced by dojo.event.* -- will be removed in version: 0.5 DEBUG: DEPRECATED: dojo.io replaced by dojo.io.* -- will be removed in version: 0.5 DEBUG: failed loading /crm/struts/dojo/struts/widget/StrutsTreeSelector.js with error: [SyntaxError: Identificateur, chaîne ou nombre attendu] FATAL exception raised: Could not load 'struts.widget.StrutsTreeSelector'; last tried '__package__.js' DEBUG: failed loading /crm/struts/dojo/struts/widget/__package__.js with error: [Error: Could not load 'struts.widget.StrutsTreeSelector'; last tried '__package__.js'] FATAL exception raised: symbol 'struts.widget' is not defined after loading '__package__.js' XP/FF 2 : DEBUG: DEPRECATED: dojo.event replaced by dojo.event.* -- will be removed in version: 0.5 DEBUG: DEPRECATED: dojo.io replaced by dojo.io.* -- will be removed in version: 0.5 Generated HTML : // Dojo configuration djConfig = { isDebug: true ,bindEncoding: "UTF-8" ,baseRelativePath: "/crm/struts/dojo/" ,baseScriptUri: "/crm/struts/dojo/" }; Date de début : I don't have any folder named /crm/struts/... Is that normal that the head.ftl generates this ? Do I have to copy some files from dojo-plugin/resources to /crm/struts ? Or specify another baseRelativePath ? Thanks for your help. Regards, Michaël [EMAIL PROTECTED] 23/05/2007 17:43 Veuillez répondre à "Struts Users Mailing List" A "Struts Users Mailing List" cc Objet Re: [S2 v2.1.0] DateTimePicker : Dojo javascript error I get all the SVN workspace this morning, I didn't have it before... I resolved the javascript bug saying "unterminated string" by modifing the head.ftl : I set the "," before each parameter, elsewhere whe have a "," for the last parameter. // Dojo configuration djConfig = { isDebug: ${parameters.debug?default(false)?string} ,bindEncoding: "${parameters.encoding}" <#if parameters.baseRelativePath?if_exists != ""> ,baseRelativePath: "<@s.url value= '${parameters.baseRelativePath}' includeParams='none' encode='false' />" ,baseScriptUri: "<@s.url value='${parameters.baseRelativePath}' includeParams='none' encode='false' />" <#else> ,baseRelativePath: "${base}/struts/dojo/" ,baseScriptUri: "${base}/struts/dojo/" #if> <#if parameters.locale?if_exists != ""> ,locale: "${parameters.locale}" #if> <#if parameters.extraLocales?exists> ,extraLocale: [ <#list parameters.extraLocales as locale> "${locale}", #list> ] #if> }; Now I have these errors : DEBUG: DEPRECATED: dojo.event replaced by dojo.event.* -- will be removed in version: 0.5 DEBUG: DEPRECATED: dojo.io replaced by dojo.io.* -- will be removed in version: 0.5 DEBUG: failed loading /crm/struts/dojo/struts/widget/StrutsTreeSelector.js with error: [SyntaxError: Identificateur, chaîne ou nombre attendu] FATAL exception raised: Could not load 'struts.widget.StrutsTreeSelector'; last tried '__package__.js' DEBUG: failed loading /crm/struts/dojo/struts/widget/__package__.js with error: [Error: Could not load 'struts.widget.StrutsTreeSelector'; last tried '__package__.js'] FATAL exception raised: symbol 'struts.widget' is not defined after loading '__package__.js' I add a folder struts/dojo in my "WebContent" folder, containing the resource of dojo-plugin "resources\org\apache\struts2\static\dojo\struts", but the same errors occures :/ Michaël "Musachy Barroso" <[EMAIL PROTECTED]> 23/05/2007 17:30 Veuillez répondre à "Struts Users Mailing List" A "Struts Users Mailing List" cc Objet Re: [S2 v2.1.0] DateTimePicker : Dojo javascript error Can you do a maven clean and recompile/redeploy? In the last days I've been making changes that could result in that kind of problem, but at least it was fine on the weekend, and it is working for me now (XP\FF) musachy On 5/23/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > In Firefox I have this : > DEBUG: DEPRECATED: dojo.event replaced by dojo.event.* -- will be removed > in version: 0.5 > DEBUG: DEPRECATED: dojo.io replaced by dojo.io.* -- will be removed in > version: 0.5 > > But nothing in IE. > > Just to say, the datepicker is working fine (it opens, I can choose a > date, it fills the input), but I have this javascript error, and my HTML > page is not good rendered. > > > Michaël > > > > "Musachy Barroso" <[EMAIL PROTECTED]> > 23/05/2007 15:12 > Veuillez répondre à > "Struts Users Mailing List" > > > A > "Struts Users Mailing List" > cc > > Objet > Re: [S2 v2.1.0] DateTimePicker : Dojo javascript error > > > > > > > that usually means that there is a javascri
Re: [S2 v2.1.0] DateTimePicker : Dojo javascript error
I get all the SVN workspace this morning, I didn't have it before... I resolved the javascript bug saying "unterminated string" by modifing the head.ftl : I set the "," before each parameter, elsewhere whe have a "," for the last parameter. // Dojo configuration djConfig = { isDebug: ${parameters.debug?default(false)?string} ,bindEncoding: "${parameters.encoding}" <#if parameters.baseRelativePath?if_exists != ""> ,baseRelativePath: "<@s.url value= '${parameters.baseRelativePath}' includeParams='none' encode='false' />" ,baseScriptUri: "<@s.url value='${parameters.baseRelativePath}' includeParams='none' encode='false' />" <#else> ,baseRelativePath: "${base}/struts/dojo/" ,baseScriptUri: "${base}/struts/dojo/" #if> <#if parameters.locale?if_exists != ""> ,locale: "${parameters.locale}" #if> <#if parameters.extraLocales?exists> ,extraLocale: [ <#list parameters.extraLocales as locale> "${locale}", #list> ] #if> }; Now I have these errors : DEBUG: DEPRECATED: dojo.event replaced by dojo.event.* -- will be removed in version: 0.5 DEBUG: DEPRECATED: dojo.io replaced by dojo.io.* -- will be removed in version: 0.5 DEBUG: failed loading /crm/struts/dojo/struts/widget/StrutsTreeSelector.js with error: [SyntaxError: Identificateur, chaîne ou nombre attendu] FATAL exception raised: Could not load 'struts.widget.StrutsTreeSelector'; last tried '__package__.js' DEBUG: failed loading /crm/struts/dojo/struts/widget/__package__.js with error: [Error: Could not load 'struts.widget.StrutsTreeSelector'; last tried '__package__.js'] FATAL exception raised: symbol 'struts.widget' is not defined after loading '__package__.js' I add a folder struts/dojo in my "WebContent" folder, containing the resource of dojo-plugin "resources\org\apache\struts2\static\dojo\struts", but the same errors occures :/ Michaël "Musachy Barroso" <[EMAIL PROTECTED]> 23/05/2007 17:30 Veuillez répondre à "Struts Users Mailing List" A "Struts Users Mailing List" cc Objet Re: [S2 v2.1.0] DateTimePicker : Dojo javascript error Can you do a maven clean and recompile/redeploy? In the last days I've been making changes that could result in that kind of problem, but at least it was fine on the weekend, and it is working for me now (XP\FF) musachy On 5/23/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > In Firefox I have this : > DEBUG: DEPRECATED: dojo.event replaced by dojo.event.* -- will be removed > in version: 0.5 > DEBUG: DEPRECATED: dojo.io replaced by dojo.io.* -- will be removed in > version: 0.5 > > But nothing in IE. > > Just to say, the datepicker is working fine (it opens, I can choose a > date, it fills the input), but I have this javascript error, and my HTML > page is not good rendered. > > > Michaël > > > > "Musachy Barroso" <[EMAIL PROTECTED]> > 23/05/2007 15:12 > Veuillez répondre à > "Struts Users Mailing List" > > > A > "Struts Users Mailing List" > cc > > Objet > Re: [S2 v2.1.0] DateTimePicker : Dojo javascript error > > > > > > > that usually means that there is a javascript error in one of the struts > dojo widgets. If you set debug="true" on the head tag you should a lot of > errors on the page. > > musachy > > On 5/23/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> > wrote: > > > > Hi all, > > > > I try to insert a datetimepicker tag in my JSP, and I have the following > > javascript error : > > symbol 'struts.widget' is not defined after loading '__package__.js' > > > > here is my JSP : > > <%@ taglib uri="/struts-dojo-tags" prefix="sx"%> > > > > > > > > > > > > > > > > > "test.datepicker" /> > > > > > > > > > > > > > > I'm in version 2.1.0-SNAPSHOT (of today) for "core", > "codebehind-plugin", > > "dojo-plugin", "sitemesh-plugin", "spring-plugin" and "tiles-plugin" > jars. > > > > What's wrong ? > > > > Thanks for your help, > > > > Regards, > > > > Michaël > > > > > -- > "Hey you! Would you help me to carry the stone?" Pink Floyd > > -- "Hey you! Would you help me to carry the stone?" Pink Floyd
Re: [S2 v2.1.0] DateTimePicker : Dojo javascript error
In Firefox I have this : DEBUG: DEPRECATED: dojo.event replaced by dojo.event.* -- will be removed in version: 0.5 DEBUG: DEPRECATED: dojo.io replaced by dojo.io.* -- will be removed in version: 0.5 But nothing in IE. Just to say, the datepicker is working fine (it opens, I can choose a date, it fills the input), but I have this javascript error, and my HTML page is not good rendered. Michaël "Musachy Barroso" <[EMAIL PROTECTED]> 23/05/2007 15:12 Veuillez répondre à "Struts Users Mailing List" A "Struts Users Mailing List" cc Objet Re: [S2 v2.1.0] DateTimePicker : Dojo javascript error that usually means that there is a javascript error in one of the struts dojo widgets. If you set debug="true" on the head tag you should a lot of errors on the page. musachy On 5/23/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Hi all, > > I try to insert a datetimepicker tag in my JSP, and I have the following > javascript error : > symbol 'struts.widget' is not defined after loading '__package__.js' > > here is my JSP : > <%@ taglib uri="/struts-dojo-tags" prefix="sx"%> > > > > > > > > "test.datepicker" /> > > > > > > > I'm in version 2.1.0-SNAPSHOT (of today) for "core", "codebehind-plugin", > "dojo-plugin", "sitemesh-plugin", "spring-plugin" and "tiles-plugin" jars. > > What's wrong ? > > Thanks for your help, > > Regards, > > Michaël -- "Hey you! Would you help me to carry the stone?" Pink Floyd
Re: [S2 v2.1.0] DateTimePicker : Dojo javascript error
> Maybe with this : instead of theme is not in the DTD of sx:head > Check to see if you have scriptaculos.js included as well as you dojo > scripts...I was getting a problem with firefox in relation to this. > Andrew Where do I have to have this scriptaculos.js ? Declared in my JSP ? I don't see any file named like this in Dojo plugin. > are you compiling S2.1 yourself? Yes, with maven 2 from the SVN source ( http://svn.apache.org/repos/asf/struts/struts2/trunk) of today. > If you set debug="true" Nothing more happens :/ My JSP : <%@ taglib uri="/struts-tags" prefix="s"%> <%@ taglib uri="/struts-dojo-tags" prefix="sx"%> The HTML generated : // Dojo configuration djConfig = { isDebug: true, bindEncoding: "UTF-8", baseRelativePath: "/crm/struts/dojo/", baseScriptUri: "/crm/struts/dojo/", }; Date de début : Cette page est en cours de construction. One thing : /crm is my app context. But I don't have any folder named "struts" in my webapp. Do I have to add the Dojo templates in my webapp, or does Struts find it in the dojo-plugin.jar ? How does he find the dojo.js, dojoRequire.js, ... ? Michaël "Julien Leonard" <[EMAIL PROTECTED]> 23/05/2007 15:56 Veuillez répondre à "Struts Users Mailing List" A "Struts Users Mailing List" cc Objet Re: [S2 v2.1.0] DateTimePicker : Dojo javascript error Maybe with this : instead of 2007/5/23, Andrew Penrose <[EMAIL PROTECTED]>: > > Check to see if you have scriptaculos.js included as well as you dojo > scripts...I was getting a problem with firefox in relation to this. > Andrew > > -Original Message- > From: Musachy Barroso [mailto:[EMAIL PROTECTED] > Sent: 23 May 2007 14:15 > To: Struts Users Mailing List > Subject: Re: [S2 v2.1.0] DateTimePicker : Dojo javascript error > > I just compiled/deployed the dojo plugin and showcase seems to be working > fine, are you compiling S2.1 yourself? > > musachy > > On 5/23/07, Musachy Barroso <[EMAIL PROTECTED]> wrote: > > > > that usually means that there is a javascript error in one of the struts > > dojo widgets. If you set debug="true" on the head tag you should a lot > of > > errors on the page. > > > > musachy > > > > On 5/23/07, [EMAIL PROTECTED] <[EMAIL PROTECTED] > > > wrote: > > > > > > Hi all, > > > > > > I try to insert a datetimepicker tag in my JSP, and I have the > following > > > > > > javascript error : > > > symbol 'struts.widget' is not defined after loading '__package__.js' > > > > > > here is my JSP : > > > <%@ taglib uri="/struts-dojo-tags" prefix="sx"%> > > > > > > > > > > > > > > > > > > > > > > > > > > "test.datepicker" /> > > > > > > > > > > > > > > > > > > > > > I'm in version 2.1.0-SNAPSHOT (of today) for "core", > > > "codebehind-plugin", > > > "dojo-plugin", "sitemesh-plugin", "spring-plugin" and "tiles-plugin" > > > jars. > > > > > > What's wrong ? > > > > > > Thanks for your help, > > > > > > Regards, > > > > > > Michaël > > > > > > > > > > -- > > "Hey you! Would you help me to carry the stone?" Pink Floyd > > > > > -- > "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] > >
[S2 v2.1.0] DateTimePicker : Dojo javascript error
Hi all, I try to insert a datetimepicker tag in my JSP, and I have the following javascript error : symbol 'struts.widget' is not defined after loading '__package__.js' here is my JSP : <%@ taglib uri="/struts-dojo-tags" prefix="sx"%> I'm in version 2.1.0-SNAPSHOT (of today) for "core", "codebehind-plugin", "dojo-plugin", "sitemesh-plugin", "spring-plugin" and "tiles-plugin" jars. What's wrong ? Thanks for your help, Regards, Michaël
RE Displaytag
Hi, With this declaration, your server has to have acces to the Internet, to download the tld and so one. If you don't have this acces, try to download the tld file, add it in your WEB-INF/tld folder, and add the mapping in your web.xml. Regards, Michaël Balazs Michnay <[EMAIL PROTECTED]> 16/05/2007 16:43 Veuillez répondre à "Struts Users Mailing List" A user@struts.apache.org cc Objet Displaytag Dear Struts users, I've recently downloaded displaytag-1.1 and followed all the instructions on how to install it. It would have been too nice if it had worked immediately, but I get this annoying error message all the time. I ask you guys how to solve this, because I found no posts on this specific error. When I paste the taglib line (<%@ taglib uri="http://displaytag.sf.net"; prefix="display" %>) in my jsp, I get the following error message: "The absolute uri: http://displaytag.sf.net cannot be resolved in either web.xml or the jar files deployed with this application." The documentation says that all I should do is to put the jars in my WEB-INF/lib and paste the <%@ taglib uri. %> line in the jsp. It doesn't say that I should make modification in my web.xml... Any ideas what to do now? Thanks a lot, BM We won't tell. Get more on shows you hate to love (and love to hate): Yahoo! TV's Guilty Pleasures list. http://tv.yahoo.com/collections/265
[s2] break up a large struts.xml file into smaller pieces : extends problem
Hi all, I try to separate the modules of my app in differents xml files, but the extends seems to have problems. Struts.xml : dojo\..* input,back,cancel,browse input,back,cancel,browse /loginV2.jsp /error.jsp home.xml : /loginV2.jsp /frame.jsp /error.jsp activites The error : 2007-05-16 10:45:18,374 [main] ERROR com.opensymphony.xwork2.config.ConfigurationUtil - Unable to find parent package default 2007-05-16 10:45:18,374 [main] ERROR com.opensymphony.xwork2.config.providers.XmlConfigurationProvider - Unable to find parent packages default 2007-05-16 10:45:18,390 [main] ERROR org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/crm] - Exception au démarrage du filtre struts Error building results for action enter in namespace - action - file:/C:/_applis/eclipse/workspace/CRMV2/crm-webapp/WebContent/WEB-INF/classes/home.xml:7:71 at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction( XmlConfigurationProvider.java:299) at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage( XmlConfigurationProvider.java:384) at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages( XmlConfigurationProvider.java:239) I would like to have the default-interceptor to be "crmStack" in each "sub-xml", so I would like to extends package "default" of struts.xml, not "struts-default"; Is that possible ? I'm in v2.1.0-SNAPSHOT-20070425 Thanks, Michaël.
Re: [S2] Creating my own tag/theme/template
Kikoolol. Thanks for your help, but if you had read my question, you will have understood that we don't care what will be in my tag. In do know that displayTag is not Struts... By the way, I found my mistake. Tags does'nt more exist, it is themes and templates. So here is my JSP : ... and my template : "> ${stack.findValue("getText('"+parameters.title+"')")} "> " width="1"> ${parameters.table} " width="1"> "> "> If it could be helpfull for someone... Michaël. "Antonio Petrelli" <[EMAIL PROTECTED]> 10/05/2007 15:35 Veuillez répondre à "Struts Users Mailing List" A "Struts Users Mailing List" cc Objet Re: [S2] Creating my own tag 2007/5/10, [EMAIL PROTECTED] <[EMAIL PROTECTED]>: > In fact I would like to put some HTML around displayTag. DisplayTag IS NOT part of Struts: http://displaytag.sourceforge.net/ Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] Creating my own tag
Hi all, I don't find any documentation on that, so I post here. I would like to create my own tag (in Struts 1 I extend org.apache.struts.taglib.html.BaseFieldTag for example) to display a table. In fact I would like to put some HTML around displayTag. How could I do ? Where are the new "baseFieldTag" ? My HTML code to put in my Tag : "> "> " width="1"> ... " width="1"> "> "> Thanks a lot, Regards, Michaël.
Re: [s2] Extending struts.xml
Hi, I have some errors too, in 2.1.0 (build 25/04) version. I had to add the tiles type () in the default-struts.xml, because it was not inherite from my struts.xml The bad configuration : struts.xml : ... ... home.xml : /login.jsp /frame.jsp /error.jsp home.def error.def The error was Struts did'nt find the result type "tiles". To resolve this, I have to duplicate the result-type in each imported xml files. Or to had the "tiles" result-type in the struts-default.xml. Regards, Michaël Zoran Avtarovski <[EMAIL PROTECTED]> 26/04/2007 02:34 Veuillez répondre à "Struts Users Mailing List" A Struts Users Mailing List cc Objet Re: [s2] Extending struts.xml > What are the errors you are seeing? > ERROR [http-8080-1] - Unable to find parent package default ERROR [http-8080-1] - Unable to find parent packages default Apr 24, 2007 9:53:50 PM org.apache.catalina.core.StandardContext filterStart SEVERE: Exception starting filter struts Error building results for action getAction in namespace - action - file:/usr/local/apache-tomcat-6.0.10/webapps/mms/WEB-INF/classes/struts-sysa dmin.xml:14:55 ... Caused by: No result type specified for result named 'success', perhaps the parent package does not specify the result type? - result - file:/usr/local/apache-tomcat-6.0.10/webapps/mms/WEB-INF/classes/struts-sysa dmin.xml:15:36 Z. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2][interceptors]Inserted my own interceptor => no more params value
Hi all, I try to insert my "AuthentificatedInterceptor" in the stack, but now nothing works. First, I had a login page, with login/password fields, and the LoginAction getted well the parameters' value. Now, with my new Interceptor, the LoginAction gets empty values from my login and password fields. What's wrong ? I tried a lot of order's combinations in the stack, but I did'nt find the good one. My login.jsp : My LoginAction.java : public class LoginAction extends ActionSupport implements ServletRequestAware { private Logger log = Logger.getLogger(LoginAction.class); private HttpServletRequest request; private UserVO user; private AuthentifyUserServiceInterface authentifyUserService; public String login () { String vTarget; try { // Call the Service layer for authentification. if (authentifyUserService.authentifyUser(user)) { setSessionAttribute(request, Constants.USER, user.getLogin ()); vTarget = SUCCESS; } else { addActionError(getText("errors.loginko")); vTarget = INPUT; } } catch (TechnicalException e) { addActionError(getText("error.message")); vTarget = ERROR; } return vTarget; } protected void setSessionAttribute(HttpServletRequest request, String key, Object o) { if(o != null) { request.getSession().setAttribute(key, o); } } public void setUser(UserVO user) { this.user = user; } public void setAuthentifyUserService( AuthentifyUserServiceInterface authentifyUserService) { this.authentifyUserService = authentifyUserService; } public void setServletRequest(HttpServletRequest request) { this.request = request; } } My LoginInterceptor.java : public class LoginInterceptor extends AbstractInterceptor implements StrutsStatics { private static final String LOGIN_ATTEMPT = "user.loginAttempt "; public String intercept (ActionInvocation invocation) throws Exception { final ActionContext context = invocation.getInvocationContext (); HttpServletRequest request = (HttpServletRequest) context.get(HTTP_REQUEST); HttpSession session = request.getSession (true); Object user = session.getAttribute(Constants.USER); if (user == null) { String loginAttempt = request.getParameter (LOGIN_ATTEMPT); if (! StringUtils.isBlank (loginAttempt) ) { return invocation.invoke (); } return "notLogged"; } else { return invocation.invoke(); } } } My struts.xml : The fact is that first I would like to have the hidden parameter in the login.jsp being not an attribute in the userVO bean. But if I set , I have a ParametersInterceptor Exception saying "ParametersInterceptor - [setParameters]: Unexpected Exception catched". Then, How could I have my values in my LoginAction ? I would like to do the authentifyUserService.authentifyUser() in the Action, not in the Interceptor. And I suppose this will allow me to have my values in my others forms too. Thanks for your help. Regards, Michaël.
Re: RE [S2] How to have validation message using localization ?
Yes the good properties would be login.login.required= The field "${getText(login.login)}" is required ! But I would like to do it automatically with a generic error message : errors.required= The field "${getText(???)}" is required ! and the ??? is replaced with the "label" of the input, to get the localized message printed at the user, not the fieldName... Can't we do that ? Regards, Michaël Just to make sure, did you tried %{getText('login.login')} ? because fieldName you give you the fieldName, that is loginInput. Best, Felipe MLENEVEUT wrote: > > Anyone ? :( > > > Michaël > > > > > Hi all, > > With Struts 2.0.6, I try to have validation message with localization. > > For example, I have a "login" form, with a "loginInput" input text : > > > > > I have a validation on it : > > > > > > > > > And the "errors.required" is in my package.properties : > errors.required= The field "${getText(fieldName)}" is required ! > login.login = Login > > But this will displays : "The field "loginInput" is required !" > > And I would like : "The field "Login" is required !". So I would like > something which get the localization of my textfield label (login.login) > to have localization in my error message, and not the field name, which > does not say anything to the user :) > > Could someone tells me how to do ? > > Thanks a lot ! > > Regards, > > Michaël. > > -- View this message in context: http://www.nabble.com/-S2--How-to-have-validation-message-using-localization---tf3599220.html#a10063744 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 [S2] How to have validation message using localization ?
Anyone ? :( Michaël Hi all, With Struts 2.0.6, I try to have validation message with localization. For example, I have a "login" form, with a "loginInput" input text : I have a validation on it : And the "errors.required" is in my package.properties : errors.required= The field "${getText(fieldName)}" is required ! login.login = Login But this will displays : "The field "loginInput" is required !" And I would like : "The field "Login" is required !". So I would like something which get the localization of my textfield label (login.login) to have localization in my error message, and not the field name, which does not say anything to the user :) Could someone tells me how to do ? Thanks a lot ! Regards, Michaël.
Re: [s2]Would like each action to go throught my parent class
I was talking about a "dynamic" mecanism. In Struts 1, I never called super.dispathMethod() : the CRMAction.dispatchMethod() was first called by Struts, then my "return super.dispatchMethod()" was returning the ActionForward returned by my called Action. public class CRMAction extends DispatchAction { protected ActionForward dispatchMethod(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response, String name) throws Exception { try{ log.debug("CRM dispatchMethod.debut"); UserBean user = getConnectedUser(request); if(user==null) { log.error("User null !"); return mapping.findForward("error"); } return super.dispatchMethod(mapping, form, request, response, name); } catch (Exception e) { log.error(e.getMessage()); return mapping.findForward("error"); } } Regards, Michaël --- [EMAIL PROTECTED] wrote: > My parent Action : > public class CRMAction extends ActionSupport > @Override > public String execute() throws Exception { > //do all tests (user logged, ...) > //... > return super.execute(); > } > } > > My others Actions : > public class LoginAction extends CRMAction { > public String myMethod () { > //do something > return "myForward"; > } > } > > But I never go in CRMAction.execute()... You never call super.execute() in your subclass. d.
[s2]Would like each action to go throught my parent class
Hi all, I would like to do as in Struts 1 with DispathAction : create a parent Action, which each other action extends, and each request/action passes by this parent action, and I could so add there the generic validations (user logged, etc...) How could I do ? I tried this : My parent Action : public class CRMAction extends ActionSupport implements ServletRequestAware { private static final long serialVersionUID = 7543537304330132164L; private Logger log = Logger.getLogger(CRMAction.class); private HttpServletRequest request; @Override public String execute() throws Exception { //do all tests (user logged, ...) //... return super.execute(); } } My others Actions : public class LoginAction extends CRMAction { private static final long serialVersionUID = -5438115193615924021L; private Logger log = Logger.getLogger(LoginAction.class); public String myMethod () { //do something return "myForward"; } } But I never go in CRMAction.execute()... Thanks, Regards, Michaël
[s2]How to customize the errors prefix, suffix, ... ?
Hi all, I tried to customize the errors.prefix, suffix, header and footer, but they are not taken into account. How to do in Struts 2 ? I just put this in my package.properties : errors.footer= errors.header= errors.prefix= errors.suffix= Thanks, Regards, Michaël.
[S2] How to have validation message using localization ?
Hi all, With Struts 2.0.6, I try to have validation message with localization. For example, I have a "login" form, with a "loginInput" input text : I have a validation on it : And the "errors.required" is in my package.properties : errors.required= The field "${getText(fieldName)}" is required ! login.login = Login But this will displays : "The field "loginInput" is required !" And I would like : "The field "Login" is required !". So I would like something which get the localization of my textfield label (login.login) to have localization in my error message, and not the field name, which does not say anything to the user :) Could someone tells me how to do ? Thanks a lot ! Regards, Michaël.