Re: Multiple Webapps and the TLDs
On 9/8/05, Wendy Smoak [EMAIL PROTECTED] wrote: From: Jason Kwon [EMAIL PROTECTED] Say I have multiple webapps. Currently, I am deploying each webapp with their own copies of the struts TLDs. Is there any way I can deploy each webapp and deploy only a single set of struts TLDs? There is a way you can deploy *none* of the tlds. :) Assuming you're on a Servlet 2.3 or better container, and that by deploying you mean you're putting the tlds under WEB-INF and configuring them in web.xml, all you have to do is start using the right URI in your @taglib tags, and the tlds which are already in (for example) struts.jar will be automatically used. Example: %@ taglib uri=http://struts.apache.org/tags-html-el; prefix=html % If you're using the non-el version of the tags, the URI will be different-- look in the tld itself for the urihttp://struts.apache.org/tags-html/uri, and use that in your %@ taglib tag. Then delete the .tld files from wherever you had them, and delete the taglib tags from web.xml. Ok, I have Struts 1.2.7 distro, which contains META-INF/tlds directory with the following tld files: struts-bean-1.1.tld struts-bean.tld struts-html-1.1.tld struts-html.tld struts-logic-1.1.tld struts-logic.tld struts-nested-1.1.tld struts-nested.tld struts-tiles-1.1.tld struts-tiles.tld *1.1.tld files have older uri in them referring jakarta.struts (interesting why they have higher version number?). What about EL tags? Will they be included in distro? With JSP 2.4 most users will fall back to standard Struts tags, but I use Struts-EL and I would like it to be in the distro as well. Michael. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Shale] NullpointerException when running struts-shale-usecas es
From: [EMAIL PROTECTED] I downloaded and installed a clean Tomcat 5.0.30, and now it started Ok. So I went back and looked at my other Tomcat 5 install, and found that I had some commons-xxx jars and log4J among other things in the common/lib directory. Since we have been suspecious of digester, I removed that one first - No cigar. I then readded that one and remove the next until I finally figured out what causes the problem. There is a compatibility issue between log4j (1.2.8) and Shale. When I removed my two log4j jars, Shale started ok. I just added a dependency on log4j-1.2.8 to the use-cases, added commons-logging.properties and log4j.properties to WEB-INF/classes, built and deployed it. It starts up normally. That's with the log4j .jar file in WEB-INF/lib, however. You mention _two_ log4j jars, which could be a problem. Where were they? If you have multiple copies of the same class(es) available on the classpath, strange things can happen. -- Wendy Smoak - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:optioncollection
Hi I think your question's answer will be layout:pager layout:collectionlist use these tags refer layout tag lib Regards Kumar Marc Ende [EMAIL PROTECTED] wrote: Hi, I'm using the only with collections. Now I need to order the contents. It's possible to assign anything else (orderable/sortable) than collections to this tag? marc __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
SV: [Shale] NullpointerException when running struts-shale-usecas es
Hi The other log4j file is the log4j-sandbox-0.1alpha.jar. This contains the InitContextListener for Log4J amongst other things. I added the log4j jar file to the struts-shale-usecases webapps lib directory and it started ok. So conclusion is that if log4j is in the common/lib directory it won't start, while it will start with the same jar file in the web-inf/lib directory. I suspect that this has to do with the way Shale (i.e commons-logging) initializes the logging. When running in any container, you need to handle logging specially to avoid log intermixing (which is why I use InitContextListener and place it in common/lib). Hermod -Opprinnelig melding- Fra: Wendy Smoak [mailto:[EMAIL PROTECTED] Sendt: 20. september 2005 08:22 Til: Struts Users Mailing List Emne: Re: [Shale] NullpointerException when running struts-shale-usecas es From: [EMAIL PROTECTED] I downloaded and installed a clean Tomcat 5.0.30, and now it started Ok. So I went back and looked at my other Tomcat 5 install, and found that I had some commons-xxx jars and log4J among other things in the common/lib directory. Since we have been suspecious of digester, I removed that one first - No cigar. I then readded that one and remove the next until I finally figured out what causes the problem. There is a compatibility issue between log4j (1.2.8) and Shale. When I removed my two log4j jars, Shale started ok. I just added a dependency on log4j-1.2.8 to the use-cases, added commons-logging.properties and log4j.properties to WEB-INF/classes, built and deployed it. It starts up normally. That's with the log4j .jar file in WEB-INF/lib, however. You mention _two_ log4j jars, which could be a problem. Where were they? If you have multiple copies of the same class(es) available on the classpath, strange things can happen. -- Wendy Smoak - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This email with attachments is solely for the use of the individual or entity to whom it is addressed. Please also be aware that the DnB NOR Group cannot accept any payment orders or other legally binding correspondence with customers as a part of an email. This email message has been virus checked by the virus programs used in the DnB NOR Group. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Hibernate] This stuff is cool
First, Hibernate Mailing List might be a better list to answer your questions. However, i'll try to answer as am also an Hibernate user. Le Mardi 20 Septembre 2005 06:30, Murray Collingwood a écrit : Hi all Hibernate is an excellent tool! I managed to get it running quite quickly, only a few small issues to resolve, fortunately the error messages were fairly clear. I've implemented Hibernate into the beginning of a new Struts app, however my code isn't looking like the examples and I'm wondering if I'm putting files in the wrong places. Here is the structure I have: Note, the term Menu here refers to a restaurant menu item. Form bean MenuForm is stored in com.path.controller.form Action class is in com.path.controller.action In this app my form beans reflect closely the database so I am using the same form bean classes for the model. You mean you are persisting the Struts forms in database? This is dangerous i think. I'll recommend using the delegate design pattern to prevent user access to some setters of the bean (eg. Hibernate requires you to have a setOwner on a bean to populate it from database but you don't want somebody to be allowed to change the owner by doing someAction.do?owner=SomeFakeOwner) So better have form do this: getXXX(){ return theBean.getXXX(); } and persist theBean :) This way you have better control on form setters I created Menu.hbm.xml and tried placing it in com.path.controller.form as the Hibernate documentation said to place these 'hbm' files with the pojos. When I tried to start the app Hibernate complained that it couldn't find the Menu.hbm.xml file. So I moved the file around a bit, finally placing it in the root of the Source directory, eg src/Menu.hbm.xml with src/com/path/controller/form/MenuForm.java. The contents of my Menu.hbm.xml is as follows: ?xml version=1.0? !DOCTYPE hibernate-mapping PUBLIC -//Hibernate/Hibernate Mapping DTD 3.0//EN http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd; hibernate-mapping class name=com.path.controller.form.MenuForm table=Menu id name=mid generator class=native/ /id property name=title/ property name=description/ property name=price type=float/ property name=rating type=int/ property name=dateFrom type=date/ property name=dateTo type=date/ property name=imageid type=int/ /class /hibernate-mapping My hibernate.cfg.xml is: ?xml version=1.0 encoding=UTF-8? !DOCTYPE hibernate-configuration PUBLIC -//Hibernate/Hibernate Configuration DTD//EN http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd; hibernate-configuration session-factory property name=connection.datasourcejava:comp/env/jdbc/dbname/property property name=show_sqltrue/property property name=dialectorg.hibernate.dialect.MySQLDialect/property !-- Drop and re-create the database schema on startup -- property name=hbm2ddl.autocreate/property !-- Mapping files -- mapping resource=Menu.hbm.xml/ /session-factory /hibernate-configuration THE QUESTION IS: My hbm file is not stored next to the pojo and has to reference it using the full path. Is this normal? Is there a better way of doing this? As Hibernate documentation says, put it along the POJO. If Hibernate didn't find it, it's perhaps because of your compilation process. Some ide/automated tools like maven only compile classes in src/ directory to target/ directory, they do not copy ressources. Try to create a separate ressources directory which is copied in target directory as part of compilation process. For info, here we put our .hbm files in webapp/WEB-INF/classes/com/company/somePath because in compilation process, webapp/* is copied in final war :) With all this, we have our own session factory which is a singleton having this in constructor: Configuration configuration = new Configuration(); // ensure that the *.hbm.xml is located in bin/be/rmi/intranet/db // (where the class is) for (int i = 0; i persistedClasses.length; i++) { configuration.addClass(persistedClasses[i]); } sessionFactory = configuration.configure().buildSessionFactory(); with private static Class[] persistedClasses = new Class[] { V4_news.class, Scpub.class, User.class, Function.class, FunctionBackup.class, Vacancy.class, TimeKeeper.class, Project.class }; Kind regards mc FOCUS Computing Mob: 0415 24 26 24 [EMAIL PROTECTED] http://www.focus-computing.com.au -- David Delbecq Royal Meteorological Institute of Belgium - Pingouins dans les champs, hiver méchant - To unsubscribe, e-mail: [EMAIL
Re: [Shale] NullpointerException when running struts-shale-usecases
Hermod, Admittedly, the error message you received is not particularly helpful. However, it is clearly related to a problem parsing your dialog-config.xmlresource file. Could you please examine the area around line 41 of this file, and/or post the entire file for us to take a look at? Craig
SV: [Shale] NullpointerException when running struts-shale-usecas es
Hi Well, its the demo webapp from shale, but heres the version that I have: ?xml version=1.0 encoding=UTF-8? !-- Copyright 2004-2005 The Apache Software Foundation. Licensed under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. $Id: dialog-config.xml 289940 2005-09-18 15:46:04Z wsmoak $ -- !-- Dialog definitions for Shale Use Cases Example Web Application -- !DOCTYPE dialogs PUBLIC -//Apache Software Foundation//DTD Shale Dialog Configuration 1.0//EN http://struts.apache.org/dtds/shale-dialog-config_1_0.dtd; dialogs !-- Log On / Create Profile Dialog -- dialogname=Log On start=Check Cookie action name=Check Cookie method=#{profile$logon.check} transition outcome=authenticated target=Exit/ transition outcome=unauthenticated target=Logon Form/ /action viewname=Logon Form viewId=/profile/logon.jsp transition outcome=authenticated target=Exit/ transition outcome=create target=Create Profile/ /view subdialog name=Create Profile dialogName=Edit Profile transition outcome=success target=Exit/ /subdialog end name=Exit viewId=/usecases.jsp/ /dialog !-- Edit Profile Dialog -- dialogname=Edit Profile start=Setup !-- Global transitioh definitions -- transition outcome=cancel target=Cancel/ transition outcome=finish target=Finish/ action name=Setup method=#{profile$edit.setup} transition outcome=success target=Page 1/ /action viewname=Page 1 viewId=/profile/profile1.jsp transition outcome=next target=Page 2/ /view viewname=Page 2 viewId=/profile/profile2.jsp transition outcome=next target=Page 3/ transition outcome=previous target=Page 1/ /view viewname=Page 3 viewId=/profile/profile3.jsp transition outcome=next target=Exit/ transition outcome=previous target=Page 2/ /view action name=Cancel method=#{profile$edit.cancel} transition outcome=success target=Exit/ /action action name=Finish method=#{profile$edit.finish} transition outcome=password target=Page 1/ transition outcome=success target=Exit/ transition outcome=username target=Page 1/ /action end name=Exit viewId=/usecases.jsp/ /dialog /dialogs -Opprinnelig melding- Fra: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] vegne av Craig McClanahan Sendt: 20. september 2005 09:37 Til: Struts Users Mailing List Emne: Re: [Shale] NullpointerException when running struts-shale-usecases Hermod, Admittedly, the error message you received is not particularly helpful. However, it is clearly related to a problem parsing your dialog-config.xmlresource file. Could you please examine the area around line 41 of this file, and/or post the entire file for us to take a look at? Craig * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This email with attachments is solely for the use of the individual or entity to whom it is addressed. Please also be aware that the DnB NOR Group cannot accept any payment orders or other legally binding correspondence with customers as a part of an email. This email message has been virus checked by the virus programs used in the DnB NOR Group. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
SV: [Shale] NullpointerException when running struts-shale-usecas es
Hi Addendum: The offending lines: dialogname=Log On start=Check Cookie action name=Check Cookie method=#{profile$logon.check} transition outcome=authenticated target=Exit/ transition outcome=unauthenticated target=Logon Form/ /action -Opprinnelig melding- Fra: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sendt: 20. september 2005 09:55 Til: user@struts.apache.org Emne: SV: [Shale] NullpointerException when running struts-shale-usecas es Hi Well, its the demo webapp from shale, but heres the version that I have: ?xml version=1.0 encoding=UTF-8? !-- Copyright 2004-2005 The Apache Software Foundation. Licensed under the Apache License, Version 2.0 (the License); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. $Id: dialog-config.xml 289940 2005-09-18 15:46:04Z wsmoak $ -- !-- Dialog definitions for Shale Use Cases Example Web Application -- !DOCTYPE dialogs PUBLIC -//Apache Software Foundation//DTD Shale Dialog Configuration 1.0//EN http://struts.apache.org/dtds/shale-dialog-config_1_0.dtd; dialogs !-- Log On / Create Profile Dialog -- dialogname=Log On start=Check Cookie action name=Check Cookie method=#{profile$logon.check} transition outcome=authenticated target=Exit/ transition outcome=unauthenticated target=Logon Form/ /action viewname=Logon Form viewId=/profile/logon.jsp transition outcome=authenticated target=Exit/ transition outcome=create target=Create Profile/ /view subdialog name=Create Profile dialogName=Edit Profile transition outcome=success target=Exit/ /subdialog end name=Exit viewId=/usecases.jsp/ /dialog !-- Edit Profile Dialog -- dialogname=Edit Profile start=Setup !-- Global transitioh definitions -- transition outcome=cancel target=Cancel/ transition outcome=finish target=Finish/ action name=Setup method=#{profile$edit.setup} transition outcome=success target=Page 1/ /action viewname=Page 1 viewId=/profile/profile1.jsp transition outcome=next target=Page 2/ /view viewname=Page 2 viewId=/profile/profile2.jsp transition outcome=next target=Page 3/ transition outcome=previous target=Page 1/ /view viewname=Page 3 viewId=/profile/profile3.jsp transition outcome=next target=Exit/ transition outcome=previous target=Page 2/ /view action name=Cancel method=#{profile$edit.cancel} transition outcome=success target=Exit/ /action action name=Finish method=#{profile$edit.finish} transition outcome=password target=Page 1/ transition outcome=success target=Exit/ transition outcome=username target=Page 1/ /action end name=Exit viewId=/usecases.jsp/ /dialog /dialogs -Opprinnelig melding- Fra: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] vegne av Craig McClanahan Sendt: 20. september 2005 09:37 Til: Struts Users Mailing List Emne: Re: [Shale] NullpointerException when running struts-shale-usecases Hermod, Admittedly, the error message you received is not particularly helpful. However, it is clearly related to a problem parsing your dialog-config.xmlresource file. Could you please examine the area around line 41 of this file, and/or post the entire file for us to take a look at? Craig * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This email with attachments is solely for the use of the individual or entity to whom
Validate array
Hello, how can i validate an array of Long and check that addNumber[] is 0 and 99.99 ? form-bean name=exampleForm type=org.apache.struts.action.DynaActionForm form-property name=addNumber type=java.lang.Long[]/ /form-bean -- Mario Nee' Brescia Italy [EMAIL PROTECTED] http://www.xmoon.org - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Shale] clay templating
Gary VanMatre wrote: The only difference is instead of span jsfid=content.html / in profile screen I need profile.html and in main I need main.html components. How can I do this? Well... to me, this sounds like a job for Tiles. Gary, what do you think? Yes, I agree. The role of Clay is to glue togather JSF components. This is at a smaller granularity than pulling together page fragments as tiles does. Thanks for clarifications.Actually I thought that combining tiles in clay is more flexible solution.For example I'd can to change in my page not entry fragment but only one component or some of its properties (in tiles we have to use variable, populated in tiles context to specify that for profile screen some component have one color and in main screen - another color - it's not clear solution) Another question about html views (since they are more interesting in practical use). For example I have main.html component and profile.html component. The both have submit buttons - but I want distinguish that one button is for main.html and another one - for profile.html. In rolodex example all components are specified in one config file without any hierarchy - so I should invent some naming convention (e.g mainPageSubmitButton,profilePageSubmitButton, addressBookPanelNotesTabSubmitButton etc) to be sure that component ids will not fail to conflict. It's not convenient - because if I'll change name for mainPage I should change names for all component. Is it possible to do by other way? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Being Lazy with Hibernate
Has anyone been able to get a Struts / Hibernate app to work nicely with Lazy Initialization? Whenever I have things with Lazy set to true I'm getting a Failed to lazily initialize a collection Exception. I'd like to be able to lazily access related objects in my DAO layer, potentially my Actions and the JSPs of the frontend as well. (I use tiles as well if that affects things). Is this possible? I've posted once or twice to the Equinox list but it seems a little low on traffic these days and was wondering if anyone else out there has done this particular thing with the same combination of technologies? If it is at all relevant my app is using Hibernate 2, JBoss 3.2.1 with a Tomcat 4 plugin (not my choice and I cannot change it), an Apache web server and Oracle as the DB. If there is anyone out there being successfully lazy I'd love to hear from you. I've been trying filters and such things but without result so far. Regards Marty - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Being Lazy with Hibernate
For lazy initialization to work, at the moment of the lazy initialisation, (that is the moment you request the data) the hibernate session must not be closed. The best way to do this is to store the hibernate session in the user session and use a servlet filter to connect/disconnect/reconnect the hibernate session. Martin Ravell a écrit : Has anyone been able to get a Struts / Hibernate app to work nicely with Lazy Initialization? Whenever I have things with Lazy set to true I'm getting a Failed to lazily initialize a collection Exception. I'd like to be able to lazily access related objects in my DAO layer, potentially my Actions and the JSPs of the frontend as well. (I use tiles as well if that affects things). Is this possible? I've posted once or twice to the Equinox list but it seems a little low on traffic these days and was wondering if anyone else out there has done this particular thing with the same combination of technologies? If it is at all relevant my app is using Hibernate 2, JBoss 3.2.1 with a Tomcat 4 plugin (not my choice and I cannot change it), an Apache web server and Oracle as the DB. If there is anyone out there being successfully lazy I'd love to hear from you. I've been trying filters and such things but without result so far. Regards Marty - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
html:select tag
hi David, I have got one more problem, this time its related to select box which is rendered using html:select tag enclosing one or more html:option or btml:options I have got an ActionForm set as request attribute, which contains a property of type java.util.Hashtable I wanted to display the values (only values without keys) in a select box so i tried html:options property=HashtableProperty name=MyActionForm / but this displays key=value in my select box, not just value If I change my property type to java.util.ArrayList then it works fine But the reason I want it with hashtable is that I want Hashtable's key as value of select box and the corresponding value as displayed item. any Suggestions? --RahulJoshi -Original Message- From: rahul [mailto:[EMAIL PROTECTED] Sent: Monday, September 19, 2005 8:43 PM To: Struts Users Mailing List Subject: RE: Radio Button in ActionForm thank you very much It worked! -Original Message- From: Harland, David [mailto:[EMAIL PROTECTED] Sent: Monday, September 19, 2005 6:07 PM To: Struts Users Mailing List Subject: RE: Radio Button in ActionForm Initialise your Action Form set sec equal to 'M' or 'F'. Add the following to your jsp html:radio property=sex name=MyActionForm value=M/ html:radio property=sex name=MyActionForm value=F/ -Original Message- From: rahul [mailto:[EMAIL PROTECTED] Sent: 19 September 2005 13:34 To: Struts Users Mailing List Subject: Radio Button in ActionForm hi all, I am looking at some simplified way of displaying the radio button on a jsp depending upon the value of an ActionForm's property. For example I have got an ActionForm with a property name sex, which can take 'M' or 'F' as input. Now after storing the value in an ActionForm instance (which is then set as a request attribute) from database, I am forwarding the request to a jsp where I need to display the values I collected. like (.) Male ( ) Female Is there any elegant way of doing this using html:radio tags in struts ? I know its pretty simple in case of simple input box where we do it by html: text property=sex name=MyActionForm / but how to go with radio buttons ? Any suggestions ? --Rahul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e mail is from DLA Piper Rudnick Gray Cary UK LLP. The contents of this email and any attachments are confidential to the intended recipient. They may not be disclosed to or used by or copied in any way by anyone other than the intended recipient. If this email is received in error, please contact DLA Piper Rudnick Gray Cary UK LLP on +44 (0) 8700 11 quoting the name of the sender and the email address to which it has been sent and then delete it. Please note that neither DLA Piper Rudnick Gray Cary UK LLP nor the sender accept any responsibility for viruses and it is your responsibility to scan or otherwise check this email and any attachments. DLA Piper Rudnick Gray Cary UK LLP is a limited liability partnership registered in England and Wales (registered number OC307847) which provides services from offices in England, Belgium, Germany and the People's Republic of China. A list of members is open for inspection at its registered office and principal place of business 3 Noble Street, London EC2V 7EE. Partner denotes member of a limited liability partnership. DLA Piper Rudnick Gray Cary UK LLP is regulated by the Law Society and is a member of DLA Piper Rudnick Gray Cary, a global legal services organisation, the members of which are separate and distinct legal entities. For further information, please refer to www.dlapiper.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Being Lazy with Hibernate
Hi David, This sounds good but I should have mentioned that I am somewhat new to this particular area and as a result I have no idea how to go about doing what you have suggested. I will continue to research but would you be able to help me with a little more detail on what this entails? Regards Marty -Original Message- From: David Delbecq [mailto:[EMAIL PROTECTED] Sent: Tuesday, 20 September 2005 10:04 PM To: Struts Users Mailing List Subject: Re: Being Lazy with Hibernate For lazy initialization to work, at the moment of the lazy initialisation, (that is the moment you request the data) the hibernate session must not be closed. The best way to do this is to store the hibernate session in the user session and use a servlet filter to connect/disconnect/reconnect the hibernate session. Martin Ravell a écrit : Has anyone been able to get a Struts / Hibernate app to work nicely with Lazy Initialization? Whenever I have things with Lazy set to true I'm getting a Failed to lazily initialize a collection Exception. I'd like to be able to lazily access related objects in my DAO layer, potentially my Actions and the JSPs of the frontend as well. (I use tiles as well if that affects things). Is this possible? I've posted once or twice to the Equinox list but it seems a little low on traffic these days and was wondering if anyone else out there has done this particular thing with the same combination of technologies? If it is at all relevant my app is using Hibernate 2, JBoss 3.2.1 with a Tomcat 4 plugin (not my choice and I cannot change it), an Apache web server and Oracle as the DB. If there is anyone out there being successfully lazy I'd love to hear from you. I've been trying filters and such things but without result so far. Regards Marty - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DynaActionForm and Indexed Properties
I'd like to update mass user Data in a form with a dynamic number of rows (depending on the number of users already available). I use a dynaform: form-bean name=userForm type=org.apache.struts.action.DynaActionForm form-property name=id type=java.lang.String[] / form-property name=username type=java.lang.String[] / /form-bean Now I use a MappingDispatchAction UserAction with two methods: public ActionForward prepareUpdate(...) { // static implementation for testing only // once it works I'll get the existing objects from a DAO object here DynaActionForm userForm = (DynaActionForm) form; userForm.set(id, 0, 0); userForm.set(username, 0, user0); userForm.set(id, 1, 1); userForm.set(username, 1, user1); return mapping.findForward(success); } and... public ActionForward update(...) { DynaActionForm userForm = (DynaActionForm) form; // Later on: Update data using DAO object ... return mapping.findForward(success); } The form looks as follows: form action=/UserUpdate logic:iterate id=_username name=userForm property=username indexId=idx html:hidden property='%= id[ + idx + ] %' /br/ html:text property='%= username[ + idx + ] %' /br/ /logic:iterate html:submit / /form struts-config.xml action config looks like this: action path=/PrepareUserUpdate type=my.actions.UserAction parameter=prepareUpdate name=userForm validate=false scope=request forward name=success path=/UserUpdateForm.do / /action action path=/UserUpdateForm forward=/WEB-INF/pages/UserUpdateForm.jsp / action path=/UserUpdate type=my.actions.UserAction parameter=update name=userForm validate=false scope=request forward name=success path=/MySuccessPage.do / /action My problems: 1. Execution fails when populating the DynaActionForm indexed properties within prepareUpdate(...) with a IndexOutOfBoundsException. I'm aware of the size-attribute of the form-property tag but the size is unknown at first. 2. Is my idea how to do it basically right and working somehow? Or are there better ways to do that? Maybe nested properties? (didn't get them to work either) 3. Is it a good idea to use DynForms here? Thanks for your help, Michael. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to pass Session variable to different Webapplication?
You can also use JMS to pass an object through a messaging queue. OpenJMS is an open source JMS Engine that works well for me. I have not played with to many of them to know if there is a better one out there (for free). All of the major Application servers (BEA, WebSphere, etc) support the JMS spec. Martin Burkert [EMAIL PROTECTED] Martin Burkert [EMAIL PROTECTED] 09/17/2005 07:06 AM Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org cc Subject Re: How to pass Session variable to different Webapplication? On Fri, 2005-09-16 at 16:20 -0700, Wendy Smoak wrote: How are the users logging in? You need some form of 'single sign on,' but how to go about it depends on where the credentials are coming from. thx for answering! I'm using JAAS to logon the user. The JAAS-subject is containing the users name and credentials. Craig McClanahan wrote, that I would violate the spec. Is there a design pattern to solve this problem in a nice way without violating the spec? - or an other question: how is it possible to split up a big struts application into small pieces? thx for any hint greetings Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Being Lazy with Hibernate
See sections 20.1.4. Initializing collections and proxies and 1.4, “Playing with cats” For details :) (Hibernate 3 documentation) Martin Ravell a écrit : Hi David, This sounds good but I should have mentioned that I am somewhat new to this particular area and as a result I have no idea how to go about doing what you have suggested. I will continue to research but would you be able to help me with a little more detail on what this entails? Regards Marty -Original Message- From: David Delbecq [mailto:[EMAIL PROTECTED] Sent: Tuesday, 20 September 2005 10:04 PM To: Struts Users Mailing List Subject: Re: Being Lazy with Hibernate For lazy initialization to work, at the moment of the lazy initialisation, (that is the moment you request the data) the hibernate session must not be closed. The best way to do this is to store the hibernate session in the user session and use a servlet filter to connect/disconnect/reconnect the hibernate session. Martin Ravell a écrit : Has anyone been able to get a Struts / Hibernate app to work nicely with Lazy Initialization? Whenever I have things with Lazy set to true I'm getting a Failed to lazily initialize a collection Exception. I'd like to be able to lazily access related objects in my DAO layer, potentially my Actions and the JSPs of the frontend as well. (I use tiles as well if that affects things). Is this possible? I've posted once or twice to the Equinox list but it seems a little low on traffic these days and was wondering if anyone else out there has done this particular thing with the same combination of technologies? If it is at all relevant my app is using Hibernate 2, JBoss 3.2.1 with a Tomcat 4 plugin (not my choice and I cannot change it), an Apache web server and Oracle as the DB. If there is anyone out there being successfully lazy I'd love to hear from you. I've been trying filters and such things but without result so far. Regards Marty - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Being Lazy with Hibernate
You may also find useful this article http://www.hibernate.org/43.html - or just google for Open Session in View :) HTH, Sergey David Delbecq wrote: See sections 20.1.4. Initializing collections and proxies and 1.4, “Playing with cats” For details :) (Hibernate 3 documentation) Martin Ravell a écrit : Hi David, This sounds good but I should have mentioned that I am somewhat new to this particular area and as a result I have no idea how to go about doing what you have suggested. I will continue to research but would you be able to help me with a little more detail on what this entails? Regards Marty -Original Message- From: David Delbecq [mailto:[EMAIL PROTECTED] Sent: Tuesday, 20 September 2005 10:04 PM To: Struts Users Mailing List Subject: Re: Being Lazy with Hibernate For lazy initialization to work, at the moment of the lazy initialisation, (that is the moment you request the data) the hibernate session must not be closed. The best way to do this is to store the hibernate session in the user session and use a servlet filter to connect/disconnect/reconnect the hibernate session. Martin Ravell a écrit : Has anyone been able to get a Struts / Hibernate app to work nicely with Lazy Initialization? Whenever I have things with Lazy set to true I'm getting a Failed to lazily initialize a collection Exception. I'd like to be able to lazily access related objects in my DAO layer, potentially my Actions and the JSPs of the frontend as well. (I use tiles as well if that affects things). Is this possible? I've posted once or twice to the Equinox list but it seems a little low on traffic these days and was wondering if anyone else out there has done this particular thing with the same combination of technologies? If it is at all relevant my app is using Hibernate 2, JBoss 3.2.1 with a Tomcat 4 plugin (not my choice and I cannot change it), an Apache web server and Oracle as the DB. If there is anyone out there being successfully lazy I'd love to hear from you. I've been trying filters and such things but without result so far. Regards Marty - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Validation of input field requires SQL. Better to put it in Form or in Action?
Hi In my HTML-Form I'm sending a number to a action. If the number is valid will be decided by a sql-query. I'm not sure to put this select in the ActionForms validate method or in the action with a corresponding forward. What would be the better way? Thanks for any opinions! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: html:select tag
Hi, Create an ArrayList object. Iterate through your Hashtable(HashMap is a better option). For each iteration create a new org.apache.struts.util.LabelValueBean object. Populate its label and value attributes and then add it to your ArrayList object. Then pass the ArrayList object as the property. Regards Dave. -Original Message- From: rahul [mailto:[EMAIL PROTECTED] Sent: 20 September 2005 13:11 To: Struts Users Mailing List Subject: html:select tag hi David, I have got one more problem, this time its related to select box which is rendered using html:select tag enclosing one or more html:option or btml:options I have got an ActionForm set as request attribute, which contains a property of type java.util.Hashtable I wanted to display the values (only values without keys) in a select box so i tried html:options property=HashtableProperty name=MyActionForm / but this displays key=value in my select box, not just value If I change my property type to java.util.ArrayList then it works fine But the reason I want it with hashtable is that I want Hashtable's key as value of select box and the corresponding value as displayed item. any Suggestions? --RahulJoshi -Original Message- From: rahul [mailto:[EMAIL PROTECTED] Sent: Monday, September 19, 2005 8:43 PM To: Struts Users Mailing List Subject: RE: Radio Button in ActionForm thank you very much It worked! -Original Message- From: Harland, David [mailto:[EMAIL PROTECTED] Sent: Monday, September 19, 2005 6:07 PM To: Struts Users Mailing List Subject: RE: Radio Button in ActionForm Initialise your Action Form set sec equal to 'M' or 'F'. Add the following to your jsp html:radio property=sex name=MyActionForm value=M/ html:radio property=sex name=MyActionForm value=F/ -Original Message- From: rahul [mailto:[EMAIL PROTECTED] Sent: 19 September 2005 13:34 To: Struts Users Mailing List Subject: Radio Button in ActionForm hi all, I am looking at some simplified way of displaying the radio button on a jsp depending upon the value of an ActionForm's property. For example I have got an ActionForm with a property name sex, which can take 'M' or 'F' as input. Now after storing the value in an ActionForm instance (which is then set as a request attribute) from database, I am forwarding the request to a jsp where I need to display the values I collected. like (.) Male ( ) Female Is there any elegant way of doing this using html:radio tags in struts ? I know its pretty simple in case of simple input box where we do it by html: text property=sex name=MyActionForm / but how to go with radio buttons ? Any suggestions ? --Rahul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e mail is from DLA Piper Rudnick Gray Cary UK LLP. The contents of this email and any attachments are confidential to the intended recipient. They may not be disclosed to or used by or copied in any way by anyone other than the intended recipient. If this email is received in error, please contact DLA Piper Rudnick Gray Cary UK LLP on +44 (0) 8700 11 quoting the name of the sender and the email address to which it has been sent and then delete it. Please note that neither DLA Piper Rudnick Gray Cary UK LLP nor the sender accept any responsibility for viruses and it is your responsibility to scan or otherwise check this email and any attachments. DLA Piper Rudnick Gray Cary UK LLP is a limited liability partnership registered in England and Wales (registered number OC307847) which provides services from offices in England, Belgium, Germany and the People's Republic of China. A list of members is open for inspection at its registered office and principal place of business 3 Noble Street, London EC2V 7EE. Partner denotes member of a limited liability partnership. DLA Piper Rudnick Gray Cary UK LLP is regulated by the Law Society and is a member of DLA Piper Rudnick Gray Cary, a global legal services organisation, the members of which are separate and distinct legal entities. For further information, please refer to www.dlapiper.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e mail is from DLA Piper Rudnick Gray Cary UK LLP. The contents of this email and any
Re: Being Lazy with Hibernate
Has anyone been able to get a Struts / Hibernate app to work nicely with Lazy Initialization? Whenever I have things with Lazy set to true I'm getting a Failed to lazily initialize a collection Exception. The easiest way to do this is to use the open session in view pattern. If you're using Spring to manage your Hibernate SessionFactory, you can just pop the OpenSessionInViewFilter in web.xml and go. The only thing to watch out for is that any writes back to the database need to be within transactions. -- Bill -- Bill Schneider Chief Architect Vecna Technologies, Inc. 5004 Lehigh Road, Suite B College Park, MD 20740 [EMAIL PROTECTED] t: 301-864-7594 f: 301-699-3180 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Being Lazy with Hibernate
I use struts and Hibernate 3 and lazy initialization works just fine for me. I didn't have to do anything. What's your hibernate version? On 9/20/05, Bill Schneider [EMAIL PROTECTED] wrote: Has anyone been able to get a Struts / Hibernate app to work nicely with Lazy Initialization? Whenever I have things with Lazy set to true I'm getting a Failed to lazily initialize a collection Exception. The easiest way to do this is to use the open session in view pattern. If you're using Spring to manage your Hibernate SessionFactory, you can just pop the OpenSessionInViewFilter in web.xml and go. The only thing to watch out for is that any writes back to the database need to be within transactions. -- Bill -- Bill Schneider Chief Architect Vecna Technologies, Inc. 5004 Lehigh Road, Suite B College Park, MD 20740 [EMAIL PROTECTED] t: 301-864-7594 f: 301-699-3180 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Letícia Álvares Barbalho [EMAIL PROTECTED]
RE: html:select tag
I did that, created ArrayList containing LabelValueBean and this ArrayList is still in a bean as a request attribute. now what to do with html:options ? --RahulJoshi -Original Message- From: Harland, David [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 20, 2005 6:13 PM To: Struts Users Mailing List Subject: RE: html:select tag Hi, Create an ArrayList object. Iterate through your Hashtable(HashMap is a better option). For each iteration create a new org.apache.struts.util.LabelValueBean object. Populate its label and value attributes and then add it to your ArrayList object. Then pass the ArrayList object as the property. Regards Dave. -Original Message- From: rahul [mailto:[EMAIL PROTECTED] Sent: 20 September 2005 13:11 To: Struts Users Mailing List Subject: html:select tag hi David, I have got one more problem, this time its related to select box which is rendered using html:select tag enclosing one or more html:option or btml:options I have got an ActionForm set as request attribute, which contains a property of type java.util.Hashtable I wanted to display the values (only values without keys) in a select box so i tried html:options property=HashtableProperty name=MyActionForm / but this displays key=value in my select box, not just value If I change my property type to java.util.ArrayList then it works fine But the reason I want it with hashtable is that I want Hashtable's key as value of select box and the corresponding value as displayed item. any Suggestions? --RahulJoshi -Original Message- From: rahul [mailto:[EMAIL PROTECTED] Sent: Monday, September 19, 2005 8:43 PM To: Struts Users Mailing List Subject: RE: Radio Button in ActionForm thank you very much It worked! -Original Message- From: Harland, David [mailto:[EMAIL PROTECTED] Sent: Monday, September 19, 2005 6:07 PM To: Struts Users Mailing List Subject: RE: Radio Button in ActionForm Initialise your Action Form set sec equal to 'M' or 'F'. Add the following to your jsp html:radio property=sex name=MyActionForm value=M/ html:radio property=sex name=MyActionForm value=F/ -Original Message- From: rahul [mailto:[EMAIL PROTECTED] Sent: 19 September 2005 13:34 To: Struts Users Mailing List Subject: Radio Button in ActionForm hi all, I am looking at some simplified way of displaying the radio button on a jsp depending upon the value of an ActionForm's property. For example I have got an ActionForm with a property name sex, which can take 'M' or 'F' as input. Now after storing the value in an ActionForm instance (which is then set as a request attribute) from database, I am forwarding the request to a jsp where I need to display the values I collected. like (.) Male ( ) Female Is there any elegant way of doing this using html:radio tags in struts ? I know its pretty simple in case of simple input box where we do it by html: text property=sex name=MyActionForm / but how to go with radio buttons ? Any suggestions ? --Rahul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e mail is from DLA Piper Rudnick Gray Cary UK LLP. The contents of this email and any attachments are confidential to the intended recipient. They may not be disclosed to or used by or copied in any way by anyone other than the intended recipient. If this email is received in error, please contact DLA Piper Rudnick Gray Cary UK LLP on +44 (0) 8700 11 quoting the name of the sender and the email address to which it has been sent and then delete it. Please note that neither DLA Piper Rudnick Gray Cary UK LLP nor the sender accept any responsibility for viruses and it is your responsibility to scan or otherwise check this email and any attachments. DLA Piper Rudnick Gray Cary UK LLP is a limited liability partnership registered in England and Wales (registered number OC307847) which provides services from offices in England, Belgium, Germany and the People's Republic of China. A list of members is open for inspection at its registered office and principal place of business 3 Noble Street, London EC2V 7EE. Partner denotes member of a limited liability partnership. DLA Piper Rudnick Gray Cary UK LLP is regulated by the Law Society and is a member of DLA Piper Rudnick Gray Cary, a global legal services organisation, the members of which are separate and distinct legal entities. For further information, please refer to www.dlapiper.com. - To unsubscribe, e-mail: [EMAIL PROTECTED]
RE: html:select tag
Sorry my mistake. You set the collection value of the options equal to the request attribute referencing the ArrayList object. Ie ROOMTYPES as below. html:select property=roomType name=editHotel html:options collection=ROOMTYPES property=value labelProperty=label/ /html:select -Original Message- From: rahul [mailto:[EMAIL PROTECTED] Sent: 20 September 2005 14:22 To: Struts Users Mailing List Subject: RE: html:select tag I did that, created ArrayList containing LabelValueBean and this ArrayList is still in a bean as a request attribute. now what to do with html:options ? --RahulJoshi -Original Message- From: Harland, David [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 20, 2005 6:13 PM To: Struts Users Mailing List Subject: RE: html:select tag Hi, Create an ArrayList object. Iterate through your Hashtable(HashMap is a better option). For each iteration create a new org.apache.struts.util.LabelValueBean object. Populate its label and value attributes and then add it to your ArrayList object. Then pass the ArrayList object as the property. Regards Dave. -Original Message- From: rahul [mailto:[EMAIL PROTECTED] Sent: 20 September 2005 13:11 To: Struts Users Mailing List Subject: html:select tag hi David, I have got one more problem, this time its related to select box which is rendered using html:select tag enclosing one or more html:option or btml:options I have got an ActionForm set as request attribute, which contains a property of type java.util.Hashtable I wanted to display the values (only values without keys) in a select box so i tried html:options property=HashtableProperty name=MyActionForm / but this displays key=value in my select box, not just value If I change my property type to java.util.ArrayList then it works fine But the reason I want it with hashtable is that I want Hashtable's key as value of select box and the corresponding value as displayed item. any Suggestions? --RahulJoshi -Original Message- From: rahul [mailto:[EMAIL PROTECTED] Sent: Monday, September 19, 2005 8:43 PM To: Struts Users Mailing List Subject: RE: Radio Button in ActionForm thank you very much It worked! -Original Message- From: Harland, David [mailto:[EMAIL PROTECTED] Sent: Monday, September 19, 2005 6:07 PM To: Struts Users Mailing List Subject: RE: Radio Button in ActionForm Initialise your Action Form set sec equal to 'M' or 'F'. Add the following to your jsp html:radio property=sex name=MyActionForm value=M/ html:radio property=sex name=MyActionForm value=F/ -Original Message- From: rahul [mailto:[EMAIL PROTECTED] Sent: 19 September 2005 13:34 To: Struts Users Mailing List Subject: Radio Button in ActionForm hi all, I am looking at some simplified way of displaying the radio button on a jsp depending upon the value of an ActionForm's property. For example I have got an ActionForm with a property name sex, which can take 'M' or 'F' as input. Now after storing the value in an ActionForm instance (which is then set as a request attribute) from database, I am forwarding the request to a jsp where I need to display the values I collected. like (.) Male ( ) Female Is there any elegant way of doing this using html:radio tags in struts ? I know its pretty simple in case of simple input box where we do it by html: text property=sex name=MyActionForm / but how to go with radio buttons ? Any suggestions ? --Rahul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e mail is from DLA Piper Rudnick Gray Cary UK LLP. The contents of this email and any attachments are confidential to the intended recipient. They may not be disclosed to or used by or copied in any way by anyone other than the intended recipient. If this email is received in error, please contact DLA Piper Rudnick Gray Cary UK LLP on +44 (0) 8700 11 quoting the name of the sender and the email address to which it has been sent and then delete it. Please note that neither DLA Piper Rudnick Gray Cary UK LLP nor the sender accept any responsibility for viruses and it is your responsibility to scan or otherwise check this email and any attachments. DLA Piper Rudnick Gray Cary UK LLP is a limited liability partnership registered in England and Wales (registered number OC307847) which provides services from offices in England, Belgium, Germany and the People's Republic of China. A list of members is open for inspection at its registered office and principal place of business 3 Noble Street, London EC2V 7EE. Partner denotes member of a
RE: Validate array
how can i validate an array of Long and check that addNumber[] is 0 and 99.99 ? form-bean name=exampleForm type=org.apache.struts.action.DynaActionForm form-property name=addNumber type=java.lang.Long[]/ /form-bean What kind of validation do you use? FormValidator and XML validation rules? Still - you can override validate() method, call super.validate() and do some additional validation as you need... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: html:select tag
I think this would work only when ROOMTYPES is set as request attribute. But I am not doing that. I have got an ActionForm containg An ArryList(which itself contains LabelValueBeans) and this ActionForm is set a request Attribute not the ArrayList(ROOMTYPES in your case) -Original Message- From: Harland, David [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 20, 2005 6:56 PM To: Struts Users Mailing List Subject: RE: html:select tag Sorry my mistake. You set the collection value of the options equal to the request attribute referencing the ArrayList object. Ie ROOMTYPES as below. html:select property=roomType name=editHotel html:options collection=ROOMTYPES property=value labelProperty=label/ /html:select -Original Message- From: rahul [mailto:[EMAIL PROTECTED] Sent: 20 September 2005 14:22 To: Struts Users Mailing List Subject: RE: html:select tag I did that, created ArrayList containing LabelValueBean and this ArrayList is still in a bean as a request attribute. now what to do with html:options ? --RahulJoshi -Original Message- From: Harland, David [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 20, 2005 6:13 PM To: Struts Users Mailing List Subject: RE: html:select tag Hi, Create an ArrayList object. Iterate through your Hashtable(HashMap is a better option). For each iteration create a new org.apache.struts.util.LabelValueBean object. Populate its label and value attributes and then add it to your ArrayList object. Then pass the ArrayList object as the property. Regards Dave. -Original Message- From: rahul [mailto:[EMAIL PROTECTED] Sent: 20 September 2005 13:11 To: Struts Users Mailing List Subject: html:select tag hi David, I have got one more problem, this time its related to select box which is rendered using html:select tag enclosing one or more html:option or btml:options I have got an ActionForm set as request attribute, which contains a property of type java.util.Hashtable I wanted to display the values (only values without keys) in a select box so i tried html:options property=HashtableProperty name=MyActionForm / but this displays key=value in my select box, not just value If I change my property type to java.util.ArrayList then it works fine But the reason I want it with hashtable is that I want Hashtable's key as value of select box and the corresponding value as displayed item. any Suggestions? --RahulJoshi -Original Message- From: rahul [mailto:[EMAIL PROTECTED] Sent: Monday, September 19, 2005 8:43 PM To: Struts Users Mailing List Subject: RE: Radio Button in ActionForm thank you very much It worked! -Original Message- From: Harland, David [mailto:[EMAIL PROTECTED] Sent: Monday, September 19, 2005 6:07 PM To: Struts Users Mailing List Subject: RE: Radio Button in ActionForm Initialise your Action Form set sec equal to 'M' or 'F'. Add the following to your jsp html:radio property=sex name=MyActionForm value=M/ html:radio property=sex name=MyActionForm value=F/ -Original Message- From: rahul [mailto:[EMAIL PROTECTED] Sent: 19 September 2005 13:34 To: Struts Users Mailing List Subject: Radio Button in ActionForm hi all, I am looking at some simplified way of displaying the radio button on a jsp depending upon the value of an ActionForm's property. For example I have got an ActionForm with a property name sex, which can take 'M' or 'F' as input. Now after storing the value in an ActionForm instance (which is then set as a request attribute) from database, I am forwarding the request to a jsp where I need to display the values I collected. like (.) Male ( ) Female Is there any elegant way of doing this using html:radio tags in struts ? I know its pretty simple in case of simple input box where we do it by html: text property=sex name=MyActionForm / but how to go with radio buttons ? Any suggestions ? --Rahul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e mail is from DLA Piper Rudnick Gray Cary UK LLP. The contents of this email and any attachments are confidential to the intended recipient. They may not be disclosed to or used by or copied in any way by anyone other than the intended recipient. If this email is received in error, please contact DLA Piper Rudnick Gray Cary UK LLP on +44 (0) 8700 11 quoting the name of the sender and the email address to which it has been sent and then delete it. Please note
Re: html:select tag
Remember that a Hashtable is a collection of Hashtable.Entry objects. What you want is something like this (untested): html:options property=HashtableProperty.entries ... L. rahul wrote: hi David, I have got one more problem, this time its related to select box which is rendered using html:select tag enclosing one or more html:option or btml:options I have got an ActionForm set as request attribute, which contains a property of type java.util.Hashtable I wanted to display the values (only values without keys) in a select box so i tried html:options property=HashtableProperty name=MyActionForm / but this displays key=value in my select box, not just value If I change my property type to java.util.ArrayList then it works fine But the reason I want it with hashtable is that I want Hashtable's key as value of select box and the corresponding value as displayed item. any Suggestions? --RahulJoshi -Original Message- From: rahul [mailto:[EMAIL PROTECTED] Sent: Monday, September 19, 2005 8:43 PM To: Struts Users Mailing List Subject: RE: Radio Button in ActionForm thank you very much It worked! -Original Message- From: Harland, David [mailto:[EMAIL PROTECTED] Sent: Monday, September 19, 2005 6:07 PM To: Struts Users Mailing List Subject: RE: Radio Button in ActionForm Initialise your Action Form set sec equal to 'M' or 'F'. Add the following to your jsp html:radio property=sex name=MyActionForm value=M/ html:radio property=sex name=MyActionForm value=F/ -Original Message- From: rahul [mailto:[EMAIL PROTECTED] Sent: 19 September 2005 13:34 To: Struts Users Mailing List Subject: Radio Button in ActionForm hi all, I am looking at some simplified way of displaying the radio button on a jsp depending upon the value of an ActionForm's property. For example I have got an ActionForm with a property name sex, which can take 'M' or 'F' as input. Now after storing the value in an ActionForm instance (which is then set as a request attribute) from database, I am forwarding the request to a jsp where I need to display the values I collected. like (.) Male ( ) Female Is there any elegant way of doing this using html:radio tags in struts ? I know its pretty simple in case of simple input box where we do it by html: text property=sex name=MyActionForm / but how to go with radio buttons ? Any suggestions ? --Rahul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This e mail is from DLA Piper Rudnick Gray Cary UK LLP. The contents of this email and any attachments are confidential to the intended recipient. They may not be disclosed to or used by or copied in any way by anyone other than the intended recipient. If this email is received in error, please contact DLA Piper Rudnick Gray Cary UK LLP on +44 (0) 8700 11 quoting the name of the sender and the email address to which it has been sent and then delete it. Please note that neither DLA Piper Rudnick Gray Cary UK LLP nor the sender accept any responsibility for viruses and it is your responsibility to scan or otherwise check this email and any attachments. DLA Piper Rudnick Gray Cary UK LLP is a limited liability partnership registered in England and Wales (registered number OC307847) which provides services from offices in England, Belgium, Germany and the People's Republic of China. A list of members is open for inspection at its registered office and principal place of business 3 Noble Street, London EC2V 7EE. Partner denotes member of a limited liability partnership. DLA Piper Rudnick Gray Cary UK LLP is regulated by the Law Society and is a member of DLA Piper Rudnick Gray Cary, a global legal services organisation, the members of which are separate and distinct legal entities. For further information, please refer to www.dlapiper.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Shale] clay templating
Another question about html views (since they are more interesting in practical use). For example I have main.html component and profile.html component. The both have submit buttons - but I want distinguish that one button is for main.html and another one - for profile.html. In rolodex example all components are specified in one config file without any hierarchy - so I should invent some naming convention (e.g mainPageSubmitButton,profilePageSubmitButton, addressBookPanelNotesTabSubmitButton etc) to be sure that component ids will not fail to conflict. It's not convenient - because if I'll change name for mainPage I should change names for all component. Is it possible to do by other way? The clay component itself is a naming container. This is the same as the subview. This means that components under it have unique clientId's. Another consideration is a faces form will uniquely identify anything under it. Using these two containers, you can reuse a single commandButton definition in a clay XML config, nested under two different forms. Another trick is to use the managedBeanName attribute. If you code your command buttons action to use the literal managed-bean-name, this sting will be replaced with what you specify for the managedBeanName attribute of the clay component. Using this technique you could standardize that all save buttons will invoke a save method on your managed bean and have the same text. Another fun thing is that the Clay component can be nested within a clay component. This allows you to do some pretty crazy stuff. Gary - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Shale] clay templating
Gary VanMatre wrote: Another question about html views (since they are more interesting in practical use). For example I have main.html component and profile.html component. The both have submit buttons - but I want distinguish that one button is for main.html and another one - for profile.html. In rolodex example all components are specified in one config file without any hierarchy - so I should invent some naming convention (e.g mainPageSubmitButton,profilePageSubmitButton, addressBookPanelNotesTabSubmitButton etc) to be sure that component ids will not fail to conflict. It's not convenient - because if I'll change name for mainPage I should change names for all component. Is it possible to do by other way? The clay component itself is a naming container. This is the same as the subview. This means that components under it have unique clientId's. Another consideration is a faces form will uniquely identify anything under it. Using these two containers, you can reuse a single commandButton definition in a clay XML config, nested under two different forms. sory for typo - I mean jsfid ;( so I need the same hierarchy as id Another trick is to use the managedBeanName attribute. If you code your command buttons action to use the literal managed-bean-name, this sting will be replaced with what you specify for the managedBeanName attribute of the clay component. Using this technique you could standardize that all save buttons will invoke a save method on your managed bean and have the same text. Another fun thing is that the Clay component can be nested within a clay component. This allows you to do some pretty crazy stuff. Gary - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Shale] clay templating
Gary VanMatre wrote: Another question about html views (since they are more interesting in practical use). For example I have main.html component and profile.html component. The both have submit buttons - but I want distinguish that one button is for main.html and another one - for profile.html. In rolodex example all components are specified in one config file without any hierarchy - so I should invent some naming convention (e.g mainPageSubmitButton,profilePageSubmitButton, addressBookPanelNotesTabSubmitButton etc) to be sure that component ids will not fail to conflict. It's not convenient - because if I'll change name for mainPage I should change names for all component. Is it possible to do by other way? The clay component itself is a naming container. This is the same as the subview. This means that components under it have unique clientId's. Another consideration is a faces form will uniquely identify anything under it. Using these two containers, you can reuse a single commandButton definition in a clay XML config, nested under two different forms. sory for typo - I mean jsfid ;( so I need the same hierarchy as id The jsfid is a Clay manufactured attribute that represents a top-level component. What I mean by top-level is that it can be a root or aggregated under another component. The jsfid must be unique. The id attribute corresponds to the faces components id attribute. The id attribute is used when rendering the html and will be used to create target html elements id. In JSF the renders use the clientId of each component as the html identity (the hierarchy or xpath). The client id represents the containment within the component tree that defines the page (viewId). This allows you to reuse visual fragments. The standard approach is to use the subview naming container. Clay is a standard faces component that just taps into the functionality that already exists in the JSF API. It expands the JSP tag piece of vanilla JSF. Gary - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Shale] clay templating
Gary VanMatre wrote: Gary VanMatre wrote: Another question about html views (since they are more interesting in practical use). For example I have main.html component and profile.html component. The both have submit buttons - but I want distinguish that one button is for main.html and another one - for profile.html. In rolodex example all components are specified in one config file without any hierarchy - so I should invent some naming convention (e.g mainPageSubmitButton,profilePageSubmitButton, addressBookPanelNotesTabSubmitButton etc) to be sure that component ids will not fail to conflict. It's not convenient - because if I'll change name for mainPage I should change names for all component. Is it possible to do by other way? The clay component itself is a naming container. This is the same as the subview. This means that components under it have unique clientId's. Another consideration is a faces form will uniquely identify anything under it. Using these two containers, you can reuse a single commandButton definition in a clay XML config, nested under two different forms. sory for typo - I mean jsfid ;( so I need the same hierarchy as id The jsfid is a Clay manufactured attribute that represents a top-level component. What I mean by top-level is that it can be a root or aggregated under another component. The jsfid must be unique. So I have to invent some naming conventions for jsfid to prevent that a child from one html template won't have the same name as another child ;( Thanks for clarifications - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
html:link Parameters and URL
Hi, I've got a little question regarding the html:link-Tag. Is it correct when I have this in a jsp: html:link action=admin_objekte_new.do?USER_ACTION=EDIT_FORM paramName=objekt paramId=objekteId paramProperty=objekteId and the result looks like this: (?) a href=/ISIMuenchenWeb/admin_objekte_new.do?USER_ACTION=EDIT_FORMamp;objekte Id=5858d30b-f760-48be-a0db-c65e497f495aasdfasdf/a , br / I expected something like: - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
JDeveloper 10.1.3 Early Access
Hi, just wanted to drop some note that finally Oracle put the EA version of the upcoming JDeveloper 10g release on OTN. Only had little time for evaluation so far, but as far as I can tell by now, the thing really rocks. http://www.oracle.com/technology/software/products/jdev/index.html -- Chris It even supports JGoodies FormLayout (Swing) ?!! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
file upload and form fields
I'm using Struts 1.2.4. I have an html form with a bunch of fields on it, including an input file field. I set the max file size in the controller in the struts config to 1 megabyte. The problem I'm having is that Struts doesn't populate my action form's fields when I attempt to upload a file that is bigger than the specified max. The form validation fails, which is fine, but because the other form fields are not set, when the form validate method redirects back to the original page, all of the user's input is lost. I want all of the data that the user entered to be preserved when the upload exceeds the max size. Is there any way to do this? Thanks in advance, -ft
Re: [Shale] clay templating
Another question about html views (since they are more interesting in practical use). For example I have main.html component and profile.html component. The both have submit buttons - but I want distinguish that one button is for main.html and another one - for profile.html. In rolodex example all components are specified in one config file without any hierarchy - so I should invent some naming convention (e.g mainPageSubmitButton,profilePageSubmitButton, addressBookPanelNotesTabSubmitButton etc) to be sure that component ids will not fail to conflict. It's not convenient - because if I'll change name for mainPage I should change names for all component. Is it possible to do by other way? The clay component itself is a naming container. This is the same as the subview. This means that components under it have unique clientId's. Another consideration is a faces form will uniquely identify anything under it. Using these two containers, you can reuse a single commandButton definition in a clay XML config, nested under two different forms. sory for typo - I mean jsfid ;( so I need the same hierarchy as id The jsfid is a Clay manufactured attribute that represents a top-level component. What I mean by top-level is that it can be a root or aggregated under another component. The jsfid must be unique. So I have to invent some naming conventions for jsfid to prevent that a child from one html template won't have the same name as another child ;( Thanks for clarifications That is only true for things defined as component. Things defined as component are top-level. That really means that they are an entry in the Map that caches the digested XML file. When you use the jsfid for an element, it kind of works like and a java anonymous class.It is assumed that you are extending a top-level component by that jsfid. The attributes defined for that element will override the ones defined by the component and inheritance will also apply. Elements are the composition glue for creating complex components. Another fun feature is that you can override the componentType of the attribute. In effect, your morphing a component into another type. This could be used if you have an outputText that you want to morph into an inputText. Gary - 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]
form resubmission on refreshing page
I have a list in my jsp .For each item in the list I have a submit button through which user can remove an item in list. When user clicks on remove link I submit the form to my action class .Action class removes selected item from the collection and then sends him back to the same page . After the page is loaded if user clicks on refresh for some reason the same action is repeated again ie one more item is deleted from list .How can I avoid this? thanks regards __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Validate array
Wojciech Ciesielski wrote: how can i validate an array of Long and check that addNumber[] is 0 and 99.99 ? form-bean name=exampleForm type=org.apache.struts.action.DynaActionForm form-property name=addNumber type=java.lang.Long[]/ /form-bean What kind of validation do you use? FormValidator and XML validation rules? Still - you can override validate() method, call super.validate() and do some additional validation as you need... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] i use DynaActionForm and i think there is not validate method. Should i use ActionForm ? -- Mario Nee' Brescia Italy [EMAIL PROTECTED] http://www.xmoon.org - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: form resubmission on refreshing page
I have a list in my jsp .For each item in the list I have a submit button through which user can remove an item in list. When user clicks on remove link I submit the form to my action class .Action class removes selected item from the collection and then sends him back to the same page . After the page is loaded if user clicks on refresh for some reason the same action is repeated again ie one more item is deleted from list .How can I avoid this? thanks regards You need to redirect from the action that handled the delete back to your view. A redirect will refresh your browser URL. To do this simply specify the redirect attribute on your actions forward or global forward. Gary __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Validate array
Hello, Actually yes there is a validate method if your actionform extends dynaActionform the 'bad side' will be that you have declared all properties, (I suppose to avoid writing java code) and then you end upt writing code for validation.. probably It won't be a nice solution, but that's one the other one I suppose Is to write your own custom validator.. HTH marco -Original Message- From: Mario Neè [mailto:[EMAIL PROTECTED] Sent: 20 September 2005 17:05 To: Struts Users Mailing List Subject: Re: Validate array Wojciech Ciesielski wrote: how can i validate an array of Long and check that addNumber[] is 0 and 99.99 ? form-bean name=exampleForm type=org.apache.struts.action.DynaActionForm form-property name=addNumber type=java.lang.Long[]/ /form-bean What kind of validation do you use? FormValidator and XML validation rules? Still - you can override validate() method, call super.validate() and do some additional validation as you need... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] i use DynaActionForm and i think there is not validate method. Should i use ActionForm ? -- Mario Nee' Brescia Italy [EMAIL PROTECTED] http://www.xmoon.org - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: form resubmission on refreshing page
On 9/20/05, temp temp [EMAIL PROTECTED] wrote: I have a list in my jsp .For each item in the list I have a submit button through which user can remove an item in list. When user clicks on remove link I submit the form to my action class .Action class removes selected item from the collection and then sends him back to the same page . After the page is loaded if user clicks on refresh for some reason the same action is repeated again ie one more item is deleted from list .How can I avoid this? In your forward element you need to use redirect=true to decouple input and output phases. Therefore, you need to stick your ArrayList into the session. Why not then set ActionForm scope to session and to set ArrayList as nested property of your ActionForm? This article may help you to understand what is going on (sorry for a somewhat patronizing style and bad grammar): http://www.theserverside.com/articles/article.tss?l=RedirectAfterPost Also play with this online demo: http://www.superinterface.com/strutsdialog/crudactionlite.do More demos here: http://www.superinterface.com/strutsdialog If you like it, you may want to check out Struts Dialogs library: http://struts.sourceforge.net/strutsdialogs This is the most important class of the library: http://struts.sourceforge.net/strutsdialogs/dialogaction.html Michael Struts Dialogs: http://struts.sourceforge.net/strutsdialogs - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
html:link Parameters and URL II
Sorry I've send too fast... Hi, I've got a little question regarding the html:link-Tag. Is it correct when I have this in a jsp: html:link action=admin_objekte_new.do?USER_ACTION=EDIT_FORM paramName=objekt paramId=objekteId paramProperty=objekteId and the result looks like this: (?) a href=/ISIMuenchenWeb/admin_objekte_new.do?USER_ACTION=EDIT_FORMamp;objekte Id=5858d30b-f760-48be-a0db-c65e497f495aasdfasdf/a , br / I expected something like: a href=/ISIMuenchenWeb/admin_objekte_new.do?USER_ACTION=EDIT_FORMobjekteId=5 858d30b-f760-48be-a0db-c65e497f495aasdfasdf/a , br / I've got trouble with the 'amp;' at the objekteid I thought it should only be an '' yours marc - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Multiple Webapps and the TLDs
From: Michael Jouravlev [EMAIL PROTECTED] Ok, I have Struts 1.2.7 distro, which contains META-INF/tlds directory with the following tld files: ... *1.1.tld files have older uri in them referring jakarta.struts (interesting why they have higher version number?). What do you mean by higher version number? A quick check shows they are all Struts 1.2 tlds (look at the tlibversion in them). And that the pairs match exactly except for the URIs. The *1.1.tld files are probably there for backwards compatibility, though I can't quite come up with a good explanation. What about EL tags? Will they be included in distro? With JSP 2.4 most users will fall back to standard Struts tags, but I use Struts-EL and I would like it to be in the distro as well. For 1.2, Struts-EL is in the 'contrib' directory. If there were to be a Struts 1.2.8 release, there's no reason to think EL would be excluded. If you're asking about 1.3, the release notes show that Struts-EL is intended to be part of Struts Classic 1.3.0. http://wiki.apache.org/struts/StrutsClassicRelease130 I don't think you have to worry about Struts-EL disappearing. :) -- Wendy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: html:link Parameters and URL
I've got a little question regarding the html:link-Tag. Is it correct when I have this in a jsp: html:link action=admin_objekte_new.do?USER_ACTION=EDIT_FORM paramName=objekt paramId=objekteId paramProperty=objekteId No, it's not correct. In action parameter should be ONLY the actio (ie /admin_objekte_new.do). NO PARAMS. If you want to add params manually to string use href instead of action. If you want to use action you have to use maps of parameters or paramId/paramName/paramProperty if there is only one URL-passed parameter. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Validate array
i use DynaActionForm and i think there is not validate method. Should i use ActionForm ? I think you may use MyActionForm extends DynaActionForm, just override validate method and you're OK. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Shale] clay templating
So I have to invent some naming conventions for jsfid to prevent that a child from one html template won't have the same name as another child ;( Thanks for clarifications That is only true for things defined as component. Things defined as component are top-level. That really means that they are an entry in the Map that caches the digested XML file. When you use the jsfid for an element, it kind of works like and a java anonymous class.It is assumed that you are extending a top-level component by that jsfid. The attributes defined for that element will override the ones defined by the component and inheritance will also apply. Elements are the composition glue for creating complex components. yes but as I understand components defined in html template can't be bound to elements - just to top level components ;( may be it will be possible to use top-level components as jsf views ? e.g in faces config - navigation-case from-action#{login.login}/from-action from-outcomesuccess/from-outcome to-view-id/profilePage.clay/to-view-id /navigation-case and ClayViewHandler try to find top-level component with name profilePage defined in clay config: component jsfid=profilePage extends=profile.html element renderid=0 jsfid=submitButton attributesset name=value value=#{action.login} //attributes /element /component component jsfid=mainPage extends=main.html element renderid=0 jsfid=submitButton attributesset name=value value=#{action.changeProfile} //attributes /element /component I think it will be very flexible. what do you think? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Validate array
Hello, Actually yes there is a validate method if your actionform extends dynaActionform the 'bad side' will be that you have declared all properties, (I suppose to avoid writing java code) and then you end upt writing code for validation.. probably It won't be a nice solution, but that's one the other one I suppose Is to write your own custom validator.. No, he is not forced to declare attributes (it would make using DynaActionForm sensless). Just use org.apache.commons.beanutils.PropertyUtils: String foo = (String) PropertyUtils.getSimpleProperty(form, foo); String bar = (String) PropertyUtils.getSimpleProperty(form, bar); Boolean baz = (Boolean) PropertyUtils.getSimpleProperty(form, baz); String[] mice = (String[]) PropertyUtils.getProperty(form, blindMice); Etc... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: JDeveloper 10.1.3 Early Access
It's been there for a while I've been playing with it for a while and what I've seen is: 1.- Support for JSF (Nice, but waiting that the standard matures to move from Struts). 2.- Source Control without the use of CVS. 3.- Better refactoring options (at last!). 4.- More memory requirements. It's looking good. Regards, Néstor Boscán -Mensaje original- De: Christian Bollmeyer [mailto:[EMAIL PROTECTED] Enviado el: Tuesday, September 20, 2005 12:08 PM Para: Struts Users Mailing List Asunto: JDeveloper 10.1.3 Early Access Hi, just wanted to drop some note that finally Oracle put the EA version of the upcoming JDeveloper 10g release on OTN. Only had little time for evaluation so far, but as far as I can tell by now, the thing really rocks. http://www.oracle.com/technology/software/products/jdev/index.html -- Chris It even supports JGoodies FormLayout (Swing) ?!! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Shale] clay templating
That is only true for things defined as component. Things defined as component are top-level. That really means that they are an entry in the Map that caches the digested XML file. When you use the jsfid for an element, it kind of works like and a java anonymous class.It is assumed that you are extending a top-level component by that jsfid. The attributes defined for that element will override the ones defined by the component and inheritance will also apply. Elements are the composition glue for creating complex components. yes but as I understand components defined in html template can't be bound to elements - just to top level components ;( may be it will be possible to use top-level components as jsf views ? e.g [snippet] I think it will be very flexible. what do you think? That's an interesting idea. Currently, when using full html views, the view id (uri) is assumed to be the jsfid and this can only correspond to a HTML template. This is similar to a tiles customization I've seen in Struts 1.1. A customized request processor intercepted the forward in the processForwardConfig and provided a mapping layer injecting a new forward name based on a customer branding. What about creating a viewId to jsfid mapping. We could extend the Clay config file. Maybe something like this? dispatch mapping viewId=/profile.clay jsfid=profile/ mapping viewId=/main.clay jsfid=main/ /dispatch Gary - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] Re: JDeveloper 10.1.3 Early Access
Néstor Boscán wrote: 2.- Source Control without the use of CVS. How does it implement SCM? If you use JDeveloper for SCM does that preclude other IDE usage? Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Help - I cannot validate a simple form with 2 fields
Hi all, I really need a big help in validation with Struts, I dont know why but I just cant validate a very simple form I have, with 2 simple fields (login and password), I have follown all tutorials I got but til now no success. I am not able to validate either in server side or client side. I am using Struts 1.2.7 - Is there any big difference in validating with this version and the previous ones? Here are the stpeds I did: 1) created the DynaValidatorForm in struts-config and mapped the Actions it there too. //- form-beans form-bean name=loginForm type=org.apache.struts.validator.DynaValidatorForm form-property name=login type=java.lang.String / form-property name=senha type=java.lang.String / form-property name=senha2 type=java.lang.String / /form-bean /form-beans !-- this one is called to show the page with the fields -- action path=/prepararLogin type=br.com.gerente.SuccessAction forward name=success path=/paginas/login.jsp/ /action !-- this one is processed when the submit button is pressed -- action path=/Login type=br.com.gerente.ProcessaLoginDynaAction name=loginForm scope=request input=input validate=true forward name=success path=/paginas/clienteCadastro.jsp/ forward name=input path=/prepararLogin.do / /action ... message-resources parameter=br/com/gerente/Resources/ ... !-- = Validator plugin = -- plug-in className=org.apache.struts.validator.ValidatorPlugIn set-property property=pathnames value=/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml/ set-property property=stopOnFirstError value=true / /plug-in 2) create the action to call the login.jsp (and others): SuccessAction.java //- package br.com.gerente; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.Action; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; public class SuccessAction extends Action { /** Creates a new instance of SuccessAction */ public SuccessAction() { super(); } /** * Returns the codeActionForward/code named success if one is * configured or codenull/codeif it cannot be found. * * Searches first for a local forward, then a global forward. * * @param mapping The ActionMapping used to select this instance * @param form The optional ActionForm bean for this request (if any) * @param request The HTTP request we are processing * @param response The HTTP response we are creating * * @exception Exception if mapping.findForward throws an Exception * * @return the success ActionForward, or null if it cannot be found */ public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { return mapping.findForward(success); } } 3) created the action: ProcessaLoginDynaAction.java package br.com.gerente; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.Action; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import org.apache.struts.validator.DynaValidatorForm; public class ProcessaLoginDynaAction extends Action { /** Creates a new instance of ProcessaLoginDynaAction */ public ProcessaLoginDynaAction() { super(); } /** * Process the request and return an codeActionForward/code instance * describing where and how control should be forwarded, or * codenull/codeif the response has already been completed. * * @param mapping The ActionMapping used to select this instance * @param form The optional ActionForm bean for this request (if any) * @param request The HTTP request we are processing * @param response The HTTP response we are creating * * @exception Exception if the application logic throws an exception * * @return the ActionForward for the next view */ public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { // Se o usuario pressionar o botao 'Cancelar' volta para o inicio if (isCancelled(request)) { return mapping.findForward(inicio); } DynaValidatorForm dynaForm = (DynaValidatorForm)form; //dynaForm.set(login,nome do login);
Facade in the view
To better maintain all the data, I am opting not having alot of session variables but instead maintain one object that will contain all data needed and store that in a session. For example, instead of having session.setAttribute(product, product), session.setAttribute(web_preference, webPreference), etc. just create an object like this which can then be stored in a session: public class UserContainer{ private Product product; private WebPreference webPreference; public Product getProduct () { return product; } public void setProduct(Product newProduct){ product= newProduct; } } and in the jsp page have something like this % UserContainer userContainer = (UserContainer) session.getAttribute(Constants.USER_CONTAINER_KEY); % Do you guys do something similar or any other recommendations? Jade __ Find your next car at http://autos.yahoo.ca - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Refreshing the application properties
Is there a way to refresh the application properties without redeploying or restarting a web app? I havent found a way to do this. Jade __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Layout Forms in conjunction with Struts
HI, I am looking for a tool to layout my forms in conjunction. I am evaluating two packages - http://www.common-controls.com/en/index.php - http://struts.application-servers.com/ Have somebody work with these tools or do you have any other suggestions. Regards Richard Markham
Re: Facade in the view
Jadeler wrote: To better maintain all the data, I am opting not having alot of session variables but instead maintain one object that will contain all data needed and store that in a session. [...] Do you guys do something similar or any other recommendations? I generally do something similar. For one reason, I can encapsulate state within a single object when I can then use for testing. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] Re: JDeveloper 10.1.3 Early Access
Hi Dave Haven't got the time to see how it works. I have worked we JDeveloper 9.0.3 and 10.1.2 with CVS. In this new release after I installed it it stored every version of my source files, I don't really know how this mechanism will work with CVS. Regards, Néstor Boscán -Mensaje original- De: Dave Newton [mailto:[EMAIL PROTECTED] Enviado el: Tuesday, September 20, 2005 2:37 PM Para: Struts Users Mailing List Asunto: [OT] Re: JDeveloper 10.1.3 Early Access Néstor Boscán wrote: 2.- Source Control without the use of CVS. How does it implement SCM? If you use JDeveloper for SCM does that preclude other IDE usage? Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Facade in the view
Or... you can set Product object as nested property of an ActionForm, and set ActionForm's scope to session. The result is the same, but seems more natural to me. You can render Product on JSP page, or populate it from input (Struts will do it for you). Michael On 9/20/05, Jadeler [EMAIL PROTECTED] wrote: To better maintain all the data, I am opting not having alot of session variables but instead maintain one object that will contain all data needed and store that in a session. For example, instead of having session.setAttribute(product, product), session.setAttribute(web_preference, webPreference), etc. just create an object like this which can then be stored in a session: public class UserContainer{ private Product product; private WebPreference webPreference; public Product getProduct () { return product; } public void setProduct(Product newProduct){ product= newProduct; } } and in the jsp page have something like this % UserContainer userContainer = (UserContainer) session.getAttribute(Constants.USER_CONTAINER_KEY); % Do you guys do something similar or any other recommendations? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] Re: Facade in the view
Michael Jouravlev wrote: Or... you can set Product object as nested property of an ActionForm, and set ActionForm's scope to session. The result is the same, but seems more natural to me. You can render Product on JSP page, or populate it from input (Struts will do it for you). True. But then you've tied at least part of your app to Struts, which makes standalone unit testing more difficult than (I feel ;) it needs to be! With the decoupling you can trivially test business logic that depends on state. third-grade One two three four, I declare a religion war! /third-grade smiley=true too-geeky-for-own-good=really-really-true Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
dynamic forwards
Hi, I have an Action servlet which at development time doesn't know what it's forwards will be. They are determined at runtime (plugin type framework is used). Is there anyway i can forward to views from the action servlet being defined at run time? i tried using the request dispatcher's forward() method, but it doesn't do anything in struts. Any help is appreciated..thank you Marc Dumontier - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Re: Facade in the view
On 9/20/05, Dave Newton [EMAIL PROTECTED] wrote: Michael Jouravlev wrote: Or... you can set Product object as nested property of an ActionForm, and set ActionForm's scope to session. The result is the same, but seems more natural to me. You can render Product on JSP page, or populate it from input (Struts will do it for you). True. But then you've tied at least part of your app to Struts, which makes standalone unit testing more difficult than (I feel ;) it needs to be! With the decoupling you can trivially test business logic that depends on state. It still is decoupled, only nested ;-) Nesting it in ActionForm you keep its state and get it populated from request. You can do the same for unit test: keep the state and populate. A little bit offtopic: say you have a New User Registration form. Your business object for userinfo contains username and password, but does not contain retyped password, because retyped password is not part of business data, it is needed for input verification only. How would you test Adding a new user use case without ActionForm or additional wrapper around your Accout object? So, Account object still has to be tied to something else, if not to ActionForm, then to some other view/model wrapper. This is what I implemented about a year ago: a wrapper around business object, which contains business object itself and UI-only fields plus error messages relevant to this object only. Worked great, so I basically use ActionForm only as hollow container, as a facilitator to populate fields with input data, because Struts populates properties of ActionForm only. Michael. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: dynamic forwards
sorry, figured it out..i was looking at the mapping class...but you can just create a new ActionForward with the path as the constructor arg. Marc Hi, I have an Action servlet which at development time doesn't know what it's forwards will be. They are determined at runtime (plugin type framework is used). Is there anyway i can forward to views from the action servlet being defined at run time? i tried using the request dispatcher's forward() method, but it doesn't do anything in struts. Any help is appreciated..thank you Marc Dumontier - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: dynamic forwards
Yep, you can either create a new ActionForward, or you can use wildcard mapping, if your forwarded location depends on input parameters in certain pattern: http://struts.apache.org/userGuide/building_controller.html#action_mapping_wildcards Michael. On 9/20/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: sorry, figured it out..i was looking at the mapping class...but you can just create a new ActionForward with the path as the constructor arg. Marc Hi, I have an Action servlet which at development time doesn't know what it's forwards will be. They are determined at runtime (plugin type framework is used). Is there anyway i can forward to views from the action servlet being defined at run time? i tried using the request dispatcher's forward() method, but it doesn't do anything in struts. Any help is appreciated..thank you Marc Dumontier - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How to just get mails ONLY abt Shale?
Does Shale has its own mailing list?
Re: How to just get mails ONLY abt Shale?
Siva Jagadeesan [EMAIL PROTECTED] wrote on 09/20/2005 04:21:06 PM: Does Shale has its own mailing list? Nope, at least not yet... This is it..:) There is a convention to add a [Shale] in the subject line... which most of us remember most times to follow ;) Geeta
Re: How to just get mails ONLY abt Shale?
Oh okay I will set my filters accordingly But I guess it will be better if we Shale has its own mailing list Thans Geeta On 9/20/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Siva Jagadeesan [EMAIL PROTECTED] wrote on 09/20/2005 04:21:06 PM: Does Shale has its own mailing list? Nope, at least not yet... This is it..:) There is a convention to add a [Shale] in the subject line... which most of us remember most times to follow ;) Geeta
Re: [OT] Re: Facade in the view
Michael Jouravlev wrote: It still is decoupled, only nested ;-) Nesting it in ActionForm you keep its state and get it populated from request. You can do the same for unit test: keep the state and populate. Hmm, yeah, I suppose. I guess in this case I felt that the stuff in the object in question weren't necessarily being populated from a request. For instance, I carry might around a user object in the session that contains some info from the user table, but other stuff that gets added during web-app travel or is calculated somehow, etc. Basically non-request, potentially non-db, etc. A little bit offtopic: say you have a New User Registration form. Your business object for userinfo contains username and password, but does not contain retyped password, because retyped password is not part of business data, it is needed for input verification only. How would you test Adding a new user use case without ActionForm or additional wrapper around your Accout object? I'd functional-test the web app, and unit-test the business logic. That is, I have standalone unit tests that add a new user given the username, password, whatever else the business side expected, and I check the results of the business logic. I also have client-oriented web-app tests that make sure forms contain all expected fields and validate properly, then submit the form, and makes sure that the web-app continues to the appropriate place with the appropriate content based on the results of the form submission. This is what I implemented about a year ago: a wrapper around business object, which contains business object itself and UI-only fields plus error messages relevant to this object only. What do you mean the ActionForm contains the error messages relevant to this object only? I've been struggling with finding a good way to encapsulate errors, return messages, etc. from specific pages; so far I've been putting them in the properties file but I'm not a huge fan of the ad-hoc solution I've developed. Right now it's too much trouble to standalone-test. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Re: Facade in the view
Thanks Dave and Michael. I've implemented the UserContainer object as a means of just encapsulating necessary info that would otherwise be in separate sessions. I have also used the action forms accordingly to display necessary info that would be more natural. For pages that require the form to change depending on user interactions and maintaining a list of objects within the form, I basically use them as a form attribute that is a list and store the form in a session. Jade --- Dave Newton [EMAIL PROTECTED] wrote: Michael Jouravlev wrote: It still is decoupled, only nested ;-) Nesting it in ActionForm you keep its state and get it populated from request. You can do the same for unit test: keep the state and populate. Hmm, yeah, I suppose. I guess in this case I felt that the stuff in the object in question weren't necessarily being populated from a request. For instance, I carry might around a user object in the session that contains some info from the user table, but other stuff that gets added during web-app travel or is calculated somehow, etc. Basically non-request, potentially non-db, etc. A little bit offtopic: say you have a New User Registration form. Your business object for userinfo contains username and password, but does not contain retyped password, because retyped password is not part of business data, it is needed for input verification only. How would you test Adding a new user use case without ActionForm or additional wrapper around your Accout object? I'd functional-test the web app, and unit-test the business logic. That is, I have standalone unit tests that add a new user given the username, password, whatever else the business side expected, and I check the results of the business logic. I also have client-oriented web-app tests that make sure forms contain all expected fields and validate properly, then submit the form, and makes sure that the web-app continues to the appropriate place with the appropriate content based on the results of the form submission. This is what I implemented about a year ago: a wrapper around business object, which contains business object itself and UI-only fields plus error messages relevant to this object only. What do you mean the ActionForm contains the error messages relevant to this object only? I've been struggling with finding a good way to encapsulate errors, return messages, etc. from specific pages; so far I've been putting them in the properties file but I'm not a huge fan of the ad-hoc solution I've developed. Right now it's too much trouble to standalone-test. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Validator and locale
Hi there, Where can I specify what locale should Validator use? I have problems with float numbers which in Poland are represented as ##,## while Validator float rule is complaining about ##.## format... I have session scope LOCALE set by request filter to pl_PL already but it doesn't help :-/ TIA Wojtek - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Validator and locale
The latest stable Struts, 1.2.7, doesn't support locale-specific numeric validations. This feature, having been added to Commons Validator 1.2.0, will be available in Struts 1.3 and is currently available in the source code repository and probably nightlies. Don On 9/20/05, Wojciech Ciesielski [EMAIL PROTECTED] wrote: Hi there, Where can I specify what locale should Validator use? I have problems with float numbers which in Poland are represented as ##,## while Validator float rule is complaining about ##.## format... I have session scope LOCALE set by request filter to pl_PL already but it doesn't help :-/ TIA Wojtek - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Being Lazy with Hibernate
-Original Message- From: David Delbecq [mailto:[EMAIL PROTECTED] Sent: Tuesday, 20 September 2005 10:28 PM To: Struts Users Mailing List Subject: Re: Being Lazy with Hibernate See sections 20.1.4. Initializing collections and proxies and 1.4, Playing with cats For details :) (Hibernate 3 documentation) Martin Ravell a écrit : Thanks for this David. Will check it out today. I am using Hibernate2 is the only thing. With luck it will work the same Regards Marty - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Default locale in VM
How can I set default locale within my JVM (Jboss server instance) ? Wojtek - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
MailReader demo app is rewritten with Struts Dialogs
Considering Ted's initiative to create more different implementations of venerable MailReader and his invitation of non-committeres to participate, I converted MailReader from standard Struts using Struts Dialogs. Here it is: http://www.superinterface.com/mailreader The tour doc file still needs updates and fixes, but the app itself works. The structure of MailReader was slightly changed since I didn't see the point to display and update user info on the same page where subscription list is displayed. There are four web resources (or actions, or components, whatever you call them): Home, Login, Subscriptions and Registration. Each component displays pages appropriate to this component and to application state, and handles input from a user. Beloved by many pre- and post- actions are combined now into dispatch-like two-phase actions that do both. Logon action is basically the same as sample Login component from Struts Dialogs. Registration and Subscriptions actions are mosty standard CRUDAction actions. Subscriptions action is interesting in that it handles both list and individual items just like CRUDAction (all-in-one web island) sample from this page: http://www.superinterface.com/strutsdialog/index.htm What to check out: -- * Refresh works without resubmit [of course :-) ] * Action name in the address bar always corresponds to the page you see * You can jump to any url you like, it will show relevant page appropriate in that applicaiton state * Open app in a new window, change language. If you use MSIE or Firefox, you will not get a new page, that is, Back button will not be enabled. * Log in using user/pass credentials. You will get to welcome/main page with different content. Now click Back button: instead of login screen you will see current user info. Why? Because pages reflect current application state. * Subscription list uses bits of DisplayTag CSS, and sports pageable item list. Play around, application is not 100% free of bugs yet, but pretty solid. Source code, JAR and javadocs are to be updated. Michael Jouravlev Struts Dialogs: struts.sourceforge.net/strutsdialogs - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Being Lazy with Hibernate
-Original Message- From: Bill Schneider [mailto:[EMAIL PROTECTED] Sent: Tuesday, 20 September 2005 11:01 PM To: user@struts.apache.org Subject: Re: Being Lazy with Hibernate Has anyone been able to get a Struts / Hibernate app to work nicely with Lazy Initialization? Whenever I have things with Lazy set to true I'm getting a Failed to lazily initialize a collection Exception. The easiest way to do this is to use the open session in view pattern. If you're using Spring to manage your Hibernate SessionFactory, you can just pop the OpenSessionInViewFilter in web.xml and go. The only thing to watch out for is that any writes back to the database need to be within transactions. -- Bill -- Bill Schneider Chief Architect Vecna Technologies, Inc. 5004 Lehigh Road, Suite B College Park, MD 20740 [EMAIL PROTECTED] t: 301-864-7594 f: 301-699-3180 I am using Spring and have bee having a go at getting this pattern to work without much luck. Not sure what I am doing wrong but will persevere. It seems as though even if I have the filter in place I still get the Exceptions. Perhaps I need to disable some of my existing setup (on top of setting up the filter properly). Could I have a conflict somehow? Regards Marty - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[Shale] Clay Vs Facelets
Hi Guys: I am evaluvating Shale for upcoming project. I wanted to use HTML rather than JSP like Tapestry. I just want to know what you guys think about Clay and Facelets. One thing I liked about Facelets is it doesnt need any extra xml file to define jsf components . Rgds, --Siva Jagadeesan
Re: [Shale] Clay Vs Facelets
Hi Guys: I am evaluvating Shale for upcoming project. I wanted to use HTML rather than JSP like Tapestry. I just want to know what you guys think about Clay and Facelets. One thing I liked about Facelets is it doesnt need any extra xml file to define jsf components . This is also true for clay HTML templating (as of 09-19). For example: span jsfid=loadBundle var=messages basename=com.acme.mywidgets / table tr td #{messages.city}: td span jsfid=outputText id=city value=#{managed-bean-name.city} size=25/ or input id=city type=text value=#{managed-bean-name.city} size=25/(assumed mapping to outputText) /table input id=submit type=submit value=#{messages.save} action=#{managed-bean-name.save} The HTML attributes are passed thru to the component values. The attributes that are passed thru are defined in the default clay config file found under META-INF of the clay jar. I was thinking about creating a third rolodex example that used this method. Gary Rgds, --Siva Jagadeesan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Please help! I have been looling at this problem for two days
Hi, I have a class named UserLoginForm that extend ActionForm. I also have a UserLoginAction class that extend Action. The UserLoginForm runs to completion. The problem is that my UserLoginAction class never called by the Struts RequestProcessor class and the execute method never run. But however, I got an exception java.lang.NoClassDefFoundError: javax/ejb/CreateException from the log file. This code is within the execute method. But, none of the log statement indicates the execute method got called by the RequestProcessor class. I verified the path to the UserLoginAction is fine. Thank you in advance for you help. Kam Lung Leung Here is my jsp file for the user login page: body bgcolr=white table border=0 width=100% tr th align=right /th td align=left html:text property=userId size=10 maxlength=10/ /td /tr tr th align=right /th td align=left html:text property=userSubId size=4 maxlength=4/ /td /tr tr th align=right td align=left html:password property=password size=12 maxlength=12 redisplay=false/ /td /tr tr td align=right html:submit/ /td /tr /table /html:form html:javascript formName=userLoginForm dynamicJavascript=true staticJavascript=true/ /body **struts-config.xml struts-config form-beans form-bean name=userLoginForm type=com.wlwa.Infra.ClientComponent.Dispatcher.Forms.UserLoginForm / /form-beans /form-beans global-exceptions /global-exceptions global-forwards forward name=login path=/userLogin.do/ /global-forwards action-mappings action path=/userLoginSubmit type=com.wlwa.Infra.ClientComponent.Dispatcher.Actions.UserLoginAction name=userLoginForm scope=session validate=true input=login forward name=success path=/index.do / /action action path=/index type=org.apache.struts.actions.ForwardAction parameter=/WEB-INF/Infra/ClientComponent/Presentation/index.jsp/ /action-mappings controller set-property property=inputForward value=true/ /controller message-resources parameter=resources.AlertClientComponent/ message-resources parameter=resources.AlternateAlertClientComponent key=alternate /message-resources plug-in className=org.apache.struts.plugins.ModuleConfigVerifier/ !-- Here we specified the tiles plug-in. This plug-in register appropriate Request Processor -- !-- controller processorClass=org.apache.struts.tiles.TilesRequestProcessor / -- plug-in className=org.apache.struts.tiles.TilesPlugin set-property property=definitions-config value=/WEB-INF/tiles-definitions.xml, /WEB-INF/tiles-client-admin-definitions.xml / set-property property=definitions-parser-validate value=true / set-property property=moduleAware value=true / /plug-in plug-in className=org.apache.struts.validator.ValidatorPlugIn set-property property=pathnames value=/WEB-INF/validator-rules.xml, /WEB-INF/validation.xml / /plug-in /struts-config *** log file *** DEBUG [http8136-Processor4] (RequestUtils.java:1799) - Get module name for path /userLoginSubmit.do DEBUG [http8136-Processor4] (RequestUtils.java:1821) - Module name found: default DEBUG [http8136-Processor4] (RequestProcessor.java:225) - Processing a 'POST' for path '/userLoginSubmit' DEBUG [http8136-Processor4] (RequestUtils.java:764) - Looking for ActionForm bean instance in scope 'session' under attribute key 'userLoginFo rm' DEBUG [http8136-Processor4] (RequestUtils.java:800) - Recycling existing ActionForm instance of class 'com.wlwa.Infra.ClientComponent.Dispatch er.Forms.UserLoginForm' DEBUG [http8136-Processor4] (RequestUtils.java:805) - -- [EMAIL PROTECTED] DEBUG [http8136-Processor4] (RequestProcessor.java:372) - Storing ActionForm bean instance in scope 'session' under attribute key 'userLoginFo rm' DEBUG [http8136-Processor4] (RequestProcessor.java:813) - Populating bean properties from this request DEBUG [http8136-Processor4] (BeanUtils.java:792) - BeanUtils.populate([EMAIL PROTECTED], {p assword=[Ljava.lang.String;@166bfd8, userId=[Ljava.lang.String;@bd09e8, userSubId=[Ljava.lang.String;@d58ce2}) DEBUG [http8136-Processor4] (BeanUtils.java:873) - setProperty([EMAIL PROTECTED], passwor d, [12345678]) DEBUG [http8136-Processor4] (ConvertUtils.java:369) - Convert string '12345678' to class 'java.lang.String' DEBUG [http8136-Processor4] (ConvertUtils.java:377) - Using converter [EMAIL PROTECTED] DEBUG [http8136-Processor4] (BeanUtils.java:873) - setProperty([EMAIL PROTECTED], userId, [0079]) DEBUG [http8136-Processor4]
RE: Being Lazy with Hibernate
-Original Message- From: Letícia Álvares Barbalho [mailto:[EMAIL PROTECTED] Sent: Tuesday, 20 September 2005 11:03 PM To: Struts Users Mailing List Subject: Re: Being Lazy with Hibernate I use struts and Hibernate 3 and lazy initialization works just fine for me. I didn't have to do anything. What's your hibernate version? I have Hibernate 2 which originally came with the Equinox build that I started the project on (like an Appfuse lite if you have not heard of it before. Matt Raible put it together.) I wonder if I should attempt upgrading to Hibernate 3 from hibernate 2? Does anyone know if there are significant differences between the two versions that I should be aware of? Regards Marty - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Shale] Clay Vs Facelets
Oh that is great !!! I never knew we could do these things using Clay. But I have some questions about ur example, 1) span jsfid=loadBundle var=messages basename=com.acme.mywidgets / I guess it is ur custom component.. What is baseName ? Could you explain this line for me. 2) input id=city type=text value=#{managed-bean-name.city} size=25/ (assumed mapping to outputText) What you mean by mapping to outputText ? Gary please do create thrid rolodex example using this method. On 9/20/05, Gary VanMatre [EMAIL PROTECTED] wrote: Hi Guys: I am evaluvating Shale for upcoming project. I wanted to use HTML rather than JSP like Tapestry. I just want to know what you guys think about Clay and Facelets. One thing I liked about Facelets is it doesnt need any extra xml file to define jsf components . This is also true for clay HTML templating (as of 09-19). For example: span jsfid=loadBundle var=messages basename=com.acme.mywidgets / table tr td #{messages.city}: td span jsfid=outputText id=city value=#{managed-bean-name.city} size=25/ or input id=city type=text value=#{managed-bean-name.city} size=25/ (assumed mapping to outputText) /table input id=submit type=submit value=#{messages.save} action=#{ managed-bean-name.save} The HTML attributes are passed thru to the component values. The attributes that are passed thru are defined in the default clay config file found under META-INF of the clay jar. I was thinking about creating a third rolodex example that used this method. Gary Rgds, --Siva Jagadeesan
[Shale] Unit Testing View Controller
Where can I find an example for testing View Controller ?
RE: Please help! I have been looling at this problem for two days
What's the appserver? Jboss or Tomcat? It seems that you do not have libraries containing javax.ejb.* packages in server lib directory... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Please help! I have been looling at this problem for two days
Kam Lung Leung wrote: body bgcolr=white table border=0 width=100% tr th align=right /th td align=left html:text property=userId size=10 maxlength=10/ /td /tr I don't know anything about the exception you're getting, but do you have the html:form... start tag in your file? Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Shale] Clay Vs Facelets
Oh that is great !!! I never knew we could do these things using Clay. It's a new feature that Sergey Smirnov requested. It's good to hear feedback:-) But I have some questions about ur example, 1) span jsfid=loadBundle var=messages basename=com.acme.mywidgets / I guess it is ur custom component.. What is baseName ? Could you explain this line for me. Yep, The LoadBundle is one of Clay's. It was contributed by Manfred Klug. It simulates the JSF loadBundle JSP tag. The basename is the path to a resource bundle. The cool thing about JSF's approach to a resource bundle is wrappered by a Map making it available to EL. This component will load the bundle into request scope. Craig commited a LoadBundle bean in the core Shale code base last weekend. It's a managed bean verses a JSF component. The benefit is that you can control the scope the bundle is loaded (request, session, application). 2) input id=city type=text value=#{managed-bean-name.city} size=25/ (assumed mapping to outputText) What you mean by mapping to outputText ? There is a assumed mapping to some html elements to JSF components. These include: a, form, input/text, input/checkbox, input/radio, input/submit, label, option, select and textarea. You don't have to specify a jsfid binding for these components (input/submit is currently broken). Other html begin nodes that don't fall into the assumed mapping require a jsfid. This was limited to just the span element but now applies to anything. Maybe the the assumed mapping is just confusing now? At first I thought it was important to protect/restrict the mapping but I'm not sure now. Gary please do create thrid rolodex example using this method. I'll add that example. Thanks for the feedback, Gary
Re: [Shale] Unit Testing View Controller
On 9/20/05, Siva Jagadeesan [EMAIL PROTECTED] wrote: Where can I find an example for testing View Controller ? The source code for the Use Cases example app includes unit tests for some of the ViewController implementations. See the following for examples: src/test/org/apache/shale/usecases/locale/SelectTestCase.java src/test/org/apache/shale/usecases/rolodex/RolodexTestCase.java These use the Test Framework to provide convenient mock object implementations, as well as a base class for test cases that wires together all the relevant mock objects for you. Craig
Re: Refreshing the application properties
hi, Jade. commons-configuration may fit to your needs. have you checked that out? 2005/9/21, Jadeler [EMAIL PROTECTED]: Is there a way to refresh the application properties without redeploying or restarting a web app? I havent found a way to do this. Jade __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Please help! I have been looling at this problem for two days
Yes, I do have the html:form... Struts Users Mailing List user@struts.apache.org wrote: Kam Lung Leung wrote: body bgcolr=white table border=0 width=100% tr th align=right /th td align=left html:text property=userId size=10 maxlength=10/ /td /tr I don't know anything about the exception you're getting, but do you have the html:form... start tag in your file? Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Sincerely yours, br br br br br Kam Lung Leung br Presidentbr strong Advanced Voice Technologies, Inc.br /strong strong A href=http://www.advoicetech.com; target=_blankwww.advoicetech.com /A /strongbr strongOffice:/strong 303.539.2950br strongFax:/strong 303.539.2951br strongOur business is to bring your clients to you by personalized voice messaging. br/strong - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Shale] Clay Vs Facelets
Thanx Gary. It is quite impressive. I have started building a prototype using Spring , hibernate and Shale. I will let the group how it goes. The main thing I was lookin for was HTML template (as my cool web designer gets pissed with my JSPs :) ) I think I will go with Clay ( for record , I dont have anything against Facelets) Rgds, --Siva Jagadeesan On 9/20/05, Gary VanMatre [EMAIL PROTECTED] wrote: Oh that is great !!! I never knew we could do these things using Clay. It's a new feature that Sergey Smirnov requested. It's good to hear feedback:-) But I have some questions about ur example, 1) span jsfid=loadBundle var=messages basename=com.acme.mywidgets / I guess it is ur custom component.. What is baseName ? Could you explain this line for me. Yep, The LoadBundle is one of Clay's. It was contributed by Manfred Klug. It simulates the JSF loadBundle JSP tag. The basename is the path to a resource bundle. The cool thing about JSF's approach to a resource bundle is wrappered by a Map making it available to EL. This component will load the bundle into request scope. Craig commited a LoadBundle bean in the core Shale code base last weekend. It's a managed bean verses a JSF component. The benefit is that you can control the scope the bundle is loaded (request, session, application). 2) input id=city type=text value=#{managed-bean-name.city} size=25/ (assumed mapping to outputText) What you mean by mapping to outputText ? There is a assumed mapping to some html elements to JSF components. These include: a, form, input/text, input/checkbox, input/radio, input/submit, label, option, select and textarea. You don't have to specify a jsfid binding for these components (input/submit is currently broken). Other html begin nodes that don't fall into the assumed mapping require a jsfid. This was limited to just the span element but now applies to anything. Maybe the the assumed mapping is just confusing now? At first I thought it was important to protect/restrict the mapping but I'm not sure now. Gary please do create thrid rolodex example using this method. I'll add that example. Thanks for the feedback, Gary
Re: MailReader demo app is rewritten with Struts Dialogs
Looks interesting, when you are ready to donate this, I'd be happy to commit it for you. Is the source available now? -- James Mitchell Software Engineer / Open Source Evangelist Consulting / Mentoring / Freelance EdgeTech, Inc. http://www.edgetechservices.net/ 678.910.8017 AIM: jmitchtx Yahoo: jmitchtx MSN: [EMAIL PROTECTED] Skype: callto://jmitchtx On Sep 20, 2005, at 6:34 PM, Michael Jouravlev wrote: Considering Ted's initiative to create more different implementations of venerable MailReader and his invitation of non-committeres to participate, I converted MailReader from standard Struts using Struts Dialogs. Here it is: http://www.superinterface.com/mailreader The tour doc file still needs updates and fixes, but the app itself works. The structure of MailReader was slightly changed since I didn't see the point to display and update user info on the same page where subscription list is displayed. There are four web resources (or actions, or components, whatever you call them): Home, Login, Subscriptions and Registration. Each component displays pages appropriate to this component and to application state, and handles input from a user. Beloved by many pre- and post- actions are combined now into dispatch-like two-phase actions that do both. Logon action is basically the same as sample Login component from Struts Dialogs. Registration and Subscriptions actions are mosty standard CRUDAction actions. Subscriptions action is interesting in that it handles both list and individual items just like CRUDAction (all-in-one web island) sample from this page: http://www.superinterface.com/strutsdialog/index.htm What to check out: -- * Refresh works without resubmit [of course :-) ] * Action name in the address bar always corresponds to the page you see * You can jump to any url you like, it will show relevant page appropriate in that applicaiton state * Open app in a new window, change language. If you use MSIE or Firefox, you will not get a new page, that is, Back button will not be enabled. * Log in using user/pass credentials. You will get to welcome/main page with different content. Now click Back button: instead of login screen you will see current user info. Why? Because pages reflect current application state. * Subscription list uses bits of DisplayTag CSS, and sports pageable item list. Play around, application is not 100% free of bugs yet, but pretty solid. Source code, JAR and javadocs are to be updated. Michael Jouravlev Struts Dialogs: struts.sourceforge.net/strutsdialogs - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: MailReader demo app is rewritten with Struts Dialogs
Source is available (of course, what did I compile it from ;-) ), but I need to beatify it a little, add javadocs, stuff like that. I will be happy to donate it. Michael. On 9/20/05, James Mitchell [EMAIL PROTECTED] wrote: Looks interesting, when you are ready to donate this, I'd be happy to commit it for you. Is the source available now? -- James Mitchell Software Engineer / Open Source Evangelist Consulting / Mentoring / Freelance EdgeTech, Inc. http://www.edgetechservices.net/ 678.910.8017 AIM: jmitchtx Yahoo: jmitchtx MSN: [EMAIL PROTECTED] Skype: callto://jmitchtx On Sep 20, 2005, at 6:34 PM, Michael Jouravlev wrote: Considering Ted's initiative to create more different implementations of venerable MailReader and his invitation of non-committeres to participate, I converted MailReader from standard Struts using Struts Dialogs. Here it is: http://www.superinterface.com/mailreader The tour doc file still needs updates and fixes, but the app itself works. The structure of MailReader was slightly changed since I didn't see the point to display and update user info on the same page where subscription list is displayed. There are four web resources (or actions, or components, whatever you call them): Home, Login, Subscriptions and Registration. Each component displays pages appropriate to this component and to application state, and handles input from a user. Beloved by many pre- and post- actions are combined now into dispatch-like two-phase actions that do both. Logon action is basically the same as sample Login component from Struts Dialogs. Registration and Subscriptions actions are mosty standard CRUDAction actions. Subscriptions action is interesting in that it handles both list and individual items just like CRUDAction (all-in-one web island) sample from this page: http://www.superinterface.com/strutsdialog/index.htm What to check out: -- * Refresh works without resubmit [of course :-) ] * Action name in the address bar always corresponds to the page you see * You can jump to any url you like, it will show relevant page appropriate in that applicaiton state * Open app in a new window, change language. If you use MSIE or Firefox, you will not get a new page, that is, Back button will not be enabled. * Log in using user/pass credentials. You will get to welcome/main page with different content. Now click Back button: instead of login screen you will see current user info. Why? Because pages reflect current application state. * Subscription list uses bits of DisplayTag CSS, and sports pageable item list. Play around, application is not 100% free of bugs yet, but pretty solid. Source code, JAR and javadocs are to be updated. Michael Jouravlev Struts Dialogs: struts.sourceforge.net/strutsdialogs - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: Please help! I have been looling at this problem for two days
Seems like struts can't instantiate your action class, so maybe you could post your code of the action class. Bjoern -Ursprüngliche Nachricht- Von: Kam Lung Leung [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 21. September 2005 01:36 An: Struts Users Mailing List Betreff: Please help! I have been looling at this problem for two days Hi, I have a class named UserLoginForm that extend ActionForm. I also have a UserLoginAction class that extend Action. The UserLoginForm runs to completion. The problem is that my UserLoginAction class never called by the Struts RequestProcessor class and the execute method never run. But however, I got an exception java.lang.NoClassDefFoundError: javax/ejb/CreateException from the log file. This code is within the execute method. But, none of the log statement indicates the execute method got called by the RequestProcessor class. I verified the path to the UserLoginAction is fine. Thank you in advance for you help. Kam Lung Leung Here is my jsp file for the user login page: body bgcolr=white table border=0 width=100% tr th align=right /th td align=left html:text property=userId size=10 maxlength=10/ /td /tr tr th align=right /th td align=left html:text property=userSubId size=4 maxlength=4/ /td /tr tr th align=right td align=left html:password property=password size=12 maxlength=12 redisplay=false/ /td /tr tr td align=right html:submit/ /td /tr /table /html:form html:javascript formName=userLoginForm dynamicJavascript=true staticJavascript=true/ /body **struts-config.xml struts-config form-beans form-bean name=userLoginForm type=com.wlwa.Infra.ClientComponent.Dispatcher.Forms.UserLogi nForm / /form-beans /form-beans global-exceptions /global-exceptions global-forwards forward name=login path=/userLogin.do/ /global-forwards action-mappings action path=/userLoginSubmit type=com.wlwa.Infra.ClientComponent.Dispatcher.Actions.UserLo ginAction name=userLoginForm scope=session validate=true input=login forward name=success path=/index.do / /action action path=/index type=org.apache.struts.actions.ForwardAction parameter=/WEB-INF/Infra/ClientComponent/Presentation/index.jsp/ /action-mappings controller set-property property=inputForward value=true/ /controller message-resources parameter=resources.AlertClientComponent/ message-resources parameter=resources.AlternateAlertClientComponent key=alternate /message-resources plug-in className=org.apache.struts.plugins.ModuleConfigVerifier/ !-- Here we specified the tiles plug-in. This plug-in register appropriate Request Processor -- !-- controller processorClass=org.apache.struts.tiles.TilesRequestProcessor / -- plug-in className=org.apache.struts.tiles.TilesPlugin set-property property=definitions-config value=/WEB-INF/tiles-definitions.xml, /WEB-INF/tiles-client-admin-definitions.xml / set-property property=definitions-parser-validate value=true / set-property property=moduleAware value=true / /plug-in plug-in className=org.apache.struts.validator.ValidatorPlugIn set-property property=pathnames value=/WEB-INF/validator-rules.xml, /WEB-INF/validation.xml / /plug-in /struts-config *** log file *** DEBUG [http8136-Processor4] (RequestUtils.java:1799) - Get module name for path /userLoginSubmit.do DEBUG [http8136-Processor4] (RequestUtils.java:1821) - Module name found: default DEBUG [http8136-Processor4] (RequestProcessor.java:225) - Processing a 'POST' for path '/userLoginSubmit' DEBUG [http8136-Processor4] (RequestUtils.java:764) - Looking for ActionForm bean instance in scope 'session' under attribute key 'userLoginFo rm' DEBUG [http8136-Processor4] (RequestUtils.java:800) - Recycling existing ActionForm instance of class 'com.wlwa.Infra.ClientComponent.Dispatch er.Forms.UserLoginForm' DEBUG [http8136-Processor4] (RequestUtils.java:805) - -- [EMAIL PROTECTED] DEBUG [http8136-Processor4] (RequestProcessor.java:372) - Storing ActionForm bean instance in scope 'session' under attribute key 'userLoginFo rm' DEBUG [http8136-Processor4] (RequestProcessor.java:813) - Populating bean properties from this request DEBUG [http8136-Processor4] (BeanUtils.java:792) - BeanUtils.populate(com.wlwa.Infra.ClientComponent.Dispatcher.F [EMAIL PROTECTED], {p