[OT] Session Timeout Logged-in-ness
Hi all, Have an interesting issue here and just wondering if any of you have the same kind of problem on other containers, or even whether you think this is working correctly. The servlet spec (2.3) it seems does not cover this. We are running Jboss 2.4 with Jetty 4 I have an object that is placed in the HttpSession that implements HttpSessionBindingListener. What I would like is when this object is being removed from the session (which would only be by an explict logout or session timeout) then it goes and does some tidyup on the system - which includes calling remove() on some stateful EJBs On an explicit logout everything works fine. However during the session timeout i get authentication errors - the principle is null. I don't know if it the container is designed to be either not 'logged in' or to be explicitly 'logged out' when the session is being emptied or whether this is an oversight. Or do you think it should work like this? Or are other containers 'logged in' at this point? Cheers Ian
Re: [OT] Session Timeout Logged-in-ness
Unfortunately we need this functionality as all the ejb interfaces are secure and need to remove beans when the session ends... should really be in the spec i think as otherwise there is no way to support this kind of environment (its fine if all your interfaces are insecure..) anyway this is of course the beauty of open source you can dig in and find a workaround, which for the record is: keep a copy of the UserPrincipal object when your object is created... get it from: org.mortbay.http.UserPrincipal userPrincipal = (UserPrincipal) request.getSession().getAttribute( org.mortbay.jetty.Auth ); and when you need to be authenticated during object removal call: userPrinciapl.isAuthenticated() you can't look that object up at the call to valueUnbound() as it may have been unbound itself.. regards Ian [EMAIL PROTECTED] 11/06/02 12:32pm IT Have an interesting issue here and just wondering if any of you have IT the same kind of problem on other containers, or even whether you IT think this is working correctly. The servlet spec (2.3) it seems does IT not cover this. IT On an explicit logout everything works fine. However during the IT session timeout i get authentication errors - the principle is null. I IT don't know if it the container is designed to be either not 'logged IT in' or to be explicitly 'logged out' when the session is being emptied IT or whether this is an oversight. IT Or do you think it should work like this? Since it's not covered by the spec it should work in unpredictable way. You may faced with a situation when the next version of Jetty return you null even in case of explicit logout. You should not rely on this behavior since it's not portable. -- Max Kutny -- To unsubscribe, e-mail: mailto:struts-user-unsubscribe;jakarta.apache.org For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org
Re: Tiles and subapps in Struts 1.1
my advice to you is dont bother with subapps with tiles unless you have a lot of time to invest in working on it. a lot would need to be changed to make it work properly. [EMAIL PROTECTED] 07/17/02 09:32am Does anyone have tiles working in a subapp under Struts 1.1? Our working app seems to have stopped working once we divided the app into subapps with separate struts config files. Is ActionComponentServlet not compatible with subapplications? We do have ActionComponentServlet specified in the web.xml and have the Tiles RequestProcessor specified in each of the subapp's struts config files. Is there another piece of the puzzle we are missing for using Tiles with subapps? Thanks, Steve -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Include-problem with .do
I saw no other way around it. Can anyone else suggest a way to include jsp:include page=/PanelDisplay.do/? can't be that difficult, it works in Tiles. some tiles are actions that forward onto jsps [EMAIL PROTECTED] 05/21/02 07:05pm I also had this problem. The error message given was to the effect that the page had already been committed. It seems that once one action has started writing to the output stream the ActionServlet denies another action from processing that request. Once can bypass the ActionServlet however. I ended up using a new processAction method in my ActionServlet subclass. It is invoked from the action which produces the parent page, processes the action that produces the nested page, fixes the returned jsp forward as a request attribute called 'panel'. Then the JSP is retrieved in the main JSP and a template is used to include it. E.g. bean:define id=_page name=panel/ temp:insert template=%=_page%/ This works fine, allowing the nested action to preload whatever form data required by its JSP, except it does involve processing the action manually rather than allowing the struts framework to do it. [I used a Ted Husted method called invokeAction from one of his examples as a starting point. I can post the code if you like but I think this solution is a bit half-baked.] I saw no other way around it. Can anyone else suggest a way to include jsp:include page=/PanelDisplay.do/? Toby Steel -Original Message- From: Stian Skjævesland [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 21, 2002 12:46 PM To: [EMAIL PROTECTED] Subject: Include-problem with .do I have recently started using struts and I have encountered a problem. I want to include with a statement like this: jsp:include page=%= _page % / where an example of a page might be loginform.do . I get an exception when I try to do this, and I am wondering if there is a special include-tag to be used with .do tags or if it is not possible to include such pages. Thanks for Your help! Stian -- Stian Skjævesland Nettredaksjonen, Mandalskamerater på nett mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] Mandalskamerater på nett www.mk.no 918 24 339 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Small Complaint - Struts Impl.
Not strictly true, we use the form reset method to prepare complex forms from an xml description, although it is a bit messy as reset is called too often. we end up looking for size properties from the request and if we don't find the attributes then just continue, we will eventually be called with the right information. What we need on forms I believe is some other functions on form ... void prepare( ActionMapping, HttpServletRequest ) - called before the form is populated from the request. Allows the form to create any data structures required to allow population to take place. void fill( ActionMapping, HttpServletRequest ) - Allow a form to load any lookup information. Called automatically if form validation fails, before forwarding the form back to the input jsp. Useful when you say have an id of something on the form which is from a dropdown selection objects. Would be called manually from the code that sets up the form. Ian [EMAIL PROTECTED] 05/20/02 12:43pm The only time reset() is of direct value to the framework is when * the form is being maintained in session scope, AND * there are boolean properties on the ActionForm In practice, using reset() to return all values to their initial state is usually either futile or problematic. It's futile when the bean is in request scope since a new bean's properties will be at their initial state. It's problematic for non-boolean properties since they may have values you'd like to retain. In most cases, developers probably want to include a mutable and a page property on their ActionForms. Mutable can be used to tell the property mutators NOT to access any new values (mutable=false). This is very useful when forwarding ActionForms between Actions in the same request. The reset()/automatic-population guantlet takes place on every trip through the ActionServlet which can happens more than once in a request. A page property (like the one provided by ValidatorForm) can be very useful in wizard forms. The various properties can be reset according to what page they are on. If page=0 then all values can be reset(). Otherwise, you can reset values (including the booleans) according to what page of the wizard they are on. (Not an ideal wizard-solution, but I don't know if we have an ideal solution yet.) A WORM ActionForm, like Craig mentioned, can also be useful. Here the mutator checks to see if its value is NULL before setting it again. This is much like having a mutator switch but without the bother of turning it on and off. Regarding how ActionForms behave in different scopes, it's important to remember is that whether clients share a session is really up to the clients. The sessions are usually determined by cookies, and the clients determine whether the cookies (and ergo the session) are stored. If two clients manage to share a cookie (or page with a rewritten URL), they will share whatever is in the session. Struts has no say in the matter. -- Ted Husted, Husted dot Com, Fairport NY US -- Developing Java Web Applications with Struts -- Tel: +1 585 737-3463 -- Web: http://husted.com/about/services Galbreath, Mark wrote: Ted/Craig, Speaking of states (like the insane one I find myself in, being in the office on yet another Saturday :-( ), the spec allows the specification of scope for an ActionForm in struts-config.xml but I've found it has no effect. For example, I specify an form bean in session scope, but all the properties get reset to defaults after every pass through by the Action. The only way I've found to maintain the bean's state is removing the body of reset() in the bean and providing only a call to super.reset( mapping, request ). I'll be testing my app with multiple clients soon, but what I'm not clear on now is how Struts handles beans in session scope with respect to different simultaneous clients. Does ActionServlet create a pool of stateless beans to serve each client, or are multiple clients going to see the state of the bean previously set by a separate client? My understanding is that the Action uses one instance of a bean like a singleton, resetting its properties before releasing it to service another thread. If this is correct, what exactly is happening if the bean is declared in session scope and/or the reset() is stripped? Mark -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: any way of making tiles display the stack trace onexception
Have you check the servlet log to see if the stack trace is reported ? yep, nothing there I suspect Struts to catch the exception and only displaying the message, not the stack. In this case, the exception must be stored in an attribute in the request scope. Well this is a JspException throw from a struts tag - which sets that property. You can also try to associate an error page to your tile. Use the appropriate jsp directive (% page errorPage=... %). In your error page, retrieve the exception if it exist, and show it. its not getting that far i believe - its being caught inside tiles. the rest of the page continues processing as my footer comes up ok -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Sub-application motel -- pages check in but they don'tcheck out
Hi Steve I registered an enhancement in bugzilla months ago... to get around this the easiest way is to subclass the tags and add some extensions. here is an example from the form tag. the function called lookup, first block of code deals with determining appConfig. replace it with: if ( action.substring(0,2).equals(//) ) { int actionSlash = action.indexOf('/',2); if (actionSlash==-1) throw new JspException(multi-app action name is in incorrect format); String app=action.substring(1,actionSlash); action=action.substring( action.length()-actionSlash ); if (app.equals(/)) app=; appConfig = (ApplicationConfig) pageContext.getServletContext().getAttribute(Action.APPLICATION_KEY+app); if (appConfig==null) throw new JspException(could not find the sub application); } else appConfig = (ApplicationConfig) pageContext.getRequest().getAttribute(Action.APPLICATION_KEY); then in your form tag you can use //subapp/action.do or even ///defaultappaction.do this (or something like it) really needs to be applied to every tag that uses uris in a sub-app aware way Regards Ian [EMAIL PROTECTED] 05/13/02 06:42pm In reading the somewhat as-yet scanty documentation about what subapplications are, and how to use them, I was unable to find any description of how to express in a forward that I wanted to leave one subapplication and transition to another one (or possibly up to the default one). Of course I could use an absolute URL, but that means that I have to embed hard knowledge of the URL that I'm deployed at into the struts-config.xml file. Or, I could some up with some scriptlet that computes this value at runtime, and use that value as the target for the HTML form action attribute -- again, somewhat suboptimal. What is the correct way to express using struts a transition out of one subapplication and into another? Steve -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: struts sub application selection issue? - was Tiles subapplications
Hey Cedric. Right, as of 30 mins ago I got tiles sub apps to work together grudingly :-) That patch to RequestUtils.selectApplication fixes the problems I thought it would and does not seem to have any side effects (i.e. the old frames based version continues to work fine). I will submit this as a bug (as I believe that it affects any include of action, not specifially tiles related) Anyway, that worked fine for a bit, right up until I redirected to a jsp from the definition and tried to use a sub application form on the page. If the definition went to an action, and that action redirected to a jsp, it worked fine. Otherwise I get an unable to find mapping error for my sub app action. Same kind of problem again, no sub application is selected. So to get around this problem I built a tag called selectApplication which simply calls RequestUtils.selectApplication and placed this on the page... and it works. Now that one im not sure about - you can't jump on all jsp includes from struts, and say placing the call to selectApplication inside perhaps html:base isn't going to help a tiles application. But for the time being it is working so I'm happy :-) Cheers Ian [EMAIL PROTECTED] 05/03/02 09:25am Hello, One goals of Tiles is to enable reuse and to avoid copy/paste. So, having to copy same layouts in all sub-applications is not what we expect. Consequently, the actual behavior that you describe sound like a bug ;-). I have to dig a little bit to see what can be done. If you have more info, let me know. Cedric Ian Tomey wrote: Hi again, Been tracing through the code to see what the issue is (and if I can fix it quickly) and spotted the problem. I'm not sure if this is going to be problem anywhere else. quick recap of what is going on: call action in the /refdata sub app that returns a tiles-def reference, which points to a page /standardLayout.jsp the layout has reference to /refdata/showAllSchemes.do the tiles insert tag (supposedly) gets the value and inserts it into the layout page (by using pageContext.include in the tag ) - boom - invalid action mapping. The reason this is failing is that struts is not picking up the sub application during the include. we are doing include on /refdata/showAllSchemes.do. We hit the ActionServlet, which goes through to RequestUtils.selectApplication to determine the app. *this is where it goes horribly wrong* // Acquire the path used to compute the sub-application String matchPath = request.getServletPath(); This gets however not /refdata/showAllSchemes.do but /standardLayout.jsp, so the selected application for mapping actions is the root application! (it then looks for the action named /refdata/showAllSchemes inside the default application config) Is this the expected behaviour when doing an include?. Later on in the RequestProcessor the correct uri is got from path = (String) request.getAttribute(INCLUDE_SERVLET_PATH); if (path == null) { path = request.getServletPath(); } The first call gets the correct path (/refdata/showAllSchemes.do) in this case. Should this be done in RequestUtils.selectApplication as well? finally, an obvious way to get around these problems in tiles is to refer to a layout page in the sub application. unfortunately this means copying the layout page into every sub application. Then as well we loose access to the root application and have to copy the pages/action mappings into every sub app as well... GRRR! Ian -- Hi all, Got a problem trying to move our app over to using tiles and its probably specifically related to sub applications. In this simple case, we have the default app and a sub app called refdata. In the refdata config we have something along these lines: action path=/showAScheme type=. forward name=success redirect=false path=refdata.refdata / /action action path=/showAllSchemes type=. forward name=success redirect=false path=/tree.jsp / /action and the tile def: definition name=refdata.refdata extends=site.mainLayout put name=body value=/refdata/showScheme.jsp / put name=left value=/refdata/showAllSchemes.do / /definition Now, when we do http://localhost/testapp/refdata/showAScheme.do the showScheme.jsp displays, but the /refdata/showAllSchemes.do fails with an invalid request. However, if I place put name=left value=/applicationList.do / in the tiledef then the application list action in the default app works fine. Obviously tiles is working in default app space. Anybody got a patch or workaround for this problem? Ian -- To unsubscribe, e-mail:mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail:mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Iterating two lists
Yeah there are times when I could have done with this as well. What's required really is a flag on the iterate tag named something like loop=false where the end tag code will move to the next item in the iterator/array/whatever but just drop out of the end of the tag, not repeat it. then you could do something like logic:iterate name=list1 id=item1 logic:iterate name=list2 id=item2 loop=false Struts list member bean:write name=item1/ thinks bean:write name=item2/ sucks /logic:iterate /logic:iterate no, hold on that looks confusing. probably a better idea is to subclass the iterate tag and set the flag in the constructor/reset and call it something different, say nextitem... logic:iterate name=list1 id=item1 logic:nextitem name=list2 id=item2 Struts list member bean:write name=item1/ thinks bean:write name=item2/ sucks /logic:nextiem /logic:iterate either way, its not going to take a lot of work... Ian [EMAIL PROTECTED] 05/01/02 09:10pm Say I have two lists, which are (in Java terms) independent. Is it possible, using the Struts tags, to iterate and use nested properties to iterate over them in parallel, so the that I can refer to the the nth item in both lists as the same time, or do I have to build a custom class that holds one item from each and combine the two lists into one. Thanks. David Corbin -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Tiles sub applications
Hi all, Got a problem trying to move our app over to using tiles and its probably specifically related to sub applications. In this simple case, we have the default app and a sub app called refdata. In the refdata config we have something along these lines: action path=/showAScheme type=. forward name=success redirect=false path=refdata.refdata / /action action path=/showAllSchemes type=. forward name=success redirect=false path=/tree.jsp / /action and the tile def: definition name=refdata.refdata extends=site.mainLayout put name=body value=/refdata/showScheme.jsp / put name=left value=/refdata/showAllSchemes.do / /definition Now, when we do http://localhost/testapp/refdata/showAScheme.do the showScheme.jsp displays, but the /refdata/showAllSchemes.do fails with an invalid request. However, if I place put name=left value=/applicationList.do / in the tiledef then the application list action in the default app works fine. Obviously tiles is working in default app space. Anybody got a patch or workaround for this problem? Ian -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
struts sub application selection issue? - was Tiles subapplications
Hi again, Been tracing through the code to see what the issue is (and if I can fix it quickly) and spotted the problem. I'm not sure if this is going to be problem anywhere else. quick recap of what is going on: call action in the /refdata sub app that returns a tiles-def reference, which points to a page /standardLayout.jsp the layout has reference to /refdata/showAllSchemes.do the tiles insert tag (supposedly) gets the value and inserts it into the layout page (by using pageContext.include in the tag ) - boom - invalid action mapping. The reason this is failing is that struts is not picking up the sub application during the include. we are doing include on /refdata/showAllSchemes.do. We hit the ActionServlet, which goes through to RequestUtils.selectApplication to determine the app. *this is where it goes horribly wrong* // Acquire the path used to compute the sub-application String matchPath = request.getServletPath(); This gets however not /refdata/showAllSchemes.do but /standardLayout.jsp, so the selected application for mapping actions is the root application! (it then looks for the action named /refdata/showAllSchemes inside the default application config) Is this the expected behaviour when doing an include?. Later on in the RequestProcessor the correct uri is got from path = (String) request.getAttribute(INCLUDE_SERVLET_PATH); if (path == null) { path = request.getServletPath(); } The first call gets the correct path (/refdata/showAllSchemes.do) in this case. Should this be done in RequestUtils.selectApplication as well? finally, an obvious way to get around these problems in tiles is to refer to a layout page in the sub application. unfortunately this means copying the layout page into every sub application. Then as well we loose access to the root application and have to copy the pages/action mappings into every sub app as well... GRRR! Ian -- Hi all, Got a problem trying to move our app over to using tiles and its probably specifically related to sub applications. In this simple case, we have the default app and a sub app called refdata. In the refdata config we have something along these lines: action path=/showAScheme type=. forward name=success redirect=false path=refdata.refdata / /action action path=/showAllSchemes type=. forward name=success redirect=false path=/tree.jsp / /action and the tile def: definition name=refdata.refdata extends=site.mainLayout put name=body value=/refdata/showScheme.jsp / put name=left value=/refdata/showAllSchemes.do / /definition Now, when we do http://localhost/testapp/refdata/showAScheme.do the showScheme.jsp displays, but the /refdata/showAllSchemes.do fails with an invalid request. However, if I place put name=left value=/applicationList.do / in the tiledef then the application list action in the default app works fine. Obviously tiles is working in default app space. Anybody got a patch or workaround for this problem? Ian -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: I killed the (tom)cat
if you click on a console window with it selected you start to select text to copy to the clipboard. press enter to clear 'select' mode. apps will be blocked until you exit that mode [EMAIL PROTECTED] 04/24/02 04:28pm Im still new to struts so Ive yet to encounter most of the 'gotchas' involved, but this problem seems a bit 'unusual'. Ive got a custom tag (intended to be similar to the html:text field tag only with some options to make my life easier generating my html forms) which is trying to obtain the action form bean from the request scope (with the intent of obtaining a field property to populate an html input element). Its failing on the call to get the bean and throwing an exception in the method that does this. I catch this exception inside the method and ignore it, but somewhere after this point tomcat (4.0.3, running standalone on win2k) is dying (but not always. (such as right now when im trying to get more info to add to my post. sigh...)). The batch file window changes to read Select Tomcat and attempts to load pages in the browser just hang. No exceptions are reported in the log, or the batch file window (other than my nobean line). Im probably just doing something stupid somewhere , however my brain is not at peak efficiency right now (Ive done 110 hours in the last 10 days. So much for XPs 40hr week!) so I figured Id ask if anyone here has any idea why it might do this? BeanName is Constants.BEAN_KEY getName() returns the name of the property in the action form bean (ie: username) private String getValue() { String bN = getBeanName(); if(bN == null) return ; Object bean = pageContext.getRequest().getAttribute(bN); try { String value = (String)PropertyUtils.getSimpleProperty(bean, getName()); if(value != null) return value; else return ; } catch(Exception e) { System.out.println(nobean); return ; //somewhere after here tomcat is tomcatatonic... } } -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Jetty, Struts, and the html:base tag
Hi, We are using Jetty 3.1.3 (I think) with Jboss and don't see this issue. However, an attempted upgrade to the latest jboss Jetty 4.0 has thrown up this problem. There are other problems with the jboss so we are not actually upgrading for the time being, but it would be nice to see a resolution for this for when we do. Ian [EMAIL PROTECTED] 04/11/02 04:52pm I apologize if this is a repeat question, but I couldn't locate an answer to this mailing list archive, nor via google to any of your docs or other FAQs. I'm using JBoss 3.0.0 with embedded Jetty. Just about everything works with our web application since we ported it to JBoss from Weblogic. The only problem is with the html:base tag - for some reason, the tag renders base href=http://localhost:8080/transactionmanagerweb/AdminUser.bmi; instead of base href=http://localhost:8080/transactionmanagerweb/useradmin/prefs.jsp;. Since its doing this, our relative URLs are off. Again, weblogic 6.1 and Tomcat 4.0 seem to be fine. When looking at the source for the tag (both in 1.0.2 and 1.1), it seems to be using the getRequestURI() from the request. I guess Jetty doesn't adjust this value if you do a server-side redirect? Has anyone else seen this problem? Is there a workaround? If this is something broken with Jetty, then I could write a similiar tag that uses the mapping to obtain the proper page, rather than the request. I'd prefer not to do this, however, and was hoping someone else has a workaround for this problem. Thanks in advance, James -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Link in iterate
this is a JSP limitation, not a struts limitation. Hopefully Struts will soon be integrated with the upcoming standard tag library which will give us a powerful expression evaluator to use in tag properties [EMAIL PROTECTED] 04/11/02 09:14am You can not nest tags in Struts. What you can do is do something like this: html:link page=/select.do paramId=species paramName=myForm paramProperty=spec/ Another note, using page is not recomended, it is better to define a forward in your Struts-config.xml and use forward instead of page. Cheers, Victor On Thu, 11 Apr 2002 17:52, you wrote: Hello, can anyone show me how to manage that I can do the following: under out_put there is an ArrayList of OutDataForms that take the records of a ResultSet. logic:interate id=myForm name=out_put scope=request type=org.apache.struts.example.OutDataForm bean:write name=myForm property=spec/ html:link page=/select.do?species=bean:write name=myForm property=spec/ bean:write name=myForm property=name/ /html:link /logic:interate In my SelectAction (/select.do) I would like to access the species String: request.getParameter(species); and query the database again to edit or delete this row. Everything works fine except that the ?species=.. parameter to the link-Tag seems to be forbidden. But I need the link to expedite the value to the action. What can I do? Thanks Wolfgang -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Form Beans - Vector
This will work if the form is in session scope, but NOT if it is in request scope. the reason being is that the form is recreated every time, and the parameterList will be null. what is needed is some kind of creation description in the config file - which I built a quick version of yesterday. I don't know if the dynamic form beans are supposed to fix this kind of issue... does anybody know? (aka when is that going to get documented? lol) if not I should be able tidy this stuff up a bit and submit it to somebody who can do the proper integration. my config xml stuff looks like this: form-creation-definition name=aForm form-creation-property name=someProperties type=java.util.ArrayList sizeProperty=propertyCount childType=foo.bar.SomePropertyType form-creation-property name=subProperties type=java.util.Vector sizeProperty=someProperties[].subPropertiesSize childType=foo.bar.AnotherPropertyType/ /form-creation-property /form-creation-definition only aggravating thing is placing the size of collections into the form, so they can (have) to be written out by nested:hiddens. Would be easier if either the collection interfaces could be accessed as a bean properly (ie. getSize() instead of size() ) or the commons output code could handle it. Regards Ian [EMAIL PROTECTED] 03/27/02 07:54pm Hi, Perpetua The attachement is the example, I tested it, it is OK. It is not my work. A kind person.send me. Hope it is useful for you. Annie - Original Message - From: Ted Husted [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, March 27, 2002 5:42 AM Subject: Re: Form Beans - Vector Generally, specifying the type seems to help. .. type=java.util.Vector ... I don't use Vectors myself, since the synchronized aspect is not useful in the kind of applications I tend to work on, but using them with the iterate tags does seem to generate a lot of messages. If you continue to have problems, and if it's possible to use another collection class, like ArrayList, I'd do that. If not, I'd add a helper method that returned the Vector as an array. -- Ted Husted, Husted dot Com, Fairport NY US -- Developing Java Web Applications with Struts -- Tel: +1 585 737-3463 -- Web: http://husted.com/about/services Perpetua Cysne wrote: Could someone please provide me with an example of Form Beans using a Vector of objects? How do display it in a iterate tag? The object is Passenger(firstName, lastName). Thank you! Perpetua -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Tiles sub-applications?
Hi all, been reading about tiles in struts 1.1-b1 and just wondering if it supports sub applications when using definitions? we would need it to support a number of definitons files , one for each sub application Cheers Ian -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: how to edit an array of records with action forms?
Hi Arron, Had a quick look at it, seems like what I need. One gotcha though is that the number of records is not fixed, so the creation of the array of row objects in the form constructor has to be bigger than the max size expected. I'm hoping that actionForm.reset is called before bean population then I can init the size of the array from looking up the param. ugh, an ugly kludge. good work BTW. Cheers Ian [EMAIL PROTECTED] 03/06/02 05:24pm If you're on a nightly build, you'll have the nested extension already there. It will help you make light work of iterating objects. For a pimer and tutorial, go here... http://www.keyboardmonkey.com/struts And for mor implementation detail for each of the tags, the Struts site has the most complete info. Arron. Ian Tomey wrote: Hi all, Got an array of records and I want to put them onto the screen to edit. What is the technique to go about this? (i am using the nightly 1.1 at the moment) is it create an action form that maps a single record and create a load of them? or create an action form with the properties being arrays of the information? one form in total or one form per record? i take it the indexed= attribute for the html tags is going to be useful? It's not obvious how to do this and I just dont have time to expriement (deadline to meet). Any help appreciated Cheers Ian -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
how to edit an array of records with action forms?
Hi all, Got an array of records and I want to put them onto the screen to edit. What is the technique to go about this? (i am using the nightly 1.1 at the moment) is it create an action form that maps a single record and create a load of them? or create an action form with the properties being arrays of the information? one form in total or one form per record? i take it the indexed= attribute for the html tags is going to be useful? It's not obvious how to do this and I just dont have time to expriement (deadline to meet). Any help appreciated Cheers Ian -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Annoyance with html:form name=xxxx/
Hi all, Using Struts 1.02. I am placing multiple forms on the screen which I have populated from an action and pushed into request scope. When I use the html:form tag and specify name, then it barfs if I don't specify the type property (to create new bean if it doesnt exist). Don't really want to specify the full class of the form, especially as they are set up in struts-config. shouldn't this tag at least check for a form name in struts-config? Cheers Ian -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Annoyance with html:form name=xxxx/
oh yeah, those ones are fine, just got a page with multiple forms on which have different values as specified by an action, and are written into the request attributes. need to name each one. [EMAIL PROTECTED] 02/28/02 01:44pm try html:form action= where is the path of the action defined in the struts-config.xml file - Original Message - From: Ian Tomey [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 28, 2002 4:53 AM Subject: Annoyance with html:form name=/ Hi all, Using Struts 1.02. I am placing multiple forms on the screen which I have populated from an action and pushed into request scope. When I use the html:form tag and specify name, then it barfs if I don't specify the type property (to create new bean if it doesnt exist). Don't really want to specify the full class of the form, especially as they are set up in struts-config. shouldn't this tag at least check for a form name in struts-config? Cheers Ian -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]