extending nested tiles templates
Hi I'd like to be able to nest templates within other templates. I know it can be done but I'm not sure I can do it the way I'm trying to do it. AFAICT you have to add n tiles defs for each page you want to add where n is the depth of nesting within tiles. MasterLayout.jsp and FullHistoryBody.jsp both are templates and use tiles:insert. FullHistoryBody is a template for the 'body' section of the MasterLayout.jsp. What I'd like to do: definition name=pocweb.master path=/layout/MasterLayout.jsp put name=title value=OnePort master Layout / put name=header value=/layout/Header.jsp / put name=servnav value=/layout/ServiceNav.jsp / put name=navbar value=/layout/NavBar.jsp / put name=breadcrumb value=/layout/Breadcrumb.jsp / put name=body value=/layout/Body.jsp / put name=footer value=/layout/Footer.jsp / /definition definition name=pocweb.fullHistory extends=pocweb.master put name=body value=/layout/FullHistoryBody.jsp / /definition definition name=appointment.FullHistoryAppointmentJSP extends=pocweb.fullHistory put name=title value=Appointment Version History / put name=detail value=/pages/appointment/ViewAppointmentDetail.jsp / /definition this fails with FullHistoryBody.jsp complainging about not being able to locate the detail attribute. *** What I have to do to make it work: definition name=pocweb.master path=/layout/MasterLayout.jsp put name=title value=OnePort master Layout / put name=header value=/layout/Header.jsp / put name=servnav value=/layout/ServiceNav.jsp / put name=navbar value=/layout/NavBar.jsp / put name=breadcrumb value=/layout/Breadcrumb.jsp / put name=body value=/layout/Body.jsp / put name=footer value=/layout/Footer.jsp / /definition definition name=appointment.FullHistoryAppointmentJSP extends=pocweb.master put name=title value=Appointment Version History / put name=body value=appointment.FullHistoryAppointmentJSPbody / /definition definition name=appointment.FullHistoryAppointmentJSPbody path=/layout/FullHistoryBody.jsp put name=detail value=/pages/appointment/ViewAppointmentDetail.jsp / /definition The 'problem' with this is that I have to add two tiles defs to add a single page. with n levels of nesting I'd have to add n tiles defs per page. cheers Nathan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts converts null to 0 ?
internally BeanUtils uses ConvertUtils to convert from Strings to objects. You can deregister the default converters http://jakarta.apache.org/commons/beanutils/apidocs/org/apache/commons/beanutils/ConvertUtils.html The default converters are initialised as follows with 0 for most numeric defaults. if you construct and register converters with no default value, null will be returned for or when an error occurs converters.clear(); converters.put(BigDecimal.class, new BigDecimalConverter()); converters.put(BigInteger.class, new BigIntegerConverter()); converters.put(Boolean.TYPE, new BooleanConverter(defaultBoolean)); converters.put(Boolean.class, new BooleanConverter(defaultBoolean)); converters.put(booleanArray.getClass(), new BooleanArrayConverter(booleanArray)); converters.put(Byte.TYPE, new ByteConverter(defaultByte)); converters.put(Byte.class, new ByteConverter(defaultByte)); converters.put(byteArray.getClass(), new ByteArrayConverter(byteArray)); converters.put(Character.TYPE, new CharacterConverter(defaultCharacter)); converters.put(Character.class, new CharacterConverter(defaultCharacter)); converters.put(charArray.getClass(), new CharacterArrayConverter(charArray)); converters.put(Class.class, new ClassConverter()); converters.put(Double.TYPE, new DoubleConverter(defaultDouble)); converters.put(Double.class, new DoubleConverter(defaultDouble)); converters.put(doubleArray.getClass(), new DoubleArrayConverter(doubleArray)); converters.put(Float.TYPE, new FloatConverter(defaultFloat)); converters.put(Float.class, new FloatConverter(defaultFloat)); converters.put(floatArray.getClass(), new FloatArrayConverter(floatArray)); converters.put(Integer.TYPE, new IntegerConverter(defaultInteger)); converters.put(Integer.class, new IntegerConverter(defaultInteger)); converters.put(intArray.getClass(), new IntegerArrayConverter(intArray)); converters.put(Long.TYPE, new LongConverter(defaultLong)); converters.put(Long.class, new LongConverter(defaultLong)); converters.put(longArray.getClass(), new LongArrayConverter(longArray)); converters.put(Short.TYPE, new ShortConverter(defaultShort)); converters.put(Short.class, new ShortConverter(defaultShort)); converters.put(shortArray.getClass(), new ShortArrayConverter(shortArray)); converters.put(String.class, new StringConverter()); converters.put(stringArray.getClass(), new StringArrayConverter(stringArray)); converters.put(Date.class, new SqlDateConverter()); converters.put(Time.class, new SqlTimeConverter()); converters.put(Timestamp.class, new SqlTimestampConverter()); Larry Meadors wrote: Yeah, that is the joy of bean-utils. It is best to leave it a stringon the form and convert it yourself. [EMAIL PROTECTED] 02/16/04 7:45 AM I have a form with a Long property; I used Long instead of long to have the property nullable, but if the (html) form includes such a property, struts sets the corresponding bean property to 0, even if it has no value (value=); what I'd like is struts to leave the property at null!! It also behaves so if the (html) property has non numeric value!! Any help is VERY appreciated Renato Renato Romano Sistemi e Telematica S.p.A. Calata Grazie - Vial Al Molo Giano 16127 - GENOVA e-mail: [EMAIL PROTECTED] Tel.: 010 2712603 _ - 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]
locale specific date format
Hi How do I set locale specific date formats? I tried setting org.apache.struts.taglib.bean.format.date with format strings within locale specific applicationResources.properties but the format keeps coming out the same Fri Nov 21 16:46:05 CST 2003 any ideas? cheers Nathan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
ExceptionHandler to ActionError
Hi I'd like to catch exceptions in an exception handler and then re-use the ActionMessage mechanism to relay messages to the failed input page. Is this possible? What do I have to do within the ExceptionHandler to invoke the ActionMessage mechanism? thanks Nathan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
wrapping action invocations
Hi, Apologies if this is a duplicate, I posted a few days ago but it doesn't seem to have made it to the list. I'd like to introduce a layer between the action servlet and the action classes to perform generic processing - authorisation, error handling etc. I have 2 solutions: 1) subclass the RequestProcessor with generic code in an overridden processActionPerform method. 2) provide an Action base class, generic code goes in a final implementation of the execute method which delegates to an abstract doExecute method. Each subclass implements the doExecute method. or is there some other way of achieving this? Thanks Nathan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
multiple modules
Hi, do you have to have a default module called '' or with multiple modules can they all be defined with a name? init-param param-nameconfig/equipment/param-name param-value/WEB-INF/struts-equipment-config.xml/param-value /init-param init-param param-nameconfig/logistics/param-name param-value/WEB-INF/struts-logistics-config.xml/param-value /init-param I'm getting errors with deployment when I don't have: init-param param-nameconfig/param-name param-value/WEB-INF/struts-config.xml/param-value /init-param Even though theres no mention of a struts-config.xml within my web.xml I'm seeing these errors on the console. DEBUG - Initializing module path '' configuration from '/WEB-INF/struts-config.xml' 2003-10-03 16:05:05,600 DEBUG [ExecuteThread: '13' for queue: 'weblogic.kernel.Default'] action.ActionServlet (ActionSer vlet.java:916) - Initializing module path '' configuration from '/WEB-INF/struts-config.xml' 03-Oct-2003 16:05:05 o'clock CST Error HTTP BEA-101017 [ServletContext(id=13453463,name=opweb,context-path=/opw eb)] Root cause of ServletException. java.lang.NullPointerException at org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionServlet.java:1003) at org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.java:955) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
looping with ant:available
Hi, I test for a condition within a loop using the ant:available tag j:forEach var=lib items=${pom.artifacts} j:set var=dep value=${lib.dependency}/ j:set var=junitejb.test.jar value=${dep}/ ant:available property=junitejb.test.jar.available file=${junitejb.test.jar}/ j:if test=${junitejb.test.jar.available} do something with the file /j:if /j:forEach if junit.test.jar.available is set to true it is never reset to false or null. If the available is false, the property is left in whatever state it is currently in. any ideas for a workaround as I guess I'm stuck with how ant works. cheers Nathan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
tiles, modules tiles-defs
Hi, I posted a question earlier as to whether it was possible to have a module based web-app with each module having its own tiles defs configuration. The tiles-documentation web app is a working example of this. So that answers my first question. On looking at the details of the webapp the tiles-defs are within each module configuration as follows: struts-tutorial-config module plug-in className=org.apache.struts.tiles.TilesPlugin set-property property=definitions-config value=/WEB-INF/tiles-defs.xml, /WEB-INF/tiles-tutorial-defs.xml / set-property property=moduleAware value=true / /plug-in struts-doc-config module plug-in className=org.apache.struts.tiles.TilesPlugin set-property property=definitions-config value=/WEB-INF/tiles-defs.xml, /WEB-INF/tiles-doc-defs.xml / set-property property=moduleAware value=true / /plug-in struts-config module plug-in className=org.apache.struts.tiles.TilesPlugin set-property property=definitions-config value=/WEB-INF/tiles-defs.xml / set-property property=moduleAware value=true / /plug-in etc. can someone explain to me the significance of specifying the tiles-defs in this way? is this to make paths defined in one tiles-defs file available to another module? Is there any other significance of having multiple tiles-defs declared within each module? cheers Nathan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
modules and tiles
Hi, is it be possible to configure layouts using tiles-defs.xml when using multiple modules? I had a go but couldn't get it to work. The configuration I tried was two modules each with their own tiles-defs layout configuration file. Also, is there an example app that uses modules (with or without tiles layouts). thanks Nathan. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to keep session info??
Make sure that your forward/ isn't doing a redirect (i.e. redirect=true). If I understand things correctly, a redirect will cause a new session to be created... Jerry Are you sure? I haven't looked at this area of the source for a while but I can't think any sensible reason why it would be desirable for a redirect to cause a new session. If the problem is that a variable is placed into the session and then is missing during the same request (and the forward is within the same web-app), it sounds to me like there might be some erroneous code somewhere. I'd check for silly mistakes check you aren't putting null in the session, check you aren't setting the var in the request rather than the session, check the var in the session isn't null immediately after placing in the session, check the request isn't going via some code that calls session.invalidate(), or is removing the var from the session. hope this helps Jerry Jalenak wrote: -Original Message- From: development [mailto:[EMAIL PROTECTED] Sent: Thursday, August 14, 2003 8:42 PM To: [EMAIL PROTECTED] Subject: How to keep session info?? Hi all, I've got a LoginAction which inside its execute method validates and saves the login info into HttpSession instance. It creates an ActionForward and returns it. All works good and it calls the new Action which I call MembersAction which tries to retrieve the login info. Somehow though the session ID is different and so I lost all my login info :( Can someone tell me why session would be diferent please? Cheers Vic - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This transmission (and any information attached to it) may be confidential and is intended solely for the use of the individual or entity to which it is addressed. If you are not the intended recipient or the person responsible for delivering the transmission to the intended recipient, be advised that you have received this transmission in error and that any use, dissemination, forwarding, printing, or copying of this information is strictly prohibited. If you have received this transmission in error, please immediately notify LabOne at the following email address: [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: UPON APPLICATION STARTUP!!!!!!!!!!!!!!!!
select tags or indeed any tag that acts on a collection uses the name property to locate the collection. If in your case you have a collection of values that you load once and share accross every session interacting with your app, load this at startup, say in a startup servlet init and place it into the application context. servletConfig.getServletContext().setAttribute(name, value) Curtney Jacobs wrote: Greetings! I would like to load default values in my forms upon application startup. Is this possible with STRUTS? Seriously, is this possible with STRUTS? If not, I will have to look some where else for this. Many of my forms have drop down list that enables the user to choose the appropriate values. It would be nice that UPON APPLICATION STARTUP forms that need default values are automatically populated with said values. I am aware that I can call an action that can prepopulate my forms with those values. However, it seems tedious to always call an action to populate a form with default values. Has anyone done this before, if so, I would greatly appreciate some assistance. This is like the upteen post concerning this. I find it hard that no one else needs this or has done this. Regards, Curtney - 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]
exception handling
Hi, I'm using tiles to manage my layouts, one of the sections of a page is throwing an exception: [ServletException in:/log4j/Loggers_body.jsp] org/apache/commons/collections/IteratorUtils' these are the only exception details I see, how do I obtain the full stack of the exception? cheers Nathan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
module / tiles problems
Hi, I tried setting up a web application with configuration files. init-param param-nameconfig/param-name param-value/WEB-INF/struts-config.xml,/WEB-INF/struts-config-logweb.xml/param-value /init-param both referred to their own tiles-defs files with tiles plugins plug-in className=org.apache.struts.tiles.TilesPlugin set-property property=definitions-config value=/WEB-INF/tiles-defs.xml / set-property property=definitions-parser-validate value=true / set-property property=moduleAware value=false / /plug-in and plug-in className=org.apache.struts.tiles.TilesPlugin set-property property=definitions-config value=/WEB-INF/tiles-defs-logweb.xml / set-property property=definitions-parser-validate value=true / set-property property=moduleAware value=false / /plug-in the tiles-defs were only loaded for the file listed in the first config file (struts-config.xml) Am I doing something wrong? thanks Nathan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: module / tiles problems
thanks, unfortunately still doesn't work Erez Efrati wrote: Just by looking and I am new to tiles... That the set-property property=moduleAware value=false / The VALUE should be set to TRUE not false. Hope it helps, Erez -Original Message- From: Nathan Coast [mailto:[EMAIL PROTECTED] Sent: Sunday, July 13, 2003 2:12 PM To: struts-user Subject: module / tiles problems Hi, I tried setting up a web application with configuration files. init-param param-nameconfig/param-name param-value/WEB-INF/struts-config.xml,/WEB-INF/struts-config-logweb.xm l/param-value /init-param both referred to their own tiles-defs files with tiles plugins plug-in className=org.apache.struts.tiles.TilesPlugin set-property property=definitions-config value=/WEB-INF/tiles-defs.xml / set-property property=definitions-parser-validate value=true / set-property property=moduleAware value=false / /plug-in and plug-in className=org.apache.struts.tiles.TilesPlugin set-property property=definitions-config value=/WEB-INF/tiles-defs-logweb.xml / set-property property=definitions-parser-validate value=true / set-property property=moduleAware value=false / /plug-in the tiles-defs were only loaded for the file listed in the first config file (struts-config.xml) Am I doing something wrong? thanks Nathan - 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]
mapped properties
Hi, is it possible to use mapped properties for populating properties within forms? If yes, does anyone have an example snip of jsp demonstrating how to use mapped properties. thanks Nathan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
BeanUtils.populate for non-basic types
Hi, Is there any mechanism to populate form fields whose class isn't from java.lang? Apologies if this question should be directed to the commons-beanutils list. e.g. org.apache.log4j.Level thanks Nathan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
debugging bean populate
Hi, I'm getting an IllegalArgumentException presumably due to trying to populate a field of a form with the wrong datatype. I can't see where I'm going wrong. Is there a simple way to turn on debugging for the BeanUtils.populate code to see which attribute is failing? thanks Nathan java.lang.IllegalArgumentException: argument type mismatch at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.commons.beanutils.PropertyUtils.setSimpleProperty(PropertyUtils.java:1789) at org.apache.commons.beanutils.PropertyUtils.setNestedProperty(PropertyUtils.java:1684) at org.apache.commons.beanutils.PropertyUtils.setProperty(PropertyUtils.java:1713) at org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:1019) at org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:808) at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1097) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
struts tags vs jstl
Hi, I've used struts for a while now and figured I should probably look at the jstl. Theres certainly plenty of common ground to do with programatic control (decisions and looping) and with internationalisation. I'm not sure sql tags in jsp are particularly bright idea but anyway Does anyone have any thoughts on which bits are best to use from each of the taglibs? Also, is there any plan to make the struts tags support the definition of the corresponding jstl tags? The idea being that you'd only have to learn one syntax to use both taglibs, whilst using the struts tags would give you all the additional funcionality that comes with struts. cheers Nathan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: struts tags vs jstl
thanks is this documented somewhere? ie which tags have / haven't been ported James Norman wrote: I'm pretty sure that the latest release of Struts includes a subset of Struts tags that have been configured to support the EL Expression language. This is the expression language that is built into JSTL. I think that only the Struts tags that don't have equivalents in the JSTL have been ported. - Original Message - From: Nathan Coast [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 02, 2003 9:36 PM Subject: struts tags vs jstl Hi, I've used struts for a while now and figured I should probably look at the jstl. Theres certainly plenty of common ground to do with programatic control (decisions and looping) and with internationalisation. I'm not sure sql tags in jsp are particularly bright idea but anyway Does anyone have any thoughts on which bits are best to use from each of the taglibs? Also, is there any plan to make the struts tags support the definition of the corresponding jstl tags? The idea being that you'd only have to learn one syntax to use both taglibs, whilst using the struts tags would give you all the additional funcionality that comes with struts. cheers Nathan - 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: struts tags vs jstl
thanks so, if I understand it right. you would use c:forEach items= rather than logic:iterate name=... and behind the scenes the class implementing the c:forEach is a struts-el class? or should you call the tags their struts names but jstl attributes? logic-el:iterate items- if the latter, what are the preferred prefixes for the el tags? the same as their struts counterparts or with some el prefix or suffix? cheers Nathan David M. Karr wrote: Nathan == Nathan Coast [EMAIL PROTECTED] writes: Nathan is this documented somewhere? ie which tags have / haven't been ported As other posters implied, if both a Struts tag and a JSTL tag overlap, the tag wasn't ported to Struts-EL, in general. The README.txt file in the struts-el directory tries to list what tags were not ported, and why. Note that there were some problems in the RC1 release of Struts-EL, so you should probably use the nightly build, or wait until RC2. Nathan James Norman wrote: I'm pretty sure that the latest release of Struts includes a subset of Struts tags that have been configured to support the EL Expression language. This is the expression language that is built into JSTL. I think that only the Struts tags that don't have equivalents in the JSTL have been ported. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
creating dynamic forms for unknown attribute types
Hi, I'd like to be able to dynamically create forms based on the properties of the class as defined by the PropertyDescriptors. What I'd like to do is to have a mapping between the data type of the property and the input type used for the form. e.g. for Strings a html:text for boolean / Boolean a html:select with option value=true option value=false, for Date use some form of calendar. Has anyone tried anything like this? I'd like to be able to define my own tag which performed the mapping and then delegated to the appropriate struts tag once the tag class had been selected. thanks Nathan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
internationalization numeric formats
Hi, does struts support different formats for numbers dependent upon the locale of the user? I've had a look in the bean write tag code which seems to indicate using keys such as org.apache.struts.taglib.bean.format.float. Should this be used in the Application.properties and Application_de.properties files e.g: org.apache.struts.taglib.bean.format.float=###,###,###,###,###.### Cheers Nathan ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper at LevelSeas for the presence of computer viruses. ** -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
quick question - next release
Hi, I saw a load of emails flying around a little while ago about an upcoming release quality build (1.1 or whatever) to provide a release in line with the commons packages. Is this happening? Is there a time frame in mind for this? how long is a piece of string etc. Cheers Nathan. ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper at LevelSeas for the presence of computer viruses. ** -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: tiles / portal / digester
Is there a standard way of reversing the Digester code (taking an object tree and generating XML) - do we need a regurgitater :) I don't know about a standard way to revers digester code. Could be interesting. ATM just doing some ugly dom building and generating xml from that. Is it possible to re-use the digester that tiles uses to read the tilesDefinition.xml to generate the object tree when retrieving the preferences from the database? Tile use the digester to read xml files. You can reuse it to read any file with appropriate format. But if you want to read from a read DB, you can only reuse part of it. This could be an interesting extension/new feature for Tiles. I've found the code I needed in org.apache.struts.tiles.xmlDefinition.XmlParser - I cut the code from here as its private - could be a case for making method public? I think I favour storing the preferences (definitions) as XML over serializing the objects. I anticipate a need for admin functions to operate globally e.g. remove / add / modify a component from everyones definitions. I think this might be possible by sql operations on the db rather than deserialize / modify / reserialize. Apart from this, it seems to be going well, I'll let you know how I get on. ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper at LevelSeas for the presence of computer viruses. www.mimesweeper.com **
Re: [ANNOUNCE] Struts Console
Hi Ted, I'll try to update the TODO list, since many items there are actually being tested, are already done, or just obsolete. bit off topic from the original post but seeing as your talking about the todo list I spoted this on the list: PropertyEditor Support. Add support for JavaBeans that include a PropertyEditor class for conversion to and from the string representation used in an HTML input field. This support should operate in a manner consistent with the way that standard JSP tags do in JSP 1.2. I've implemented a proof of concept of this in the commons.beanutils package and posted this to the commons-dev list but got no response back, (src attached). If this is wanted for inclusion then I'll gladly clean the code up and write more tests. In summary: Using this code, form bean properties can be any type (assuming a PropertyEditor class is provided). PropertyEditors which provide the same functionality as the current ConvertUtils are included in the jar changes to ConvertUtils 1) removed of all conversion code (virtually all of the code is now for the defaults) 2) default values opened to package scope to enable the PropertyEditor classes to use the default values 3) registration of the PropertyEditor classes for use with the basic types and object wrappers in the static initialiser. other changes: addition of the basic property editors. addition of a java.util.Date property editor (example of a non-basic property editor) added a test to the BeanUtil test case to test the populate method for a variety of cases (by no means exhaustive). The only reason we have to implement all of the Basic Property Editors is because of the default property functionality (provide a default value if parsing fails - standard editors throw IllegalArgumentException). Without this functionality the we could use the PropertyEditor classes that come with the VM. Cheers Nathan ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper at LevelSeas for the presence of computer viruses. www.mimesweeper.com ** beanutils.zip
tiles / portal / digester
Hi, I'm trying to develop a basic portal app using tiles. Each user may have selected different components that they want to display in different locations. At the moment the I'm thinking of implementing this by dynamically building up a Definition for each user containing their preferences - an object representation of something like this: definition name=main.portal.body path=/layout/columnsLayout.jsp put name=numCols value=2 / putList name=list0 add value=/tutorial/portal/login.jsp / add value=/tutorial/portal/messages.jsp / add value=/tutorial/portal/newsFeed.jsp / add value=/tutorial/portal/advert2.jsp / /putList putList name=list1 add value=/tutorial/portal/advert3.jsp / add value=/tutorial/portal/stocks.jsp / add value=/tutorial/portal/whatsNew.jsp / add value=/tutorial/portal/personalLinks.jsp / add value=/tutorial/portal/search.jsp / /putList /definition when saving a users preferences I'd convert the object tree to xml and store it somewhere. Is this a good idea? Is there a standard way of reversing the Digester code (taking an object tree and generating XML) - do we need a regurgitater :) Is it possible to re-use the digester that tiles uses to read the tilesDefinition.xml to generate the object tree when retrieving the preferences from the database? Cheers Nathan ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper at LevelSeas for the presence of computer viruses. www.mimesweeper.com **
Tiles Newbie - tutorial problem
Hi, I've downloaded the tiles install from http://www.lifl.fr/~dumoulin/tiles/tiles.zip I deployed the tiles-doc.war in weblogic and the index page displayed fine. However, when I clicked on the Tutorial Live examples link: http://localhost:7001/tiles-doc/tutorial/index.jsp I get this error: Thu Sep 27 14:15:13 BST 2001 [Exception in:/tutorial/common/header.jsp] (line 1): Error in using tag library uri='/WEB-INF/struts-html.tld' prefix='html': For tag 'messages', cannot load extra info class 'com.wintecinc.struts.taglib.html.MessagesTei' weblogic.servlet.jsp.JspException: (line 1): Error in using tag library uri='/WEB-INF/struts-html.tld' prefix='html': For tag 'messages', cannot load extra info class 'com.wintecinc.struts.taglib.html.MessagesTei' at weblogic.servlet.jsp.StandardTagLib.tld_jspException(StandardTagLib.java:901) at weblogic.servlet.jsp.StandardTagLib.parseTagDD(StandardTagLib.java:949) at weblogic.servlet.jsp.StandardTagLib.parseDD(StandardTagLib.java:926) at weblogic.servlet.jsp.StandardTagLib.(StandardTagLib.java:207) at weblogic.servlet.jsp.JspLexer.loadTagLib(JspLexer.java:145) at weblogic.servlet.jsp.JspLexer.mTAGLIB_DIRECTIVE_BODY(JspLexer.java:4174) at weblogic.servlet.jsp.JspLexer.mTAGLIB_DIRECTIVE(JspLexer.java:4015) at . .. ... Any ideas? Cheers Nathan
struts portal?
Hi, quick question, is there any struts or apache sub-project to provide 'portal-like' functionality? basic functionality for users to select components from a default list that they want to see in their home page. Our current app is in struts and we'd like to avoid adding more new technologies if possible. Cheers Nathan ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper at LevelSeas for the presence of computer viruses. www.mimesweeper.com **
obtaining action forwards in jsps
Hi, Is there any way to obtain the action forward urls in jsps using their logical 'struts-config' name? I'd like to code links etc point to certain action forward urls found in struts config rather than hard coding the url? Similarly I'd like to be able to change the action url of forms using values found in struts-config using the logical forward name. Is this possible? Cheers Nathan ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com **
RE: Question about html:link
% String str = javascript:doSummlkjsdf( + myVar + ); % html:link href=%=str% .. / -Original Message- From: Alex Colic [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 29, 2001 8:30 PM To: [EMAIL PROTECTED] Subject: Question about html:link Hi, how can I pass a javascript function to a link tag? My present tag is a href=javascript:doSummarry(A_NUMBER) The value of A_NUMBER is found in a bean via workrequest.number. Thanks for the help. Alex = Regards Alex Colic, HBA, B. Ed PopWare Inc. Driving down the cost of conversions! E-Mail: [EMAIL PROTECTED] Tel: 1-905-777-8171 ext. 104 Fax: 1-905-777-0132 __ Do You Yahoo!? Get email alerts NEW webcam video instant messaging with Yahoo! Messenger http://im.yahoo.com ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com **
RE: The index number of iterate tag
logic:iterate name=myBeanName property=myBeanProp id=indexedBeanName indexId=myIndexName this will: 1) iterate over the collection / array obtained by calling 'getMyBeanProp()' on the bean named 'myBeanName' 2) place the current element in the iteration in page context against the name 'indexedBeanName' 3) place the current index in the page context against the name myIndexName -Original Message- From: Vincent Lin [mailto:[EMAIL PROTECTED]] Sent: Friday, August 24, 2001 9:26 AM To: [EMAIL PROTECTED] Subject: The index number of iterate tag Hi, Could any one tell me how to get the index number in a iterate tag? For example, I want to show a html table in screen like below. No. Name. Address.. --- 1 AAAXX 2 BBB xxY 3 CCC ffxx .. And I have a collection of objects which have attribute name and address ... etc. I can use logic:iterate to display this collection. But I don't know how to get the item number number. Now, I use a variable i and use scriptlet %= ++i % in JSP, but I think the codes are ugly. Is there a tag or implicit variable to get the index number of logic:iterate ? Regards, Vincent??¡¢??.úÞ{¡¢?§]ë,jØm?ÿ¨¥É¨h¡Ê ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper at LevelSeas for the presence of computer viruses. www.mimesweeper.com **
Quick question / indexed iterate tag / Text area
Hi, Are indexed tags implemented for text areas as part of Dave Hays indexed tag patch? is there a reason why they weren't included in the patch? Cheers Nathan ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com **
why both html and form tags?
hi, why are there two tlds one for 'form' and one for 'html' where all of the form tags point to the same classes as those in the html package? Cheers Nathan ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com **
java.util.Date properties
Hi, We've got a number of forms in which it would be useful to have java.util.Date properties. Is there any plan to have conversions for data types other than the standard java.lang basic type wrappers? from Convert Utils if (clazz == stringClass) { if (value == null) return ((String) null); else return (value); } else if (clazz == Integer.TYPE) { return (convertInteger(value, defaultInteger)); } else if (clazz == Boolean.TYPE) { return (convertBoolean(value, defaultBoolean)); } else if (clazz == Long.TYPE) { return (convertLong(value, defaultLong)); } else if (clazz == Double.TYPE) { return (convertDouble(value, defaultDouble)); . what about adding } else if (clazz = java.util.Date) { return DateFormat.parse(value); } any thoughts? Cheers Nathan ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com **
base, templates and relative urls
Hi, We've got a problem with relative urls to images in our pages due to jsps and templates residing at different directory depths. here's our directory structure /images/blah.gif /pages/MainTemplate.jsp /pages/section1/Section1Page.jsp /pages/section1/Section2Body.jsp Our pages are structured in directories beneath pages and subdirectories thereof. All pages are accessed via action servlet urls of varying depth e.g: /foo/bar/whiz.do /foo/bar/whiz/bang.do So for relative urls to other resources to work we've added a base tag to the main template. This is where it all goes a bit wrong. How do you now reference images etc in MainTemplate.jsp as the base could be at any depth so relative urls don't work. Similarly if we wanted to pass other pages in the template e.g /pages/leftnav.jsp etc, none of these would work. Is there something I'm doing wrong? Is there some html:img attribute I've missed that will prefix the context to img tags? Solutions I can think of are: 1) place all jsps in one folder or at the same folder depth 2) write a custom tag that prefixes /MyContext/ to the src 3) use MS Front Page (only joking) On a similar note is there a 'correct' way of refering to components in a template - relative or absolute template:insert template='/pages/MainTemplate.jsp' template:put name='body' content='/pages/section1/section1_body.jsp'/ /template:insert or template:insert template='../MainTemplate.jsp' template:put name='body' content='section1_body.jsp'/ /template:insert Thanks Nathan ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com **
Iterate tag - type attribute
Hi, quick question, what is the purpose of the type attribute in the iterate tag? Cheers Nathan ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com **
indexed properties problems ArrayIndexOutOfBoundsException
Hi, I've followed various threads (Long Story Short etc) about Dave Hays index tags enhancement and after much hair tearing! The suggested code for the form bean is: private ArrayList parameterList = new ArrayList(); public ArrayList getParameterList() { return(this.parameterList); } public void setParameterList(ArrayList parameterList) { this.parameterList = parameterList; } public Parameter getParameter(int index) { System.out.println(index); if (idx parameterList.size()-1) { parameterList.add(index,new Parameter ()); } return (Parameter) parameterList.get(index); } The problem I'm getting is that struts is calling the getParameter(index) method out of sequence e.g. index=5 index=4 index=17 index=17 index=3 index=7 index=16 index=15 index=2 index=14 index=10 index=1 index=0 etc.. and so the calls to add and get on the ArrayList result in ArrayIndexOutOfBoundsException rather than building up the values. This problem would go away if I used session scope form beans but I'd rather not do that. Has anyone else seen this problem / found a neat solution? Cheers Nathan ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com **
Indexed tags - Dave Hays code
Hi, I'm trying to use the Indexed tags from Dave Hays: http://husted.com/about/struts/indexed-tags.htm anyone got a replacement struts.jar with the relevant code changes in? It's not that I'm lazy, I'm just having trouble getting the code built using ant 1.3 java.lang.NoClassDefFoundError: javax/xml/transform/Source at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:120) at org.apache.tools.ant.taskdefs.XSLTProcess.setProcessor(XSLTProcess.ja va:229) at org.apache.tools.ant.taskdefs.XSLTProcess.execute(XSLTProcess.java:13 7) at org.apache.tools.ant.Target.execute(Target.java:153) at org.apache.tools.ant.Project.runTarget(Project.java:898) at org.apache.tools.ant.Project.executeTarget(Project.java:536) at org.apache.tools.ant.Project.executeTargets(Project.java:510) at org.apache.tools.ant.Main.runBuild(Main.java:421) at org.apache.tools.ant.Main.main(Main.java:149) ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com **
Indexed properties
Hi, What I want to do is to have multiple text fields in a table get assigned to an array or collection property in an ActionForm. I've followed a few threads in the newsgroups about this and have tried some jsp code: logic:iterate id=myObject name=indexedForm property=indexedPropsList TR TDhtml:text name=myObject property=name indexed=true//TD /TR /logic:iterate but this produces this jsp error: /pages/test/TestIndexedPropertyPage_Body.jsp(11): for tag 'text' handler type 'org.apache.struts.taglib.html.TextTag' has no property 'indexed' Is the indexed property a non-standard struts patch / extension I have to use? Thanks Nathan ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com **
RE: Link Tag not supported?
Thanks, Not sure how this helps me. I now get this html generated: base href=http://localhost:7001/LevelSeas/pages/myvessels/MyVesselsFirstPage.jsp This tag is generated from within a template jsp (pages/MainTemplate.jsp). This template jsp is at a different directory depth from the repuested jsp (above) and so relative urls in the template jsp wont work. Please excuse my ignorance here as I'm a java programmer rather than HTML. Cheers Nathan -Original Message- From: Siggelkow, Bill [mailto:[EMAIL PROTECTED]] Sent: 16 July 2001 18:06 To: '[EMAIL PROTECTED]' Subject: RE: Link Tag not supported? You should only need to provide a relative link as the href attribute of your link tag. You can also use the Struts base tag to set the base from the calling page ... html head titleMy Home Page/title html:base/ link rel=stylesheet type=text/css href=styles/default.css /head ... -Original Message- From: Nathan Coast [mailto:[EMAIL PROTECTED]] Sent: Monday, July 16, 2001 12:47 PM To: Struts-User (E-mail) Subject: Link Tag not supported? Hi, I want to create this html using struts tags so I don't have to hard code my context (LevelSeas) but the html:link tag is for A href = . link rel=stylesheet href=/LevelSeas/style/LS_stylesheet.css charset=ISO-8859-1 type=text/css/ Is there a tag to do this or am I going to have to write my own custom tag? Cheers Nathan ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com ** ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com **
Link Tag not supported?
Hi, I want to create this html using struts tags so I don't have to hard code my context (LevelSeas) but the html:link tag is for A href = . link rel=stylesheet href=/LevelSeas/style/LS_stylesheet.css charset=ISO-8859-1 type=text/css/ Is there a tag to do this or am I going to have to write my own custom tag? Cheers Nathan ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com **
display of ActionErrors
Hi, Is there any way to separate individual error messages in a jsp form? The sort of behaviour I'm looking for is to place the error messages (ActionErrors) next to the errant fields rather than a single block. Or is the only option to display all of the errors in one place using html:errors/ tag? Cheers Nathan ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com **
page flow control
Hi, In the site I'm developing, there are sections that have forms on consecutive pages, I want to guarantee that pages are navigated: page1 - page2 - pageN. At the same time allowing back and forward navigation to change values entered on previous pages. After the last submit, the only valid page in the sequence is then page1. I've had a look at the Struts Token functionality but I don't think it can support this functionality. Is it possible with Tokens or some other way? Thanks in advance Nathan
Re: Automathic user authentication
the method will return null if the user is not authenticated. There is also the method java.security.principal user = HttpServletRequest.getUserPrincipal() which returns the current user (if logged in). have a read of the security chapter of the servlet spec (chapter 11 in 2.2, chapter 12 in 2.3). This tells you how to configure your web app to require authentication to access certain resources. LORENA MASSIMO wrote: hi everibody, i'm developing for myintranet a web app based on apache/tomcat/struts. My users are using NT Wks on a NT Domain. I'm trying to auto-authenticate the users using the NT Logon User. Somebody told me to use the following jsp code String logon_user = Request.ServerVariables(LOGON_USER); but the class Request is unknown in Tomcat (ok with JRUN) Somebody told me to use the following code String logon_user = request.getRemoteUser(); but it return null (or empty String) Can anybody suggest me any other solutions? Thanks MaxL
relative urls
Hi, I've got an app that will be deployed to a number of different contexts /test /dev /staging / (root) The app contains a large amount of static content e.g. images which will always be referenced from /current_context/image some of the jsps are accessed directly and via the action servlet - sometimes with different depths for the action url e.g. /current_context/something/something_else/my_action.do /current_context/something/another_action.do /somepage.jsp this obviously rules out using relative urls for the static content but the changing contexts makes it difficult for basing the urls on root. Is the solution to precede the url to every image in every jsp with a variable containing the value of the context? Is this not a performance hit? What's the best way to do it? Is there a struts tag that does this for me? How do I achieve world peace? - oops wrong mail list. Thanks Nathan
Re: relative urls
cheers this is what I figured, seems like an unpleasant overhead object - instantiation and 3 method calls for every relative url in the site every time every page is accessed. Must be some hack to get the context and place it into a static final variable somewhere prior to jsp compilation. This would effectively compile the variable value into every jsp. Any ideas? Scott Walter wrote: I ran into this same issue. I accomplished this by creating a custom tag (in my case called, PageLoader). The PageLoader tag will expose a scripting variable called contextRoot, which is basically pageContext.getRequest()).getContextPath() scott. --- Nathan Coast [EMAIL PROTECTED] wrote: Hi, I've got an app that will be deployed to a number of different contexts /test /dev /staging / (root) The app contains a large amount of static content e.g. images which will always be referenced from /current_context/image some of the jsps are accessed directly and via the action servlet - sometimes with different depths for the action url e.g. /current_context/something/something_else/my_action.do /current_context/something/another_action.do /somepage.jsp this obviously rules out using relative urls for the static content but the changing contexts makes it difficult for basing the urls on root. Is the solution to precede the url to every image in every jsp with a variable containing the value of the context? Is this not a performance hit? What's the best way to do it? Is there a struts tag that does this for me? How do I achieve world peace? - oops wrong mail list. Thanks Nathan = ~~~ Scott __ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/