DynaValidatorForm for java.lang.Integer
Hi all, I have a problem using Validator with DynaBeans. In my struts-config if I declare java.lang.String props for a DynaValidatorForm a "required" validation works fine, but if I change the props to java.lang.Integer the "required" validation fails ( no ActionErrors returned ). Please hep me! I'm using struts 1.1, validator 1.0.2, commons-beanutils 1.6.1 ( maybe this is the problem? ) on tomcat 5.1.19. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: DynaValidatorForm for java.lang.Integer
Use String. Anything else is asking of trouble. According to the party line (ref: struts dev list) action form properties should always be of type string. You can still validate whether a string is "1" for example or whether it looks like a date whatever, it doesn't have to be typed as such. On 19 Mar 2004, at 09:01, Duma Rolando wrote: Hi all, I have a problem using Validator with DynaBeans. In my struts-config if I declare java.lang.String props for a DynaValidatorForm a "required" validation works fine, but if I change the props to java.lang.Integer the "required" validation fails ( no ActionErrors returned ). Please hep me! I'm using struts 1.1, validator 1.0.2, commons-beanutils 1.6.1 ( maybe this is the problem? ) on tomcat 5.1.19. - 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]
JSPG0103E: Unable to open taglibrary /WEB-INF/struts-bean.tld
Hi All, In our project we are getting an error with the subject as the error message. We are getting this in the development environment. We are using WSAD 4.0. The interesting thing is we are not getting the error when we are using WAS 4.0.1 as part of WSAD but with WAS 4.0.2. I'm writing the error message again below. Have tried searching on struts, google and almost every other option but failed to find a solution to this... Has anyone else faced this? Is there a solution to this? thanks ansu [3/17/04 11:25:41:734 CST] 70060345 OSEListenerDi X PLGN0021E: Servlet Request Processor Exception: Virtual Host/WebGroup Not Found : The web group / has not been defined java.lang.ClassCastException: org.apache.xerces.jaxp.DocumentBuilderFactoryImpl at javax.xml.parsers.DocumentBuilderFactory.newInstance(DocumentBuilderFactory.java:147) at org.apache.jasper.compiler.JspUtil.parseXMLDoc(JspUtil.java:187) at org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(TagLibraryInfoImpl.java:473) at org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:305) at org.apache.jasper.compiler.JspParseEventListener.handleDirective(JspParseEventListener.java:800) at org.apache.jasper.compiler.DelegatingListener.handleDirective(DelegatingListener.java:116) at org.apache.jasper.compiler.Parser$Directive.accept(Parser.java:216) at org.apache.jasper.compiler.Parser.parse(Parser.java:1115) at org.apache.jasper.compiler.Parser.parse(Parser.java:1066) at org.apache.jasper.compiler.Parser.parse(Parser.java:1062) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:237) at org.apache.jasper.runtime.JspServlet.loadJSP(JspServlet.java:697) at org.apache.jasper.runtime.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:244) at org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.java:261) at org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:430) at org.apache.jasper.runtime.JspServlet.service(JspServlet.java:565) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletManager.java:827) at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(StrictLifecycleServlet.java:167) at com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifecycleServlet.java:297) at com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(StrictLifecycleServlet.java:110) at com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManager.java:472) at com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(ServletManager.java:1012) at com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(ServletManager.java:913) at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:523) at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:282) at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:112) at com.ibm.servlet.engine.webapp.SimpleFileServlet.doGet(SimpleFileServlet.java:223) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletManager.java:827) at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(StrictLifecycleServlet.java:167) at com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifecycleServlet.java:297) at com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(StrictLifecycleServlet.java:110) at com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManager.java:472) at com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(ServletManager.java:1012) at com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(ServletManager.java:913) at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java:523) at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:282) at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:112) at com.ibm.servlet.engine.srt.WebAppInvoker.doForward(WebAppInvoker.java:91) at com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:184) at com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:67) at com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:122) at com.ibm.servlet.engine.oselistener.OSEListenerDispat
portal concepts [was: what would it take to build site navigation into struts?]
After taking a BroadVision One-To-One Portal Developer Workshop this week and seeing how BroadVision uses Struts, I have come to realize that some of the functionality that their product provides could be built directly into Struts itself. Let's start with a simple site map: 0. Root 1. Home 1. Products 1. Product Line 1 1. Product A 2. Product B 3. Product C 2. Product Line 2 1. Product D 2. Product E 2. Personal Home Page 1. Personal Weather Portlet 2. Personal Stock Portlet First, BroadVision Portal provides an admin tool and an API to build page hierarchies like what is shown above. Every page within the page hierarchy knows itself, its parent, its siblings, and its children. Having an API like this prevents a page from ever becoming an orphan. It also allows sitemaps to be dynamically created and for each page to know how to build its own breadcrumb navigation like this: Home >> Products >> Product Line 1 >> Product B Second, each of the above pages can contain zero or more pieces of "content". Broadvision is designed so that multiple pages can point to the same "content". This is the same way multiple Struts Actions can point to the same JSP. Third, they provide a way to create a user profile. Fourth, BroadVision provides a way to define what they refer to as qualifiers. For instance: Department: IT, HR, Finance, Marketing, Sales, etc. User Type: Customer, Employee, Supplier, Distributor Role: Admin, Power User, User, Guest Language: English, French, German These qualifiers can be assigned to each page within the page hierarchy, each page's content items, and each user profile. This allows the portal to dynamically determine what content to display to a user based on what qualifiers have been assigned to the user. If no qualifiers have been assigned to a page, the page is publicly visible. Otherwise, unless the user profile has the same qualifiers assigned to it as the page, the page will not be visible. The same rules apply to the content items on the page. The cool part about this is that the user only sees the content relevant to them. Thus you are able to create truly dynamic content. There are, of course, a lot more features associated with BroadVision Portal than what I have listed above. I am mainly looking to have some type of Page Hierarchy concept built into Struts as a Plugin as tightly as Tiles is. The rest of the features could be added onto that concept over time. What do others think? Andy -Original Message- From: Adam Hardy [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 17, 2004 3:52 AM To: Struts Users Mailing List Subject: Re: what would it take to build site navigation into struts? You're talking about breadcrumbs as site navigation - just to be clear, because there is another implementation of breadcrumbs as history navigation. It is relatively simple to implement (and maintain) a navigation breadcrumb menu using Tiles, which shows the position of your page in the heirarchy. It is basic, so I'm not sure if it could fulfil what you describe as 'knowing its relationship to the rest of the pages' or an 'API to know the current page's parent siblings & children'. Perhaps a couple of examples to show what you mean would help. Adam On 03/17/2004 04:45 AM Andrew Freeman wrote: > I have been learning about a web portal tool called BroadVision Portal. One > of the nice things that it provides "out of the box" are breadcrumbs. It > allows you to define a hierarchical navigation system where each level of > the hierarchy can have a sub-navigation element and/or one or more "content" > items. You can compare this concept to a file system. Every webpage/link > knows its relationship to the rest of the pages/links. This means that > there is an API to know the current page's/link's parent, siblings, and > children. Microsoft's Whidbey release of ASP.NET will provide an API for > this. The bottom line is that having such a feature in Struts would make it > easy to build things like breadcrumbs. > > Does anyone have any idea of what it would take to build a "site navigation" > type concept into Struts? > > thanks, > Andy > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- struts 1.1 + tomcat 5.0.16 + java 1.4.2 Linux 2.4.20 Debian - 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]
File-Upload: Progress-Bar
Hello everybody! I'm up to the task to implement a progress bar for File-Uploads, cause the files that are uploaded to my Webapp can be quite large. Well as usual this problem is not easily solved on the HTTP-Browser upload side. I'm using Struts here so I'm also using the commons/FileUpload. I was planning to do it that way that I assign a unique number to every session's-upload and keep the current status of an upload in a singleton for access. In an additional frame (with refresh) I would like to show the progress bar. My question: Has anybody done something like this with Struts before and can give me some little advise? Or more specific: Is it possible to first get the complete filesize from the FormFiles and the do the real Upload during the Action (keeping track of the read bytes) Thx for every help!! ___ Tim Adler, Abt. SDA1 Adress Management Solutions AZ | Direct Carl-Bertelsmann Straße 161s D-33311 Gütersloh Tel.: 05241/ 80 - 89574 [EMAIL PROTECTED]
SessionTimeout handling
Hi, I am trying to handle session timeout by extending the ActionServlet. I am trying to use the request method isRequestedSessionIdValid() coupled with checking the session for my userbean. Please comment about this code. Advice if there is a better way to do session timeout trapping. /**/ public boolean processPreprocess(HttpServletRequest request, HttpServletResponse response) { /* "UserBean" is a bean which represents the logged in user. */ if( request.isRequestedSessionIdValid() || request.getSession().getAttribute("UserBean") != null) return true; else { try {request.getRequestDispatcher("SessionTimeout.do").forward(request,response); } catch(Exception e) { e.printStackTrace(); } return false; } } /**/ Regards, Sanoj Antony - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: SessionTimeout handling
I do something similar. I don't know which version of Struts you are using, but I decided to create a general SessionTimeoutException and forward the User to a SessionTimeout page when that error occurs. I'm simply configured a GeneralFoward for the SessionTimeout page. protected void ensureSessionSecurity(HttpServletRequest request) throws AzDiasMinerSessionTimeoutException { HttpSession session = request.getSession(false); if(session == null || session.isNew()) { session.invalidate(); throw new AzDiasMinerSessionTimeoutException(); } } On the respective page the User can read about the Timeout. You just need to catch and forward on this exception. } catch(AzDiasMinerSessionTimeoutException ase) { return mapping.findForward("session_timeout"); } I also did that in a subclass of Action. PLEASE NOTE: You have to check for isNew() cause Tomcat e.g. creates a new session even if your call getSession() with false. The Specs say that null should normally be returned instead. -Ursprüngliche Nachricht- Von: Sanoj, Antony (IE10) [mailto:[EMAIL PROTECTED] Gesendet: Freitag, 19. März 2004 10:48 An: [EMAIL PROTECTED] Betreff: SessionTimeout handling Hi, I am trying to handle session timeout by extending the ActionServlet. I am trying to use the request method isRequestedSessionIdValid() coupled with checking the session for my userbean. Please comment about this code. Advice if there is a better way to do session timeout trapping. /*** ***/ public boolean processPreprocess(HttpServletRequest request, HttpServletResponse response) { /* "UserBean" is a bean which represents the logged in user. */ if( request.isRequestedSessionIdValid() || request.getSession().getAttribute("UserBean") != null) return true; else { try { request.getRequestDispatcher("SessionTimeout.do").forward(request,response); } catch(Exception e) { e.printStackTrace(); } return false; } } /*** ***/ Regards, Sanoj Antony - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: SessionTimeout handling
If your container supports it use a Filter. And I think (perhaps don't know) that session timeout is something you usually configure the container to do, but again i'm not sure of your requirement. On 19 Mar 2004, at 10:48, Sanoj, Antony (IE10) wrote: Hi, I am trying to handle session timeout by extending the ActionServlet. I am trying to use the request method isRequestedSessionIdValid() coupled with checking the session for my userbean. Please comment about this code. Advice if there is a better way to do session timeout trapping. / *** ***/ public boolean processPreprocess(HttpServletRequest request, HttpServletResponse response) { /* "UserBean" is a bean which represents the logged in user. */ if( request.isRequestedSessionIdValid() || request.getSession().getAttribute("UserBean") != null) return true; else { try { request.getRequestDispatcher("SessionTimeout.do").forward(request,r esponse); } catch(Exception e) { e.printStackTrace(); } return false; } } / *** ***/ Regards, Sanoj Antony - 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: RE: Re: Performance Improvement :: Struts based applications
Raise the debug level for certain packages in your production environment (if you run debug there at all), set classes like log4j.logger.org.apache.commons.digester to FATAL. This will trim down your log files considerably. You should consider proper use of the logging levels within your application to provide meaningful INFO/ERROR messages so you should not have to run at DEBUG level anywhere other than in development. - How soon after starting up your appserver are you trying to hit your application ? You have to allow time for the appserver to initialise its resources. Tomcat 4.1.24 takes a little over 6 seconds to boot on one of our development boxes and initialise 7 (pre-deployed) applications, and be ready to service requests. If you are starting your appserver and having it redeploy your war file on startup then you should be expected to wait for it to initialise. If you setup connection pools on startup then check they are all available and none are timing out etc. As another user said you could always run JProbe to get to the root cause without too much hassle :) Chris McCormack -Original Message- From: Scott Piker [mailto:[EMAIL PROTECTED] Sent: 18 March 2004 22:23 To: [EMAIL PROTECTED] Subject: Re: RE: Re: Performance Improvement :: Struts based applications What's your logging level set to? We recently did a late roll-in of log4j to our app and discovered that when we set logging level to debug, the initial struts/tiles initialization process takes forever (>5 mins) and generates thousands of lines of debug statements as the various config files get parsed. >>> [EMAIL PROTECTED] 3/18/2004 3:19:19 PM >>> Chris, I have precompiled JSP files. So i do not think that is a problem. Rather I feel it is ActionServlet which is taking time to intialize on first startup. Yes, I tries to use the cache mechanism of Apache (in windows), like mod_cache, mod_file_cache, mod_mem_cache and mod_disk_cache. But could not see much improvement. But no cache mechanism in Tomcat.Or are you talking of something else? Apache provides cache taglibs for the JSPs. Do you recommend to use that?? The site that you have mentioned http://wiki.opensymphony.com/space/OSCache, I have been to there, but that is a commercial one. I want a freeware. Can you give me some reference? Regards, Satya. that On Thu, 18 Mar 2004 McCormack, Chris wrote : >If you build your war file using ant then you can use jasper (see >org.apache.jasper.JspC) to precompile your jsps. This is useful if you are deploying >your app to a live user environment and dont want the initial compile time to impact >any users experience. > >On top of that you could use tomcat/apache mods to compress requests etc. > >If you are serious about needing bigger performance boosts, then look at partial/full >caching. i.e store in server ram/disk the static or infrequently changing parts of >your application (jsp or java objects), or have a small cache period on dynamic but >less frequently updated parts of your application. >There are a few companies that ply these out of the box caching solutions on >companies now for extortionate cost (naming no names) but there are a few excellent >open source contenders. The best of the open source solutions I have used is this one >: http://wiki.opensymphony.com/space/OSCache (It does tie you in to using HttpSession >unfortunately, but with a few lines of code you can easily work around this). > >It is a shame that this project http://www.jcp.org/en/jsr/detail?id=128 is not in >progress, anyone on this list working on it ? ;) > >cheers >Chris McCormack > >-Original Message- > From: Axel Groß [mailto:[EMAIL PROTECTED] >Sent: 18 March 2004 14:43 >To: Struts Users Mailing List >Cc: [EMAIL PROTECTED] >Subject: Re: Re: Performace Improvement :: Struts based applications > > >some IDEs also precompile the pages... >axel > >On 2004-03-18 at 14:16:26 +0100, [EMAIL PROTECTED] wrote: > > The reason is jsps are not compiled when you hit the pages the first time.So the > > first call will always be slow as it alos has to compile jsps.The subsequent calls > > will use the compiled jsps and hence faster. > > > > Some server/ServletEngines have the option to precompile jsps. > > > > HTH. > > > > Regards, > > Shirish > > > > > > -Original Message- > > From: Satya Narayan Dash [mailto:[EMAIL PROTECTED] > > Sent: Thursday, March 18, 2004 2:13 PM > > To: Struts Users Mailing List > > Cc: Vic Cekvenich > > Subject: Re: Re: Performace Improvement :: Struts based applications > > > > > > Hi, > > > > I have done the testing of the view layer. And what is peculiar is when i am > > hitting the ServletEngine for the first time, then it takes a lot of time, but > > subsequent hits take less time. > > > > Is it because the ActionServlet is not initiliazed, though I have started the > > engine? > > > > I would like to know if any recommended technique is given to improve the > > perfor
RE: Database backed forms
I guess your first place to look would be DynaActionForm - this base class dynamically creates FormAction objects setting the properties from the struts-config file. http://jakarta.apache.org/struts/api/org/apache/struts/action/DynaAction Form.html DynaValidatorActionForm adds validator support to this. Perhaps you could extend this class to add your own methods for specifying form properties on the fly. The key function seems to be initialize(FormBeanConfig) - FormBeanConfig "represents the configuration information of a element in a Struts configuration file". So create a FormBeanConfig object in code to represent the dynamic data you want and then initialize a DynaActionForm with this object. Add properties to FormBeanConfig with addFormPropertyConfig. That sounds like a realistic starting point... Anyone else have any ideas suggestions or corrections? -Original Message- From: Melonie Brown [mailto:[EMAIL PROTECTED] Sent: 18 March 2004 18:30 To: [EMAIL PROTECTED] Subject: Database backed forms I have written a very rough website page content management system using Struts and OJB. (The goal being to allow end users to modify content without having to know anything about Struts or the code behind the pages.) That's working all well and good, but now they want to be able to create forms "on the fly". I would like to store all of the form components and validation in the database as well, but I'm not sure how to represent that in Struts (since there's no ValidatorActionDatabaseForm). I would appreciate any advice, tips/techniques, or gotchas that you guys could provide. __ Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: SessionTimeout handling
I am using Struts1.1 with Tomcat5.0. The reason why I am extending ActionServlet is to handle the timeout in a central place. Target environment might be Websphere 4.0. I heard it doesn't support Filters. My requirement is not to propogate the session timeout handling to action classes. Regards, Sanoj Antony -Original Message- From: Mark Lowe [mailto:[EMAIL PROTECTED] Sent: Friday, March 19, 2004 3:28 PM To: Struts Users Mailing List Subject: Re: SessionTimeout handling If your container supports it use a Filter. And I think (perhaps don't know) that session timeout is something you usually configure the container to do, but again i'm not sure of your requirement. On 19 Mar 2004, at 10:48, Sanoj, Antony (IE10) wrote: > Hi, > > I am trying to handle session timeout by extending the ActionServlet. > > I am trying to use the request method isRequestedSessionIdValid() > coupled with checking the session for my userbean. > > Please comment about this code. Advice if there is a better way to do > session timeout trapping. > > / > *** > ***/ > > public boolean processPreprocess(HttpServletRequest > request, HttpServletResponse response) > { > > /* "UserBean" is a bean which represents the logged in user. */ > if( request.isRequestedSessionIdValid() > || request.getSession().getAttribute("UserBean") != null) > return true; > else > { > try > { > request.getRequestDispatcher("SessionTimeout.do").forward(request,r > esponse); > } > catch(Exception e) > { > e.printStackTrace(); > } > return false; > } > } > > / > *** > ***/ > > Regards, > Sanoj Antony > - > 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]
Help with StrutsStudio
Has anyone used JNDI Naming for Excadel Struts Studio using Tomcat Server 4. following is the code (how it shud be) for JNDI Naming for an EJB with JNDI Name VesselManager Context ctx = new javax.naming.InitialContext(); Object ref = ctx.lookup("VesselManager"); VesselManagerHome vesselManagerHome = (VesselManagerHome) PortableRemoteObject.narrow(ref, VesselManagerHome.class); vesselManager = vesselManagerHome.create(); According to Tomcat Documentatin .. it should be like this :: Context ctx = new javax.naming.InitialContext();Context envCtx = (Context) ctx.lookup("java:comp/env"); Object ref2 = envCtx.lookup("VesselManager"); VesselManagerHome vesselManagerHome = (VesselManagerHome) PortableRemoteObject.narrow(ref2, VesselManagerHome.class); vesselManager = vesselManagerHome.create(); .. any help for using EJBs in StrutsStudio Or even just struts would be highly appreciated. Thanks in Advance... farrokh. 15 Mbytes Free Web-based and POP3 Sign up now: http://www.gawab.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: SessionTimeout handling
Well I simply subclassed "Action" to my own and made the session-checking configurable through properties for the respective ActionMapping. Therefore you simply need to subclass ActionMapping also and put this on top of your s: Properties will be read to the customer ActionMapping throgh reflection just like in FormBeans. -Ursprüngliche Nachricht- Von: Sanoj, Antony (IE10) [mailto:[EMAIL PROTECTED] Gesendet: Freitag, 19. März 2004 11:14 An: Struts Users Mailing List Betreff: RE: SessionTimeout handling I am using Struts1.1 with Tomcat5.0. The reason why I am extending ActionServlet is to handle the timeout in a central place. Target environment might be Websphere 4.0. I heard it doesn't support Filters. My requirement is not to propogate the session timeout handling to action classes. Regards, Sanoj Antony -Original Message- From: Mark Lowe [mailto:[EMAIL PROTECTED] Sent: Friday, March 19, 2004 3:28 PM To: Struts Users Mailing List Subject: Re: SessionTimeout handling If your container supports it use a Filter. And I think (perhaps don't know) that session timeout is something you usually configure the container to do, but again i'm not sure of your requirement. On 19 Mar 2004, at 10:48, Sanoj, Antony (IE10) wrote: > Hi, > > I am trying to handle session timeout by extending the ActionServlet. > > I am trying to use the request method isRequestedSessionIdValid() > coupled with checking the session for my userbean. > > Please comment about this code. Advice if there is a better way to do > session timeout trapping. > > / > *** > ***/ > > public boolean processPreprocess(HttpServletRequest > request, HttpServletResponse response) > { > > /* "UserBean" is a bean which represents the logged in user. */ > if( request.isRequestedSessionIdValid() > || request.getSession().getAttribute("UserBean") != null) > return true; > else > { > try > { > request.getRequestDispatcher("SessionTimeout.do").forward(request,r > esponse); > } > catch(Exception e) > { > e.printStackTrace(); > } > return false; > } > } > > / > *** > ***/ > > Regards, > Sanoj Antony > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
FormFile Upload restrictions
Hi, Is there any size restriction in uploading any file using the FormFile? If there are any restrictions in file upload, what should be the maximum file size that can be uploaded? Are there any other ways of using FormFile and uploading files as large as 800MB - 1GB? Thanks in advance. Thanks and Regards D.Badrinarayanan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Database backed forms
I've seen many posts on "Not pre-populating action forms". This seems to be a design decision as action forms are only for validating input. However, in most applications I write I don't want to only input data but to view and edit existing data as well. For me ActionForms seem to be the best way to code an input/output layer between the browser and the backend. In order to view and edit existing data, the action form needs to pre-populate its data from the backend before displaying the form. How would you suggest implementing view/edit functionality without pre-populating action forms? I've coded pre-populating action forms in the following way: 1) I've got session objects to maintain my current system state (whether I'm looking at an extisting object or creating a new one) 2) I've extended DynaValidatorActionForm to provide a reset() implementation. If required, the actionForm's properties are populated from the backend model. -Original Message- From: Mark Lowe [mailto:[EMAIL PROTECTED] Sent: 19 March 2004 10:41 To: Struts Users Mailing List Subject: Re: Database backed forms If there's talk of having action forms populated by themselves then I wouldn't. For example you want to create a new record, to instantiate a new form bean you'd perhaps have to save a record to the db, and all this before the user decides what s/he wants to do with it. niall wrote some classes that could be useful. http://www.niallp.pwp.blueyonder.co.uk On 19 Mar 2004, at 11:05, Brendan Richards wrote: > I guess your first place to look would be DynaActionForm - this base > class dynamically creates FormAction objects setting the properties > from > the struts-config file. > > http://jakarta.apache.org/struts/api/org/apache/struts/action/ > DynaAction > Form.html > > DynaValidatorActionForm adds validator support to this. > > Perhaps you could extend this class to add your own methods for > specifying form properties on the fly. > > The key function seems to be initialize(FormBeanConfig) - > FormBeanConfig > "represents the configuration information of a element in a > Struts configuration file". > > So create a FormBeanConfig object in code to represent the dynamic data > you want and then initialize a DynaActionForm with this object. > > Add properties to FormBeanConfig with addFormPropertyConfig. > > That sounds like a realistic starting point... > > Anyone else have any ideas suggestions or corrections? > > > > > -Original Message- > From: Melonie Brown [mailto:[EMAIL PROTECTED] > Sent: 18 March 2004 18:30 > To: [EMAIL PROTECTED] > Subject: Database backed forms > > I have written a very rough website page content > management system using Struts and OJB. (The goal > being to allow end users to modify content without > having to know anything about Struts or the code > behind the pages.) > > That's working all well and good, but now they want to > be able to create forms "on the fly". > > I would like to store all of the form components and > validation in the database as well, but I'm not sure > how to represent that in Struts (since there's no > ValidatorActionDatabaseForm). > > I would appreciate any advice, tips/techniques, or > gotchas that you guys could provide. > > __ > Do you Yahoo!? > Yahoo! Mail - More reliable, more storage, less spam > 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] > - 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: File-Upload: Progress-Bar
A simpler solution that may still meet your needs might be to use an animated GIF on a pop-up just to give the user some feedback that the upload is still in progress and that they should be patient. You could setup something like this: The HTML form with upload file input element has a hidden field with some UUID generated by the Action. The UUID is just some unique ID to avoid having two upload forms with the same ID. For instance, the session-id or perhaps session-id+current_time would work fine for a UUID. Have the javascript onSubmit for the form pop-up a window, where the content of that window will be /uploadStatus.do?UUID=234344. Your /uploadStatus.do action will look for the UUID and forward to a JSP with the animated GIF in it if that file has not completed uploading. That JSP will have a meta-refresh in it that will refresh the content of the pop-up every few seconds. The form submit with the file upload input element will be uploading the file for a while. When it finishes, it will indicate that the file upload with UUID=234344 has completed to some server-side upload-tracking subsystem. Then it will forward or redirect to whatever page the user should see when the upload completes. The pop-up status window will refresh itself within a second or two, and the /uploadStatus.do action will determine that the upload for the file with UUID=234344 has completed (by checking with the server-side upload-tracking subsystem). It will then forward to a JSP that closes the pop-up window or shows a message that the upload has completed. This isn't a progress bar, but it should be easier to implement. You could even use a fast-cycling animated GIF that looks like a progress bar (but doesn't really relate to the actual % progress) if that would satisfy your UI design requirements. -Max - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, March 19, 2004 1:31 AM Subject: File-Upload: Progress-Bar Hello everybody! I'm up to the task to implement a progress bar for File-Uploads, cause the files that are uploaded to my Webapp can be quite large. Well as usual this problem is not easily solved on the HTTP-Browser upload side. I'm using Struts here so I'm also using the commons/FileUpload. I was planning to do it that way that I assign a unique number to every session's-upload and keep the current status of an upload in a singleton for access. In an additional frame (with refresh) I would like to show the progress bar. My question: Has anybody done something like this with Struts before and can give me some little advise? Or more specific: Is it possible to first get the complete filesize from the FormFiles and the do the real Upload during the Action (keeping track of the read bytes) Thx for every help!! ___ Tim Adler, Abt. SDA1 Adress Management Solutions AZ | Direct Carl-Bertelsmann Straße 161s D-33311 Gütersloh Tel.: 05241/ 80 - 89574 [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: portal concepts [was: what would it take to build site navigation into struts?]
Are you aiming to put Broadvision out of business? ;) It sounds like quite a task. The admin tool that you use to build page heirarchies - how does it store the info? XML presumably? And the XML is read by the application at run-time. And so your plug-in would do the same - read its config from an XML file to establish the heirarchy and relationships. The dynamic part sounds like a major piece of work - but you wouldn't necessarily need that - or is it integral? I suppose it depends on how much static content you have. Obviously with lots of static content, then it would seem churlish not to allow dynamic rearrangement of the site map. But it depends on how you do it - most of the URLs in a struts-tiles app are based in files that can only be reloaded by reloading the whole app. I think that's your first worry. Adam On 03/19/2004 09:45 AM Andrew Freeman wrote: After taking a BroadVision One-To-One Portal Developer Workshop this week and seeing how BroadVision uses Struts, I have come to realize that some of the functionality that their product provides could be built directly into Struts itself. Let's start with a simple site map: 0. Root 1. Home 1. Products 1. Product Line 1 1. Product A 2. Product B 3. Product C 2. Product Line 2 1. Product D 2. Product E 2. Personal Home Page 1. Personal Weather Portlet 2. Personal Stock Portlet First, BroadVision Portal provides an admin tool and an API to build page hierarchies like what is shown above. Every page within the page hierarchy knows itself, its parent, its siblings, and its children. Having an API like this prevents a page from ever becoming an orphan. It also allows sitemaps to be dynamically created and for each page to know how to build its own breadcrumb navigation like this: Home >> Products >> Product Line 1 >> Product B Second, each of the above pages can contain zero or more pieces of "content". Broadvision is designed so that multiple pages can point to the same "content". This is the same way multiple Struts Actions can point to the same JSP. Third, they provide a way to create a user profile. Fourth, BroadVision provides a way to define what they refer to as qualifiers. For instance: Department: IT, HR, Finance, Marketing, Sales, etc. User Type: Customer, Employee, Supplier, Distributor Role: Admin, Power User, User, Guest Language: English, French, German These qualifiers can be assigned to each page within the page hierarchy, each page's content items, and each user profile. This allows the portal to dynamically determine what content to display to a user based on what qualifiers have been assigned to the user. If no qualifiers have been assigned to a page, the page is publicly visible. Otherwise, unless the user profile has the same qualifiers assigned to it as the page, the page will not be visible. The same rules apply to the content items on the page. The cool part about this is that the user only sees the content relevant to them. Thus you are able to create truly dynamic content. There are, of course, a lot more features associated with BroadVision Portal than what I have listed above. I am mainly looking to have some type of Page Hierarchy concept built into Struts as a Plugin as tightly as Tiles is. The rest of the features could be added onto that concept over time. What do others think? -- struts 1.1 + tomcat 5.0.16 + java 1.4.2 Linux 2.4.20 Debian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Database backed forms
If there's talk of having action forms populated by themselves then I wouldn't. For example you want to create a new record, to instantiate a new form bean you'd perhaps have to save a record to the db, and all this before the user decides what s/he wants to do with it. niall wrote some classes that could be useful. http://www.niallp.pwp.blueyonder.co.uk On 19 Mar 2004, at 11:05, Brendan Richards wrote: I guess your first place to look would be DynaActionForm - this base class dynamically creates FormAction objects setting the properties from the struts-config file. http://jakarta.apache.org/struts/api/org/apache/struts/action/ DynaAction Form.html DynaValidatorActionForm adds validator support to this. Perhaps you could extend this class to add your own methods for specifying form properties on the fly. The key function seems to be initialize(FormBeanConfig) - FormBeanConfig "represents the configuration information of a element in a Struts configuration file". So create a FormBeanConfig object in code to represent the dynamic data you want and then initialize a DynaActionForm with this object. Add properties to FormBeanConfig with addFormPropertyConfig. That sounds like a realistic starting point... Anyone else have any ideas suggestions or corrections? -Original Message- From: Melonie Brown [mailto:[EMAIL PROTECTED] Sent: 18 March 2004 18:30 To: [EMAIL PROTECTED] Subject: Database backed forms I have written a very rough website page content management system using Struts and OJB. (The goal being to allow end users to modify content without having to know anything about Struts or the code behind the pages.) That's working all well and good, but now they want to be able to create forms "on the fly". I would like to store all of the form components and validation in the database as well, but I'm not sure how to represent that in Struts (since there's no ValidatorActionDatabaseForm). I would appreciate any advice, tips/techniques, or gotchas that you guys could provide. __ Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
validator form and OR-relations between fields
hi struts-users is it possible with the validator-framework to check if ONE of TWO fields contains text? i just see the possibility to set both fields as required or not, but not to say "if in one of the two fields is text, the forms ok" thanks and greetings stefan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: File-Upload: Progress-Bar
Well that was generally what I was planning to do. The GIF-animation is somewhat a good idea, but if I do such an server-side upload system, then I could also do a real-percentage progress bar. I think a simple open-window-close-window could be done with JavaScript also. But anyway thanks for the suggestion. Now the tricky part is: How do I do this server-side upload-system? Perhaps you can help here also. I already implemented a singleton that keeps track of upload-numbers for every session. So that I always have a unique identifier combined out SessionId and Upload-Number. My problem is tracking down the current status of an upload. Meaning: When I upload files with Struts then the File is immediately available through the FormFiles. Now: Is it possible to handle this upload through the FileForm.getInputStream(). Or is the File already completely read, when I get access to that method in the Action?! And if that is so, do I have to parse the Multipart-Request by myself then?? -Ursprüngliche Nachricht- Von: Max Cooper [mailto:[EMAIL PROTECTED] Gesendet: Freitag, 19. März 2004 12:03 An: Struts Users Mailing List Betreff: Re: File-Upload: Progress-Bar A simpler solution that may still meet your needs might be to use an animated GIF on a pop-up just to give the user some feedback that the upload is still in progress and that they should be patient. You could setup something like this: The HTML form with upload file input element has a hidden field with some UUID generated by the Action. The UUID is just some unique ID to avoid having two upload forms with the same ID. For instance, the session-id or perhaps session-id+current_time would work fine for a UUID. Have the javascript onSubmit for the form pop-up a window, where the content of that window will be /uploadStatus.do?UUID=234344. Your /uploadStatus.do action will look for the UUID and forward to a JSP with the animated GIF in it if that file has not completed uploading. That JSP will have a meta-refresh in it that will refresh the content of the pop-up every few seconds. The form submit with the file upload input element will be uploading the file for a while. When it finishes, it will indicate that the file upload with UUID=234344 has completed to some server-side upload-tracking subsystem. Then it will forward or redirect to whatever page the user should see when the upload completes. The pop-up status window will refresh itself within a second or two, and the /uploadStatus.do action will determine that the upload for the file with UUID=234344 has completed (by checking with the server-side upload-tracking subsystem). It will then forward to a JSP that closes the pop-up window or shows a message that the upload has completed. This isn't a progress bar, but it should be easier to implement. You could even use a fast-cycling animated GIF that looks like a progress bar (but doesn't really relate to the actual % progress) if that would satisfy your UI design requirements. -Max - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, March 19, 2004 1:31 AM Subject: File-Upload: Progress-Bar Hello everybody! I'm up to the task to implement a progress bar for File-Uploads, cause the files that are uploaded to my Webapp can be quite large. Well as usual this problem is not easily solved on the HTTP-Browser upload side. I'm using Struts here so I'm also using the commons/FileUpload. I was planning to do it that way that I assign a unique number to every session's-upload and keep the current status of an upload in a singleton for access. In an additional frame (with refresh) I would like to show the progress bar. My question: Has anybody done something like this with Struts before and can give me some little advise? Or more specific: Is it possible to first get the complete filesize from the FormFiles and the do the real Upload during the Action (keeping track of the read bytes) Thx for every help!! ___ Tim Adler, Abt. SDA1 Adress Management Solutions AZ | Direct Carl-Bertelsmann Straße 161s D-33311 Gütersloh Tel.: 05241/ 80 - 89574 [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: Database backed forms
How would you suggest implementing view/edit functionality without pre-populating action forms? prepopulating is exactly what i would do, just in an action not in the action form. Sure you can shoe-horn checking your system state constantly but just seems complicated. Surely some transaction management when you come to insert/update/delete data should do the job. 2) I've extended DynaValidatorActionForm to provide a reset() implementation. If required, the actionForm's properties are populated from the backend model. If you've got that far then the question of dynamically generating fields shouldn't be a problem. On 19 Mar 2004, at 11:58, Brendan Richards wrote: I've seen many posts on "Not pre-populating action forms". This seems to be a design decision as action forms are only for validating input. However, in most applications I write I don't want to only input data but to view and edit existing data as well. For me ActionForms seem to be the best way to code an input/output layer between the browser and the backend. In order to view and edit existing data, the action form needs to pre-populate its data from the backend before displaying the form. How would you suggest implementing view/edit functionality without pre-populating action forms? I've coded pre-populating action forms in the following way: 1) I've got session objects to maintain my current system state (whether I'm looking at an extisting object or creating a new one) 2) I've extended DynaValidatorActionForm to provide a reset() implementation. If required, the actionForm's properties are populated from the backend model. -Original Message- From: Mark Lowe [mailto:[EMAIL PROTECTED] Sent: 19 March 2004 10:41 To: Struts Users Mailing List Subject: Re: Database backed forms If there's talk of having action forms populated by themselves then I wouldn't. For example you want to create a new record, to instantiate a new form bean you'd perhaps have to save a record to the db, and all this before the user decides what s/he wants to do with it. niall wrote some classes that could be useful. http://www.niallp.pwp.blueyonder.co.uk On 19 Mar 2004, at 11:05, Brendan Richards wrote: I guess your first place to look would be DynaActionForm - this base class dynamically creates FormAction objects setting the properties from the struts-config file. http://jakarta.apache.org/struts/api/org/apache/struts/action/ DynaAction Form.html DynaValidatorActionForm adds validator support to this. Perhaps you could extend this class to add your own methods for specifying form properties on the fly. The key function seems to be initialize(FormBeanConfig) - FormBeanConfig "represents the configuration information of a element in a Struts configuration file". So create a FormBeanConfig object in code to represent the dynamic data you want and then initialize a DynaActionForm with this object. Add properties to FormBeanConfig with addFormPropertyConfig. That sounds like a realistic starting point... Anyone else have any ideas suggestions or corrections? -Original Message- From: Melonie Brown [mailto:[EMAIL PROTECTED] Sent: 18 March 2004 18:30 To: [EMAIL PROTECTED] Subject: Database backed forms I have written a very rough website page content management system using Struts and OJB. (The goal being to allow end users to modify content without having to know anything about Struts or the code behind the pages.) That's working all well and good, but now they want to be able to create forms "on the fly". I would like to store all of the form components and validation in the database as well, but I'm not sure how to represent that in Struts (since there's no ValidatorActionDatabaseForm). I would appreciate any advice, tips/techniques, or gotchas that you guys could provide. __ Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam 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] - 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: Database backed forms
> prepopulating is exactly what i would do, just in an action not in the > action form. Ah! That makes perfect sense. Keep the action form only for temporarily holding the data we're input/outputting and do all work in the actions. If you want to edit have a 'viewEdit' action that populates the Action form and displays. Then to save, have a 'submitEdit' action. Sounds like a much better way of going about it... Thanks. -Original Message- From: Mark Lowe [mailto:[EMAIL PROTECTED] Sent: 19 March 2004 11:41 To: Struts Users Mailing List Subject: Re: Database backed forms > How would you suggest implementing view/edit functionality without > pre-populating action forms? prepopulating is exactly what i would do, just in an action not in the action form. Sure you can shoe-horn checking your system state constantly but just seems complicated. Surely some transaction management when you come to insert/update/delete data should do the job. > 2) I've extended DynaValidatorActionForm to provide a reset() > implementation. If required, the actionForm's properties are populated > from the backend model. If you've got that far then the question of dynamically generating fields shouldn't be a problem. On 19 Mar 2004, at 11:58, Brendan Richards wrote: > I've seen many posts on "Not pre-populating action forms". This seems > to > be a design decision as action forms are only for validating input. > > However, in most applications I write I don't want to only input data > but to view and edit existing data as well. For me ActionForms seem to > be the best way to code an input/output layer between the browser and > the backend. > In order to view and edit existing data, the action form needs to > pre-populate its data from the backend before displaying the form. > > How would you suggest implementing view/edit functionality without > pre-populating action forms? > > I've coded pre-populating action forms in the following way: > 1) I've got session objects to maintain my current system state > (whether > I'm looking at an extisting object or creating a new one) > 2) I've extended DynaValidatorActionForm to provide a reset() > implementation. If required, the actionForm's properties are populated > from the backend model. > > -Original Message- > From: Mark Lowe [mailto:[EMAIL PROTECTED] > Sent: 19 March 2004 10:41 > To: Struts Users Mailing List > Subject: Re: Database backed forms > > If there's talk of having action forms populated by themselves then I > wouldn't. > > For example you want to create a new record, to instantiate a new form > bean you'd perhaps have to save a record to the db, and all this before > > the user decides what s/he wants to do with it. > > niall wrote some classes that could be useful. > > http://www.niallp.pwp.blueyonder.co.uk > > > > On 19 Mar 2004, at 11:05, Brendan Richards wrote: > >> I guess your first place to look would be DynaActionForm - this base >> class dynamically creates FormAction objects setting the properties >> from >> the struts-config file. >> >> http://jakarta.apache.org/struts/api/org/apache/struts/action/ >> DynaAction >> Form.html >> >> DynaValidatorActionForm adds validator support to this. >> >> Perhaps you could extend this class to add your own methods for >> specifying form properties on the fly. >> >> The key function seems to be initialize(FormBeanConfig) - >> FormBeanConfig >> "represents the configuration information of a element in > a >> Struts configuration file". >> >> So create a FormBeanConfig object in code to represent the dynamic > data >> you want and then initialize a DynaActionForm with this object. >> >> Add properties to FormBeanConfig with addFormPropertyConfig. >> >> That sounds like a realistic starting point... >> >> Anyone else have any ideas suggestions or corrections? >> >> >> >> >> -Original Message- >> From: Melonie Brown [mailto:[EMAIL PROTECTED] >> Sent: 18 March 2004 18:30 >> To: [EMAIL PROTECTED] >> Subject: Database backed forms >> >> I have written a very rough website page content >> management system using Struts and OJB. (The goal >> being to allow end users to modify content without >> having to know anything about Struts or the code >> behind the pages.) >> >> That's working all well and good, but now they want to >> be able to create forms "on the fly". >> >> I would like to store all of the form components and >> validation in the database as well, but I'm not sure >> how to represent that in Struts (since there's no >> ValidatorActionDatabaseForm). >> >> I would appreciate any advice, tips/techniques, or >> gotchas that you guys could provide. >> >> __ >> Do you Yahoo!? >> Yahoo! Mail - More reliable, more storage, less spam >> http://mail.yahoo.com >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> >> --
Re: Database backed forms
This is just my opinion but for editor style forms lookupdispatchaction is the dogs. Especially if you want to avoiding scoping forms to httpsession. The classes are longer but less. On 19 Mar 2004, at 12:55, Brendan Richards wrote: prepopulating is exactly what i would do, just in an action not in the action form. Ah! That makes perfect sense. Keep the action form only for temporarily holding the data we're input/outputting and do all work in the actions. If you want to edit have a 'viewEdit' action that populates the Action form and displays. Then to save, have a 'submitEdit' action. Sounds like a much better way of going about it... Thanks. -Original Message- From: Mark Lowe [mailto:[EMAIL PROTECTED] Sent: 19 March 2004 11:41 To: Struts Users Mailing List Subject: Re: Database backed forms How would you suggest implementing view/edit functionality without pre-populating action forms? prepopulating is exactly what i would do, just in an action not in the action form. Sure you can shoe-horn checking your system state constantly but just seems complicated. Surely some transaction management when you come to insert/update/delete data should do the job. 2) I've extended DynaValidatorActionForm to provide a reset() implementation. If required, the actionForm's properties are populated from the backend model. If you've got that far then the question of dynamically generating fields shouldn't be a problem. On 19 Mar 2004, at 11:58, Brendan Richards wrote: I've seen many posts on "Not pre-populating action forms". This seems to be a design decision as action forms are only for validating input. However, in most applications I write I don't want to only input data but to view and edit existing data as well. For me ActionForms seem to be the best way to code an input/output layer between the browser and the backend. In order to view and edit existing data, the action form needs to pre-populate its data from the backend before displaying the form. How would you suggest implementing view/edit functionality without pre-populating action forms? I've coded pre-populating action forms in the following way: 1) I've got session objects to maintain my current system state (whether I'm looking at an extisting object or creating a new one) 2) I've extended DynaValidatorActionForm to provide a reset() implementation. If required, the actionForm's properties are populated from the backend model. -Original Message- From: Mark Lowe [mailto:[EMAIL PROTECTED] Sent: 19 March 2004 10:41 To: Struts Users Mailing List Subject: Re: Database backed forms If there's talk of having action forms populated by themselves then I wouldn't. For example you want to create a new record, to instantiate a new form bean you'd perhaps have to save a record to the db, and all this before the user decides what s/he wants to do with it. niall wrote some classes that could be useful. http://www.niallp.pwp.blueyonder.co.uk On 19 Mar 2004, at 11:05, Brendan Richards wrote: I guess your first place to look would be DynaActionForm - this base class dynamically creates FormAction objects setting the properties from the struts-config file. http://jakarta.apache.org/struts/api/org/apache/struts/action/ DynaAction Form.html DynaValidatorActionForm adds validator support to this. Perhaps you could extend this class to add your own methods for specifying form properties on the fly. The key function seems to be initialize(FormBeanConfig) - FormBeanConfig "represents the configuration information of a element in a Struts configuration file". So create a FormBeanConfig object in code to represent the dynamic data you want and then initialize a DynaActionForm with this object. Add properties to FormBeanConfig with addFormPropertyConfig. That sounds like a realistic starting point... Anyone else have any ideas suggestions or corrections? -Original Message- From: Melonie Brown [mailto:[EMAIL PROTECTED] Sent: 18 March 2004 18:30 To: [EMAIL PROTECTED] Subject: Database backed forms I have written a very rough website page content management system using Struts and OJB. (The goal being to allow end users to modify content without having to know anything about Struts or the code behind the pages.) That's working all well and good, but now they want to be able to create forms "on the fly". I would like to store all of the form components and validation in the database as well, but I'm not sure how to represent that in Struts (since there's no ValidatorActionDatabaseForm). I would appreciate any advice, tips/techniques, or gotchas that you guys could provide. __ Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-ma
access variable value in html tag
Dear, I'm not an expert in Struts and Java. I need some simple help: Everything works fine, but at ??? mark I would like take account.no_account like ${accounts.number}, but it doesn't work. May someone can give me a small note about the right syntax to get the value from accounts.number as text in the quotes. Thanks Regards J. Steltner - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts cookbook
Danilo: Is there a chapter or two which you could make available on-line for a preview..? :) Geeta Danilo Gurovich wrote: > Actually, a struts cookbook is just in the finishing stages. George > Franciscus and I have been hard at work at it for the last year, and > it's in final review.
Re: Struts cookbook
Good Suggestion, -Jignesh On Friday 19 March 2004 18:17, Geeta Ramani wrote: > Danilo: > > Is there a chapter or two which you could make available on-line for a > preview..? :) > > Geeta > > Danilo Gurovich wrote: > > Actually, a struts cookbook is just in the finishing stages. George > > Franciscus and I have been hard at work at it for the last year, and > > it's in final review. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Two beans in same form
Hi I have two beans - teacher and student in same form and with same variable(property) SSN. Teacher is a subclass of my studnet (in my design) error comes as no getter for SSN for bean student ... javax.servlet.jsp.JspException: No getter method for property employeeID of student how do i differentiate these two ,. Thanks much for help. Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam
RE: access variable value in html tag
Hmm..Your syntax looks right to me, though you are missing a closing > just before Could the problem lie elsewhere? Can you write out the accounts.number/account.no_account label/value as a simple list? Colm -Original Message- From: Steltner, Joern [mailto:[EMAIL PROTECTED] Sent: 19 March 2004 12:28 To: [EMAIL PROTECTED] Subject: access variable value in html tag Dear, I'm not an expert in Struts and Java. I need some simple help: Everything works fine, but at ??? mark I would like take account.no_account like ${accounts.number}, but it doesn't work. May someone can give me a small note about the right syntax to get the value from accounts.number as text in the quotes. Thanks Regards J. Steltner - 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: Two beans in same form
Need to see the code, compadre :) -Original Message- From: as as [mailto:[EMAIL PROTECTED] Sent: 19 March 2004 13:07 To: [EMAIL PROTECTED] Subject: Two beans in same form Hi I have two beans - teacher and student in same form and with same variable(property) SSN. Teacher is a subclass of my studnet (in my design) error comes as no getter for SSN for bean student ... javax.servlet.jsp.JspException: No getter method for property employeeID of student how do i differentiate these two ,. Thanks much for help. Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Two beans in same form
Colm, Thanks for quick reply. his page has one particular teacher and all students under him. so the code to display info about teacher is: SSN: "> "/> "> "> ... The code from and below displays the rows of students under that teacher (and displays each students' SSN under it) Thanks in advance for the help. Colm Garvey <[EMAIL PROTECTED]> wrote: Need to see the code, compadre :) -Original Message- From: as as [mailto:[EMAIL PROTECTED] Sent: 19 March 2004 13:07 To: [EMAIL PROTECTED] Subject: Two beans in same form Hi I have two beans - teacher and student in same form and with same variable(property) SSN. Teacher is a subclass of my studnet (in my design) error comes as no getter for SSN for bean student ... javax.servlet.jsp.JspException: No getter method for property employeeID of student how do i differentiate these two ,. Thanks much for help. Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam
RE: access variable value in html tag
You will need to use Struts-EL taglib then you should be able to do what you want. http://jakarta.apache.org/struts/faqs/struts-el.html You might also investigate using the or the http://jakarta.apache.org/struts/userGuide/struts-html robert > -Original Message- > From: Steltner, Joern [mailto:[EMAIL PROTECTED] > Sent: Friday, March 19, 2004 7:28 AM > To: [EMAIL PROTECTED] > Subject: access variable value in html tag > > > Dear, > > I'm not an expert in Struts and Java. I need some simple help: > > > >value="${accounts.number}" > > > > Everything works fine, but at ??? mark I would like take > account.no_account like ${accounts.number}, but it doesn't work. May someone > can give me a small note about the right syntax to get the value from > accounts.number as text in the quotes. > > Thanks > > Regards > J. Steltner > > > > - > 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: File-Upload: Progress-Bar
At 10:31 AM +0100 3/19/04, [EMAIL PROTECTED] wrote: I'm up to the task to implement a progress bar for File-Uploads ... My question: Has anybody done something like this with Struts before and can give me some little advise? I think someone is working on this, or at least has posted a bugzilla enhancement to commons-fileupload requesting it. You might want to search the commons-dev mailing list archives or do a bugzilla search. Joe -- Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com "Imagine if every Thursday your shoes exploded if you tied them the usual way. This happens to us all the time with computers, and nobody thinks of complaining." -- Jef Raskin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
UTF-8 characters in the name of the uploaded document
Hi, I use struts-1.1 with tomcat-4.1.30 and cannot get the name of the uploaded document correctly if that contains UTF-8 (Asian) characters. The application itself does work fine with UTF-8 characters in forms etc. the only exception is upload. Is there a fix to solve this problem or will it be fixed in the next release? Zsolt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: FormFile Upload restrictions
At 3:53 PM +0530 3/19/04, Badri wrote: Hi, Is there any size restriction in uploading any file using the FormFile? If there are any restrictions in file upload, what should be the maximum file size that can be uploaded? Are there any other ways of using FormFile and uploading files as large as 800MB - 1GB? File-upload has a threshold after which it writes uploads to disk instead of holding them in memory, so in theory, there are no software limitations. You might run into server or network issues with uploads that large, but the risk of a webapp OutOfMemoryError is controlled by this threshold. These values are set in the controller-config; see the docs for struts-config.xml for details. Joe -- Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com "Imagine if every Thursday your shoes exploded if you tied them the usual way. This happens to us all the time with computers, and nobody thinks of complaining." -- Jef Raskin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: validator form and OR-relations between fields
ok, i found myself some infos at http://jakarta.apache.org/struts/userGuide/dev_validator.html ist there any possibility to use the struts 1.2.0-validators without using a nightly build? something like a milestone-build perhaps? or by using the commons validator itself? thanks and greetings stefan Stefan Burkard wrote: hi struts-users is it possible with the validator-framework to check if ONE of TWO fields contains text? i just see the possibility to set both fields as required or not, but not to say "if in one of the two fields is text, the forms ok" thanks and greetings stefan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Database backed forms
> From: Brendan Richards [mailto:[EMAIL PROTECTED] > However, in most applications I write I don't want to only input data > but to view and edit existing data as well. For me ActionForms seem to > be the best way to code an input/output layer between the browser and > the backend. > In order to view and edit existing data, the action form needs to > pre-populate its data from the backend before displaying the form. > How would you suggest implementing view/edit functionality without > pre-populating action forms? A LookupDispatchAction with 'create' 'edit' 'update' methods. In the 'edit' method, you read from the database and prepopulate the form. I've never gotten the idea that prepopulating forms is frowned upon, unless you mean doing it *in* the ActionForm. Dynamic forms (or generating the ActionForm code) keep you out of all sorts of trouble-- there's nowhere to write the code that you shouldn't be writing. ;) -- Wendy Smoak Application Systems Analyst, Sr. ASU IA Information Resources Management - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Database backed forms
Hi Mark, Your app seems similar to something taht we are doing Could you enclose the same action and form class i fpossibel... Thansks! Mark Lowe <[EMAIL PROTECTED]> wrote: This is just my opinion but for editor style forms lookupdispatchaction is the dogs. Especially if you want to avoiding scoping forms to httpsession. The classes are longer but less. On 19 Mar 2004, at 12:55, Brendan Richards wrote: >> prepopulating is exactly what i would do, just in an action not in the > >> action form. > > Ah! That makes perfect sense. Keep the action form only for temporarily > holding the data we're input/outputting and do all work in the actions. > If you want to edit have a 'viewEdit' action that populates the Action > form and displays. Then to save, have a 'submitEdit' action. > Sounds like a much better way of going about it... > > Thanks. > > -Original Message- > From: Mark Lowe [mailto:[EMAIL PROTECTED] > Sent: 19 March 2004 11:41 > To: Struts Users Mailing List > Subject: Re: Database backed forms > >> How would you suggest implementing view/edit functionality without >> pre-populating action forms? > > prepopulating is exactly what i would do, just in an action not in the > action form. > > Sure you can shoe-horn checking your system state constantly but just > seems complicated. Surely some transaction management when you come to > insert/update/delete data should do the job. > >> 2) I've extended DynaValidatorActionForm to provide a reset() >> implementation. If required, the actionForm's properties are populated >> from the backend model. > > If you've got that far then the question of dynamically generating > fields shouldn't be a problem. > > > On 19 Mar 2004, at 11:58, Brendan Richards wrote: > >> I've seen many posts on "Not pre-populating action forms". This seems >> to >> be a design decision as action forms are only for validating input. >> >> However, in most applications I write I don't want to only input data >> but to view and edit existing data as well. For me ActionForms seem to >> be the best way to code an input/output layer between the browser and >> the backend. >> In order to view and edit existing data, the action form needs to >> pre-populate its data from the backend before displaying the form. >> >> How would you suggest implementing view/edit functionality without >> pre-populating action forms? >> >> I've coded pre-populating action forms in the following way: >> 1) I've got session objects to maintain my current system state >> (whether >> I'm looking at an extisting object or creating a new one) >> 2) I've extended DynaValidatorActionForm to provide a reset() >> implementation. If required, the actionForm's properties are populated >> from the backend model. >> >> -Original Message- >> From: Mark Lowe [mailto:[EMAIL PROTECTED] >> Sent: 19 March 2004 10:41 >> To: Struts Users Mailing List >> Subject: Re: Database backed forms >> >> If there's talk of having action forms populated by themselves then I >> wouldn't. >> >> For example you want to create a new record, to instantiate a new form >> bean you'd perhaps have to save a record to the db, and all this > before >> >> the user decides what s/he wants to do with it. >> >> niall wrote some classes that could be useful. >> >> http://www.niallp.pwp.blueyonder.co.uk >> >> >> >> On 19 Mar 2004, at 11:05, Brendan Richards wrote: >> >>> I guess your first place to look would be DynaActionForm - this base >>> class dynamically creates FormAction objects setting the properties >>> from >>> the struts-config file. >>> >>> http://jakarta.apache.org/struts/api/org/apache/struts/action/ >>> DynaAction >>> Form.html >>> >>> DynaValidatorActionForm adds validator support to this. >>> >>> Perhaps you could extend this class to add your own methods for >>> specifying form properties on the fly. >>> >>> The key function seems to be initialize(FormBeanConfig) - >>> FormBeanConfig >>> "represents the configuration information of a element in >> a >>> Struts configuration file". >>> >>> So create a FormBeanConfig object in code to represent the dynamic >> data >>> you want and then initialize a DynaActionForm with this object. >>> >>> Add properties to FormBeanConfig with addFormPropertyConfig. >>> >>> That sounds like a realistic starting point... >>> >>> Anyone else have any ideas suggestions or corrections? >>> >>> >>> >>> >>> -Original Message- >>> From: Melonie Brown [mailto:[EMAIL PROTECTED] >>> Sent: 18 March 2004 18:30 >>> To: [EMAIL PROTECTED] >>> Subject: Database backed forms >>> >>> I have written a very rough website page content >>> management system using Struts and OJB. (The goal >>> being to allow end users to modify content without >>> having to know anything about Struts or the code >>> behind the pages.) >>> >>> That's working all well and good, but now they want to >>> be able to create forms "on the fly". >>> >>> I would like to store all of the form components and >>> validation in the databas
Re: UTF-8 characters in the name of the uploaded document
At 3:22 PM +0100 3/19/04, Zsolt Koppany wrote: Hi, I use struts-1.1 with tomcat-4.1.30 and cannot get the name of the uploaded document correctly if that contains UTF-8 (Asian) characters. The application itself does work fine with UTF-8 characters in forms etc. the only exception is upload. Is there a fix to solve this problem or will it be fixed in the next release? Struts gets its file upload functionality from commons-fileupload. http://jakarta.apache.org/commons/fileupload/ I'm guessing that the problem is in this class somewhere: http://jakarta.apache.org/commons/fileupload/xref/org/apache/commons/fileupload/FileUploadBase.html I'd suggest posting a bug to http://nagoya.apache.org/bugzilla/ If you can attach a patch, then it's that much more likely to be fixed in the next release! Joe -- Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com "Imagine if every Thursday your shoes exploded if you tied them the usual way. This happens to us all the time with computers, and nobody thinks of complaining." -- Jef Raskin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: File-Upload: Progress-Bar
I could tell you how I'm going it (I also have very large files to upload.) 1) Once the upload request comes in, I launch a thread from my action class/servlet to handle the actual upload 2) I then forward to a page which displays a message indicating status. 3) I use java script to submit the status page so I can check on the progress of the upload and prevent browser timeout. I set this submit for every 10 secs. 4) Once I determine that the upload has completed, I forward back to my upload jsp page (or wherever you need to go next.) As for the size of the file ... that depends on whether or not the multipart message contains the filesize. --JoAnn -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, March 19, 2004 2:31 AM To: [EMAIL PROTECTED] Subject: File-Upload: Progress-Bar Hello everybody! I'm up to the task to implement a progress bar for File-Uploads, cause the files that are uploaded to my Webapp can be quite large. Well as usual this problem is not easily solved on the HTTP-Browser upload side. I'm using Struts here so I'm also using the commons/FileUpload. I was planning to do it that way that I assign a unique number to every session's-upload and keep the current status of an upload in a singleton for access. In an additional frame (with refresh) I would like to show the progress bar. My question: Has anybody done something like this with Struts before and can give me some little advise? Or more specific: Is it possible to first get the complete filesize from the FormFiles and the do the real Upload during the Action (keeping track of the read bytes) Thx for every help!! ___ Tim Adler, Abt. SDA1 Adress Management Solutions AZ | Direct Carl-Bertelsmann Straße 161s D-33311 Gütersloh Tel.: 05241/ 80 - 89574 [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Forwarding to another action over a jsp page
Hello here is my situation i have a page in which a foreachtag prints values from a bean into the page <% out.flush(); %> now i want that after all values are printed an action is called to do something else at the end of page doesnt do anything anyone knows? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Database backed forms
> Dynamic forms (or > generating the ActionForm code) keep you out of all sorts of trouble-- > there's nowhere to write the code that you shouldn't be writing. ;) Never underestimate the fudge-it capacity of the determined hacker. I'd quite happily subclassed DynaValidatorActionForm to do just that. Don't worry - I've realised the error of my ways and am moving my code into actions where it belongs =) -Original Message- From: Wendy Smoak [mailto:[EMAIL PROTECTED] Sent: 19 March 2004 14:58 To: Struts Users Mailing List Subject: RE: Database backed forms > From: Brendan Richards [mailto:[EMAIL PROTECTED] > However, in most applications I write I don't want to only input data > but to view and edit existing data as well. For me ActionForms seem to > be the best way to code an input/output layer between the browser and > the backend. > In order to view and edit existing data, the action form needs to > pre-populate its data from the backend before displaying the form. > How would you suggest implementing view/edit functionality without > pre-populating action forms? A LookupDispatchAction with 'create' 'edit' 'update' methods. In the 'edit' method, you read from the database and prepopulate the form. I've never gotten the idea that prepopulating forms is frowned upon, unless you mean doing it *in* the ActionForm. Dynamic forms (or generating the ActionForm code) keep you out of all sorts of trouble-- there's nowhere to write the code that you shouldn't be writing. ;) -- Wendy Smoak Application Systems Analyst, Sr. ASU IA Information Resources Management - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How to upload dynamic number of files and then save them into a DB
Hi, doy you have any tips or hints oin how to upload a dynamic number of files. Should I use a session object to hold them and then save them to the database on submit? Thanks, Julio
html:form focus problem
Anyone else noticed an issue whereby the focus javascript is popping up an error because it can't find the element to which the focus is attached? I've tested the code by re-invoking it after the page has fully loaded and it works just fine. The problem seems to be that for some very odd reason the javascript is being called before the element is available. Anyone else experience this and if so, any workarounds? Colm
RE: UTF-8 characters in the name of the uploaded document
In this article: http://www.anassina.com/struts/i18n/i18n.html The author mentions that a filter is required for UTF-8 encoded forms. Worth a go? Colm -Original Message- From: Zsolt Koppany [mailto:[EMAIL PROTECTED] Sent: 19 March 2004 14:22 To: Struts Users Mailing List Subject: UTF-8 characters in the name of the uploaded document Hi, I use struts-1.1 with tomcat-4.1.30 and cannot get the name of the uploaded document correctly if that contains UTF-8 (Asian) characters. The application itself does work fine with UTF-8 characters in forms etc. the only exception is upload. Is there a fix to solve this problem or will it be fixed in the next release? Zsolt - 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: html:form focus problem
What about if you move the javascript to below the form in the page? Unless the javascript is being called by an onload in the body tag, it will need to be below the form elements for them to exist when the javascript executes. -Original Message- From: Colm Garvey [mailto:[EMAIL PROTECTED] Sent: 19 March 2004 15:18 To: Struts Users Mailing List Subject: html:form focus problem Anyone else noticed an issue whereby the focus javascript is popping up an error because it can't find the element to which the focus is attached? I've tested the code by re-invoking it after the page has fully loaded and it works just fine. The problem seems to be that for some very odd reason the javascript is being called before the element is available. Anyone else experience this and if so, any workarounds? Colm - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: html:form focus problem
I'm using the built in struts functionality so I don't have any control over where in the page the code goes, but looking at the source, the code is indeed below the form. I'd like to attach it to an body onload event trigger, but that's going to require extending the struts classes and I'm trying not to digress too much from the norm. Any other suggestions? Colm -Original Message- From: Brendan Richards [mailto:[EMAIL PROTECTED] Sent: 19 March 2004 15:24 To: Struts Users Mailing List Subject: RE: html:form focus problem What about if you move the javascript to below the form in the page? Unless the javascript is being called by an onload in the body tag, it will need to be below the form elements for them to exist when the javascript executes. -Original Message- From: Colm Garvey [mailto:[EMAIL PROTECTED] Sent: 19 March 2004 15:18 To: Struts Users Mailing List Subject: html:form focus problem Anyone else noticed an issue whereby the focus javascript is popping up an error because it can't find the element to which the focus is attached? I've tested the code by re-invoking it after the page has fully loaded and it works just fine. The problem seems to be that for some very odd reason the javascript is being called before the element is available. Anyone else experience this and if so, any workarounds? Colm - 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: html:form focus problem
Also, relying on a wouldn't be a good general solution for struts. What if you were rendering a tile with the body part of the page already sent to the client? You could remove the generated javascript and try adding your own below your form. Not ideal but probably easier than extending struts classes document.forms['myForm'].myField.focus(); myForm = the name of your action form myField = the property value of you input element To be sure, you could just add the javascript line to your body's onload attribute. -Original Message- From: Colm Garvey [mailto:[EMAIL PROTECTED] Sent: 19 March 2004 15:29 To: Struts Users Mailing List Subject: RE: html:form focus problem I'm using the built in struts functionality so I don't have any control over where in the page the code goes, but looking at the source, the code is indeed below the form. I'd like to attach it to an body onload event trigger, but that's going to require extending the struts classes and I'm trying not to digress too much from the norm. Any other suggestions? Colm -Original Message- From: Brendan Richards [mailto:[EMAIL PROTECTED] Sent: 19 March 2004 15:24 To: Struts Users Mailing List Subject: RE: html:form focus problem What about if you move the javascript to below the form in the page? Unless the javascript is being called by an onload in the body tag, it will need to be below the form elements for them to exist when the javascript executes. -Original Message- From: Colm Garvey [mailto:[EMAIL PROTECTED] Sent: 19 March 2004 15:18 To: Struts Users Mailing List Subject: html:form focus problem Anyone else noticed an issue whereby the focus javascript is popping up an error because it can't find the element to which the focus is attached? I've tested the code by re-invoking it after the page has fully loaded and it works just fine. The problem seems to be that for some very odd reason the javascript is being called before the element is available. Anyone else experience this and if so, any workarounds? Colm - 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]
Multiple forms/beans
Any samples on multiple forms/beans in struts... Thanks in advance! (addendum to my previous post) Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam
ValidatorForm
Hi, So, to reset my values in the form, should I be using ValidatorForm... Thanks, Sam Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam
Re: ValidatorForm
Hi Sam, reset seems to work fine when using ValidatorForm. Nevertheless if your action throughs a GLOBAL.ERROR and you do a return (new ActionForward(mapping.getInput())); reset won't work (at least that has been my experience) Theo - Original Message - From: "as as" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, March 19, 2004 3:56 PM Subject: ValidatorForm > Hi, > So, to reset my values in the form, should I be using ValidatorForm... > Thanks, > Sam > > Do you Yahoo!? > Yahoo! Mail - More reliable, more storage, less spam - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ValidatorForm
Hi Also U can also use ActionForm but u must use the reset() method - Original Message - From: "Theodosios Paschalidis" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Sent: Friday, March 19, 2004 6:08 PM Subject: Re: ValidatorForm > Hi Sam, > reset seems to work fine when using ValidatorForm. Nevertheless if your > action throughs a GLOBAL.ERROR and you do a > return (new ActionForward(mapping.getInput())); > reset won't work (at least that has been my experience) > Theo > > - Original Message - > From: "as as" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Friday, March 19, 2004 3:56 PM > Subject: ValidatorForm > > > > Hi, > > So, to reset my values in the form, should I be using ValidatorForm... > > Thanks, > > Sam > > > > Do you Yahoo!? > > Yahoo! Mail - More reliable, more storage, less spam > > - > 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: File-Upload: Progress-Bar
Check the archives. There has been a lot on this. At 01:31 AM 3/19/2004, you wrote: Hello everybody! I'm up to the task to implement a progress bar for File-Uploads, cause the files that are uploaded to my Webapp can be quite large. Well as usual this problem is not easily solved on the HTTP-Browser upload side. I'm using Struts here so I'm also using the commons/FileUpload. I was planning to do it that way that I assign a unique number to every session's-upload and keep the current status of an upload in a singleton for access. In an additional frame (with refresh) I would like to show the progress bar. My question: Has anybody done something like this with Struts before and can give me some little advise? Or more specific: Is it possible to first get the complete filesize from the FormFiles and the do the real Upload during the Action (keeping track of the read bytes) Thx for every help!! ___ Tim Adler, Abt. SDA1 Adress Management Solutions AZ | Direct Carl-Bertelsmann Straße 161s D-33311 Gütersloh Tel.: 05241/ 80 - 89574 [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: File-Upload: Progress-Bar
Hi Tim! i didn't tryed it out, but on ORA's ONJAVA is saw an artikel on that http://www.onjava.com/lpt/a/3886 perhaps you got some ideas on it! Cheers, Matthias -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, March 19, 2004 10:31 AM To: [EMAIL PROTECTED] Subject: File-Upload: Progress-Bar Hello everybody! I'm up to the task to implement a progress bar for File-Uploads, cause the files that are uploaded to my Webapp can be quite large. Well as usual this problem is not easily solved on the HTTP-Browser upload side. I'm using Struts here so I'm also using the commons/FileUpload. I was planning to do it that way that I assign a unique number to every session's-upload and keep the current status of an upload in a singleton for access. In an additional frame (with refresh) I would like to show the progress bar. My question: Has anybody done something like this with Struts before and can give me some little advise? Or more specific: Is it possible to first get the complete filesize from the FormFiles and the do the real Upload during the Action (keeping track of the read bytes) Thx for every help!! ___ Tim Adler, Abt. SDA1 Adress Management Solutions AZ | Direct Carl-Bertelsmann Straße 161s D-33311 Gütersloh Tel.: 05241/ 80 - 89574 [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Can coarse grained ActionForms validate?
Hi, I am using coarse grained action forms that are re-used by various action classes. Each of these action classes serve a different page and retrieves information from the backend so that the jsp page can show it. Now because I am using coarse grained forms, I have now way of knowing which fields to validate because the same form serve multiple actions. Also, if I use the ActionForm class to validate the client data, the ActionForm has to be responsible for re-initializing that page with backend information if validation fails. Therefore, even if I change to very fine-grained DynaForms and use the validation framework so that each action maps to one form, I will probably have to figure some way of fetching backend information if validation fails. Currently, I am doing all the client input validation in the action classes because it seems to be the most simple solution; however, it has the caveat that the action class is now responsible for both validation and backend service delegation. I am just wondering if there is a more elegant solution using the action forms as the validator. Any help is greatly appreciated.
RE: Can coarse grained ActionForms validate?
Are you using the validator framework? If you are, you can associate different validation rules with different actions for the same form (use DynaValidatorActionForm). Have a look at the documentation - it'll explain how to set it up. D -Original Message- From: Chan, Jim [mailto:[EMAIL PROTECTED] Sent: 19 March 2004 17:42 To: 'Struts Users Mailing List' Subject: Can coarse grained ActionForms validate? Hi, I am using coarse grained action forms that are re-used by various action classes. Each of these action classes serve a different page and retrieves information from the backend so that the jsp page can show it. Now because I am using coarse grained forms, I have now way of knowing which fields to validate because the same form serve multiple actions. Also, if I use the ActionForm class to validate the client data, the ActionForm has to be responsible for re-initializing that page with backend information if validation fails. Therefore, even if I change to very fine-grained DynaForms and use the validation framework so that each action maps to one form, I will probably have to figure some way of fetching backend information if validation fails. Currently, I am doing all the client input validation in the action classes because it seems to be the most simple solution; however, it has the caveat that the action class is now responsible for both validation and backend service delegation. I am just wondering if there is a more elegant solution using the action forms as the validator. Any help is greatly appreciated. This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Can coarse grained ActionForms validate?
Hi Jim, You can specify multiple form bean mappings per action form. For insance: Then, in your validation.xml, you can have different rules for both of those forms. HTH, Blake --- "Chan, Jim" <[EMAIL PROTECTED]> wrote: > > > Hi, I am using coarse grained action forms that are > re-used by various > action classes. Each of these action classes serve > a different page and > retrieves information from the backend so that the > jsp page can show it. > Now because I am using coarse grained forms, I have > now way of knowing which > fields to validate because the same form serve > multiple actions. Also, if I > use the ActionForm class to validate the client > data, the ActionForm has to > be responsible for re-initializing that page with > backend information if > validation fails. Therefore, even if I change to > very fine-grained > DynaForms and use the validation framework so that > each action maps to one > form, I will probably have to figure some way of > fetching backend > information if validation fails. > > Currently, I am doing all the client input > validation in the action classes > because it seems to be the most simple solution; > however, it has the caveat > that the action class is now responsible for both > validation and backend > service delegation. I am just wondering if there is > a more elegant solution > using the action forms as the validator. > > Any help is greatly appreciated. > __ Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Pl. help options collection
Dear All Can any body complete this oode , I mean to say that what needs to be done in configuration file struts-config, where ARRAY information must be kept.. Can any body complete the code that it will be directly a working code .I have successfully completed select using simple options . But want to learn using collections I am suing struts1.1. I am trying from so many days ...pl. help Many many thanks in advance pl. help.. Kind Regards Strutsguy If nay boy needs all code for above I can send all with java class and config file . ARRAY information ArrayList prod = new ArrayList(); prod.add( new org.apache.struts.util.LabelValueBean( "Widget", "20" ) ); prod.add( new org.apache.struts.util.LabelValueBean( "Sprocket", "29-2a" ) ); prod.add( new org.apache.struts.util.LabelValueBean( "Cog", "29s" ) ); prod.add( new org.apache.struts.util.LabelValueBean( "Dunsel", "943" ) ); LabelValueBean takes the first String argument as the displayed name and the second as the value returned. Well see more about this in a bit. Now that you have prod set up, you pass that as a session or request bean to the JSP. request.setAttribute( Constants.PRODUCT_KEY, prod ); (the Constants.PRODUCT_KEY is set to our bean name: "products"; we use this to centralize bean name management) To use the data in the JSP, add the following code: Notes: product_id is the variable the JSP will set to the product ID value of the product selected by the user. products is the name of the bean (it must match what is in Contants.PRODUCT_KEY -- we probably could've said ... collection="<%= Constants.PRODUCT_KEY %>" ... in place of hard-coding the name. The choice is up to you. property="value" and labelProperty="label" are automatically set by org.apache.struts.util.LabelValueBean, so only use the values shown here. The resulting HTML will look something like: Widget Sprocket Cog Dunsel
RE: Struts cookbook
I think that publication of chapters must happen through Manning's site. I'm contractually bound to work within their parameters concerning publication of materials. I'm sure that the Manning site will announce and publish some teasers as soon as they can, as they are anxious to get the book to market. We (George and I) still want to incorporate our final changes and suggestions from the reviewers (Cedric DuMoulin, Joe Germuska, Steve Raeburn, et.al.). Check http://books.manning.com/ for the announcement. Danilo Gurovich Manager, Web Development LowerMyBills.com [EMAIL PROTECTED] 2401 Colorado Ave., 2nd Floor Santa Monica, CA 90404 (310) 998-6412 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Can coarse grained ActionForms validate?
Thanks gentlemen. This solves the problem for different validation rules for the same form, but I still need to figure how to get information from the backend that the form doesn't store. For example each form has a section on user input, which will be populated with user info if validation fails. However, below that section is an area that holds readonly information that is retrieved from backend services, so I need to retrieve this again unless I store it in the session, which I hesitate to do. So even though I can specify which rules apply to the same form, I cannot specify which initialization code to use when validation fails. -Original Message- From: Blake Whitmore [mailto:[EMAIL PROTECTED] Sent: Friday, March 19, 2004 9:50 AM To: Struts Users Mailing List Subject: Re: Can coarse grained ActionForms validate? Hi Jim, You can specify multiple form bean mappings per action form. For insance: Then, in your validation.xml, you can have different rules for both of those forms. HTH, Blake --- "Chan, Jim" <[EMAIL PROTECTED]> wrote: > > > Hi, I am using coarse grained action forms that are > re-used by various > action classes. Each of these action classes serve > a different page and > retrieves information from the backend so that the > jsp page can show it. > Now because I am using coarse grained forms, I have > now way of knowing which > fields to validate because the same form serve > multiple actions. Also, if I > use the ActionForm class to validate the client > data, the ActionForm has to > be responsible for re-initializing that page with > backend information if > validation fails. Therefore, even if I change to > very fine-grained > DynaForms and use the validation framework so that > each action maps to one > form, I will probably have to figure some way of > fetching backend > information if validation fails. > > Currently, I am doing all the client input > validation in the action classes > because it seems to be the most simple solution; > however, it has the caveat > that the action class is now responsible for both > validation and backend > service delegation. I am just wondering if there is > a more elegant solution > using the action forms as the validator. > > Any help is greatly appreciated. > __ Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Object insertion semantics
Oops, wrong list; please ignore! :) L. Laurie Harper wrote: What are the expected semantics for object insertion? I'm a bit confused by what I'm seeing here :) Here's some sample code: Player p1 = null, p2 = null, p3 = null; Implementation odmg = OJB.getInstance(); Database db = odmg.newDatabase(); db.open("repository.xml", Database.OPEN_READ_ONLY); try { System.out.println("insert p1 (pre-existing)"); p1 = new Player("name1", "player11", "pwd"); Transaction txn = odmg.newTransaction(); txn.begin(); txn.lock(p1, Transaction.WRITE); System.out.println("commit"); txn.commit(); System.out.println("ok"); } catch (Throwable t) { System.out.println("got a "+t.getClass().getName()); } try { System.out.println("insert p2 (new)"); Transaction txn = odmg.newTransaction(); txn.begin(); p2 = new Player("name3", "player3", "pwd"); txn.lock(p2, Transaction.WRITE); System.out.println("insert p2 (again)"); p3 = new Player("name3", "player3", "pwd"); txn.lock(p3, Transaction.WRITE); System.out.println("commit"); txn.commit(); System.out.println("ok"); } catch (Throwable t) { System.out.println("got a "+t.getClass().getName()); t.printStackTrace(); } System.out.println("clean-up"); try { Transaction txn = odmg.newTransaction(); txn.begin(); db.deletePersistent(p2); txn.commit(); } catch (Throwable t) { System.out.println("got a "+t.getClass().getName()); } db.close(); } Assume player1 exists and player3 doesn't. I'm getting several surprises with this. First, the insertion of player1 fails, as it should. But I expected it to fail on the call to lock(). It doesn't fail until the commit() at which point I get a org.apache.ojb.odmg.TransactionAbortedExceptionOJB. Is this the expected behaviour? Next, the insertion of player3. This succeeds. What I was expecting was an error on the second call to lock(). I could see it failing in commit() instead for consistency with what I saw on player1, but it ought to fail somewhere shouldn't it? Finally, the call to deletePersistent is having no effect. I'm unable to delete objects after I insert them. Am I doing something wrong or is this an OJB bug? I suspect some or all of these problems may be to do with OJB's primary key handling. I'm using database native sequences and OJB seems not to cope with that correctly, going on the SQL statements P6Spy is reporting: 1079658237422|1|0|statement|SELECT password,email,name,ID FROM PLAYER WHERE ID = ? |SELECT password,email,name,ID FROM PLAYER WHERE ID = '' [from the first call to lock() on player3; the second call generates no SQL] 1079658237473|2|0|statement|DELETE FROM PLAYER WHERE ID = ? |DELETE FROM PLAYER WHERE ID = '' [on the call to deletePersistent, which explains why it's not doing much] ID is an anonymous property on Player; could that be a factor? Here's the repository entry for the class: If you need more info to diagnose what's going on, let me know. L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Iterating through a Hashtable of Vectors
Hi all I've created a Hashtable, who's values are Vectors: Vector a = new Vector(); a.add("something"); a.add("somethingelse"); Vector b = new Vector(); b.add("something"); b.add("somethingelse"); Hashtable ht = new Hashtable(); ht.put ("key", a); ht.put ("anotherkey", b); request.setAttribute("attrkey", ht); What I want to be able to do is iterate through this Hashtable (in the JSP), pull out a Vector, and iterate through it. How would I do this? tia bort - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Dummy ActionForms?
Hi all, I am trying to execute an Action using only a dummy form (empty). I have successfully used this in other occasions but it seems to fail now. In my config I have But I get this exception thrown: java.lang.ClassCastException at app.CloseOrderAction.execute(Unknown Source) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProces sor.java:446) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:266) I though it might have been the Input that messed things so i changed that as follows with no luck. I am getting frustrated over this, am I missing something? I would be gratefull is somebody could give a hint on what the problem might be. Thank you for your time, Theo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Can coarse grained ActionForms validate?
> I still need to figure how to get information > from the backend that the > form doesn't store. Why not set properties on the form (which obviously there will be no validation for) and in the JSP, store that data as hidden fields ()? That way when the user submits the form, you will not have to invoke your business logic again should validation errors occur with the submission. > For example each form has a > section on user input, > which will be populated with user info if validation > fails. However, below > that section is an area that holds readonly > information that is retrieved > from backend services, so I need to retrieve this > again unless I store it in > the session, > -Original Message- > From: Blake Whitmore > [mailto:[EMAIL PROTECTED] > Sent: Friday, March 19, 2004 9:50 AM > To: Struts Users Mailing List > Subject: Re: Can coarse grained ActionForms > validate? > > > Hi Jim, > > You can specify multiple form bean mappings per > action > form. For insance: > > type="com.pkg.MyFormBean"/> > > type="com.pkg.MyFormBean"/> > > Then, in your validation.xml, you can have different > rules for both of those forms. > > HTH, > Blake > > > > > > > > --- "Chan, Jim" <[EMAIL PROTECTED]> wrote: > > > > > > Hi, I am using coarse grained action forms that > are > > re-used by various > > action classes. Each of these action classes > serve > > a different page and > > retrieves information from the backend so that the > > jsp page can show it. > > Now because I am using coarse grained forms, I > have > > now way of knowing which > > fields to validate because the same form serve > > multiple actions. Also, if I > > use the ActionForm class to validate the client > > data, the ActionForm has to > > be responsible for re-initializing that page with > > backend information if > > validation fails. Therefore, even if I change to > > very fine-grained > > DynaForms and use the validation framework so that > > each action maps to one > > form, I will probably have to figure some way of > > fetching backend > > information if validation fails. > > > > Currently, I am doing all the client input > > validation in the action classes > > because it seems to be the most simple solution; > > however, it has the caveat > > that the action class is now responsible for both > > validation and backend > > service delegation. I am just wondering if there > is > > a more elegant solution > > using the action forms as the validator. > > > > Any help is greatly appreciated. > > > > > __ > Do you Yahoo!? > Yahoo! Mail - More reliable, more storage, less spam > http://mail.yahoo.com > > - > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > __ Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Progress-Bar & Task Delegate
I love that article! I've been looking into Quartz to manage some long-running tasks on my business tier, but couldn't find a good way to get status updates to the admin. With this example, I can merge their TaskBean with a Business Delegate, creating a 'Task Delegate'? The Task Delegate would communicate with the business objects (EJB,DAO,etc) and make their status available to the calling JSP. Ooo, ooo... [Friday might actually be productive this week] Wiebe -Original Message- From: Matthias Wessendorf [mailto:[EMAIL PROTECTED] Sent: Friday, March 19, 2004 9:38 AM To: 'Struts Users Mailing List' Subject: RE: File-Upload: Progress-Bar Hi Tim! i didn't tryed it out, but on ORA's ONJAVA is saw an artikel on that http://www.onjava.com/lpt/a/3886 perhaps you got some ideas on it! Cheers, Matthias -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, March 19, 2004 10:31 AM To: [EMAIL PROTECTED] Subject: File-Upload: Progress-Bar Hello everybody! I'm up to the task to implement a progress bar for File-Uploads, cause the files that are uploaded to my Webapp can be quite large. Well as usual this problem is not easily solved on the HTTP-Browser upload side. I'm using Struts here so I'm also using the commons/FileUpload. I was planning to do it that way that I assign a unique number to every session's-upload and keep the current status of an upload in a singleton for access. In an additional frame (with refresh) I would like to show the progress bar. My question: Has anybody done something like this with Struts before and can give me some little advise? Or more specific: Is it possible to first get the complete filesize from the FormFiles and the do the real Upload during the Action (keeping track of the read bytes) Thx for every help!! ___ Tim Adler, Abt. SDA1 Adress Management Solutions AZ | Direct Carl-Bertelsmann Straße 161s D-33311 Gütersloh Tel.: 05241/ 80 - 89574 [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: Dummy ActionForms?
I'm guessing your DisOrderDetail.jsp's tag is wrong. Check the mapping there. --- Theodosios Paschalidis <[EMAIL PROTECTED]> wrote: > Hi all, > > I am trying to execute an Action using only a dummy > form (empty). I have > successfully used this in other occasions but it > seems to fail now. > In my config I have > > type="app.CloseOrderForm" /> > > > > type="app.CloseOrderAction" > name="closeOrderForm" scope="request" > validate="false" > input="/DisOrderDetail.jsp"> > > > type="org.apache.struts.actions.ForwardAction" > parameter="/FindOrder.jsp" /> > But I get this exception thrown: > > java.lang.ClassCastException > at app.CloseOrderAction.execute(Unknown Source) > at > org.apache.struts.action.RequestProcessor.processActionPerform(RequestProces > sor.java:446) > at > org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:266) > > I though it might have been the Input that messed > things so i changed that > as follows with no luck. > > I am getting frustrated over this, am I missing > something? I would be > gratefull is somebody could give a hint on what the > problem might be. > > Thank you for your time, > Theo > > > type="app.CloseOrderAction" > name="closeOrderForm"> > > /> > > > - > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > __ Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Iterating through a Hashtable of Vectors
I'm going to add some more the my previous post, and put the whole thing into an understandable context... please bear with me. In addition to the Hashtable mentioned below, I have another Vector (let's call this 'ACCVEC'). ACCVEC contains account numbers as Integer objects. On my JSP page, I use to list these account numbers on the screen. The keys in the aforementioned Hashtable are also account numbers (as Integers). The corresponding value is a Vector (let's call this 'INVVEC') of invoice numbers that are related to the account. It should be noted that not every account number in ACCVEC is not a key in the Hashtable. That is, there may be some accounts that have no invoices. What I'd like to do is create a table (in my JSP) with a list of all account numbers (as in ACCVEC), and an associated of invoice numbers, if they exist. Essentially, what I want is: for each account number in ACCVEC { display the account number attempt to retrieve a value from the Hashtable for this account number if there is a INVVEC { for each invoice number in INNVEC { create a select drop down box } } } How should this look using Struts? bort "bort" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi all > > I've created a Hashtable, who's values are Vectors: > > Vector a = new Vector(); > a.add("something"); > a.add("somethingelse"); > > Vector b = new Vector(); > b.add("something"); > b.add("somethingelse"); > > Hashtable ht = new Hashtable(); > ht.put ("key", a); > ht.put ("anotherkey", b); > > request.setAttribute("attrkey", ht); > > What I want to be able to do is iterate through this Hashtable (in the JSP), > pull out a Vector, and iterate through it. How would I do this? > > tia > bort - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: File-Upload: Progress-Bar
"Joe Germuska" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > At 10:31 AM +0100 3/19/04, [EMAIL PROTECTED] wrote: > >I'm up to the task to implement a progress bar for File-Uploads > >... > >My question: Has anybody done something like this with Struts before and can > >give me some little advise? > > I think someone is working on this, or at least has posted a bugzilla > enhancement to commons-fileupload requesting it. You might want to > search the commons-dev mailing list archives or do a bugzilla search. Yes, there is an enhancement request open against Commons FileUpload for this, complete with code: http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25830 Expect something along these lines in a forthcoming release of FileUpload, with subsequent support in Struts. -- Martin Cooper > > Joe > > -- > Joe Germuska > [EMAIL PROTECTED] > http://blog.germuska.com >"Imagine if every Thursday your shoes exploded if you tied them > the usual way. This happens to us all the time with computers, and > nobody thinks of complaining." > -- Jef Raskin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Dummy ActionForms?
The ClassCastException is in your Action code, so check your code and see what you're casting. Post the code so others can see, too. --- Theodosios Paschalidis <[EMAIL PROTECTED]> wrote: > Hi all, > > I am trying to execute an Action using only a dummy form (empty). I have > successfully used this in other occasions but it seems to fail now. > In my config I have > > > > > > name="closeOrderForm" scope="request" validate="false" > input="/DisOrderDetail.jsp"> > > > parameter="/FindOrder.jsp" /> > But I get this exception thrown: > > java.lang.ClassCastException > at app.CloseOrderAction.execute(Unknown Source) > at > org.apache.struts.action.RequestProcessor.processActionPerform(RequestProces > sor.java:446) > at > org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:266) > > I though it might have been the Input that messed things so i changed that > as follows with no luck. > > I am getting frustrated over this, am I missing something? I would be > gratefull is somebody could give a hint on what the problem might be. > > Thank you for your time, > Theo > > > name="closeOrderForm"> > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > __ Do you Yahoo!? Yahoo! Mail - More reliable, more storage, less spam http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Mapping Forward to new form
Hey, I am adding user details to the DB through a form, on a successful insert I would like to map forward to the same form. The problem is when I use the action forward the form on the forwarded page is filled with the details from the user I just added. if(addUser((UserForm) form, request, response)) { return (mapping.findForward("adduser")); } I would like to map to a new blank form, how do I do this? Thanks
Re: Mapping Forward to new form
Ciaran: Just create a new formbean and put it in the request before you forward..:) Geeta Ciaran Hanley wrote: > I would like to map to a new blank form, how do I do this? > > Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Mapping Forward to new form
You can call ((UserForm) form).reset() before forwarding. Saul > -Original Message- > From: Ciaran Hanley [mailto:[EMAIL PROTECTED] > Sent: Friday, March 19, 2004 1:52 PM > To: Struts User Mailing List > Subject: Mapping Forward to new form > > > Hey, > > > > I am adding user details to the DB through a form, on a > successful insert I would like to map forward to the same form. > > The problem is when I use the action forward the form on the > forwarded page is filled with the details from the user I just added. > > > > if(addUser((UserForm) form, request, response)) > > { > > return (mapping.findForward("adduser")); > > } > > > > I would like to map to a new blank form, how do I do this? > > > > Thanks > > > > > > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Dummy ActionForms?
Thanks for your reply Blake. That tag read Thank you Hubert! You were correct I was doing a "session.getAttribute()" of an object, and was casting it into a String! I thought it was just a String attribute. (I will be changing my naming convention to make this dinstiction!) Thanks for the heads up, I appreciate it. - Original Message - From: "Hubert Rabago" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Sent: Friday, March 19, 2004 6:39 PM Subject: Re: Dummy ActionForms? > The ClassCastException is in your Action code, so check your code and see > what you're casting. Post the code so others can see, too. > > --- Theodosios Paschalidis <[EMAIL PROTECTED]> wrote: > > Hi all, > > > > I am trying to execute an Action using only a dummy form (empty). I have > > successfully used this in other occasions but it seems to fail now. > > In my config I have > > > > > > > > > > > > > name="closeOrderForm" scope="request" validate="false" > > input="/DisOrderDetail.jsp"> > > > > > > > parameter="/FindOrder.jsp" /> > > But I get this exception thrown: > > > > java.lang.ClassCastException > > at app.CloseOrderAction.execute(Unknown Source) > > at > > > org.apache.struts.action.RequestProcessor.processActionPerform(RequestProces > > sor.java:446) > > at > > > org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:266) > > > > I though it might have been the Input that messed things so i changed that > > as follows with no luck. > > > > I am getting frustrated over this, am I missing something? I would be > > gratefull is somebody could give a hint on what the problem might be. > > > > Thank you for your time, > > Theo > > > > > > > name="closeOrderForm"> > > > > > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > __ > Do you Yahoo!? > Yahoo! Mail - More reliable, more storage, less spam > http://mail.yahoo.com > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: File-Upload: Progress-Bar : Mega Upload
So I have never tried this.. But if someone can try it and let me know.. Check this out http://www.raditha.com/megaupload/jsp.php Its progress bar thing that uses struts :) Today when I was driving to work.. I thought if a progress bar can be done using an applet.. :) ideas. ideas.. ideas.. Pritpal Dhaliwal -Original Message- From: Martin Cooper [mailto:[EMAIL PROTECTED] Sent: Friday, March 19, 2004 10:39 AM To: [EMAIL PROTECTED] Subject: Re: File-Upload: Progress-Bar "Joe Germuska" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > At 10:31 AM +0100 3/19/04, [EMAIL PROTECTED] wrote: > >I'm up to the task to implement a progress bar for File-Uploads ... > >My question: Has anybody done something like this with Struts before and can > >give me some little advise? > > I think someone is working on this, or at least has posted a bugzilla > enhancement to commons-fileupload requesting it. You might want to > search the commons-dev mailing list archives or do a bugzilla search. Yes, there is an enhancement request open against Commons FileUpload for this, complete with code: http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25830 Expect something along these lines in a forthcoming release of FileUpload, with subsequent support in Struts. -- Martin Cooper > > Joe > > -- > Joe Germuska > [EMAIL PROTECTED] > http://blog.germuska.com >"Imagine if every Thursday your shoes exploded if you tied them > the usual way. This happens to us all the time with computers, and > nobody thinks of complaining." > -- Jef Raskin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: validwhen validation question
Is it possisble to use validwhen for date fields like comparing dates? Brendan Richards <[EMAIL PROTECTED]> wrote: I'm looking at using validwhen for a complex validation. I've got a value that can either be ignored when another parameter is set or is valid when it's a date. A simple date validation would be something like this: datePatterndd-MM-var> Can a validwhen call another validation? Giving you something like test ((ignoreDate == "yes") or ( #insert date validation# )) or should I just write my own validation rule / do it with javascript before I submit? Thanks, Brendan Do you Yahoo!? Yahoo! Finance Tax Center - File online. File on time.
Re: Peculiar Session Problem Weblogic 8.1
I think the session objects are stored in web server's memory.So when u r trying to acces a session object stored in one web server from another the problem occurs. On Thu, 18 Mar 2004 sougata wrote : >Hi All > >I have a peculiar problem of session maintenence > >I have two servers one runing TomCat and the other running Weblogic . > >On on of the pages presented by the TomCat server there exists a >HREF link to another page on the Weblogic Server. >When the user clicks on this link then the page from the >Weblogic Server is supposed to load in the right frame. > >now the problem is that the page from weblogic has three >IFRAMES embedded in it which use the session object to display >some data. These sessions are not consistent. > >When I run he whole app only on Weblogic it runs fine. > >Can someone please help me out on this !!! > >Regards >Saugata > > >-Original Message- > From: news [mailto:[EMAIL PROTECTED] Behalf Of Vic Cekvenich >Sent: Thursday, March 18, 2004 10:39 AM >To: [EMAIL PROTECTED] >Subject: Re: Performace Improvement :: Struts based applications > > >Unit test the performance of the model layer. >.V > >Satya Narayan Dash wrote: > > Hi, > > > > I am in the process of improving a struts based application. I am using >the cache taglib (from apache) and have written some filters to improve the >performace. > > > > I am using Apache2 as the web-sever and Tomcat4 as the servelt/jsp engine. >I have optimized them both. > > > > But the peformance improvement is not substantial. Can you please give me >some tips to improve the performance ? > > > > Need your help, > > Regards, > > Satya. > > >- >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: RE: Pls help on shopping cart App
Hi, I am also facing the same problem.. Can u explain how you have solved it? On Thu, 18 Mar 2004 sougata wrote : >No it is not like that since I am using weblogic's struts .Anyway I solved >that.Thanks for your reply >Sougata > >-Original Message- > From: Mark Lowe [mailto:[EMAIL PROTECTED] >Sent: Thursday, March 18, 2004 1:36 PM >To: Struts Users Mailing List >Subject: Re: Pls help on shopping cart App > > >Do your > >On 18 Mar 2004, at 07:07, sougata wrote: > > > Hi All, > > I have a shopping cart apps.When the user is buying items it is coming > > to > > "mycart" .In "my mycart" page I am showing all the products and the > > beside > > that I have a update button by which I can update the quantity of my > > each > > item which is in a textbox.I am follwing struts for that.My text box > > name is > > same in every row(say quantity).if its name is quantity in servlet I am > > getting a String array of quantity.But when I am coming to the same > > page its > > showing > > > > value="[Ljava.lang.String;@1765ae" which is the reference of my string > > array.How to get the original value > > > > Pls let me know ASAP. > > > > Thanks > > > > Sougata > > > > >- >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: UTF-8 characters in the name of the uploaded document
Hi Colm, I know that article, and as I wrote the application does work fine with UTF-8 characters except upload. Zsolt > -Original Message- > From: Colm Garvey [mailto:[EMAIL PROTECTED] > Sent: Friday, March 19, 2004 4:20 PM > To: Struts Users Mailing List > Subject: RE: UTF-8 characters in the name of the uploaded document > > > In this article: > > http://www.anassina.com/struts/i18n/i18n.html > > The author mentions that a filter is required for UTF-8 encoded forms. > Worth a go? > > Colm > > -Original Message- > From: Zsolt Koppany [mailto:[EMAIL PROTECTED] > Sent: 19 March 2004 14:22 > To: Struts Users Mailing List > Subject: UTF-8 characters in the name of the uploaded document > > > Hi, > > I use struts-1.1 with tomcat-4.1.30 and cannot get the name of > the uploaded > document correctly if that contains UTF-8 (Asian) characters. The > application itself does work fine with UTF-8 characters in forms etc. the > only exception is upload. Is there a fix to solve this problem or > will it be > fixed in the next release? > > Zsolt > > > > - > 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: UTF-8 characters in the name of the uploaded document
Hi Zsolt, I wrote this reply in response to the same problem but in a different thread. I couldn't find it in the struts mailing list archives, so I include it again with the message it responds to. Someone has since written to me confirming that this does work. - Yes, I think you are right, i didn't realise which class we were talking about there. I have just read a bit more about the Struts FileUpload and how it wraps commons upload. Assuming Commons Upload works correctly with the setHeaderEncoding, then I guess there might be work around. Struts will use org.apache.struts.upload.CommonsMultipartRequestHandler by default to handle extracting the parameters out of the request and populating the form. It uses the DiskFileUpload class from Commons FileUpload. It is that handler that we need to modify, to do that we could create our own using the org.apache.struts.upload.CommonsMultipartRequestHandler source as the basis. We need to tell Struts to use ours instead of the defualt by adding this to your struts-config.xml Then to modify org.apache.struts.upload.CommonsMultipartRequestHandler by creating our my.own.MultiPartClassHandler class. We need to modify the handleRequest() method like so: // Create and configure a DIskFileUpload instance. DiskFileUpload upload = new DiskFileUpload(); upload.setHeaderEncoding("UTF-8"); // Set the maximum size before a FileUploadException will be thrown. upload.setSizeMax((int) getSizeMax(ac)); ... This is all untested and off the top of my head, so there is likely to be a mistake there somewhere, but I think it is possible. Daniel Rabe wrote: I see a similar problem with file upload. It doesn't look like org.apache.strugs.upload.FormFile exposes a setHeaderEncoding method... Daniel Rabe -Original Message- From: Jason Lea [mailto:[EMAIL PROTECTED] Sent: Friday, December 26, 2003 1:33 PM To: Struts Users Mailing List Subject: Re: What is wrong with this upload filename (UTF-8) decoding? I have not used the file upload yet, but I believe you need to set the encoding for the headers formFile.setHeaderEncoding("UTF-8") setHeaderEncoding does this: "Specifies the character encoding to be used when reading the headers of individual parts. When not specified, or |null|, the platform default encoding is used." If this was running on a English operating system it is probably defaulting to the Latin-1 encoding. From this Java Doc: http://jakarta.apache.org/commons/fileupload/apidocs/org/apache/commons/file upload/FileUploadBase.html#setHeaderEncoding(java.lang.String) Please post back to the forum if this works. I would be interested in the result. Zsolt Koppany wrote: Hi, my application has to support UTF-8 including when files are uploaded with UTF-8 characters in the filename (for example: ??.txt). I use a servlet filter that always call request.setCharacterEncoding("UTF-8") and my jsp pages contain response.setContentType("text/html; charset=UTF-8"); Everything works fine except that I have problems with decoding of the name of uploaded filenames. I use the code below to get the name of the uploaded filename: String nm = formFile.getFileName(); String filename = new String(nm.getBytes(), "UTF-8"); The code above converts only the first couple of characters correctly (result: ??.txt). Any ideas how to fix the problem? I use TC-4.1.29, Struts-1.1, jdk1.4.2_02 Windows-XP. Zsolt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Jason Lea Zsolt Koppany wrote: Hi Colm, I know that article, and as I wrote the application does work fine with UTF-8 characters except upload. Zsolt -Original Message- From: Colm Garvey [mailto:[EMAIL PROTECTED] Sent: Friday, March 19, 2004 4:20 PM To: Struts Users Mailing List Subject: RE: UTF-8 characters in the name of the uploaded document In this article: http://www.anassina.com/struts/i18n/i18n.html The author mentions that a filter is required for UTF-8 encoded forms. Worth a go? Colm -Original Message- From: Zsolt Koppany [mailto:[EMAIL PROTECTED] Sent: 19 March 2004 14:22 To: Struts Users Mailing List Subject: UTF-8 characters in the name of the uploaded document Hi, I use struts-1.1 with tomcat-4.1.30 and cannot get the name of the uploaded document correctly if that contains UTF-8 (Asian) characters. The application itself does work fine with UTF-8 characters in forms etc. the only exception is upload. Is there a fix to solve this problem or will it be fixed in the next release? Zsolt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMA