RE: Tiles and changing the title based on content
That could work. BTW where is the advanced tiles PDF? The other possibility I suppose is to have the default layout use an include that specifies c:set var=titleKeytiles:getAsString name=titleKey//c:set titlebean:message key=${titleKey}//title and it could be overriden in an extended tile definition to use title${item.name}/title but my question on that is the efficiency of having two line JSPs that are included in tiles. What overhead is there in including a one or two line JSP? Inheriting the TilesAction would require another intermediate class that would handle the default behaviour that I want the pages to have, and other actions would have to override this. If I did this, is there an appropriate method to do this default behaviour that happens before the execute method? Tim -Original Message- From: David Friedman [mailto:[EMAIL PROTECTED] Sent: 21 May 2004 23:41 To: Struts Users Mailing List Subject: RE: Tiles and changing the title based on content Tim, Why not use a TilesAction (org.apache.struts.tiles.action package) and change/set tiles attributes using the putAttribute() method of the ComponentContext object. For more details, see the advances tiles PDF. -David -Original Message- From: Michael McGrady [mailto:[EMAIL PROTECTED] Sent: Friday, May 21, 2004 6:34 PM To: Struts Users Mailing List Cc: Struts Users Mailing List Subject: RE: Tiles and changing the title based on content I am not sure why this is a problem. All you have to do if you want part of the response object to be dynamic is put your dynamic value in the tile. Presumably you have some dynamic factor choosing the tiles content page. Just have that same factor decide what the value of the title is. There are lots of ways to introduce dynamic content. I don't see the problem. Michael - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: double click submit button problem
Thanks Denial, But the code which I have submitted fine, there is no need to add anything extra. -Jignesh On Friday 21 May 2004 21:36, Daniel Perry wrote: If you are calling saveToken(request) before isTokenValid like your code suggests, you are probably overwriting the token in the session, so it is different to the one being submitted in the form! It should happen as follows: In the action that gives the form: saveToken(request); Then in the action the form is submitted to: if(!isTokenValid(request){ //token vaildation failed so send to error page (or straight onto success page if desired) return mapping.findForward(failure); }else{ resetToken(request); // do some work as token is ok return mapping.findForward(success); } Daniel. -Original Message- From: Jignesh Patel [mailto:[EMAIL PROTECTED] Sent: 21 May 2004 17:05 To: Struts Users Mailing List Subject: double click submit button problem Hi, To avoid double click problem we implemented code in our execute method as follows saveToken(request); if(!isTokenValid(request){ //submit mapping.forward(target); }else{ resetToken(request); } but then the page is not working as expected whenever we double click the page is not getting submitted at all, can anybody suggest what wrong I am doing. For your information we are using one Action class per form so I am setting saveToken method in execute method as per form. -- Jignesh Patel Project Leader Bang Software Technolgy Pvt. Ltd. (E) [EMAIL PROTECTED] (T) 091 484 3942132 B-4, Smart Business Centre, Infopark, SDF IT Building, Kusumagiri P.O.,Kakkanad, Kochi - 682030, Kerala, India. Information contained in this transmission to the named addressee, including any attachments thereto, should be considered the proprietary and confidential information of the sender. As a condition for viewing the information, the sender agrees to keep the information confidential, to refrain from disclosing the information, directly or indirectly, and to refrain from any actions that would constitute or facilitate unauthorized access to the information without express permission from the sender. The recipient also acknowledges and agrees to respect sender's intellectual property rights in and to the information. If the recipient of this transmission is not the named addressee, the recipient should immediately notify the sender and destroy the information transmitted without making any copy or distribution thereof. - 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] -- Jignesh Patel Project Leader Bang Software Technolgy Pvt. Ltd. (E) [EMAIL PROTECTED] (T) 091 484 3942132 B-4, Smart Business Centre, Infopark, SDF IT Building, Kusumagiri P.O.,Kakkanad, Kochi - 682030, Kerala, India. Information contained in this transmission to the named addressee, including any attachments thereto, should be considered the proprietary and confidential information of the sender. As a condition for viewing the information, the sender agrees to keep the information confidential, to refrain from disclosing the information, directly or indirectly, and to refrain from any actions that would constitute or facilitate unauthorized access to the information without express permission from the sender. The recipient also acknowledges and agrees to respect sender's intellectual property rights in and to the information. If the recipient of this transmission is not the named addressee, the recipient should immediately notify the sender and destroy the information transmitted without making any copy or distribution thereof. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[ANN] Providers 0.3 Released (includes DisplayTag tip)
Providers is a framework to be used with JSP to fill Select options in HTML. You can use it with Struts to replace html:options tag and use prv:options to fill the select without the need of creating a collection in an Action. Providers is intended to help in managing select related problems. Providers also comes with some util taglibs like ComboSelectTag, that allows to create Dependant Drow Down Lists. Providers 0.3 new features are: --- -DefineTag: Allows to define a provider collection as a bean in a given scope. -SelectRefTag: allows to create dependencies between a tag and multiples ones at the same time (see example) Next release will have the following: - -Expresion language: providers-el taglibs. -Use comboselect with a diferent collection for each select Known bug (will be corrected in next release): ComboSelectTag works wrong if Tomcat pooling tag is enabled. Try this in web.xml: init-param param-nameenablePooling/param-name param-valuefalse/param-value /init-param ## - ## ## Tip for DisplayTag users: ## ## - ## If you have a List to be displayed with DisplatTag and one of the fields is an ID, you can create a provider for this field and create a decorator to display the description: Example: Your collection objects have the following attributes: -userName -idStatus You want to display idStatus description but you haven't the value in the collection. This is the JSP code: display:table name=test display:column property=userName / display:column property=idStatus decorator=com.mycompany.StatusProviderDecorator / /display:table Your decorator could be as follows: public class StatusProviderDecorator implements ColumnDecorator { public final String decorate(Object pColumnValue) { try { ProviderFactory factory = ProviderFactory.getInstance(); String valueToFormat = (String)pColumnValue; Object obj = factory.getProvider(status).getDescription(valueToFormat); return obj.toString(); } catch (Exception e) { return obj.toString(); //default returns the same... There was an unexpected error } } } And your provider definition: provider name=status className=ar.com.koalas.providers.FixedProvider set-property property=keyName value=key/ set-property property=description value=value/ value className=ar.com.koalas.providers.ParBean key=01 value=Active/ value className=ar.com.koalas.providers.ParBean key=02 value=Inactive/ value className=ar.com.koalas.providers.ParBean key=03 value=Blocked/ value className=ar.com.koalas.providers.ParBean key=04 value=Deleted/ /provider You also could use this provider to display options in a page (for example, while changing the status): prv:select property=idStatus doMatches=true prv:options provider=status/ /prv:select And in a detail, you could show status description given the ID: prv:write name=testForm property=idStatus provider=status/ Cheers! Guillermo Meyer System Engineer EDS Argentina - Proyecto X71 Interbanking. 54.11.4322-1307 NOTA DE CONFIDENCIALIDAD Este mensaje (y sus anexos) es confidencial, esta dirigido exclusivamente a las personas direccionadas en el mail y puede contener informacion (i)de propiedad exclusiva de Interbanking S.A. o (ii) amparada por el secreto profesional. Cualquier opinion en el contenido, es exclusiva de su autor y no representa necesariamente la opinion de Interbanking S.A. El acceso no autorizado, uso, reproduccion, o divulgacion esta prohibido. Interbanking S.A no asumira responsabilidad ni obligacion legal alguna por cualquier informacion incorrecta o alterada contenida en este mensaje. Si usted ha recibido este mensaje por error, le rogamos tenga la amabilidad de destruirlo inmediatamente junto con todas las copias del mismo, notificando al remitente. No debera utilizar, revelar, distribuir, imprimir o copiar este mensaje ni ninguna de sus partes si usted no es el destinatario. Muchas gracias. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[ANN] Providers 0.3 Released (includes DisplayTag tip and URL!)
http://providers.sourceforge.net/ -Original Message- From: Guillermo Meyer [mailto:[EMAIL PROTECTED] Sent: Sábado, 22 de Mayo de 2004 09:24 a.m. To: Struts Users Mailing List Subject: [ANN] Providers 0.3 Released (includes DisplayTag tip) Providers is a framework to be used with JSP to fill Select options in HTML. You can use it with Struts to replace html:options tag and use prv:options to fill the select without the need of creating a collection in an Action. Providers is intended to help in managing select related problems. Providers also comes with some util taglibs like ComboSelectTag, that allows to create Dependant Drow Down Lists. Providers 0.3 new features are: --- -DefineTag: Allows to define a provider collection as a bean in a given scope. -SelectRefTag: allows to create dependencies between a tag and multiples ones at the same time (see example) Next release will have the following: - -Expresion language: providers-el taglibs. -Use comboselect with a diferent collection for each select Known bug (will be corrected in next release): ComboSelectTag works wrong if Tomcat pooling tag is enabled. Try this in web.xml: init-param param-nameenablePooling/param-name param-valuefalse/param-value /init-param ## - ## ## Tip for DisplayTag users: ## ## - ## If you have a List to be displayed with DisplatTag and one of the fields is an ID, you can create a provider for this field and create a decorator to display the description: Example: Your collection objects have the following attributes: -userName -idStatus You want to display idStatus description but you haven't the value in the collection. This is the JSP code: display:table name=test display:column property=userName / display:column property=idStatus decorator=com.mycompany.StatusProviderDecorator / /display:table Your decorator could be as follows: public class StatusProviderDecorator implements ColumnDecorator { public final String decorate(Object pColumnValue) { try { ProviderFactory factory = ProviderFactory.getInstance(); String valueToFormat = (String)pColumnValue; Object obj = factory.getProvider(status).getDescription(valueToFormat); return obj.toString(); } catch (Exception e) { return obj.toString(); //default returns the same... There was an unexpected error } } } And your provider definition: provider name=status className=ar.com.koalas.providers.FixedProvider set-property property=keyName value=key/ set-property property=description value=value/ value className=ar.com.koalas.providers.ParBean key=01 value=Active/ value className=ar.com.koalas.providers.ParBean key=02 value=Inactive/ value className=ar.com.koalas.providers.ParBean key=03 value=Blocked/ value className=ar.com.koalas.providers.ParBean key=04 value=Deleted/ /provider You also could use this provider to display options in a page (for example, while changing the status): prv:select property=idStatus doMatches=true prv:options provider=status/ /prv:select And in a detail, you could show status description given the ID: prv:write name=testForm property=idStatus provider=status/ Cheers! Guillermo Meyer System Engineer EDS Argentina - Proyecto X71 Interbanking. 54.11.4322-1307 NOTA DE CONFIDENCIALIDAD Este mensaje (y sus anexos) es confidencial, esta dirigido exclusivamente a las personas direccionadas en el mail y puede contener informacion (i)de propiedad exclusiva de Interbanking S.A. o (ii) amparada por el secreto profesional. Cualquier opinion en el contenido, es exclusiva de su autor y no representa necesariamente la opinion de Interbanking S.A. El acceso no autorizado, uso, reproduccion, o divulgacion esta prohibido. Interbanking S.A no asumira responsabilidad ni obligacion legal alguna por cualquier informacion incorrecta o alterada contenida en este mensaje. Si usted ha recibido este mensaje por error, le rogamos tenga la amabilidad de destruirlo inmediatamente junto con todas las copias del mismo, notificando al remitente. No debera utilizar, revelar, distribuir, imprimir o copiar este mensaje ni ninguna de sus partes si usted no es el destinatario. Muchas gracias. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] NOTA DE CONFIDENCIALIDAD Este mensaje (y sus anexos) es confidencial, esta dirigido exclusivamente a las personas direccionadas en el mail y puede contener informacion (i)de propiedad
RE: Tiles and changing the title based on content
Tim, The advanced tiles pdf is under the User and Developer Guides (http://jakarta.apache.org/struts/userGuide/index.html), Tiles Guide (http://jakarta.apache.org/struts/userGuide/dev_tiles.html), under the bottom-of-the-page link Tiles Advanced Features: http://www.lifl.fr/~dumoulin/tiles/tilesAdvancedFeatures.pdf Why not just subclass TilesAction? You wrote you need other classes to subclass it and do something before you execute? Can't you just subclass TilesAction into MyTilesAction, create an empty MyTilesAction.dummy() method which you will override in future subclasses, then override MyTilesAction.execute() (the appropriate one since one get a Tiles context object so you can manipulate the tile data) so it calls MyTilesAction.execute() before running the real super.execute() method? All your classes can then subclass MyTilesAction and setup your dummy() method in that subclass to do your appropriate pre-execute() work. Or were you doing something like this for your actions but didn't know it could be used with anything you subclassed from a TilesAction? Regards, David -Original Message- From: Tim Penhey [mailto:[EMAIL PROTECTED] Sent: Saturday, May 22, 2004 4:03 AM To: Struts Users Mailing List Subject: RE: Tiles and changing the title based on content That could work. BTW where is the advanced tiles PDF? The other possibility I suppose is to have the default layout use an include that specifies c:set var=titleKeytiles:getAsString name=titleKey//c:set titlebean:message key=${titleKey}//title and it could be overriden in an extended tile definition to use title${item.name}/title but my question on that is the efficiency of having two line JSPs that are included in tiles. What overhead is there in including a one or two line JSP? Inheriting the TilesAction would require another intermediate class that would handle the default behaviour that I want the pages to have, and other actions would have to override this. If I did this, is there an appropriate method to do this default behaviour that happens before the execute method? Tim -Original Message- From: David Friedman [mailto:[EMAIL PROTECTED] Sent: 21 May 2004 23:41 To: Struts Users Mailing List Subject: RE: Tiles and changing the title based on content Tim, Why not use a TilesAction (org.apache.struts.tiles.action package) and change/set tiles attributes using the putAttribute() method of the ComponentContext object. For more details, see the advances tiles PDF. -David -Original Message- From: Michael McGrady [mailto:[EMAIL PROTECTED] Sent: Friday, May 21, 2004 6:34 PM To: Struts Users Mailing List Cc: Struts Users Mailing List Subject: RE: Tiles and changing the title based on content I am not sure why this is a problem. All you have to do if you want part of the response object to be dynamic is put your dynamic value in the tile. Presumably you have some dynamic factor choosing the tiles content page. Just have that same factor decide what the value of the title is. There are lots of ways to introduce dynamic content. I don't see the problem. Michael - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problem with Action Forms and html:* tags
I am having a problem using Action forms because I do not know what to call the attributes (setters and getters on the form) so that they are called with the request values. Here is a sample of the JSP: td html:select name=yeast property=yeastLab.ID html:options collection=labList property=ID labelProperty=lab/ /html:select /td /tr tr tdForm/td td html:select name=yeast property=yeastForm.ID html:options collection=formList property=ID labelProperty=form/ /html:select /td Note that both select tags have the same name and different properties. What do I call the attribute on the form bean so that it is called (setter and getter) for each of these select options? Thanks in advance, Tom Veldhouse - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem with Action Forms and html:* tags
Thomas T. Veldhouse wrote: I am having a problem using Action forms because I do not know what to call the attributes (setters and getters on the form) so that they are called with the request values. Here is a sample of the JSP: td html:select name=yeast property=yeastLab.ID html:options collection=labList property=ID labelProperty=lab/ /html:select /td /tr tr tdForm/td td html:select name=yeast property=yeastForm.ID html:options collection=formList property=ID labelProperty=form/ /html:select /td Note that both select tags have the same name and different properties. What do I call the attribute on the form bean so that it is called (setter and getter) for each of these select options? As often happens with a lot of experimenting, I have figured this one out for myself. I used the form bean for everything. All the documentation that I found didn't indicate that the form bean was actually instatiated upon entry into the page (with a call to reset), and thus I didn't quite understand that using the bean for data output was the proper method. Programming Jakarta Struts indicated that this might be the case, but then proceded to state that the form bean was instantiated upon submitting the form, which isn't true. It is created upon entering the page and hitting the html:form tag. Tom Veldhouse - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Validator Framework, WHAT's UP !!!!
I'm using the 1.1 validator framework. I have activated the validator pluging correctly, because I can see the validations from the validation.xml file being displayed on the output from the app-server. I know that the validations themselves are working as per the validations that I set up in validation.xml, because when I enter in unwanted data. I get returned to the page that I was currently entering in data into. That's all fine. But, I'm not gettting any error messages displayed in my JSP, even though I'm including the html:errors/ tag. Someone please tell me what I'm doing wrong. Thanks in advance. -- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
The set-property element
Hi all, I am puzzled about the behavior of the set-property element when it is nested in an action element. I thought it was setting the properties of the Action class, but it seems not working. Could you please help me clear it up? Thanks! Paraman