Re: Tiles:insert role(s)?
Below is a reply sent to this mailing list about the Tiles controller class. The problem was trying to populate a dynamic Tiles attribute (exactly the same as what you want) in a cleaner way. If you still have problems post them in this thread and I will try to answer. Hope it helps, Pedro Salgado Hi Robert.. I guess you could achieve the same using the controllerClass attribute and building your class.. For instance, I have this definition in the tiles-defs.xml file: --- definition name=.layout path=/common/layout.jsp controllerClass='com.dars.XTileAction' put name=title value=Encabezado primario/ put name=leftsidevalue=/common/leftside.jsp/ put name=rightside value=/common/rightside.jsp/ put name=header value=/common/header.jsp/ put name=footer value=/common/footer.jsp/ put name=bodyvalue=/common/body.jsp/ /definition --- And I have this controllerClass --- package com.dars; import org.apache.struts.tiles.actions.TilesAction; import org.apache.struts.tiles.ComponentContext; import org.apache.struts.tiles.Controller; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.ServletContext; import javax.servlet.ServletException; import java.io.IOException; public class XTileAction extends TilesAction implements Controller{ public void perform(ComponentContext tilesctx, HttpServletRequest request, HttpServletResponse response, ServletContext servctx) throws ServletException, IOException{ /* GetAttributes */ String titulo= (String)tilesctx.getAttribute(title); String derecha= (String)tilesctx.getAttribute(rightside); /* GetAttributes */ System.out.println( Titulo: +titulo); System.out.println( Derecha: +derecha); /* SetAttributes */ tilesctx.putAttribute(title, Titulo nuevo de esta vaina..); tilesctx.putAttribute(rightside, /common/footer.jsp); /* SetAttributes */ } } --- You can change the values of those attributes at runtime. I prefer to do it using this method. Atte. Domingo A. Rodriguez S. --- Robert Taylor [EMAIL PROTECTED] escribió: Greetings, I have a tiles definition in my tiles-defs.xml similar to below: definition name=search extends=layout put name=heading value={0}Search type=string / put name=content value=/search.jsp type=page / /definition which I would like to be able to modify the heading value such that at runtime I could substitute a value for {0}. For example, it would be ideal to use a JSTL type of syntax such as: definition name=search extends=layout put name=heading value=${param.myValue}Search type=string / put name=content value=/search.jsp type=page / /definition but this does not work. robert - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Do You Yahoo!? Información de Estados Unidos y América Latina, en Yahoo! Noticias. Visítanos en http://noticias.espanol.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] On 24/03/2004 18:14, Mariano García González [EMAIL PROTECTED] wrote: Hi all, I am newbie using tiles, so maybe this question is too easy for you. I want to use a tile definition in which, one of the attribute values is dynamic. It is something like this: definition name=tracebox.def.encoderconfig extends=tracebox.def.menu put name=title value=encoderconfig / put name=body value=DYNAMIC CONTENT / /definition I want to use a dynamic url in body attribute, depending of a bean attribute. I hope you understand me. Could you help me? Thanks, Mariano. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] On 17/11/04 3:15 am, Dave Bender [EMAIL PROTECTED] wrote: The logic:present looks like a good solution, but I would be interested in seeing how you've defined a controllerClass to do the trick, too. Dave -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 16, 2004 2:29 PM To: [EMAIL PROTECTED] Subject: RE: Tiles:insert role(s)? You can also define a controllerClass for your tiles definition and insert the tiles properties according to the user roles. If you need I can send you an example (tomorrow). Pedro Salgado Hi Dave, You can use the logic present to show what you want for a particular role. You can use it like this : logic:present role=admin,associates
AW: AW: AW: using multiple action forms in one action. Best practice?
Bill, you seem to understand my application quite well. The metaphor of region/shops is excellent. What adds a bit of complexity is that the shop-module is just one of several. There might be an additional people-module, a statistical data-module, etc. Thus serializing the editing process in a wizard style would impose an order on the process which is not very pleasant. Also, I would like to reuse the forms/action for editing already existing objects/regions, where the order enforced by a wizard is not appropriate. But I think I have learned fromthis discussion how it could be implemented reasonably. The only exception being the question of scope which is not that important in my case. Martin -Ursprüngliche Nachricht- Von: Bill Keese [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 17. November 2004 01:48 An: Struts Users Mailing List Betreff: Re: AW: AW: using multiple action forms in one action. Best practice? It's hard for me to answer because I don't really understand your application. JSP1 is for picking a region, and then JSP2 is for picking stores within that region, right? And then after picking the stores, you display a confirmation page with the map and the list of picked stores? When you hit the save button on the confirmation page, the input to the SaveAction is both the selected region and the selected stores, right? So you are combining the information entered on two previous forms. If it was me, I would have 3 separate actions and 3 separate action-forms: 1. select-region 2. select-stores 3. confirm-dialog The confirm-dialog ActionForm would contain both the region information and the list of stores. Thus I would only use one ActionForm per Action, and I wouldn't use session variables. Bill Martin Kindler wrote: Hi Bill, so you say, it is good practice to use the two forms in one action as I do in my current solution? Sure, one has to hide the internals from AF1 to an action primarily designed to use AF2 to keep the address module generic. Perhaps I should make the calling ActionForms implement a specific interface. If I really want a fully generic address module I would have to split the action(s) in two, simply because the actions designed for the address module need a generic API. I cannot rely (for full genericity) on a calling module to use AF1. In my current situation I will probably ignore this as it is a straightforward refactoring which can be done when need occurs. As to the question request vs. session scope I understand the problems which might occur using session scope. I do not see a solution which would also fulfil the modularization requirement. Thanks! Martin -Ursprüngliche Nachricht- Von: Bill Keese [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 16. November 2004 02:10 An: Struts Users Mailing List Betreff: Re: AW: using multiple action forms in one action. Best practice? Hi Martin, From this JSP I want to access a (hopefully) generic module to get the access points. This module has to get some information (e. g. a region to prefilter the addresses or access points already existing) from JSP1. I think you should generate the input to the generic module, rather than passing the ActionForm directly: // get data from ActionForm1 needed to look up addresses AddressLookupInfo info = getAddressInfoFromActionForm1(AF1); // lookup addresses List res = AddressLookup.getAddresses(info); ... Then your module can still be generic. I could take the necessary information from AF1 to some POJO (or bean) on model level (or controller level) and transfer it to AF2. This is probably the cleanest solution but means to split each action into two, just to do the data transfer. You shouldn't need to split each action into two. Action1's job is to handle the input from ActionForm1, and then do the setup to display JSP2, right? So, just create the ActionForm2 manually inside Action1: // Create AF2 as an input/output form ActionForm2 af2 = new ActionForm2(); session.setAttribute(actionForm2, af2); // ... and pre-populate it with the data the user has already input ActionForm1 af1 = (ActionForm1) getActionForm(mapping, form, request, session); af2.loadDataFromAF1(af1); // forward control to JSP2 return (mapping.findForward(jsp2)); My current solution simply accesses both action forms, AF1 and AF2 (getting the one not available as the form-parameter by MyForm mf = (MyForm)session.getAttribute(AFi); but my feeling is that this is not really good style. I guess it depends on whether you consider the two forms to represent one logical command or two logical commands. The other
RE: talking about paradigms
-Original Message- From: Don Brown [mailto:[EMAIL PROTECTED] ==== Now, now, Peter, you can't quite say that since you met me at the Struts user group at JavaOne. :) I've used stxx, an XML transformation Struts extension, for a production app and have been pretty happy with it. Performance is good, as long as one has memory resources available. The stylesheets can be cached when compiled, and using a decorator tool like sitemesh, the pages your XSL generates are quite small. The big disadvantage, as I see it, is it requires XSLT knowledge, which most web developers don't have. I probably wouldn't recommend it for apps that don't have their data in XML and don't need multiple views. Don Don, it's bean so long that I cant remember all the discussions from July this year, so there you go. My apologises, because I dont remember Stxx coming up in the conversation. Yeah! I agree XSLT is a bit harder to fathom for web page designers too. The use case is multiple views, data already stored and prepared in XML i.e. XML database / report or web services. On Tue, 16 Nov 2004 17:59:48 -, Pilgrim, Peter [EMAIL PROTECTED] wrote: -Original Message- From: Dakota Jack [mailto:[EMAIL PROTECTED] Sent: 16 November 2004 17:46 To: Struts Users Mailing List Subject: Re: talking about paradigms Bill, Sounds like you don't need what XSLT provides. The important thing, I think, is to make sure that the framework leaves that option open for those that want it and does not require that option to those who do not want it. I am not privy to the details of your application, of course, but adding code to the controller to assist in the presentation seems to me to indicate a serious design flaw. That simply is not the business of the control layer, if you are using the control layer in an MVC pattern. Part of your bad experience with XSLT sounds like it is not related to the view issues but to some confusion in the architecture of the application? Not knowing much about the details, this is probably a harsh assessment, but it is what I would intuitively expect to find. My head keeps saying What the heck is the controller doing generating XML?. The controller should be deciding what to do about user input given whatever strategy the application has adopted. Jack On Tue, 16 Nov 2004 10:55:52 -0500, Bill Siggelkow [EMAIL PROTECTED] wrote: Jack, What I found was that alot of Java code to generate XML (using DOM API) had to be added in the controller layer to facilitate the view; for example, an odd/even indicator was added just to facilitate striping on the generated HTML table; to me, this seems downright overkill for some feature that is purely presentation (granted, the developers could have avoided this through better use of XSLT). Personally, I've never warmed to the idea of using the XML/XSLT approach when the data is already in the form of a Java object; it just seems like an extra step that doesn't buy me a whole lot. -Bill Siggelkow I have never come across anyone in a face-to-face who uses the XML/XSLT approach at least with Struts. I met a straight-up Cocoon fantastic a few years ago, but by then he was moving away from XSLT to proprietary web application framework on some app server. This biggest problem of the XML is the transformation phase, and it sounds like that the original tabular XML was not augmented with attributes to say this is hint render this row in green and now render that next row with white background. Then an XSLT can be written to easily transform things around (or not as the case may be). I think XML/XSLT pipeline is useful for static stuff that mostly does not change frequently. How did you find the XSLT transformation performance on your project? Did you cache the XSLT results somewhere? ==== -- Peter Pilgrim Operations/IT - Credit Suisse First Boston, 10 South Colonnade, London E14 4QJ, United Kingdom Tel: +44-(0)207-883-4497 == This message is for the sole use of the intended recipient. If you received this message in error please delete it and notify us. If this message was misdirected, CSFB does not waive any confidentiality or privilege. CSFB retains and monitors electronic communications sent through its network. Instructions transmitted over this system are not binding on CSFB until they are confirmed by us. Message transmission is not guaranteed to be secure. == - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] User Preference System Design
Hi Julian, you should take a look at CMS (container-managed security) as this is probably the most effective solution - integrated, portable, widespread etc. Try either tomcat's website for documentation there, or even look in the servlet spec from Sun, or in your appserver's docs, to see if it suits your needs. Struts has many features that allows you to leverage CMS in the ways you say you require. Persistence of your user info groups or roles etc is done under CMS in whichever way you choose - there are various 'realm' implementations which allow database stores, XML files, LDAP or bespoke solutions. HTH Adam On 11/17/2004 03:09 AM Julian wrote: Hi, I am a Struts Newbie and would appreciate if anyone could give me some pointers on a user preferences/ configuration system design. Perhaps a link to a good resource? I have an ASP system with several levels of users that are as broad as an organization and as fine-grained as an individual person with one role. I would like to have a preference system that can handle configuration and preference issues for the different levels of the application. The information stored in these configurations range from font colors and alert boxes to the availability of various modules in the web application. Currently the information is stored in xml files on the server's hard disk, but this will not suit a distributable environment. Any suggestions are greatly appreciated. Thanks in Advance, Julian = Live simply so others may simply live. -Ghandi Pluralitas non est ponenda sine neccesitate. Entities should not be multiplied unneccesarily -William of Occam - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] User Preference System Design
If you have a good learner and familiar with Dependancy injection/IOC I would recomend you look at acegi. It has a steep initial learning curve but there is no need that it doesn't satisfy, I think it is the most flexible and advanced security system/framework I've ever seen, providing security all the way down to method invokations and object collection filtering. It is 1000 times better than CMS ( although it does allow you to use CMS as well ). http://acegisecurity.sourceforge.net/ Yours Bryan Hunt On Wed, 17 Nov 2004 10:44:04 +, Adam Hardy [EMAIL PROTECTED] wrote: Hi Julian, you should take a look at CMS (container-managed security) as this is probably the most effective solution - integrated, portable, widespread etc. Try either tomcat's website for documentation there, or even look in the servlet spec from Sun, or in your appserver's docs, to see if it suits your needs. Struts has many features that allows you to leverage CMS in the ways you say you require. Persistence of your user info groups or roles etc is done under CMS in whichever way you choose - there are various 'realm' implementations which allow database stores, XML files, LDAP or bespoke solutions. HTH Adam On 11/17/2004 03:09 AM Julian wrote: Hi, I am a Struts Newbie and would appreciate if anyone could give me some pointers on a user preferences/ configuration system design. Perhaps a link to a good resource? I have an ASP system with several levels of users that are as broad as an organization and as fine-grained as an individual person with one role. I would like to have a preference system that can handle configuration and preference issues for the different levels of the application. The information stored in these configurations range from font colors and alert boxes to the availability of various modules in the web application. Currently the information is stored in xml files on the server's hard disk, but this will not suit a distributable environment. Any suggestions are greatly appreciated. Thanks in Advance, Julian = Live simply so others may simply live. -Ghandi Pluralitas non est ponenda sine neccesitate. Entities should not be multiplied unneccesarily -William of Occam - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- http://www.revoltingdigits.com https://jestate.dev.java.net - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Prepopulate a DynaForm
I'm trying to prepopulate a DynaForm with some values - right now just hard-coded, later should be taken from a DB. For that I'm using a SetupAction, that is called to prepopulate the form, insert it into the request and after that forward to the actual action for presenting the form to the user. Looks like this: public class MediaArchiveSetupAction extends Action { public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response){ ActionServlet servlet = this.getServlet(); MediaArchiveForm mediaArchiveForm = new MediaArchiveForm(); mediaArchiveForm.setServlet(this.getServlet()); MessageResources messageResources = servlet.getInternal(); mediaArchiveForm.set(author, test); // TODO: check why this doesn't work request.setAttribute(mediaArchiveForm, mediaArchiveForm); // this does actually work request.setAttribute(test, dummy); return (mapping.findForward(success)); } } Using this approach I always get a null pointer exception, leading me to the presumption that the actual form-object isn't built. Any ideas why? Thanks for any help, Alexander - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] GMail Invite
Anyone got a spare GMAIL invite pending. I subscribed to the flaming thing a couple of months, but I forgot both my gmail username and password log. I invented some security noshbit that is unfathable or gmail admin have locked the account. (I wanted check out some javascrpt that google have invented or copied) -- Peter Pilgrim Operations/IT - Credit Suisse First Boston, 10 South Colonnade, London E14 4QJ, United Kingdom Tel: +44-(0)207-883-4497 == This message is for the sole use of the intended recipient. If you received this message in error please delete it and notify us. If this message was misdirected, CSFB does not waive any confidentiality or privilege. CSFB retains and monitors electronic communications sent through its network. Instructions transmitted over this system are not binding on CSFB until they are confirmed by us. Message transmission is not guaranteed to be secure. == - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Reload the MessageResources ???
At 12:29 PM +0800 11/17/04, Eric Chow wrote: Hello, I implement a EJBMessageResource that extends Struts' MessageResources. How can I reload the MessageResources after the application starts ??? Struts stores its MessageResources object in the ServletContext under whatever key is specified using the key attribute in the struts-config.xml, or if none is specified, under org.apache.struts.Globals.MESSAGES_KEY. If you are using modules, the ServletContext attribute name is extended by adding the module config's prefix at the end. So you can write any kind of web-based interface which retrieves your extension of MessageResources, and then call a method on your class that tells it to reload itself. Alternatively, of course, you could look at the initModuleMessageResources method in ActionServlet to see how they get initialized in the first place. This would show you how to handle the whole set of resources for a module, in case you want to have a reload which is more complete, rather than needing to know where to find just one MessageResources object. Joe -- Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com Narrow minds are weapons made for mass destruction -The Ex - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] GMail Invite
At 11:56 AM + 11/17/04, Pilgrim, Peter wrote: Anyone got a spare GMAIL invite pending. I gave all mine to the iSnoop spooler: http://isnoop.net/gmailomatic.php Go there and request an account. I think the turn around is pretty quick. Joe -- Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com Narrow minds are weapons made for mass destruction -The Ex - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] GMail Invite
Hello peter, I got still 6.. i sent you one already.. Regards Marco -Original Message- From: Pilgrim, Peter [mailto:[EMAIL PROTECTED] Sent: 17 November 2004 11:57 To: Struts User Apache (E-mail) Subject: [OT] GMail Invite Anyone got a spare GMAIL invite pending. I subscribed to the flaming thing a couple of months, but I forgot both my gmail username and password log. I invented some security noshbit that is unfathable or gmail admin have locked the account. (I wanted check out some javascrpt that google have invented or copied) -- Peter Pilgrim Operations/IT - Credit Suisse First Boston, 10 South Colonnade, London E14 4QJ, United Kingdom Tel: +44-(0)207-883-4497 == This message is for the sole use of the intended recipient. If you received this message in error please delete it and notify us. If this message was misdirected, CSFB does not waive any confidentiality or privilege. CSFB retains and monitors electronic communications sent through its network. Instructions transmitted over this system are not binding on CSFB until they are confirmed by us. Message transmission is not guaranteed to be secure. == - 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]
Can we use multiple Controllers in a single web-application?
hi, i have a requirement where we need to use two Controllers (one for each module) in our project. my web.xml looks like this.. ?xml version=1.0 encoding=UTF-8? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd; web-app servlet servlet-namecontroller1/servlet-name servlet-classcom.test.struts.Controller1/servlet-class init-param param-nameconfig/param-name param-value/WEB-INF/config1.xml/param-value /init-param init-param param-namedebug/param-name param-value2/param-value /init-param init-param param-namedetail/param-name param-value2/param-value /init-param load-on-startup2/load-on-startup /servlet servlet servlet-namecontroller2/servlet-name servlet-classcom.test.struts.Controller2/servlet-class init-param param-nameconfig/param-name param-value/WEB-INF/config2.xml/param-value /init-param init-param param-namedebug/param-name param-value2/param-value /init-param init-param param-namedetail/param-name param-value2/param-value /init-param load-on-startup2/load-on-startup /servlet servlet-mapping servlet-namecontroller1/servlet-name url-pattern/controller1/*/url-pattern /servlet-mapping servlet-mapping servlet-namecontroller2/servlet-name url-pattern*.do/url-pattern /servlet-mapping welcome-file-list welcome-fileindex.jsp/welcome-file /welcome-file-list taglib taglib-uri/bean/taglib-uri taglib-location/WEB-INF/struts-bean.tld/taglib-location /taglib taglib taglib-uri/html/taglib-uri taglib-location/WEB-INF/struts-html.tld/taglib-location /taglib taglib taglib-uri/logic/taglib-uri taglib-location/WEB-INF/struts-logic.tld/taglib-location /taglib /web-app ..both controller1 and controller2 extend ActionServlet. when using controller2 i use the URL http://localhost:9080/MultipleControllers/Welcome.do (the struts-config snippet corresponding to Welcome.do is shown below ) action path=/Welcome type=org.apache.struts.actions.ForwardAction parameter=/pages/Welcome.jsp/ and it works fine.next i want to use the controller1 and i use the url http://localhost:9080/MultipleControllers/controller1/WelcomePage (the struts-config snippet corresponding to WelcomePage is shown below ) action path=/WelcomePage type=org.apache.struts.actions.ForwardAction parameter=/WorkFlow/pages/WorkFlowWelcome.jsp/ ..now it gives me an error org.apache.struts.action.RequestProcessor Invalid path /WorkFlow/WelcomePage was requested i dont know why this error comes up. i also wanted to clear some of my doubts connected with the same. 1)Is it possible to have Multiple Controllers in a single web-applicaion? (both these controllers are extended from the ActionServlet) 2)if Yes, can you please post some sample code which would help me in understanding the same? 3)Can this Muliple Controller concept be used along with the struts modules? (or to rephrase...Can the struts modules concept work with more than one Controller?) I am stuck with this for quite some time. If any of you have faced similar situations...please guide me or help me with some code snippets. THanks in advance -Amith
where i can get jdbc driver for oracle
hi, how can i use database in struts where i can get jdbc driver for oracle database Nishant Patil Software Engineer Cybage Software Pvt. Ltd. (A CMM Level 3 Company) West Avenue , Kalyani Nagar, Pune - 411 006 Tel: 91-20-4041700 -355 Email: [EMAIL PROTECTED] Website: www.cybage.com There's a difference between knowing the path, and walking the path
RE: Prepopulate a DynaForm
You need to use the form which is passed in from the execute() method signature. DynaForm dForm = (DynaForm) form; dForm.set(author, test); return mapping.findForward(success); This assumes you are using the same form for your setup and processing action and you are forwarding to the page which renders the form. robert -Original Message- From: Alexander Czernay [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 17, 2004 6:22 AM To: Struts Users Mailing List Subject: Prepopulate a DynaForm I'm trying to prepopulate a DynaForm with some values - right now just hard-coded, later should be taken from a DB. For that I'm using a SetupAction, that is called to prepopulate the form, insert it into the request and after that forward to the actual action for presenting the form to the user. Looks like this: public class MediaArchiveSetupAction extends Action { public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response){ ActionServlet servlet = this.getServlet(); MediaArchiveForm mediaArchiveForm = new MediaArchiveForm(); mediaArchiveForm.setServlet(this.getServlet()); MessageResources messageResources = servlet.getInternal(); mediaArchiveForm.set(author, test); // TODO: check why this doesn't work request.setAttribute(mediaArchiveForm, mediaArchiveForm); // this does actually work request.setAttribute(test, dummy); return (mapping.findForward(success)); } } Using this approach I always get a null pointer exception, leading me to the presumption that the actual form-object isn't built. Any ideas why? Thanks for any help, Alexander - 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: [OT] User Preference System Design
I like java.util.Properties, or, if Strings aren't good enough, another wrapper for a Map that allows put/get of Objects but that uses a hierarchical default system like Properties does. Properties has built in load/save methods that you can use to store your properties on disk until you move them to a RDBMS. Base user has colors A, B, C. Next higher user needs to have a different color A but inherit colors B and C. Create his properties with the Base user properties as the default, then just put the new property A. Works nicely for that sort of thing. Erik Julian wrote: Hi, I am a Struts Newbie and would appreciate if anyone could give me some pointers on a user preferences/ configuration system design. Perhaps a link to a good resource? I have an ASP system with several levels of users that are as broad as an organization and as fine-grained as an individual person with one role. I would like to have a preference system that can handle configuration and preference issues for the different levels of the application. The information stored in these configurations range from font colors and alert boxes to the availability of various modules in the web application. Currently the information is stored in xml files on the server's hard disk, but this will not suit a distributable environment. Any suggestions are greatly appreciated. Thanks in Advance, Julian = Live simply so others may simply live. -Ghandi Pluralitas non est ponenda sine neccesitate. Entities should not be multiplied unneccesarily -William of Occam __ Do you Yahoo!? The all-new My Yahoo! - Get yours free! http://my.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: where i can get jdbc driver for oracle
Nishant wrote: hi, how can i use database in struts Consult your Servlet container's JDBC documentation. Nothing special required for Struts. where i can get jdbc driver for oracle database http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html Erik Nishant Patil Software Engineer Cybage Software Pvt. Ltd. (A CMM Level 3 Company) West Avenue , Kalyani Nagar, Pune - 411 006 Tel: 91-20-4041700 -355 Email: [EMAIL PROTECTED] Website: www.cybage.com There's a difference between knowing the path, and walking the path - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] User Preference System Design
Hi, Thanks for the input. The Properties object is more inline with what I was thinking. The problem with it however, is that there can only be one key/value pair. I see no ability to have one key with multiple pairs other than doing comma delimitation. This is why XML was chosen originally. The problem with it now is that it is not stored in an RDBMS, and I am unaware of the scalability of a user preferences system based on XML.Comments/Suggestions? Thanks again, Julian --- Erik Weber [EMAIL PROTECTED] wrote: I like java.util.Properties, or, if Strings aren't good enough, another wrapper for a Map that allows put/get of Objects but that uses a hierarchical default system like Properties does. Properties has built in load/save methods that you can use to store your properties on disk until you move them to a RDBMS. Base user has colors A, B, C. Next higher user needs to have a different color A but inherit colors B and C. Create his properties with the Base user properties as the default, then just put the new property A. Works nicely for that sort of thing. Erik Julian wrote: Hi, I am a Struts Newbie and would appreciate if anyone could give me some pointers on a user preferences/ configuration system design. Perhaps a link to a good resource? I have an ASP system with several levels of users that are as broad as an organization and as fine-grained as an individual person with one role. I would like to have a preference system that can handle configuration and preference issues for the different levels of the application. The information stored in these configurations range from font colors and alert boxes to the availability of various modules in the web application. Currently the information is stored in xml files on the server's hard disk, but this will not suit a distributable environment. Any suggestions are greatly appreciated. Thanks in Advance, Julian = Live simply so others may simply live. -Ghandi Pluralitas non est ponenda sine neccesitate. Entities should not be multiplied unneccesarily -William of Occam __ Do you Yahoo!? The all-new My Yahoo! - Get yours free! http://my.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] = Live simply so others may simply live. -Ghandi Pluralitas non est ponenda sine neccesitate. Entities should not be multiplied unneccesarily -William of Occam __ 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: [OT] User Preference System Design
The most common way to store more than one element in a properties file is to have more than one entry like the following: colour.count=3 colour.0=red colour.1=green colour.2=blue So your code loads the property for colour.count and loops through the other properties. Not very elegant, but it works. Daniel. -Original Message- From: Julian [mailto:[EMAIL PROTECTED] Sent: 17 November 2004 14:08 To: Struts Users Mailing List Subject: Re: [OT] User Preference System Design Hi, Thanks for the input. The Properties object is more inline with what I was thinking. The problem with it however, is that there can only be one key/value pair. I see no ability to have one key with multiple pairs other than doing comma delimitation. This is why XML was chosen originally. The problem with it now is that it is not stored in an RDBMS, and I am unaware of the scalability of a user preferences system based on XML.Comments/Suggestions? Thanks again, Julian --- Erik Weber [EMAIL PROTECTED] wrote: I like java.util.Properties, or, if Strings aren't good enough, another wrapper for a Map that allows put/get of Objects but that uses a hierarchical default system like Properties does. Properties has built in load/save methods that you can use to store your properties on disk until you move them to a RDBMS. Base user has colors A, B, C. Next higher user needs to have a different color A but inherit colors B and C. Create his properties with the Base user properties as the default, then just put the new property A. Works nicely for that sort of thing. Erik Julian wrote: Hi, I am a Struts Newbie and would appreciate if anyone could give me some pointers on a user preferences/ configuration system design. Perhaps a link to a good resource? I have an ASP system with several levels of users that are as broad as an organization and as fine-grained as an individual person with one role. I would like to have a preference system that can handle configuration and preference issues for the different levels of the application. The information stored in these configurations range from font colors and alert boxes to the availability of various modules in the web application. Currently the information is stored in xml files on the server's hard disk, but this will not suit a distributable environment. Any suggestions are greatly appreciated. Thanks in Advance, Julian = Live simply so others may simply live. -Ghandi Pluralitas non est ponenda sine neccesitate. Entities should not be multiplied unneccesarily -William of Occam __ Do you Yahoo!? The all-new My Yahoo! - Get yours free! http://my.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] = Live simply so others may simply live. -Ghandi Pluralitas non est ponenda sine neccesitate. Entities should not be multiplied unneccesarily -William of Occam __ 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]
free struts boook
where do i get struts free book except strutslive Nishant Patil Software Engineer Cybage Software Pvt. Ltd. (A CMM Level 3 Company) West Avenue , Kalyani Nagar, Pune - 411 006 Tel: 91-20-4041700 -355 Email: [EMAIL PROTECTED] Website: www.cybage.com There's a difference between knowing the path, and walking the path
Re: Can we use multiple Controllers in a single web-application?
1)Is it possible to have Multiple Controllers in a single web-applicaion? (both these controllers are extended from the ActionServlet) Struts was not designed to support two ActionServlets in a single webapp. There are many places where resources would be initialized by the first webapp and then clobbered by the second. Actually, given the uncertainty of synchronization, you'd probably get a mish-mash. But Struts is not careful about how it uses the Application Context because it assumes that there is only one ActionServlet. As we've been talking about new designs for Struts in the future, I have been thinking that it would be nice to have Struts put only one object in the ApplicationContext: a Struts object which then uses its own internal references to manage application-scoped values so that instead they would be scoped to the instance that initialized them. There might still be some issues with things like the JSP tags, and this would certainly break backwards compatibility, so there's not much likelihood of this being implemented any time soon. I just prefer the model where less objects are put into the various scopes, and those objects are given more responsibility to manage references, instead of relying on well-known attribute names. Perhaps if you discuss some of the goals you are trying to achieve using multiple controllers, members of the list could help you come up with alternate solutions. Joe -- Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com Narrow minds are weapons made for mass destruction -The Ex - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Installation Getting Started Question
I am wanting to see how Struts may help in my J2EE development. I have purchased the O'Reilly book Jakarta Struts and want to get started with some examples. 1) I am currently running Tomcat 4.1.31 as a standalone. Can struts be installed with Tomcat as standalone? I saw somewhere in the install where it says to make sure you have Apache and Tomcat installed? Can someone help clear this up? 2) Is there a hello Struts example somewhere? Just to test the install/setup before I get under way? 3) The book does not start off simple either, so how can one get a handle on this effectively? My background is Servlets/JSP/ Web development. Including taglibs, ant, etc. Thanks, Scott
RE: Installation Getting Started Question
I am wanting to see how Struts may help in my J2EE development. I have purchased the O'Reilly book Jakarta Struts and want to get started with some examples. 1) I am currently running Tomcat 4.1.31 as a standalone. Can struts be installed with Tomcat as standalone? I saw somewhere in the install where it says to make sure you have Apache and Tomcat installed? Can someone help clear this up? Struts works fine under tomcat standalone. Note that if you upgrade to tomcat 5 you get to use EL anywhere in your jsp (not just in tags) so you can ditch bean:write, c:out tags. 2) Is there a hello Struts example somewhere? Just to test the install/setup before I get under way? There are loads of examples out there. Some come with struts: take a look in the webapps folder of the struts package. Or take a look at http://sourceforge.net/projects/struts/. There are some samples and some extsions to struts. 3) The book does not start off simple either, so how can one get a handle on this effectively? My background is Servlets/JSP/ Web development. Including taglibs, ant, etc. If you're up on java/servlets/jsp then just jump into the examples. Have a play with them and you'll quickly get a feel for how it all works. Daniel. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Installation Getting Started Question
1) Not sure if apache required. 2) Google for struts tutorial. You will find many simple apps to get you started and your configuration verified. 3) I started with the same book. You have to get through I think 3 chapters before you actual start writing an App! There might be some stuff in those first 3 chapters you will only understand after doing some Struts development. I suggest reading those chapters not worrying if you don't get something, then try one of the online tutorials to get some programming under your belt, then go back to the first three chapters and make sure you have answered most of your questions. That was my process and it worked well for me, and I am a relative newcomer to Servlet/JSP programming... Scott Purcell [EMAIL PROTECTED]To: [EMAIL PROTECTED] nc.com cc: Subject: Installation Getting Started Question 11/17/2004 10:09 AM Please respond to Struts Users Mailing List I am wanting to see how Struts may help in my J2EE development. I have purchased the O'Reilly book Jakarta Struts and want to get started with some examples. 1) I am currently running Tomcat 4.1.31 as a standalone. Can struts be installed with Tomcat as standalone? I saw somewhere in the install where it says to make sure you have Apache and Tomcat installed? Can someone help clear this up? 2) Is there a hello Struts example somewhere? Just to test the install/setup before I get under way? 3) The book does not start off simple either, so how can one get a handle on this effectively? My background is Servlets/JSP/ Web development. Including taglibs, ant, etc. Thanks, Scott - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: free struts boook
http://www.theserverside.com/books/sourcebeat/JakartaStrutsLive/index.tss Google is your friend :) /A -Original Message- From: Nishant [mailto:[EMAIL PROTECTED] Sent: November 17, 2004 9:51 AM To: Struts Users Mailing List Subject: free struts boook where do i get struts free book except strutslive Nishant Patil Software Engineer Cybage Software Pvt. Ltd. (A CMM Level 3 Company) West Avenue , Kalyani Nagar, Pune - 411 006 Tel: 91-20-4041700 -355 Email: [EMAIL PROTECTED] Website: www.cybage.com There's a difference between knowing the path, and walking the path - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: free struts boook
Check out www.theserverside.com On Wed, 17 Nov 2004 20:21:20 +0530, Nishant [EMAIL PROTECTED] wrote: where do i get struts free book except strutslive Nishant Patil Software Engineer Cybage Software Pvt. Ltd. (A CMM Level 3 Company) West Avenue , Kalyani Nagar, Pune - 411 006 Tel: 91-20-4041700 -355 Email: [EMAIL PROTECTED] Website: www.cybage.com There's a difference between knowing the path, and walking the path -- Regards, M. Onur Tokan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Installation Getting Started Question
Hey Scott, In practice, the Struts Distribution works like any other Servlet bases Web-App... Download struts and deploy the examples to tomcat (you do not necessarily require Apache, since struts is Servlet based technology)... in other words you really only need a Servlet Container... Good Luck /A -Original Message- From: Scott Purcell [mailto:[EMAIL PROTECTED] Sent: November 17, 2004 10:09 AM To: [EMAIL PROTECTED] Subject: Installation Getting Started Question I am wanting to see how Struts may help in my J2EE development. I have purchased the O'Reilly book Jakarta Struts and want to get started with some examples. 1) I am currently running Tomcat 4.1.31 as a standalone. Can struts be installed with Tomcat as standalone? I saw somewhere in the install where it says to make sure you have Apache and Tomcat installed? Can someone help clear this up? 2) Is there a hello Struts example somewhere? Just to test the install/setup before I get under way? 3) The book does not start off simple either, so how can one get a handle on this effectively? My background is Servlets/JSP/ Web development. Including taglibs, ant, etc. Thanks, Scott - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Pre-populate form
From: Roland Carlsson [EMAIL PROTECTED] When you say that the newinsurance.jsp just see it where do you store it? In request.setAttribute() with some key? Session? You don't have to store it anywhere... it's already there. In the 'execute' method signature, you are given a _reference_ to the Form bean which is already sitting where ever it belongs based on your configuration. Just use it, set whatever properties you need to and then forward to the appropriate JSP. -- Wendy Smoak - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Validation resources in another bundle
Hi all, I'm trying to use an alternative message resource to display errors after the validate process. I set in the validation.xml the following element: field property=siteuser.siteusername depends=required arg key=label_username bundle=loginResources position=0 / /field It doesn't work and I have the suspect that the bundle attribute is completely ignored. Can anyone help me? Thanks aris. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] User Preference System Design
I would say that 'system' level configurations(applying to all users) could easily be handled with XML files or properties files. User preferences, since they are tied to a specific user, IMO belong in the database, probably in a user preferences table. I know XML is a popular choice - you could create a seperate folder, for each user, to hold user settings (like a preferences.xml file), or you could store all user info in one monolithic file. I don't much like either of these approaches. I prefer to store application-specific configurations in the database, using 'codelist' tables. I wrote an article about it a few months ago, have a look if you want: http://www.developer.com/db/article.php/3413151 I wrote an app where I stored all preferences in codelist tables. Then, I had a user_preferences table that, instead of referencing a preference_id in a preference table, referenced a preference in a codelist name which was about 5 characters in length. Mike Daniel Perry [EMAIL PROTECTED] wrote: The most common way to store more than one element in a properties file is to have more than one entry like the following: colour.count=3 colour.0=red colour.1=green colour.2=blue So your code loads the property for colour.count and loops through the other properties. Not very elegant, but it works. Daniel. -Original Message- From: Julian [mailto:[EMAIL PROTECTED] Sent: 17 November 2004 14:08 To: Struts Users Mailing List Subject: Re: [OT] User Preference System Design Hi, Thanks for the input. The Properties object is more inline with what I was thinking. The problem with it however, is that there can only be one key/value pair. I see no ability to have one key with multiple pairs other than doing comma delimitation. This is why XML was chosen originally. The problem with it now is that it is not stored in an RDBMS, and I am unaware of the scalability of a user preferences system based on XML. Comments/Suggestions? Thanks again, Julian --- Erik Weber wrote: I like java.util.Properties, or, if Strings aren't good enough, another wrapper for a Map that allows put/get of Objects but that uses a hierarchical default system like Properties does. Properties has built in load/save methods that you can use to store your properties on disk until you move them to a RDBMS. Base user has colors A, B, C. Next higher user needs to have a different color A but inherit colors B and C. Create his properties with the Base user properties as the default, then just put the new property A. Works nicely for that sort of thing. Erik Julian wrote: Hi, I am a Struts Newbie and would appreciate if anyone could give me some pointers on a user preferences/ configuration system design. Perhaps a link to a good resource? I have an ASP system with several levels of users that are as broad as an organization and as fine-grained as an individual person with one role. I would like to have a preference system that can handle configuration and preference issues for the different levels of the application. The information stored in these configurations range from font colors and alert boxes to the availability of various modules in the web application. Currently the information is stored in xml files on the server's hard disk, but this will not suit a distributable environment. Any suggestions are greatly appreciated. Thanks in Advance, Julian = Live simply so others may simply live. -Ghandi Pluralitas non est ponenda sine neccesitate. Entities should not be multiplied unneccesarily -William of Occam __ Do you Yahoo!? The all-new My Yahoo! - Get yours free! http://my.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] = Live simply so others may simply live. -Ghandi Pluralitas non est ponenda sine neccesitate. Entities should not be multiplied unneccesarily -William of Occam __ 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] - Do you Yahoo!? The all-new My Yahoo! Get yours free!
Re: [OT] User Preference System Design
if JDK 1.4 is an option you might want to take a look at: java.util.prefs.* HTH. ATTA On Tue, 16 Nov 2004 19:09:55 -0800 (PST), Julian [EMAIL PROTECTED] wrote: Hi, I am a Struts Newbie and would appreciate if anyone could give me some pointers on a user preferences/ configuration system design. Perhaps a link to a good resource? I have an ASP system with several levels of users that are as broad as an organization and as fine-grained as an individual person with one role. I would like to have a preference system that can handle configuration and preference issues for the different levels of the application. The information stored in these configurations range from font colors and alert boxes to the availability of various modules in the web application. Currently the information is stored in xml files on the server's hard disk, but this will not suit a distributable environment. Any suggestions are greatly appreciated. Thanks in Advance, Julian = Live simply so others may simply live. -Ghandi Pluralitas non est ponenda sine neccesitate. Entities should not be multiplied unneccesarily -William of Occam __ Do you Yahoo!? The all-new My Yahoo! - Get yours free! http://my.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: Error running CactusStrutsTest case with an ExtendedActionServlet instead of ActionServlet
But it is there because we are running this app in production already as a EAR. But now when I introduced cactus, it breaks just on the tests. Not actually running the application. Mick Knutson Wells Fargo Business Direct (415) 222-1020 This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. -Original Message- From: news [mailto:[EMAIL PROTECTED] Behalf Of Bill Siggelkow Sent: Tuesday, November 16, 2004 6:53 PM To: [EMAIL PROTECTED] Subject: Re: Error running CactusStrutsTest case with an ExtendedActionServlet instead of ActionServlet Hmm .. the NoClassDefFoundError would indicate that the struts.jar is not included in your WEB-INF/lib. [EMAIL PROTECTED] wrote: Any help with this please... We extended our actionServlet with ExtendedActionServlet and when I tried to run my test from a browser in this fashion: http://localhost:8080/ServletTestRunner?xsl=cactus-report.xslsuite=com.wf.bd.ice.creditapplication.CreditapplicationSuite I got this error: -- javax.servlet.ServletException: Failed to load test suite [com.wf.bd.ice.creditapplication.CreditapplicationSuite], Reason is [Failed to invoke suite():java.lang.NoClassDefFoundError: org/apache/struts/action/ActionServlet] at org.apache.cactus.server.runner.ServletTestRunner.run(ServletTestRunner.java:309) at org.apache.cactus.server.runner.ServletTestRunner.doGet_aroundBody0(ServletTestRunner.java:193) at org.apache.cactus.server.runner.ServletTestRunner.doGet_aroundBody1$advice(ServletTestRunner.java:117) at org.apache.cactus.server.runner.ServletTestRunner.doGet(ServletTestRunner.java) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:971) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:402) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6350) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118) at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3635) at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2585) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170) Mick Knutson Wells Fargo Business Direct Information Systems (415) 222-1020 This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. - 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: Installation Getting Started Question
http://wiki.apache.org/struts/StrutsArticles The second site (Struttin' With Struts) is one of my favorites because it gets right into the examples. Erik Scott Purcell wrote: I am wanting to see how Struts may help in my J2EE development. I have purchased the O'Reilly book Jakarta Struts and want to get started with some examples. 1) I am currently running Tomcat 4.1.31 as a standalone. Can struts be installed with Tomcat as standalone? I saw somewhere in the install where it says to make sure you have Apache and Tomcat installed? Can someone help clear this up? 2) Is there a hello Struts example somewhere? Just to test the install/setup before I get under way? 3) The book does not start off simple either, so how can one get a handle on this effectively? My background is Servlets/JSP/ Web development. Including taglibs, ant, etc. Thanks, Scott - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Localised validation
Hi, I am trying to write a multi-language system which will accept localised input in one of 2 countries, namely Austria and England (and later Italy). The problem is that of trying to validate and also to convert input. I would like to be able to validate dates and numbers using the built-in standard validator-rules (eg 'double' via org.apache.struts.validator.FieldChecks.validateDouble). Using the date validator means I just need to set a new datePatternStrict which is easily done using localised formsets with different constants. However the double formatting falls over on valid Austrian prices (eg 5,99), since there is no localisation in this check. Since my application is now rather large and has all been coded for the UK so far I don't want to have to add conversion in all my ActionForms or to change all my validation to masks! To get around putting conversion in the ActionForms I am currently subclassing the RequestProcessor to translate (according to some config) locale specific formats to UK formats. However, as I want any invalid input to be picked up by the validator framework which I am currently using, I do this after the call to processValidate(). Is there a better way to do this input translation which would be quick but yet clean to implement? And is there anyway to make the validator framework locale aware, apart from writing my own checks or using masks? Thanks Dave The information contained in this e-mail is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. If You are not the intended recipient of this e-mail, the use of this information or any disclosure, copying or distribution is Prohibited and may be unlawful. If you received this in error, please contact the sender and delete the material from any computer. The views expressed in this e-mail may not necessarily be the views of The PCMS Group plc and should not be taken as authority to carry out any instruction contained.
RE: Question regarding filters in html-tags
René, By +1, I meant I would vote to add filter=true/false to the html:text and html:textarea tags as well. So, when you write you are using regular html tags, are you using a tag with bean write, like this: html type=text name=input value=bean:write filter=false name=beanName property=propertyName/ / Regards, David -Original Message- From: René Thol [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 17, 2004 1:41 AM To: Struts Users Mailing List Subject: Re: Question regarding filters in html-tags Hello David, David G. Friedman schrieb: I just skimmed over the SVN code repository for both html:text and html:textarea tags and it looks like it automatically behaves like a filter=true with no option to set it differently. You could always go to bugzilla and request a modification. I skimmed through the bean:write tag and implementing it looks trivial. If you do that, let me know so I can +1: I think I'm going to need unfiltered html:textareas very soon as I'm adding FcKEditor(.net's) to my webapp. ATM I'm replacing the non-working struts-tags by their plain HTML counterparts. I also mulled over implementing the tags by myself, but decided to go the easier way! };-[) Fortunately the struts setters are as well served using plain HTML tags. Please forgive my ignorance but what do you mean by I can +1 ? (do you mean as well?) Best regards -- René Thol 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]
RequestProcessor processRoles question!
For the first time, in struts application development I'm using roles attribute from action-mapping. I found something weird in method processRoles on the class RequestProcessor: response.sendError(HttpServletResponse.SC_BAD_REQUEST, getInternal().getMessage(notAuthorized, mapping.getPath())); IMHO it will be more correct to send a HttpServletResponse.SC_UNAUTHORIZED. BTW, I'm using struts 1.1 What do you think? What was the reason to send BAD_REQUEST (error code 400) instead of UNAUTHORIZED (error code 401)? Thanks in advance, João - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Using constants for form property names.
Hi All, I have found all sorts of ways to use constants for messages in struts, but no one seems to address the issue of property names. A simple example will make it clearer. I want to use constants for my property names. In my jsp I have the following code: html:checkbox property=%=Keys.APPLICANT_FULLNAME_CHINESE_NA% onclick=clearAndDisable(this, '%=Keys.APPLICANT_FULLNAME_CHINESE_NA%'); N/A /html:checkbox The above jsp code does not work because it is rendered as follows: input name=applicantFullNameChineseNA value=on onclick=clearAndDisable(this, '%=Keys.APPLICANT_FULLNAME_CHINESE_NA%'); type=checkboxN/A The first expression for 'property' is evaluated. The second is rendered literally. My questions are: 1. Is this a bug? 2. Is this the right way to go about using constants for property names? Many thanks. -Miles Miles Daffin Morgan Stanley 20 Cabot Square | Canary Wharf | London E14 4QA | UK Tel: +44 (0) 20 767 75119 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] NOTICE: If received in error, please destroy and notify sender. Sender does not waive confidentiality or privilege, and use is prohibited. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] User Preference System Design
Michael, Very informative article. What are your thoughts on storing user preferences as xml in a user preferences table? I think your approach would work well, but I alreay have code for parsing XML files. Ultimately, I would like the benefits of storing this data in a database (security, scalability, distributable), but also the benefits of XML hierachies (1...* relationships, code generation tools). Thanks, Julian --- Michael Klaene [EMAIL PROTECTED] wrote: I would say that 'system' level configurations(applying to all users) could easily be handled with XML files or properties files. User preferences, since they are tied to a specific user, IMO belong in the database, probably in a user preferences table. I know XML is a popular choice - you could create a seperate folder, for each user, to hold user settings (like a preferences.xml file), or you could store all user info in one monolithic file. I don't much like either of these approaches. I prefer to store application-specific configurations in the database, using 'codelist' tables. I wrote an article about it a few months ago, have a look if you want: http://www.developer.com/db/article.php/3413151 I wrote an app where I stored all preferences in codelist tables. Then, I had a user_preferences table that, instead of referencing a preference_id in a preference table, referenced a preference in a codelist name which was about 5 characters in length. Mike Daniel Perry [EMAIL PROTECTED] wrote: The most common way to store more than one element in a properties file is to have more than one entry like the following: colour.count=3 colour.0=red colour.1=green colour.2=blue So your code loads the property for colour.count and loops through the other properties. Not very elegant, but it works. Daniel. -Original Message- From: Julian [mailto:[EMAIL PROTECTED] Sent: 17 November 2004 14:08 To: Struts Users Mailing List Subject: Re: [OT] User Preference System Design Hi, Thanks for the input. The Properties object is more inline with what I was thinking. The problem with it however, is that there can only be one key/value pair. I see no ability to have one key with multiple pairs other than doing comma delimitation. This is why XML was chosen originally. The problem with it now is that it is not stored in an RDBMS, and I am unaware of the scalability of a user preferences system based on XML. Comments/Suggestions? Thanks again, Julian --- Erik Weber wrote: I like java.util.Properties, or, if Strings aren't good enough, another wrapper for a Map that allows put/get of Objects but that uses a hierarchical default system like Properties does. Properties has built in load/save methods that you can use to store your properties on disk until you move them to a RDBMS. Base user has colors A, B, C. Next higher user needs to have a different color A but inherit colors B and C. Create his properties with the Base user properties as the default, then just put the new property A. Works nicely for that sort of thing. Erik Julian wrote: Hi, I am a Struts Newbie and would appreciate if anyone could give me some pointers on a user preferences/ configuration system design. Perhaps a link to a good resource? I have an ASP system with several levels of users that are as broad as an organization and as fine-grained as an individual person with one role. I would like to have a preference system that can handle configuration and preference issues for the different levels of the application. The information stored in these configurations range from font colors and alert boxes to the availability of various modules in the web application. Currently the information is stored in xml files on the server's hard disk, but this will not suit a distributable environment. Any suggestions are greatly appreciated. Thanks in Advance, Julian = Live simply so others may simply live. -Ghandi Pluralitas non est ponenda sine neccesitate. Entities should not be multiplied unneccesarily -William of Occam __ Do you Yahoo!? The all-new My Yahoo! - Get yours free! http://my.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] = Live simply so others may simply live. -Ghandi Pluralitas non est ponenda sine neccesitate. Entities should not be multiplied
RE: Using constants for form property names.
When using RT expressions as attribute values the whole attribute must be a single RT: html:checkbox property=%=Keys.APPLICANT_FULLNAME_CHINESE_NA% onclick=%=clearAndDisable(this,' + Keys.APPLICANT_FULLNAME_CHINESE_NA + ');% N/A /html:checkbox Paul -Original Message- From: Daffin, Miles (Company IT) [mailto:[EMAIL PROTECTED] Sent: 17 November 2004 17:03 To: [EMAIL PROTECTED] Subject: Using constants for form property names. Hi All, I have found all sorts of ways to use constants for messages in struts, but no one seems to address the issue of property names. A simple example will make it clearer. I want to use constants for my property names. In my jsp I have the following code: html:checkbox property=%=Keys.APPLICANT_FULLNAME_CHINESE_NA% onclick=clearAndDisable(this, '%=Keys.APPLICANT_FULLNAME_CHINESE_NA%'); N/A /html:checkbox The above jsp code does not work because it is rendered as follows: input name=applicantFullNameChineseNA value=on onclick=clearAndDisable(this, '%=Keys.APPLICANT_FULLNAME_CHINESE_NA%'); type=checkboxN/A The first expression for 'property' is evaluated. The second is rendered literally. My questions are: 1. Is this a bug? 2. Is this the right way to go about using constants for property names? Many thanks. -Miles Miles Daffin Morgan Stanley 20 Cabot Square | Canary Wharf | London E14 4QA | UK Tel: +44 (0) 20 767 75119 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] NOTICE: If received in error, please destroy and notify sender. Sender does not waive confidentiality or privilege, and use is prohibited. - 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: Pre-populate form
The ActionForm you specified in your ActionMapping in struts-config.xml under the name attribute, e.g. logonForm, is available to you in the execute method. Just cast your ActionForm parameter to the particular form you used with the Action, e.g., if you have public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) And if your ActionForm is LogonForm, then LogonForm logonForm = (LogonForm)form; gives you the ActionForm to set as you desire. Cool, eh? Struts is wonderful. Why people hate ActionForms is beyond me. I love them. Jack On Wed, 17 Nov 2004 08:33:59 -0700, Wendy Smoak [EMAIL PROTECTED] wrote: From: Roland Carlsson [EMAIL PROTECTED] When you say that the newinsurance.jsp just see it where do you store it? In request.setAttribute() with some key? Session? You don't have to store it anywhere... it's already there. In the 'execute' method signature, you are given a _reference_ to the Form bean which is already sitting where ever it belongs based on your configuration. Just use it, set whatever properties you need to and then forward to the appropriate JSP. -- Wendy Smoak - 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: RequestProcessor processRoles question!
Among other reasons, sending SC_UNAUTHORIZED would trigger the popup dialog for basic authentication -- that's not what we really want to have happen, since we know who the user is; she's just not allowed to access this particular action. Craig On Wed, 17 Nov 2004 16:58:33 +, João Vieira da Luz [EMAIL PROTECTED] wrote: For the first time, in struts application development I'm using roles attribute from action-mapping. I found something weird in method processRoles on the class RequestProcessor: response.sendError(HttpServletResponse.SC_BAD_REQUEST, getInternal().getMessage(notAuthorized, mapping.getPath())); IMHO it will be more correct to send a HttpServletResponse.SC_UNAUTHORIZED. BTW, I'm using struts 1.1 What do you think? What was the reason to send BAD_REQUEST (error code 400) instead of UNAUTHORIZED (error code 401)? Thanks in advance, João - 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]
Nested properties with javascript
Hi, In my jsp, i am using nested properties of a form. RoleForm has UserForm which has agencies, agencyName and agencyId within it. The agencies and divisions need to be displayed in dropdown boxes. I got this to display correctly on my jsp using: html:select property=userForm.agencyId onchange=fillSelect(this.form) html:option key=select.generic value= / html:optionsCollection property=userForm.agencies value=agencyId label=agencyName / /html:select However, in the javascript for the onChange of this dropdown, i need a handle to this dropdown. the fillSelect function needs to do: function fillSelect(el) { var theSelect = el.agencyId; // == How do i get the dropdown handle here? var num = theSelect.options[theSelect.selectedIndex].value; : : // more procesing } With the above, i get the error: theSelect has no properties. If i put in var theSelect = el.userForm.agencyId, i get the error: el.userForm has no properties. What would be the correct way to access the dropdown box? Any help appreciated. Thanks, Dhanashree.
Re: Nested properties with javascript
The form propert will be whatever is rendered in the name attribute. Try this. function fillSelect(myform) { theSelect = myform.elements['userForm.agencyId']; On Wed, 17 Nov 2004 11:24:36 -0600, Apte, Dhanashree (Noblestar) [EMAIL PROTECTED] wrote: Hi, In my jsp, i am using nested properties of a form. RoleForm has UserForm which has agencies, agencyName and agencyId within it. The agencies and divisions need to be displayed in dropdown boxes. I got this to display correctly on my jsp using: html:select property=userForm.agencyId onchange=fillSelect(this.form) html:option key=select.generic value= / html:optionsCollection property=userForm.agencies value=agencyId label=agencyName / /html:select However, in the javascript for the onChange of this dropdown, i need a handle to this dropdown. the fillSelect function needs to do: function fillSelect(el) { var theSelect = el.agencyId; // == How do i get the dropdown handle here? var num = theSelect.options[theSelect.selectedIndex].value; : : // more procesing } With the above, i get the error: theSelect has no properties. If i put in var theSelect = el.userForm.agencyId, i get the error: el.userForm has no properties. What would be the correct way to access the dropdown box? Any help appreciated. Thanks, Dhanashree. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Nested properties with javascript
In fact.. Looks like you may want to do this html:select property=agencyId .. then in js.. theSelect = myform.elements['agencyId']; or myForm.agencyId On Wed, 17 Nov 2004 18:29:14 +0100, Mark Lowe [EMAIL PROTECTED] wrote: The form propert will be whatever is rendered in the name attribute. Try this. function fillSelect(myform) { theSelect = myform.elements['userForm.agencyId']; On Wed, 17 Nov 2004 11:24:36 -0600, Apte, Dhanashree (Noblestar) [EMAIL PROTECTED] wrote: Hi, In my jsp, i am using nested properties of a form. RoleForm has UserForm which has agencies, agencyName and agencyId within it. The agencies and divisions need to be displayed in dropdown boxes. I got this to display correctly on my jsp using: html:select property=userForm.agencyId onchange=fillSelect(this.form) html:option key=select.generic value= / html:optionsCollection property=userForm.agencies value=agencyId label=agencyName / /html:select However, in the javascript for the onChange of this dropdown, i need a handle to this dropdown. the fillSelect function needs to do: function fillSelect(el) { var theSelect = el.agencyId; // == How do i get the dropdown handle here? var num = theSelect.options[theSelect.selectedIndex].value; : : // more procesing } With the above, i get the error: theSelect has no properties. If i put in var theSelect = el.userForm.agencyId, i get the error: el.userForm has no properties. What would be the correct way to access the dropdown box? Any help appreciated. Thanks, Dhanashree. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] User Preference System Design
Why don't you just use a database? Am I missing something? Why XML, properties files, etc.? Jack On Wed, 17 Nov 2004 10:44:04 +, Adam Hardy [EMAIL PROTECTED] wrote: Hi Julian, you should take a look at CMS (container-managed security) as this is probably the most effective solution - integrated, portable, widespread etc. Try either tomcat's website for documentation there, or even look in the servlet spec from Sun, or in your appserver's docs, to see if it suits your needs. Struts has many features that allows you to leverage CMS in the ways you say you require. Persistence of your user info groups or roles etc is done under CMS in whichever way you choose - there are various 'realm' implementations which allow database stores, XML files, LDAP or bespoke solutions. HTH Adam On 11/17/2004 03:09 AM Julian wrote: Hi, I am a Struts Newbie and would appreciate if anyone could give me some pointers on a user preferences/ configuration system design. Perhaps a link to a good resource? I have an ASP system with several levels of users that are as broad as an organization and as fine-grained as an individual person with one role. I would like to have a preference system that can handle configuration and preference issues for the different levels of the application. The information stored in these configurations range from font colors and alert boxes to the availability of various modules in the web application. Currently the information is stored in xml files on the server's hard disk, but this will not suit a distributable environment. Any suggestions are greatly appreciated. Thanks in Advance, Julian = Live simply so others may simply live. -Ghandi Pluralitas non est ponenda sine neccesitate. Entities should not be multiplied unneccesarily -William of Occam - 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: [OT] User Preference System Design
You received several answers about security, but that is not what you want, right? You want to be able to set and to deliver user preferences. As part of any suggestion about how you should do this, one would need to know what the app is all about. Different solutions for different problems is key, no? Jack On 11/17/2004 03:09 AM Julian wrote: Hi, I am a Struts Newbie and would appreciate if anyone could give me some pointers on a user preferences/ configuration system design. Perhaps a link to a good resource? I have an ASP system with several levels of users that are as broad as an organization and as fine-grained as an individual person with one role. I would like to have a preference system that can handle configuration and preference issues for the different levels of the application. The information stored in these configurations range from font colors and alert boxes to the availability of various modules in the web application. Currently the information is stored in xml files on the server's hard disk, but this will not suit a distributable environment. Any suggestions are greatly appreciated. Thanks in Advance, Julian = Live simply so others may simply live. -Ghandi Pluralitas non est ponenda sine neccesitate. Entities should not be multiplied unneccesarily -William of Occam - 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: [OT] User Preference System Design
Why not do both and use XML database like Apache Xindice? http://xml.apache.org/xindice/ Regards, David -Original Message- From: Dakota Jack [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 17, 2004 12:33 PM To: Struts Users Mailing List Subject: Re: [OT] User Preference System Design Why don't you just use a database? Am I missing something? Why XML, properties files, etc.? Jack On Wed, 17 Nov 2004 10:44:04 +, Adam Hardy [EMAIL PROTECTED] wrote: Hi Julian, you should take a look at CMS (container-managed security) as this is probably the most effective solution - integrated, portable, widespread etc. Try either tomcat's website for documentation there, or even look in the servlet spec from Sun, or in your appserver's docs, to see if it suits your needs. Struts has many features that allows you to leverage CMS in the ways you say you require. Persistence of your user info groups or roles etc is done under CMS in whichever way you choose - there are various 'realm' implementations which allow database stores, XML files, LDAP or bespoke solutions. HTH Adam On 11/17/2004 03:09 AM Julian wrote: Hi, I am a Struts Newbie and would appreciate if anyone could give me some pointers on a user preferences/ configuration system design. Perhaps a link to a good resource? I have an ASP system with several levels of users that are as broad as an organization and as fine-grained as an individual person with one role. I would like to have a preference system that can handle configuration and preference issues for the different levels of the application. The information stored in these configurations range from font colors and alert boxes to the availability of various modules in the web application. Currently the information is stored in xml files on the server's hard disk, but this will not suit a distributable environment. Any suggestions are greatly appreciated. Thanks in Advance, Julian = Live simply so others may simply live. -Ghandi Pluralitas non est ponenda sine neccesitate. Entities should not be multiplied unneccesarily -William of Occam - 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]
Struts 1.2.4 validator is not working
Can somebody let me know any workaround for the following error? Latest struts download version 1.2.4 validator has following error This error is thrown on following line in JSP. html:javascript formName=myForm page=1 dynamicJavascript=true / I am using latest download so that I can use ValidWhen functionality. Am I the only one who is getting this error with the latest download? java.lang.NullPointerException at org.apache.struts.validator.Resources.getMessage(Resources.java:173) at org.apache.struts.taglib.html.JavascriptValidatorTag.createDynamicJavasc ript(JavascriptValidatorTag.java:464) at org.apache.struts.taglib.html.JavascriptValidatorTag.renderJavascript(Ja vascriptValidatorTag.java:373) at org.apache.struts.taglib.html.JavascriptValidatorTag.doStartTag(Javascri ptValidatorTag.java:335) Thanks Ganesh - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Validation resources in another bundle
This has already been raised as an issue in the following bugzilla ticket: http://issues.apache.org/bugzilla/show_bug.cgi?id=21760 Currently the bundle attribute on both the Arg and Msg elements in the validator dtd are ignored, as well as the resource property on the Msg element. The reason for this, is that although they are in the validator dtd - there was actually no way to access these properties. I have just changed Commons Validator and there is currently a new Version 1.1.4 (Alpha) available for download and testing, details are here: http://article.gmane.org/gmane.comp.jakarta.struts.user/96384 This doesn't re-solve this issue, but we need a proper GA quality release of Commons Validator before we can make the appropriate changes in Struts to fix this issue - any help with people trying out the new version of Commons and feeding back their experience will al help to make a GA version arrive sooner :-) Niall - Original Message - From: aris [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, November 17, 2004 3:57 PM Subject: Validation resources in another bundle Hi all, I'm trying to use an alternative message resource to display errors after the validate process. I set in the validation.xml the following element: field property=siteuser.siteusername depends=required arg key=label_username bundle=loginResources position=0 / /field It doesn't work and I have the suspect that the bundle attribute is completely ignored. Can anyone help me? Thanks aris. - 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 1.2.4 validator is not working
Check out the upgrade notes here... http://wiki.apache.org/struts/StrutsUpgradeNotes11to124 My guess is you used to have your messages resources configured through the web.xml - this was considered deprecated in Struts 1.1 and has been removed from Struts 1.2.x You need to configure them int the struts-config.xml using the message-resources element Niall - Original Message - From: Yadav, Ganesh [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, November 17, 2004 5:44 PM Subject: Struts 1.2.4 validator is not working Can somebody let me know any workaround for the following error? Latest struts download version 1.2.4 validator has following error This error is thrown on following line in JSP. html:javascript formName=myForm page=1 dynamicJavascript=true / I am using latest download so that I can use ValidWhen functionality. Am I the only one who is getting this error with the latest download? java.lang.NullPointerException at org.apache.struts.validator.Resources.getMessage(Resources.java:173) at org.apache.struts.taglib.html.JavascriptValidatorTag.createDynamicJavasc ript(JavascriptValidatorTag.java:464) at org.apache.struts.taglib.html.JavascriptValidatorTag.renderJavascript(Ja vascriptValidatorTag.java:373) at org.apache.struts.taglib.html.JavascriptValidatorTag.doStartTag(Javascri ptValidatorTag.java:335) Thanks Ganesh - 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: [OT] User Preference System Design
Comments inline: --- Dakota Jack [EMAIL PROTECTED] wrote: You received several answers about security, but that is not what you want, right? You want to be able to set and to deliver user preferences. Exactly. As part of any suggestion about how you should do this, one would need to know what the app is all about. Different solutions for different problems is key, no? There are two types of data that I would want to access. One is user preferences and the other is user's application configuration. The preferences would include information about alert boxes, GUI skins, favorites information. The favorites information is related to the data that entered into frequently filed out forms (enabling the user to quickly auto-fill a form). The application configuration indicates what functionalities of the application are available for a particular user. A user would be able to inherit configurations and preferences from the group they belong to based on their role(s - this is a one-to-many relationship - 1 user --- * role(s)). The group would in turn inherit from the organization's (global) configurations and preferences. There are several organizations, each isolated from another, so the configurations would have to be uniquely associated with an organization and inspected at runtime. I currently am loading XML configs directly from the file system, but this will not work in a distributed environment serving several independent organizations. Users will be able to update some of the information in these configurations and preferences. Thanks a ton. Julian __ 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: [OT] User Preference System Design
I forgot to mention: 1) I cannot use Xindice since I do not feel it is viable. 2) I expect to have thousands of users with a moderate load. 3) I am leaning towards Michael's suggestion: http://www.developer.com/db/print.php/10920_3413151_1 Comment appreciated :) Thanks again, Julian __ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Using constants for form property names.
Paul, Thanks. This worked. Where is this fact documented? -Miles -Original Message- From: Paul McCulloch [mailto:[EMAIL PROTECTED] Sent: 17 November 2004 17:16 To: 'Struts Users Mailing List' Subject: RE: Using constants for form property names. When using RT expressions as attribute values the whole attribute must be a single RT: html:checkbox property=%=Keys.APPLICANT_FULLNAME_CHINESE_NA% onclick=%=clearAndDisable(this,' + Keys.APPLICANT_FULLNAME_CHINESE_NA + ');% N/A /html:checkbox Paul -Original Message- From: Daffin, Miles (Company IT) [mailto:[EMAIL PROTECTED] Sent: 17 November 2004 17:03 To: [EMAIL PROTECTED] Subject: Using constants for form property names. Hi All, I have found all sorts of ways to use constants for messages in struts, but no one seems to address the issue of property names. A simple example will make it clearer. I want to use constants for my property names. In my jsp I have the following code: html:checkbox property=%=Keys.APPLICANT_FULLNAME_CHINESE_NA% onclick=clearAndDisable(this, '%=Keys.APPLICANT_FULLNAME_CHINESE_NA%'); N/A /html:checkbox The above jsp code does not work because it is rendered as follows: input name=applicantFullNameChineseNA value=on onclick=clearAndDisable(this, '%=Keys.APPLICANT_FULLNAME_CHINESE_NA%'); type=checkboxN/A The first expression for 'property' is evaluated. The second is rendered literally. My questions are: 1. Is this a bug? 2. Is this the right way to go about using constants for property names? Many thanks. -Miles Miles Daffin Morgan Stanley 20 Cabot Square | Canary Wharf | London E14 4QA | UK Tel: +44 (0) 20 767 75119 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] NOTICE: If received in error, please destroy and notify sender. Sender does not waive confidentiality or privilege, and use is prohibited. - 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] NOTICE: If received in error, please destroy and notify sender. Sender does not waive confidentiality or privilege, and use is prohibited. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Web Site vs Web Application
I'm interested in implementing the Struts and Tiles frameworks for a web site (moving slowly toward web application). Is it possible, or even recommended to design something similar to the following for the static portions of a web site. Assume Tiles have been defined to provide a common site wrapper. What's left is to select the body (jsp or Tile). Do this by defining a layout that will provide the site wrapper and receive that content/body (page or Tile) as a parameter. Then a generic action could grab the page requested from URL and put into common scope. The layout would grab the requested page name from the common scope and result in the requested page. An approach like this seems to simplify the adding of new content pages by eliminating configuration for tiles and struts. It seems this would also help when implementing a content management system that would simply add the content (body) portion of these pages. For example, once a body was added to the site, a request for that page would be successful with no additional configuration. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] User Preference System Design
I'd like to learn more about storing XML in the database myself. I really haven't had much experience there so I couldn't say if it is beneficial or not. I started out as a database developer so I tend to rely heavily on the database for a number of things, system prefs being one of those things. Oracle( as I'm sure other vendors do as well) uses 'codelist' tables for storing a great deal of application metadata and I've always liked that approach. As I said, I wrote/am still writing a system where I define codelists that define different preferences ('show_x', 'hide_a'). A user preferences table contains user_id, but also columns name and value which would include 'show_x'/'true', 'hide_a'/'false'). Mike Julian [EMAIL PROTECTED] wrote: I forgot to mention: 1) I cannot use Xindice since I do not feel it is viable. 2) I expect to have thousands of users with a moderate load. 3) I am leaning towards Michael's suggestion: http://www.developer.com/db/print.php/10920_3413151_1 Comment appreciated :) Thanks again, Julian __ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? The all-new My Yahoo! Get yours free!
RE: Web Site vs Web Application
Allan, If you are simply selecting the body while the whole site has the same wrapper, why use SiteMesh? It is a filter which wraps anything matching specific patterns (could be *.jsp, *.html, or even /someSection/* which needs it's own look such as a cross site agreement) and kicks it out with it's own wrapping JSP yet your body. Bodies may also be nested depending on the template. Take a look at it at: http://www.opensymphony.com/sitemesh/ With Tiles, you could always make every page invoke one specific tile which lists a Tile(s?)Controller in the definition. That definition could parse the URI (or pull the name from a scope bean created by your action) and insert the appropriate center tile for you. I'd recommend extending org.apache.struts.tiles.ControllerSupport. For what you described, I do not recommend making your actions subclass TilesAction because you would have much more work than simply implementing a TilesController in your particular template. See tiles controllers starting in section 5.2.1 of the Tiles Advanced Features (link at bottom of this page: http://struts.apache.org/userGuide/dev_tiles.html). I'm sure you will get other interesting suggestions and opinions. :) Regards, David -Original Message- From: Tait, Allen [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 17, 2004 1:34 PM To: 'Struts Users Mailing List' Subject: Web Site vs Web Application I'm interested in implementing the Struts and Tiles frameworks for a web site (moving slowly toward web application). Is it possible, or even recommended to design something similar to the following for the static portions of a web site. Assume Tiles have been defined to provide a common site wrapper. What's left is to select the body (jsp or Tile). Do this by defining a layout that will provide the site wrapper and receive that content/body (page or Tile) as a parameter. Then a generic action could grab the page requested from URL and put into common scope. The layout would grab the requested page name from the common scope and result in the requested page. An approach like this seems to simplify the adding of new content pages by eliminating configuration for tiles and struts. It seems this would also help when implementing a content management system that would simply add the content (body) portion of these pages. For example, once a body was added to the site, a request for that page would be successful with no additional configuration. - 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: [OT] User Preference System Design
Hey Michael, Thanks for the input, you've offered me some great insight. I was wondering if you may know a good resource that discusses database design patterns like the codelist or a line table? Otherwise, afaik I have stored XML in the database and it's great if you just transform it to an outputstream. However, trying to make some decisions based on the xml requires parsing into the application's domain model. This issue concerns me when it comes to using XML for user preferences. It sounds like your approach may be more scalable. Ok, I have to think about it. thanks again, Julian --- Michael Klaene [EMAIL PROTECTED] wrote: I'd like to learn more about storing XML in the database myself. I really haven't had much experience there so I couldn't say if it is beneficial or not. I started out as a database developer so I tend to rely heavily on the database for a number of things, system prefs being one of those things. Oracle( as I'm sure other vendors do as well) uses 'codelist' tables for storing a great deal of application metadata and I've always liked that approach. As I said, I wrote/am still writing a system where I define codelists that define different preferences ('show_x', 'hide_a'). A user preferences table contains user_id, but also columns name and value which would include 'show_x'/'true', 'hide_a'/'false'). Mike Julian [EMAIL PROTECTED] wrote: I forgot to mention: 1) I cannot use Xindice since I do not feel it is viable. 2) I expect to have thousands of users with a moderate load. 3) I am leaning towards Michael's suggestion: http://www.developer.com/db/print.php/10920_3413151_1 Comment appreciated :) Thanks again, Julian __ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? The all-new My Yahoo! Get yours free! = Live simply so others may simply live. -Ghandi Pluralitas non est ponenda sine neccesitate. Entities should not be multiplied unneccesarily -William of Occam __ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] User Preference System Design
I don't know of any resources like this, but I'm sure there are database books which detail the use of tables to help configure code. Like I said, I based my own tables off of what I've seen Oracle do, but there's probably a lot of variations on the same concept. Mike Julian [EMAIL PROTECTED] wrote: Hey Michael, Thanks for the input, you've offered me some great insight. I was wondering if you may know a good resource that discusses database design patterns like the codelist or a line table? Otherwise, afaik I have stored XML in the database and it's great if you just transform it to an outputstream. However, trying to make some decisions based on the xml requires parsing into the application's domain model. This issue concerns me when it comes to using XML for user preferences. It sounds like your approach may be more scalable. Ok, I have to think about it. thanks again, Julian --- Michael Klaene wrote: I'd like to learn more about storing XML in the database myself. I really haven't had much experience there so I couldn't say if it is beneficial or not. I started out as a database developer so I tend to rely heavily on the database for a number of things, system prefs being one of those things. Oracle( as I'm sure other vendors do as well) uses 'codelist' tables for storing a great deal of application metadata and I've always liked that approach. As I said, I wrote/am still writing a system where I define codelists that define different preferences ('show_x', 'hide_a'). A user preferences table contains user_id, but also columns name and value which would include 'show_x'/'true', 'hide_a'/'false'). Mike Julian wrote: I forgot to mention: 1) I cannot use Xindice since I do not feel it is viable. 2) I expect to have thousands of users with a moderate load. 3) I am leaning towards Michael's suggestion: http://www.developer.com/db/print.php/10920_3413151_1 Comment appreciated :) Thanks again, Julian __ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? The all-new My Yahoo! Get yours free! = Live simply so others may simply live. -Ghandi Pluralitas non est ponenda sine neccesitate. Entities should not be multiplied unneccesarily -William of Occam __ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Discover all thats new in My Yahoo!
Re: Web Site vs Web Application
Allen: We use a practice somewhat like what you describe when roughing out prototype sites, or when a site has a pretty high amount of static content. We've written a TilesSmartForwardingAction which we plug in as the unknown (default) action, and it parses the request path and converts that into a JSP. It then sets the derived value as a tiles attribute and forwards to a configured tile definition which is the template. This lets our artists add pages to the site without having to muck with the struts-config, all the while keeping all page access going through Struts, so that should we later need to apply some logic, we can. Using the Struts 1.2 wildcard action path mapping, you could extend this further to support a few different basic layouts based on match-regions of the path. Now that I look, I see that it ended up in the grab-bag of struts helpers that we put up online: http://demo.jgsullivan.com/struts/TilesSmartForwardingAction.html source code: http://demo.jgsullivan.com/struts/xref/com/jgsullivan/struts/actions/TilesSmartForwardingAction.html Javadoc: http://demo.jgsullivan.com/struts/apidocs/com/jgsullivan/struts/actions/TilesSmartForwardingAction.html Hope that helps... Joe At 1:33 PM -0500 11/17/04, Tait, Allen wrote: I'm interested in implementing the Struts and Tiles frameworks for a web site (moving slowly toward web application). Is it possible, or even recommended to design something similar to the following for the static portions of a web site. Assume Tiles have been defined to provide a common site wrapper. What's left is to select the body (jsp or Tile). Do this by defining a layout that will provide the site wrapper and receive that content/body (page or Tile) as a parameter. Then a generic action could grab the page requested from URL and put into common scope. The layout would grab the requested page name from the common scope and result in the requested page. An approach like this seems to simplify the adding of new content pages by eliminating configuration for tiles and struts. It seems this would also help when implementing a content management system that would simply add the content (body) portion of these pages. For example, once a body was added to the site, a request for that page would be successful with no additional configuration. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com Narrow minds are weapons made for mass destruction -The Ex - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using constants for form property names.
I believe this is documented in the JSP spec. Daffin, Miles (Company IT) wrote: Paul, Thanks. This worked. Where is this fact documented? -Miles -Original Message- From: Paul McCulloch [mailto:[EMAIL PROTECTED] Sent: 17 November 2004 17:16 To: 'Struts Users Mailing List' Subject: RE: Using constants for form property names. When using RT expressions as attribute values the whole attribute must be a single RT: html:checkbox property=%=Keys.APPLICANT_FULLNAME_CHINESE_NA% onclick=%=clearAndDisable(this,' + Keys.APPLICANT_FULLNAME_CHINESE_NA + ');% N/A /html:checkbox Paul -Original Message- From: Daffin, Miles (Company IT) [mailto:[EMAIL PROTECTED] Sent: 17 November 2004 17:03 To: [EMAIL PROTECTED] Subject: Using constants for form property names. Hi All, I have found all sorts of ways to use constants for messages in struts, but no one seems to address the issue of property names. A simple example will make it clearer. I want to use constants for my property names. In my jsp I have the following code: html:checkbox property=%=Keys.APPLICANT_FULLNAME_CHINESE_NA% onclick=clearAndDisable(this, '%=Keys.APPLICANT_FULLNAME_CHINESE_NA%'); N/A /html:checkbox The above jsp code does not work because it is rendered as follows: input name=applicantFullNameChineseNA value=on onclick=clearAndDisable(this, '%=Keys.APPLICANT_FULLNAME_CHINESE_NA%'); type=checkboxN/A The first expression for 'property' is evaluated. The second is rendered literally. My questions are: 1. Is this a bug? 2. Is this the right way to go about using constants for property names? Many thanks. -Miles Miles Daffin Morgan Stanley 20 Cabot Square | Canary Wharf | London E14 4QA | UK Tel: +44 (0) 20 767 75119 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] NOTICE: If received in error, please destroy and notify sender. Sender does not waive confidentiality or privilege, and use is prohibited. - 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] NOTICE: If received in error, please destroy and notify sender. Sender does not waive confidentiality or privilege, and use is prohibited. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Using commons HttpUtils to call an Action, but it doesn't work.
I'm using the following code in an initialization routine to call an Action. This occurs the first time a user hits the application. This was all working on WebSphere 4.0.4, but we upgraded to WS 5.1.0.5 and now it doesn't work. No error, no logs, no exception. Just like it doesn't get called. Of course, the same app (EAR file) works fine on a development server. Any reason why this wouldn't work in the execute() method of another action? // Create Action URL String requestUrl = request.getRequestURL().toString(); String webAppUrl = requestUrl.substring(0, requestUrl.lastIndexOf(/) ); String loadStateFormsUrl = webAppUrl + /initAction.do; HttpClient client = new HttpClient(); HttpMethod method = new GetMethod(url); try { int statusCode = client.executeMethod(method); } catch (HttpRecoverableException e) { result = Exception occurred: + e.getMessage(); } catch (IOException e) { result = Failed to get a URL's response.; } // Read the response body. byte[] responseBody = method.getResponseBody(); result = new String(responseBody); // Release the connection. method.releaseConnection(); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts 1.2.4 validator is not working
Thanks Niall, That helped me to resolve those mentioned errors. But seems like I cannot get validWhen rule working? It doesn't even generate a JavaScript validation method validateValidWhen() Following is the code snippet field property=postTimerMs depends=validwhen page=1 arg0 key=postTimerMs field value resource=false/ var var-nametest/var-name var-value((mscExm == null) or (*this* != null)) /var-value /var /field Anyone can help? Thanks in advance. G -Original Message- From: Niall Pemberton [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 17, 2004 11:52 AM To: Struts Users Mailing List Subject: Re: Struts 1.2.4 validator is not working Check out the upgrade notes here... http://wiki.apache.org/struts/StrutsUpgradeNotes11to124 My guess is you used to have your messages resources configured through the web.xml - this was considered deprecated in Struts 1.1 and has been removed from Struts 1.2.x You need to configure them int the struts-config.xml using the message-resources element Niall - Original Message - From: Yadav, Ganesh [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, November 17, 2004 5:44 PM Subject: Struts 1.2.4 validator is not working Can somebody let me know any workaround for the following error? Latest struts download version 1.2.4 validator has following error This error is thrown on following line in JSP. html:javascript formName=myForm page=1 dynamicJavascript=true / I am using latest download so that I can use ValidWhen functionality. Am I the only one who is getting this error with the latest download? java.lang.NullPointerException at org.apache.struts.validator.Resources.getMessage(Resources.java:173) at org.apache.struts.taglib.html.JavascriptValidatorTag.createDynamicJavasc ript(JavascriptValidatorTag.java:464) at org.apache.struts.taglib.html.JavascriptValidatorTag.renderJavascript(Ja vascriptValidatorTag.java:373) at org.apache.struts.taglib.html.JavascriptValidatorTag.doStartTag(Javascri ptValidatorTag.java:335) Thanks Ganesh - 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 1.2.4 validator is not working
Yadav, Ganesh wrote: Thanks Niall, That helped me to resolve those mentioned errors. But seems like I cannot get validWhen rule working? It doesn't even generate a JavaScript validation method validateValidWhen() Following is the code snippet field property=postTimerMs depends=validwhen page=1 arg0 key=postTimerMs field value resource=false/ var var-nametest/var-name var-value((mscExm == null) or (*this* != null)) /var-value /var /field There is no javascript validation for validwhen, only server side. If the server side validation isn't working, we need to know what is valid/not valid if you want help debugging the validwhen var-value. Matt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Using commons HttpUtils to call an Action, but it doesn't wor k.
Might seem silly but have you checked the firewall rules for the production server? I have seen lots of times where the firewalls or routers are set up in such a way that you cannot hit your own site(s)/boxes from within the firewall, or even resolve the DNS name (easily fixed with a etc/hosts entry of course). I would run down the network path since you say it works on a development server. Al -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Morgan Sent: Wednesday, November 17, 2004 3:28 PM To: [EMAIL PROTECTED] Subject: Using commons HttpUtils to call an Action, but it doesn't work. I'm using the following code in an initialization routine to call an Action. This occurs the first time a user hits the application. This was all working on WebSphere 4.0.4, but we upgraded to WS 5.1.0.5 and now it doesn't work. No error, no logs, no exception. Just like it doesn't get called. Of course, the same app (EAR file) works fine on a development server. Any reason why this wouldn't work in the execute() method of another action? // Create Action URL String requestUrl = request.getRequestURL().toString(); String webAppUrl = requestUrl.substring(0, requestUrl.lastIndexOf(/) ); String loadStateFormsUrl = webAppUrl + /initAction.do; HttpClient client = new HttpClient(); HttpMethod method = new GetMethod(url); try { int statusCode = client.executeMethod(method); } catch (HttpRecoverableException e) { result = Exception occurred: + e.getMessage(); } catch (IOException e) { result = Failed to get a URL's response.; } // Read the response body. byte[] responseBody = method.getResponseBody(); result = new String(responseBody); // Release the connection. method.releaseConnection(); - 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]
LazyForm
Is there anyway to use a LazyForm to do a something like: html:text property=mixture(1)date/ html:text property=mixture(1)flask(confluency)/ html:text property=mixture(1)flask(action)/ html:text property=mixture(2)date/ html:text property=mixture(2)flask(confluency)/ html:text property=mixture(2)flask(action)/ Not the best example, but exactly what I need to do :) Otherwise I'm stuck with: html:text property=mixture-1-date/ html:text property=mixture-1-flask-confluency/ html:text property=mixture-1-flask-action/ html:text property=mixture-2-date/ html:text property=mixture-2-flask-confluency/ html:text property=mixture-2-flask-action/ And then searching through the request.getParamaterNames() or something like that... Thanks... -- Sloan
Re: LazyForm
I haven't used lazyform but i imagine it should work as follows. form-bean name=yourForm type=org.apache.struts.action.LazyForm form-property name=mixtures type=java.util.ArrayList / /form-bean c:forEach var=mixture items=${yourForm.mixtures} html:text name=mixture property=date indexed=true / if you really want you could use a logic:iterate rather than c:forEach logic:iterate id=mixture name=yourForm property=mixtures The html:text will render to input type=text name=mixture[0].date / You wont need to search request parameters although if you like that sort of thing you could. LazyDynaForm theForm = (LazyDynaForm) form; List mixtureList = (List) theForm.get(mixtures); for(int i = 0;i mixutureList.size();i++) { String date = (String) mixutureList.get(i); } Mark On Wed, 17 Nov 2004 16:08:06 -0500, Seaman, Sloan [EMAIL PROTECTED] wrote: Is there anyway to use a LazyForm to do a something like: html:text property=mixture(1)date/ html:text property=mixture(1)flask(confluency)/ html:text property=mixture(1)flask(action)/ html:text property=mixture(2)date/ html:text property=mixture(2)flask(confluency)/ html:text property=mixture(2)flask(action)/ Not the best example, but exactly what I need to do :) Otherwise I'm stuck with: html:text property=mixture-1-date/ html:text property=mixture-1-flask-confluency/ html:text property=mixture-1-flask-action/ html:text property=mixture-2-date/ html:text property=mixture-2-flask-confluency/ html:text property=mixture-2-flask-action/ And then searching through the request.getParamaterNames() or something like that... Thanks... -- Sloan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problem with null value
El mar, 16-11-2004 a las 14:09 -0600, Apte, Dhanashree (Noblestar) escribió: If you are trying to do different processing in your action based on different buttons clicked in the form, you can use the Struts LookupDispatchAction instead of the normal Action class. I resolved this problem doing two button object in my jsp and submit by javascript ... Thanks, i will study your indication. -- Mauro It lets you map the buttons on your page to separate methods in your action. Please refer the struts API documentation on LookupDispatchAction for more information. Hope this helps, Dhanashree. -Original Message- From: Mauro Morales M. [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 16, 2004 9:14 AM To: [EMAIL PROTECTED] Subject: Problem with null value Hi, In my .jsp have follow html code html:submit property=resActualizar value=Actualizar/ html:submit property=resEliminar value=Eliminar / First is my update button, second delete button, both in same form. This is my form code public String getResActualizar () { return this.resActualizar; } public void setResActualizar (String resActualizar) { this.resActualizar = resActualizar; } public String getResEliminar () { return this.resEliminar; } public void setResEliminar (String resEliminar) { this.resEliminar = resEliminar; In my action have follow code System.out.println(subform.getResActualizar()); then print in STDOUT Actualizar In case of System.out.println(subform.getResEliminar()); print in STDOUT null then in action code when i do if (subform.getResEliminar().equals(Eliminar)) do it nothing ... Help me please ... Thanks, -- Mauro - 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]
using JSTL with struts (stupid question?)
Hi, I hope this is not gonna sound too stupid.. My problem is the inability to use ${expression..} in the JSP pages I use with struts. I have tried to look for information but failed to fix the problem myself, unfortunately. I have followed instructions here: http://jakarta.apache.org/taglibs/doc/standard-doc/GettingStarted.html e.g. put jstl.jar and standard.jar in WEB-INF/lib of my webapp, and actually I suppose this works since the following excerpt from a JSP doesn't produce any compile error: %@ taglib uri=http://java.sun.com/jstl/core; prefix=c % But the ${expression..} stuff keeps showing off raw instead of interpreted as the expression I give. I tried to look also in the struts-el page at: http://struts.apache.org/faqs/struts-el.html but didn't find any information on how to install it :/ So currently the following JSP excerpt: -=-=---=-=---=-=---=-=---=-=---=-=-- %@ page contentType=text/html;charset=UTF-8 language=java % %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % %@ taglib uri=/WEB-INF/app.tld prefix=app % %@ taglib uri=http://java.sun.com/jstl/core; prefix=c % jsp:useBean id=user scope=session type=org.gc.skirate.User/ html:html head titlebean:message key=main.title//title html:base/ /head body c:forEach var=i begin=1 end=10 step=1 c:out value=${i} / br / /c:forEach app:loggedin loggedin as user: ${user.login} jsp:getProperty name=user property=login/ /app:loggedin -=-=---=-=---=-=---=-=---=-=---=-=-- with the user test logged in, renders as: -=-=---=-=---=-=---=-=---=-=---=-=-- 1 2 3 4 5 6 7 8 9 10 loggedin as user: ${user.login} test -=-=---=-=---=-=---=-=---=-=---=-=-- Any help would be appreciated. And sorry again if this is real stupid.. -- Guillaume Cottenceau - http://zarb.org/~gc/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Indexed properties
I am getting the nested beans out of my form ok but saving gives no joy. I am trying to use the 2.1 Hand Cranking lazy List in the ActionForm from http://wiki.apache.org/struts/StrutsCatalogLazyList. However, I never see my log messages from the indexed getter methods for any of the nested beans. nested:form action=saveUnitDayScheduleAction.do nested:iterate id=days property=days nested:iterate id=workgroups property=workgroups nested:iterate id=employeeAppointments property=employeeAppointments nested:hidden property=statusCode indexed=true / /nested:iterate /nested:iterate /nested:iterate /nested:form The form has a collection of DayOfWeekBeans called days. Each DOW bean has a collection of WorkgroupBeans called workgroups. Each WG bean has a collection of EmployeeAppointmentBeans called employeeAppointments. To that end the form and each of DOW and WG beans have the following general construct (in a garish form of C++ template syntax). public BEAN_TYPE getLIST(int index) { while (index = list.size()) { list.add(new BEAN_TYPE()); } return (BEAN_TYPE)list.get(index); } And of course the appropriate public List getLIST(){ return list;} and Public void setLIST( List list ) { this.list = list;} The above JSP leads to this html fragment. form name=unitDayScheduleForm method=post action=/labor/saveUnitDayScheduleAction.do input type=hidden name=unitDayScheduleForm[0].days[0].workgroups[0].employeeAppointments[ 0].statusCode value=N input type=hidden name=unitDayScheduleForm[1].days[0].workgroups[0].employeeAppointments[ 1].statusCode value=N input type=hidden name=unitDayScheduleForm[2].days[0].workgroups[0].employeeAppointments[ 2].statusCode value=N input type=hidden name=unitDayScheduleForm[3].days[0].workgroups[0].employeeAppointments[ 3].statusCode value=N input type=hidden name=unitDayScheduleForm[4].days[0].workgroups[0].employeeAppointments[ 4].statusCode value=N input type=hidden name=unitDayScheduleForm[5].days[0].workgroups[0].employeeAppointments[ 5].statusCode value=N input type=hidden name=unitDayScheduleForm[6].days[0].workgroups[0].employeeAppointments[ 6].statusCode value=N input type=hidden name=unitDayScheduleForm[7].days[0].workgroups[0].employeeAppointments[ 7].statusCode value=N . . . Blah blah blah - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: using JSTL with struts (stupid question?)
The ability to use ${expr} in the text of a JSP page is new to JSP 2.0. Does your container support JSP 2.0? Tomcat 5 does, Tomcat 4 doesn't. Guillaume Cottenceau wrote: Hi, I hope this is not gonna sound too stupid.. My problem is the inability to use ${expression..} in the JSP pages I use with struts. I have tried to look for information but failed to fix the problem myself, unfortunately. I have followed instructions here: http://jakarta.apache.org/taglibs/doc/standard-doc/GettingStarted.html e.g. put jstl.jar and standard.jar in WEB-INF/lib of my webapp, and actually I suppose this works since the following excerpt from a JSP doesn't produce any compile error: %@ taglib uri=http://java.sun.com/jstl/core; prefix=c % But the ${expression..} stuff keeps showing off raw instead of interpreted as the expression I give. I tried to look also in the struts-el page at: http://struts.apache.org/faqs/struts-el.html but didn't find any information on how to install it :/ So currently the following JSP excerpt: -=-=---=-=---=-=---=-=---=-=---=-=-- %@ page contentType=text/html;charset=UTF-8 language=java % %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % %@ taglib uri=/WEB-INF/app.tld prefix=app % %@ taglib uri=http://java.sun.com/jstl/core; prefix=c % jsp:useBean id=user scope=session type=org.gc.skirate.User/ html:html head titlebean:message key=main.title//title html:base/ /head body c:forEach var=i begin=1 end=10 step=1 c:out value=${i} / br / /c:forEach app:loggedin loggedin as user: ${user.login} jsp:getProperty name=user property=login/ /app:loggedin -=-=---=-=---=-=---=-=---=-=---=-=-- with the user test logged in, renders as: -=-=---=-=---=-=---=-=---=-=---=-=-- 1 2 3 4 5 6 7 8 9 10 loggedin as user: ${user.login} test -=-=---=-=---=-=---=-=---=-=---=-=-- Any help would be appreciated. And sorry again if this is real stupid.. -- Neil Erdwien, [EMAIL PROTECTED], Web Technologies Manager Computing and Network Services, Kansas State University - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using commons HttpUtils to call an Action, but it doesn't work.
Morgan mrachell 'at' bbandt.com writes: I'm using the following code in an initialization routine to call an Action. This occurs the first time a user hits the application. This was all working on WebSphere 4.0.4, but we upgraded to WS 5.1.0.5 and now it doesn't work. No error, no logs, no exception. Just like it doesn't get called. Of course, the same app (EAR file) works fine on a development server. Any reason why this wouldn't work in the execute() method of another action? // Create Action URL String requestUrl = request.getRequestURL().toString(); String webAppUrl = requestUrl.substring(0, requestUrl.lastIndexOf(/) ); String loadStateFormsUrl = webAppUrl + /initAction.do; HttpClient client = new HttpClient(); This is not a thread-safe HttpClient. Any chance the code is called by several threads at the same time or something? -- Guillaume Cottenceau - http://zarb.org/~gc/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: using JSTL with struts (stupid question?)
From: Neil Erdwien [EMAIL PROTECTED] The ability to use ${expr} in the text of a JSP page is new to JSP 2.0. Does your container support JSP 2.0? Tomcat 5 does, Tomcat 4 doesn't. And if you're not on JSP 2.0, then try: c:out value=${user.login}/ (Assuming the 'user' object has a 'getLogin' method.) -- Wendy Smoak - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: using JSTL with struts (stupid question?)
Neil Erdwien neil 'at' k-state.edu writes: The ability to use ${expr} in the text of a JSP page is new to JSP 2.0. Does your container support JSP 2.0? Tomcat 5 does, Tomcat 4 doesn't. Ah. My container tomcat-5.0.27 so I guess it should.. -- Guillaume Cottenceau - http://zarb.org/~gc/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: using JSTL with struts (stupid question?)
Wendy Smoak java 'at' wendysmoak.com writes: From: Neil Erdwien [EMAIL PROTECTED] The ability to use ${expr} in the text of a JSP page is new to JSP 2.0. Does your container support JSP 2.0? Tomcat 5 does, Tomcat 4 doesn't. And if you're not on JSP 2.0, then try: c:out value=${user.login}/ (Assuming the 'user' object has a 'getLogin' method.) Yes, that does work. However, this much longer than I expected :) Still, as I'm using tomcat-5.0.27, I guess I should be able to use the shorter form. Any place to check where this feature could be turned off inadvertandly? -- Guillaume Cottenceau - http://zarb.org/~gc/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] secure jsp in web application
Hi I want to secure all my jsp in my web application, I added following security constraint in my web.xml file, but some how seems it does not work security-constraint web-resource-collection web-resource-nameBlock Access to jsp files/web-resource-name descriptionThis is to block access to all jsp files/description url-pattern*.jsp/url-pattern http-methodPOST/http-method http-methodGET/http-method /web-resource-collection /security-constraint what may be the reason?? Ashish = A$HI$H __ Do you Yahoo!? The all-new My Yahoo! - Get yours free! http://my.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: using JSTL with struts (stupid question?)
hi, Guillaume Cottenceau wrote: Any place to check where this feature could be turned off inadvertandly? try inserting the page directive %@ page isELIgnored=false % before any expression language (EL) stuff. hope this helps.. -gm - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: using JSTL with struts (stupid question?)
Guillaume Cottenceau gc3 'at' bluewin.ch writes: Wendy Smoak java 'at' wendysmoak.com writes: From: Neil Erdwien [EMAIL PROTECTED] The ability to use ${expr} in the text of a JSP page is new to JSP 2.0. Does your container support JSP 2.0? Tomcat 5 does, Tomcat 4 doesn't. And if you're not on JSP 2.0, then try: c:out value=${user.login}/ (Assuming the 'user' object has a 'getLogin' method.) Yes, that does work. However, this much longer than I expected :) Still, as I'm using tomcat-5.0.27, I guess I should be able to use the shorter form. Any place to check where this feature could be turned off inadvertandly? Thanks to both the suggestions about JSP 2.0 e.g. implemented first in tomcat 5, I ended up on the following page: http://archives.java.sun.com/cgi-bin/wa?A2=ind0305L=jsp-interestD=0P=24887 And actually I was using a web.xml version 2.3, it seems EL is disabled there by default :( Using a 2.4 version, it does work perfectly. But this is kinda stupid, I am using a web.xml file shown as a demo in the official tomcat 5.0.27 distribution. I don't quite get why it was using a web.xml of this older version. Thanks for the help! -- Guillaume Cottenceau - http://zarb.org/~gc/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] secure jsp in web application
Hi I dont want anyone to access them, still do i have to add auth-constraint in web.xml file?? if yes how do i add them with no user?? Ashish --- Saravanan Veerappan [EMAIL PROTECTED] wrote: Can you post the entire web descriptor? i don't see auth-constraint specified in the snippet. You need to apply authorization constraint to protect your pages/ Ashish Kulkarni [EMAIL PROTECTED] wrote:Hi I want to secure all my jsp in my web application, I added following security constraint in my web.xml file, but some how seems it does not work Block Access to jsp files This is to block access to all jsp files *.jsp POST GET what may be the reason?? Ashish = A$HI$H __ Do you Yahoo!? The all-new My Yahoo! - Get yours free! http://my.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Discover all thats new in My Yahoo! = A$HI$H __ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: using JSTL with struts (stupid question?)
Gareth Meyrick gareth 'at' kirkstonepass.com writes: hi, Guillaume Cottenceau wrote: Any place to check where this feature could be turned off inadvertandly? try inserting the page directive %@ page isELIgnored=false % before any expression language (EL) stuff. hope this helps.. Yes, this did workaround the problem, thank you. It turned out that the whole global turning off of the EL was due to using a 2.3 version of the web.xml file. Now, I don't really understand why the example web.xml file I found in tomcat 5.0.27 was still in 2.3 version.. -- Guillaume Cottenceau - http://zarb.org/~gc/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] secure jsp in web application
If you don't want to expose your jsp's by url, place your files under /WEB-INF directory of your web application. You do not need to declare in web descriptor. Ashish Kulkarni [EMAIL PROTECTED] wrote: Hi I dont want anyone to access them, still do i have to add auth-constraint in web.xml file?? if yes how do i add them with no user?? Ashish --- Saravanan Veerappan wrote: Can you post the entire web descriptor? i don't see auth-constraint specified in the snippet. You need to apply authorization constraint to protect your pages/ Ashish Kulkarni wrote:Hi I want to secure all my jsp in my web application, I added following security constraint in my web.xml file, but some how seems it does not work Block Access to jsp files This is to block access to all jsp files *.jsp POST GET what may be the reason?? Ashish = A$HI$H __ Do you Yahoo!? The all-new My Yahoo! - Get yours free! http://my.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Discover all thats new in My Yahoo! = A$HI$H __ Do you Yahoo!? Meet the all-new My Yahoo! - Try it today! http://my.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? The all-new My Yahoo! Get yours free!
RE: tiles and redirect (non-struts application)
Saravanan, This point has been discussed in the last 30 days. It usually came down to the idea that tiles has already started writing to the output stream so the headers are already committed, and often sent already. If you want do perform business conditions like that, I recommend you put them into your action and make a forward which your action can use INSTEAD of your tile. Regards, David -Original Message- From: Saravanan Veerappan [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 17, 2004 5:07 PM To: [EMAIL PROTECTED] Subject: tiles and redirect (non-struts application) I have a existing application (non-struts) and i would like to utilize tiles to take advantage of templates for layout. When i inlude redirect in the tiles body the redirection doesn't work saying response has been already comitted. Any suggestions? Here is my sample code tiles:insert page=/layout.jsp flush=false tiles:put name=header value=/includes/header.jsp/ tiles:put name=left-nav value=/includes/left-nav.jsp/ tiles:put name=body value=/jsp/body.jsp/ tiles:put name=footer value=/includes/footer.jsp/ /tiles:insert body.jsp if(bussiness_conditions){ response.sendRedirect(someother.jsp); } else{ //Show response here. } __ 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]
Help with Exception handling
I know I've tried this before, but so far I haven't gotten all the pieces properly arranged so it works. :/ I currently have code like this in an Action: try { benId = loginDAO.getBenId( asurite ); } catch ( TermsAcceptanceException ex ) { return mapping.findForward( terms ); } In struts-config.xml: action path=/denLogin type=edu.asu.vpia.struts.DevilsDenLoginAction name=loginForm scope=request validate=true input=den.login.page forward name=success path=den.login.success/ forward name=terms path=den.terms.agreement /action It's my impression that I don't need to catch the exception, that I *should* be able to let Action.execute(...) throw it and the framework can be configured to deal appropriately with it. So I took out this line: forward name=terms path=den.terms.agreement And put in: exception type=edu.asu.dao.DAOException path=/WEB-INF/error.jsp key=error.dao.exception/ And I just get a JSP with a stack trace. Although TermsAcceptanceException extends DAOException, it doesn't go to error.jsp. Two questions... what is the 'key' attribute of exception used for, and can anyone tell what I'm doing wrong? Thanks! -- Wendy Smoak - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Help with Exception handling
Wendy, This looks interesting. What is 'den.login.success'? Is it a key in a resource file or a java class or just a flat file with a dot-notation name? Regards, David -Original Message- From: Wendy Smoak [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 17, 2004 6:32 PM To: Struts Users Mailing List Subject: Help with Exception handling I know I've tried this before, but so far I haven't gotten all the pieces properly arranged so it works. :/ I currently have code like this in an Action: try { benId = loginDAO.getBenId( asurite ); } catch ( TermsAcceptanceException ex ) { return mapping.findForward( terms ); } In struts-config.xml: action path=/denLogin type=edu.asu.vpia.struts.DevilsDenLoginAction name=loginForm scope=request validate=true input=den.login.page forward name=success path=den.login.success/ forward name=terms path=den.terms.agreement /action It's my impression that I don't need to catch the exception, that I *should* be able to let Action.execute(...) throw it and the framework can be configured to deal appropriately with it. So I took out this line: forward name=terms path=den.terms.agreement And put in: exception type=edu.asu.dao.DAOException path=/WEB-INF/error.jsp key=error.dao.exception/ And I just get a JSP with a stack trace. Although TermsAcceptanceException extends DAOException, it doesn't go to error.jsp. Two questions... what is the 'key' attribute of exception used for, and can anyone tell what I'm doing wrong? Thanks! -- Wendy Smoak - 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: Help with Exception handling
From: David G. Friedman [EMAIL PROTECTED] This looks interesting. What is 'den.login.success'? Is it a key in a resource file or a java class or just a flat file with a dot-notation name? It's a Tiles definition. I'm sure I initially tried a Tiles def in the path attribute of the exception tag, and then switched to a plain old error.jsp when it didn't work. Unfortunately it still doesn't go there when the Exception is thrown, it just shows a stack trace as though the error handling isn't working at all. I forgot to mention in the first message: I'm using Struts 1.2.5 . Thanks for any ideas! -- Wendy Smoak - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Help with Exception handling
Wendy, Damn, with a name like that it seemed like a resource or a Java code. I'm so used to the convention of starting a tiles definition with a period that you bluffed me. Now, on the JSP issues, since you're trading control over to JSP's, can't you list the exception in your web.xml configuration file? See the 'exception-type' in the solution under this url: http://www.jguru.com/faq/view.jsp?EID=457102 Regards, David -Original Message- From: Wendy Smoak [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 17, 2004 6:43 PM To: Struts Users Mailing List Subject: Re: Help with Exception handling From: David G. Friedman [EMAIL PROTECTED] This looks interesting. What is 'den.login.success'? Is it a key in a resource file or a java class or just a flat file with a dot-notation name? It's a Tiles definition. I'm sure I initially tried a Tiles def in the path attribute of the exception tag, and then switched to a plain old error.jsp when it didn't work. Unfortunately it still doesn't go there when the Exception is thrown, it just shows a stack trace as though the error handling isn't working at all. I forgot to mention in the first message: I'm using Struts 1.2.5 . Thanks for any ideas! -- Wendy Smoak - 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: Help with Exception handling
Sorry, I don't exactly know what you are doing wrong, but here is an example that shows what the key attribute is for: From a struts-config.xml: !-- broker login, logout -- action path=/broker/login type=LoginAction name=brokerLoginForm scope=request validate=true parameter=doBrokerLogin input=/broker/brokerlogin.jsp exception key=broker.login.error.authFailure type=AuthenticationException bundle=ExceptionMessages/ forward name=success path=/broker/brokerhome.jsp/ forward name=failure path=/shared/error.jsp/ /action The key attribute to the exception element is a message resources key, in the bundle specified by the bundle attribute. In my ExceptionMessages properties file, I have: broker.login.error.authFailure=Sorry, you entered the wrong password You are correct that, in your Action's execute method, you simply throw the Exception (in my example, an AuthenticationException), and the framework will catch it (since handling has been configured). In my JSP I have this: %-- print exception messages if there are any, otherwise print form validation error messages if there are any --% logic:present name=org.apache.struts.action.EXCEPTION html:errors bundle=EXCEPTION_MESSAGES/ /logic:present As someone pointed out in another Thread (I think it was Joe), my JSP code (logic:present) is not the most efficient, but it works. This prints the error message Sorry, you entered the wrong password at the top of the page if that message is present (if the Exception was thrown). I have also used the path attribute in a global exception config, and it does work as expected. One thing I haven't done, however, is configure for a base class of the actual Exception. I always configure for the exact Exception class. So that could be it. Hope this helps. Erik Wendy Smoak wrote: I know I've tried this before, but so far I haven't gotten all the pieces properly arranged so it works. :/ I currently have code like this in an Action: try { benId = loginDAO.getBenId( asurite ); } catch ( TermsAcceptanceException ex ) { return mapping.findForward( terms ); } In struts-config.xml: action path=/denLogin type=edu.asu.vpia.struts.DevilsDenLoginAction name=loginForm scope=request validate=true input=den.login.page forward name=success path=den.login.success/ forward name=terms path=den.terms.agreement /action It's my impression that I don't need to catch the exception, that I *should* be able to let Action.execute(...) throw it and the framework can be configured to deal appropriately with it. So I took out this line: forward name=terms path=den.terms.agreement And put in: exception type=edu.asu.dao.DAOException path=/WEB-INF/error.jsp key=error.dao.exception/ And I just get a JSP with a stack trace. Although TermsAcceptanceException extends DAOException, it doesn't go to error.jsp. Two questions... what is the 'key' attribute of exception used for, and can anyone tell what I'm doing wrong? Thanks! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: AW: AW: AW: using multiple action forms in one action. Best practice?
Hi Martin, I see what you mean about the wizard metaphor being inappropriate for your case. Maybe tabbed dialog box is a closer analogy. But I guess that doesn't match exactly either, because the contents of tab B change according to the contents of tab A. Anyway, there are many ways to implement something like that and I guess each has advantages/disadvantages. By the way, in our application, we have a few cases where we process the data entered on multiple forms in one final action. Specifically we do this when we use popup windows, since the concept of ordering of pages becomes more complicated / impossible when there are multiple windows displayed on the screen at a single time. So we save the information from the popup window in the session context, and then reference it when the user hits submit on the main form. By the way, does anyone have experience using popup windows in this way without resorting to using session variables? Anyway, good luck! Bill Martin Kindler wrote: Bill, you seem to understand my application quite well. The metaphor of region/shops is excellent. What adds a bit of complexity is that the shop-module is just one of several. There might be an additional people-module, a statistical data-module, etc. Thus serializing the editing process in a wizard style would impose an order on the process which is not very pleasant. Also, I would like to reuse the forms/action for editing already existing objects/regions, where the order enforced by a wizard is not appropriate. But I think I have learned fromthis discussion how it could be implemented reasonably. The only exception being the question of scope which is not that important in my case. Martin -Ursprüngliche Nachricht- Von: Bill Keese [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 17. November 2004 01:48 An: Struts Users Mailing List Betreff: Re: AW: AW: using multiple action forms in one action. Best practice? It's hard for me to answer because I don't really understand your application. JSP1 is for picking a region, and then JSP2 is for picking stores within that region, right? And then after picking the stores, you display a confirmation page with the map and the list of picked stores? When you hit the save button on the confirmation page, the input to the SaveAction is both the selected region and the selected stores, right? So you are combining the information entered on two previous forms. If it was me, I would have 3 separate actions and 3 separate action-forms: 1. select-region 2. select-stores 3. confirm-dialog The confirm-dialog ActionForm would contain both the region information and the list of stores. Thus I would only use one ActionForm per Action, and I wouldn't use session variables. Bill Martin Kindler wrote: Hi Bill, so you say, it is good practice to use the two forms in one action as I do in my current solution? Sure, one has to hide the internals from AF1 to an action primarily designed to use AF2 to keep the address module generic. Perhaps I should make the calling ActionForms implement a specific interface. If I really want a fully generic address module I would have to split the action(s) in two, simply because the actions designed for the address module need a generic API. I cannot rely (for full genericity) on a calling module to use AF1. In my current situation I will probably ignore this as it is a straightforward refactoring which can be done when need occurs. As to the question request vs. session scope I understand the problems which might occur using session scope. I do not see a solution which would also fulfil the modularization requirement. Thanks! Martin -Ursprüngliche Nachricht- Von: Bill Keese [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 16. November 2004 02:10 An: Struts Users Mailing List Betreff: Re: AW: using multiple action forms in one action. Best practice? Hi Martin, From this JSP I want to access a (hopefully) generic module to get the access points. This module has to get some information (e. g. a region to prefilter the addresses or access points already existing) from JSP1. I think you should generate the input to the generic module, rather than passing the ActionForm directly: // get data from ActionForm1 needed to look up addresses AddressLookupInfo info = getAddressInfoFromActionForm1(AF1); // lookup addresses List res = AddressLookup.getAddresses(info); ... Then your module can still be generic. I could take the necessary information from AF1 to some POJO (or bean) on model level (or controller level) and transfer it to AF2. This is probably the cleanest solution but means to split each action into
Re: where i can get jdbc driver for oracle
The Oracle Client cd should come with a suitable driver or simply browse oracle's website for one. Nishant wrote: hi, how can i use database in struts where i can get jdbc driver for oracle database Nishant Patil Software Engineer Cybage Software Pvt. Ltd. (A CMM Level 3 Company) West Avenue , Kalyani Nagar, Pune - 411 006 Tel: 91-20-4041700 -355 Email: [EMAIL PROTECTED] Website: www.cybage.com There's a difference between knowing the path, and walking the path - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Help with Exception handling
Wendy, Struts exception handling *does* work correctly when it comes to inheritance; and your configuration looks correct. First, check the FQN (fully-qualified name) of your exception -- if that's correct, I suggest you take out your handy-dandy debugger and set a breakpoint in the RequestProcessor. I think you will find that using the debugger is (a) fun, (b) educational, and (c) fun ;) -Bill Siggelkow Wendy Smoak wrote: I know I've tried this before, but so far I haven't gotten all the pieces properly arranged so it works. :/ I currently have code like this in an Action: try { benId = loginDAO.getBenId( asurite ); } catch ( TermsAcceptanceException ex ) { return mapping.findForward( terms ); } In struts-config.xml: action path=/denLogin type=edu.asu.vpia.struts.DevilsDenLoginAction name=loginForm scope=request validate=true input=den.login.page forward name=success path=den.login.success/ forward name=terms path=den.terms.agreement /action It's my impression that I don't need to catch the exception, that I *should* be able to let Action.execute(...) throw it and the framework can be configured to deal appropriately with it. So I took out this line: forward name=terms path=den.terms.agreement And put in: exception type=edu.asu.dao.DAOException path=/WEB-INF/error.jsp key=error.dao.exception/ And I just get a JSP with a stack trace. Although TermsAcceptanceException extends DAOException, it doesn't go to error.jsp. Two questions... what is the 'key' attribute of exception used for, and can anyone tell what I'm doing wrong? Thanks! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
URL Customization
Hello Guys, I am not sure if this a Struts question. I think this is more of a general web devt thing. And since this is not a struts thing I am asking you guys to please help me or point me to a place where i can get help. thanks in advance im using struts 1.2.4 and tomcat 5.0.27. I need to remove the webapp specific part / names on my application. For example http://mydomain.com/mywebapp/index.jsp and http://mydomain.com/mywebapp/serverpages/add-record.rr I need the user to just see http://mydomain.com/ on their browser. AFAIK, I can do this by creating an invisible frame. Any other better and easier approach. Thanks in Advance Richard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Fwd: [Validation] and local string insertion
Sorry ... resend, I cant find the previous one in the mail archive and I am not sure why the first one disappeared -Corey -- Forwarded message -- From: Corey Scott [EMAIL PROTECTED] Date: Thu, 18 Nov 2004 01:36:54 +0800 Subject: [Validation] and local string insertion To: [EMAIL PROTECTED] Hi, I have been trying to achieve the same in my validate method to the following extract from me validation.xml form name=UpdateTaskForm field property=txtTaskSummary depends=required msg name=required key=stdError.missing/ arg0 key=UpdateTaskForm.txtTaskSummary/ /field /form Extract from my message bundle: stdError.required.field=Please enter/choose a {0} UpdateTaskForm.txtTaskSummary=Task Summary My validate method: public ActionErrors validate( ActionMapping mapping, HttpServletRequest request) { ActionErrors errors = new ActionErrors(); if ((this.txtTaskSummary == null) || (this.txtTaskSummary.length() == 0)) { MessageResources resources = this.getServlet().getInternal(); errors.add( txtTaskSummary, new ActionMessage( stdError.required.field, resources.getMessage( request.getLocale(), UpdateTaskForm.txtTaskSummary))); } return errors; } Hopefully it is clear that I am trying get an output similar to: Please enter/choose a Task Summary But all I can get is: Please enter/choose a {0} // without the whole get resources stuff or Please enter/choose a null //code above I am getting the impression I am very much off track, any help would be great. Thanks, Corey - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
how to access oracle database on netwrk
hello, i am using oracle 9i as my database in my application. My database is on anothere machine in network. my struts-config.xml is like data-sources data-source type=org.apache.commons.dbcp.BasicDataSource set-property property=driverClassName value=com.mysql.jdbc.Driver / set-property property=url value=jdbc:mysql://localhost/employees / set-property property=username value=thinc/ set-property property=password value=thinc/ /data-source /data-sources now server is throwing an errors as cannot load JDBC driver called com.mysql.jdbc.Driver wht is wrong wiil i hav to import some external JDBC driver (on my pc no oracle is there ) Nishant Patil Software Engineer Cybage Software Pvt. Ltd. (A CMM Level 3 Company) West Avenue , Kalyani Nagar, Pune - 411 006 Tel: 91-20-4041700 -355 Email: [EMAIL PROTECTED] Website: www.cybage.com There's a difference between knowing the path, and walking the path
Re: JerichoFaces ?
Craig, I not only have no technical arguments against a View Helper design pattern, but the suggestion on the Wiki WhiteBoard for Struts both for the JerichoData and the JerichoFaces is an instance of advocating such a design pattern. What I don't trust is the page based controller. Jack Personally, I'm underwhelmed by the technical arguments made against a View Helper design pattern so far, so I'm not particularly interested (personally) in Jericho or JerichoFaces as a solution to anything -- but who knows, some of the other developers might be. -- You can't wake a person who is pretending to be asleep. ~Native Proverb~ Each man is good in His sight. It is not necessary for eagles to be crows. ~Hunkesni (Sitting Bull), Hunkpapa Sioux~ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: URL Customization
A frameset with a single frame in it (doesn't need to be invisible) will get rid of the /index.jsp or /serverpages/add-record.rr parts of the URL. To get rid of the context path (/mywebapp) part, you'l need to either install your application as the root webapp on the server (in Tomcat, for example, you deploy to $CATALINA_HOME/webapps/ROOT) or you'll need to configure the server to somehow dynamically remap requests internally. Craig On Thu, 18 Nov 2004 12:50:48 +0800, Richard [EMAIL PROTECTED] wrote: Hello Guys, I am not sure if this a Struts question. I think this is more of a general web devt thing. And since this is not a struts thing I am asking you guys to please help me or point me to a place where i can get help. thanks in advance im using struts 1.2.4 and tomcat 5.0.27. I need to remove the webapp specific part / names on my application. For example http://mydomain.com/mywebapp/index.jsp and http://mydomain.com/mywebapp/serverpages/add-record.rr I need the user to just see http://mydomain.com/ on their browser. AFAIK, I can do this by creating an invisible frame. Any other better and easier approach. Thanks in Advance Richard - 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: JerichoFaces ?
On Wed, 17 Nov 2004 21:43:14 -0800, Dakota Jack [EMAIL PROTECTED] wrote: Craig, I not only have no technical arguments against a View Helper design pattern, but the suggestion on the Wiki WhiteBoard for Struts both for the JerichoData and the JerichoFaces is an instance of advocating such a design pattern. What I don't trust is the page based controller. It's sort of interesting that a page controller is one of the things people really like about Tiles, for the same reason I like it -- cutting down on the number of moving parts :-). http://struts.apache.org/api/org/apache/struts/tiles/Controller.html Jack Craig Personally, I'm underwhelmed by the technical arguments made against a View Helper design pattern so far, so I'm not particularly interested (personally) in Jericho or JerichoFaces as a solution to anything -- but who knows, some of the other developers might be. -- You can't wake a person who is pretending to be asleep. ~Native Proverb~ Each man is good in His sight. It is not necessary for eagles to be crows. ~Hunkesni (Sitting Bull), Hunkpapa Sioux~ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: how to access oracle database on netwrk
You have to use Oracle thin driver instead. I don't remember the location of jar file named classes12.jar for example to be used with jdk1.3, but it would be available with an Oracle client installation or you can copy them from an existing oracle client/oracle installation. It is also available at http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/index.html Thanks Ramesh M -Original Message- From: Nishant [mailto:[EMAIL PROTECTED] Sent: Thursday, November 18, 2004 11:12 AM To: Struts Users Mailing List Subject: how to access oracle database on netwrk hello, i am using oracle 9i as my database in my application. My database is on anothere machine in network. my struts-config.xml is like data-sources data-source type=org.apache.commons.dbcp.BasicDataSource set-property property=driverClassName value=com.mysql.jdbc.Driver / set-property property=url value=jdbc:mysql://localhost/employees / set-property property=username value=thinc/ set-property property=password value=thinc/ /data-source /data-sources now server is throwing an errors as cannot load JDBC driver called com.mysql.jdbc.Driver wht is wrong wiil i hav to import some external JDBC driver (on my pc no oracle is there ) Nishant Patil Software Engineer Cybage Software Pvt. Ltd. (A CMM Level 3 Company) West Avenue , Kalyani Nagar, Pune - 411 006 Tel: 91-20-4041700 -355 Email: [EMAIL PROTECTED] Website: www.cybage.com There's a difference between knowing the path, and walking the path - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] how to print - jdk1.3?
Hi All: How to print document/pdf file which is available on server machine on user printer in asynchronous mode? TIA Regards, Viral - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
JDBC problem
i am tryin to connect with oracle Server on network. Now i am getting errors as No Suitable Driver i hav classes12.jar file in my jre\lib directory... still i am gettin error ... and also wht should be written in set-property property=url value=jdbc:mysql://dthinsrv/employees / value field of url... plz help.. thanks in advance .. Regards Nishant Patil Software Engineer Cybage Softwares Pvt. Ltd. (A CMM Level 3 Company) West Avenue, Kalyaninagar Pune - 411006 Ph. +91-20-4044700/4041700 Extn 355 [EMAIL PROTECTED] www.cybage.com There is difference between knowing the Path and walking on the Path
Re: Question regarding filters in html-tags
Hi David, David G. Friedman schrieb: René, By +1, I meant I would vote to add filter=true/false to the html:text and html:textarea tags as well. So, when you write you are using regular html tags, are you using a tag with bean write, like this: html type=text name=input value=bean:write filter=false name=beanName property=propertyName/ / Thanx for the information. Yes I'm using the HTML tags like this. Furthermore I'm using the select tags with logic:iterate inside to create the option entries. Best regards -- René Thol E-Mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: how to access oracle database on netwrk
You say you are using Oracle, but your configuration is for a MySQL database. For Oracle, your driver class is going to be oracle.jdbc.driver.OracleDriver. Your URL is going to follow this pattern: jdbc:oracle:thin:@hostname:port:db_name The database name is also known as a TNS name in Oracle terms. Usually this is something you have to obtain from whoever set up the database. You are also going to need to download the Oracle thin driver from the URL I gave you earlier. You may have to register, I can't remember, but it's painless if you do. The driver jar file (ojdbc14.jar) has to be in your server's classpath. You don't say what server you are using, but in the case of Tomcat, it goes in tomcat_home/common/lib/. The Oracle thin driver (the collection of classes which lives in the above mentioned jar file) is a Java library which enables your Java application to talk to the Oracle database server over a network using the JDBC API. The classes are implementations of JDBC. (Sorry if you already know all this.) You don't have to use the Struts data source configuration you are trying to use, but you can if you want. Consider it to be optional. It might be easier to just follow the documentation that comes with your server for setting up a JDBC connection pool (data source). You can get a reference to a Java DataSource instance using a standard JNDI lookup (there are tutorials on this). Again, if you are using Tomcat, the docs will help with this (I think there is an Oracle example). Hope this helps, Erik Nishant wrote: hello, i am using oracle 9i as my database in my application. My database is on anothere machine in network. my struts-config.xml is like data-sources data-source type=org.apache.commons.dbcp.BasicDataSource set-property property=driverClassName value=com.mysql.jdbc.Driver / set-property property=url value=jdbc:mysql://localhost/employees / set-property property=username value=thinc/ set-property property=password value=thinc/ /data-source /data-sources now server is throwing an errors as cannot load JDBC driver called com.mysql.jdbc.Driver wht is wrong wiil i hav to import some external JDBC driver (on my pc no oracle is there ) Nishant Patil Software Engineer Cybage Software Pvt. Ltd. (A CMM Level 3 Company) West Avenue , Kalyani Nagar, Pune - 411 006 Tel: 91-20-4041700 -355 Email: [EMAIL PROTECTED] Website: www.cybage.com There's a difference between knowing the path, and walking the path - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JerichoFaces ?
Again, Craig, we are in complete agreement. I also am madly in love with the basic idea behind Tiles and with what Tiles does. I don't see why everyone isn't. Tiles, however, uses a controller in a very different sense than the sense Struts uses a web framework controller in a MVC pattern. Tiles is not at all like Java ServerFaces. That is to mix apples and oranges. Tiles, unlike Java ServerFaces, is perfectly consistent with Struts. Indeed, the JerichoFaces envisioned at http://131.191.32.112:8080/ encompasses the whole Tiles idea. The fact that Tiles has an interface used to insert the referents of attributes in definitions which is called incidentally called Controller does not mean it is anything like a controller in an MVC framework. It is not. Tiles is not a page based MVC controller or any type of MVC controller at all, and is consistent with either a page based controller such as Java ServerFaces or a controller that keeps the view and the model appropriately separate such as Struts. RIght? The bottom line is that Shale is wholly inconsistent with the Struts approach. If Struts 2.0 becomes Shale, Struts is dead. That would be, I think, a shame. I would encourage Shale and Struts. I know that as things stand, I simply cannot go the Shale route. So far my concerns are magnified not ameliorated by my admitted learning curve on Java ServerFaces. If Shale were to adopt something like Java ServerFaces but consistent with Sttuts, that would be different. But that is not in the mix, so the difference is moot. As you can see, at http://131.191.32.112:8080/ I have now split up JerichoData and JerichoFaces. I think that a wholly separate event based architecture with a multithreaded scheduler on the side is needed for workflow. That is what I have been doing for about six months and I am very happy with the results. The View in the MVC does not care about the model, really. What it cares about is what eventually is moved to request, page (tile), session and application scope and is available to tags. Consequently, I think that an abstraction which provides a framework data center apart from the model data in databases, etc., not only makes sense but will allow workflows to concentrate on algorithms and policies and not worry about where the data is. The data will be where the interface between the JerichoFaces and JerichoData says it is. The basic idea is just to have a Data interface which JerichoFaces can use to retrieve its Data for its components. Thanks for your thoughts. Please feel free to smack me around if there is some legitimate sense in which Tiles Controller classes can be considered to be a controller in the MVC pattern in Struts. On Wed, 17 Nov 2004 21:52:56 -0800, Craig McClanahan [EMAIL PROTECTED] wrote: On Wed, 17 Nov 2004 21:43:14 -0800, Dakota Jack [EMAIL PROTECTED] wrote: Craig, I not only have no technical arguments against a View Helper design pattern, but the suggestion on the Wiki WhiteBoard for Struts both for the JerichoData and the JerichoFaces is an instance of advocating such a design pattern. What I don't trust is the page based controller. It's sort of interesting that a page controller is one of the things people really like about Tiles, for the same reason I like it -- cutting down on the number of moving parts :-). http://struts.apache.org/api/org/apache/struts/tiles/Controller.html Jack Craig Personally, I'm underwhelmed by the technical arguments made against a View Helper design pattern so far, so I'm not particularly interested (personally) in Jericho or JerichoFaces as a solution to anything -- but who knows, some of the other developers might be. -- You can't wake a person who is pretending to be asleep. ~Native Proverb~ Each man is good in His sight. It is not necessary for eagles to be crows. ~Hunkesni (Sitting Bull), Hunkpapa Sioux~ - 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]