Error Stream closed while validator put
hi i have validate fileds password and re-password must same as expression using passwd eq repasswd Password and Re-password must be same when i put this in my *-validator.xml and try to check givin difference fiield value gives error like --- javax.servlet.ServletException: Stream closed org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:515) org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419) com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:119) com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:55) org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:99) --- java.io.IOException: Stream closed org.apache.jasper.runtime.JspWriterImpl.ensureOpen(JspWriterImpl.java:204) org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:115) org.apache.jasper.runtime.JspWriterImpl.flush(JspWriterImpl.java:173) org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:953) org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:600) org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:119) org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:178) com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:348) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:253) org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:50) org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:504) org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419) com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:119) com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:55) org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:99) my Saveuser-validation.xml is --- true Username is required true Password is required true Re-Password is required passwd eq repasswd Password and Re-password must be same --- my struts.xml is USERMASTER/LoadForm.jsp USERMASTER/LoadForm.jsp MainMenu --- please help me -- -- View this message in context: http://www.nabble.com/Error-Stream-closed-while-validator-put-tp17142148p17142148.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Can you set parameters in using in the tag body?
Thanks for your reply Jeromy. I've read Mark's Struts 2 Cookbook and it gave me good ideas. What I just did was the following: - Create an action in the struts.xml - Used that particular action in the tag - In the struts.xml, I've set some dynamic parameters along with the action definition Everything went like charm. Cheers! Eduardo On Thu, May 8, 2008 at 9:57 PM, Jeromy Evans < [EMAIL PROTECTED]> wrote: > Jeromy Evans wrote: > >> >> No, that's not supported. It would have to append the parameters to the >> query string or create post parameters after the specific submit button is >> pressed. That would need to be implemented using a javascript listener >> attached to the click or submit event. It's a nice idea though. >> - >> > > I should add that the action and method attributes of work by > appending the action or method value into the name/value of the for > the submit button. The selected submit button's name/value are one of the > submitted form's parameters. Embedding an arbitrary number of params into > the name/value of the submit would not be as elegant. > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Eduardo Dela Rosa
struts 2.1.2 - strange bug
Hi, all. I have a config with /pages/register.jsp /pages/result.jsp /pages/register.jsp action with public String execute() { userManager.registerUser(getEmail(), getPassword()); return SUCCESS; } public void validate() { if (getEmail().length() == 0) { addFieldError("email", getText("user.registration.errors.no.email")); } if (getPassword().length() == 0) { addFieldError("password", getText("user.registration.errors.no.password")); } if (getPasswordConfirmation().length() == 0) { addFieldError( "passwordConfirmation", getText("user.registration.errors.no.password.confirmation")); } } and jsp register.jsp with but, when i'm trying to submit zero-form i'm of course see FieldError messages, but when i'm pressing submit button again - i see double amount of same messages, again - triple amount ... and i cannot understand - why i see too much same messages? -- View this message in context: http://www.nabble.com/struts-2.1.2---strange-bug-tp17138404p17138404.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
tomcat 5.5 migrate to 6.0.16, struts 1.x application not working any more
Hi, i installed Tomcat 6.0.16, and move existing application directory from tomcat 5.5 to tomcat 6.6. after doing so, then i make the change to server.xml(global) only, add the block of to reflect the existing/transfered application but when i do test, give the error message as following(certainly i rebounce the server) The requested resource (Servlet action is not available) is not available, when i check catalina.out , it shows the following SEVERE: Parsing error processing resource path jndi:/localhost/(my application)/WEB-INF/struts-config.xml... java.lang.reflect.InvocationTargetException any expert can tel me that for migrate tomcat 5.5 to tomcat 6.0, in addition to change global server.xml, what else need to make change? or need to add extra library to make existing application still functional. tks in advance john any expert can tel me why? - Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.
How to validate a checkboxlist?
I am trying to perform client side validation on a struts checkboxlist tag but nothing I try seems to work. ANy ideas? I do not want to submit the form and do a validation method in the action bean because obviously it would be ridiculous to post back to the server just to check that there is at least one checkbox selected This is what I have: http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd";> You must select at least one role for this user -- View this message in context: http://www.nabble.com/How-to-validate-a-checkboxlist--tp17136631p17136631.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JSON Plugin - excludeProperties Issues
> I see now. categoryChildren returns a collection so I need > categoryChildren.*\.createdTs. However this only works if I do not > specify root. If I specify root then it does not appear to work. > Could you send me (or create a ticket with it) an small testcase? I will look into it > I noticed that there was mention on the Wiki of an enhancement with an > includeProperties param. Is there a release date for update? That > would be nice. Nope. But patches are welcome :) musachy > > > -Original Message- > From: Hoying, Ken [mailto:[EMAIL PROTECTED] > Sent: Thursday, May 08, 2008 4:11 PM > To: Struts Users Mailing List > Subject: RE: JSON Plugin - excludeProperties Issues > > I thought that might be the case and tried to reference them that way > (i.e. categoryChildren.createdTs). However, that did not seem to work > either. > > -Original Message- > From: Musachy Barroso [mailto:[EMAIL PROTECTED] > Sent: Thursday, May 08, 2008 4:06 PM > To: Struts Users Mailing List > Subject: Re: JSON Plugin - excludeProperties Issues > > The exclude properties are relative to the action, not the root. > > musachy > > On Thu, May 8, 2008 at 4:01 PM, Hoying, Ken <[EMAIL PROTECTED]> > wrote: >> I am trying to specify properties for the JSON plugin to ignore. >> However, this does not seem to be working. Am I specfiying something >> incorrectly? Does it not work in conjunction with specifying the > root? >> >> >>> name="root">categoryChildren >> >>createdTs, createdBy, >> lastModifiedTs, lastModifiedBy, allCategoriesOfRoot, >>products, contracts, children, >> contractCount, productCount, >>allTaxonomyCategories, >> rootTaxonomyCategories >> >> >> >> > > > > -- > "Hey you! Would you help me to carry the stone?" Pink Floyd > > - > 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] > > -- "Hey you! Would you help me to carry the stone?" Pink Floyd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: JSON Plugin - excludeProperties Issues
I see now. categoryChildren returns a collection so I need categoryChildren.*\.createdTs. However this only works if I do not specify root. If I specify root then it does not appear to work. I noticed that there was mention on the Wiki of an enhancement with an includeProperties param. Is there a release date for update? That would be nice. -Original Message- From: Hoying, Ken [mailto:[EMAIL PROTECTED] Sent: Thursday, May 08, 2008 4:11 PM To: Struts Users Mailing List Subject: RE: JSON Plugin - excludeProperties Issues I thought that might be the case and tried to reference them that way (i.e. categoryChildren.createdTs). However, that did not seem to work either. -Original Message- From: Musachy Barroso [mailto:[EMAIL PROTECTED] Sent: Thursday, May 08, 2008 4:06 PM To: Struts Users Mailing List Subject: Re: JSON Plugin - excludeProperties Issues The exclude properties are relative to the action, not the root. musachy On Thu, May 8, 2008 at 4:01 PM, Hoying, Ken <[EMAIL PROTECTED]> wrote: > I am trying to specify properties for the JSON plugin to ignore. > However, this does not seem to be working. Am I specfiying something > incorrectly? Does it not work in conjunction with specifying the root? > > > name="root">categoryChildren > >createdTs, createdBy, > lastModifiedTs, lastModifiedBy, allCategoriesOfRoot, >products, contracts, children, > contractCount, productCount, >allTaxonomyCategories, > rootTaxonomyCategories > > > > -- "Hey you! Would you help me to carry the stone?" Pink Floyd - 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: JSON Plugin - excludeProperties Issues
I thought that might be the case and tried to reference them that way (i.e. categoryChildren.createdTs). However, that did not seem to work either. -Original Message- From: Musachy Barroso [mailto:[EMAIL PROTECTED] Sent: Thursday, May 08, 2008 4:06 PM To: Struts Users Mailing List Subject: Re: JSON Plugin - excludeProperties Issues The exclude properties are relative to the action, not the root. musachy On Thu, May 8, 2008 at 4:01 PM, Hoying, Ken <[EMAIL PROTECTED]> wrote: > I am trying to specify properties for the JSON plugin to ignore. > However, this does not seem to be working. Am I specfiying something > incorrectly? Does it not work in conjunction with specifying the root? > > > name="root">categoryChildren > >createdTs, createdBy, > lastModifiedTs, lastModifiedBy, allCategoriesOfRoot, >products, contracts, children, > contractCount, productCount, >allTaxonomyCategories, > rootTaxonomyCategories > > > > -- "Hey you! Would you help me to carry the stone?" Pink Floyd - 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: JSON Plugin - excludeProperties Issues
The exclude properties are relative to the action, not the root. musachy On Thu, May 8, 2008 at 4:01 PM, Hoying, Ken <[EMAIL PROTECTED]> wrote: > I am trying to specify properties for the JSON plugin to ignore. > However, this does not seem to be working. Am I specfiying something > incorrectly? Does it not work in conjunction with specifying the root? > > > name="root">categoryChildren > >createdTs, createdBy, > lastModifiedTs, lastModifiedBy, allCategoriesOfRoot, >products, contracts, children, > contractCount, productCount, >allTaxonomyCategories, > rootTaxonomyCategories > > > > -- "Hey you! Would you help me to carry the stone?" Pink Floyd - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
JSON Plugin - excludeProperties Issues
I am trying to specify properties for the JSON plugin to ignore. However, this does not seem to be working. Am I specfiying something incorrectly? Does it not work in conjunction with specifying the root? categoryChildren createdTs, createdBy, lastModifiedTs, lastModifiedBy, allCategoriesOfRoot, products, contracts, children, contractCount, productCount, allTaxonomyCategories, rootTaxonomyCategories
Re: html:multibox read but not write
Hi Laurie, thanks for your attempts.. I give up.. I cannot find in the help how to submit via email... I have tried.. and this is another attempt with no openning tag mark "<" --- in JSP: (1) - table> logic:iterate id="funPro" name="funProForm" property="functionProList "> tr> td> table border="0"> tr> logic:iterate id="pro" name="funPro" property="pros"> td> html:multibox name="funPro" property="selectedPros"> bean:write name="pro" property="label" /> /html:multibox> /td> /logic:iterate> tr> /table> /td> /tr> /table> -- in JSP: (2) logic:iterate id="item" name="myForm" property="myList"> td> html:multibox property="selectedValues"> bean:write name="item" property="label" /> /html:multibox> /td> /logic:iterate> Laurie Harper wrote: > > Sorry, I don't see a repost with the JSP readable so there's still > nothing to take another look at :-/ > > L. > > houser wrote: >> Thanks for your reply.. >> I have already changed it by using tag and the JSP pieces of code are >> displayed.. can give it another look please? >> >> houser >> >> Laurie Harper wrote: >>> None of the JSP code made it out of your mail client into the message >>> I'm afraid. Try re-posting with your mail program set for plain text >>> instead of multipart/mime. >>> >>> L. >>> >>> houser wrote: Hi All, I am in very strange situation, and stuck! please help, I have found one thread that much more or less but does not help.. http://www.nabble.com/Check-a-multibox-dynamically-to6630704.html#a6630704 http://www.nabble.com/Check-a-multibox-dynamically-to6630704.html#a6630704 I have already use some example and it works.. Now the situation is lsightly different: I have a form: Start Code FunctionProForm extends ActionForm { private List functionProList = new ArrayList(); ... public List getSelectedPros(FunctionDto fun){ List result = new ArrayList(); for(FunProMap fp : functionProList){ if(fp.getFunction().getName().equals(fun.getName())){ for(int i = 0; i < fp.getSelectedPros().length; i++){ result.add(fp.getSelectedPros()[i]); } return result; } } return result; } } --the serializable object FunProMap -- public class FunProMap implements Serializable{ private static final long serialVersionUID = 1L; private FunctionDto function = new FunctionDto(); private List pros = new ArrayList(); private String[] selectedPros = {}; } --- in JSP: - - in the SaveAction -- SaveAction extends Action { protected ActionForward doExecute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response){ FunctionProForm myForm = (FunctionProForm) form; ... List functions = myService.listFunctions(); for(FunctionDto fun : functions){ fun.setPros(myForm.getSelectedPros(fun)); myService.updateFunction(fun); } return mapping.findForward("success"); } } End Code The check boxes are populated correctly from the database, i.e. for each FUnction, the corresponding checkbos is checked according to the list of available Pros (function.pros). The problem is that if I edit these boxes, check and uncheck, and click the Submit button, the changed is not saved to the database. I have run the debug and find that the method myForm.getSelectedPros(fun) returns the old values but not the new checked-unchecked boxes' values :-( !! I have used with a simple form according to:
UnknownHandler
I have been trying to implement an UnknownHandler, and I can not seem to find any documentation on how to integrate it into the framework. I am using spring for DependencyInjection, so I thought that I could just add a bean named unknownHandler, but that did not work. I could not find an example of how to set the unknownHandler field in DefaultActionProxy. Looking at the source code it looks like I have to apply the StrutsSpringObjectFactory injector to the DefaultActionProxy but I am not sure why that us happening. The map Class -> injectors contains an injector for Spring but it has no classes. I am not exactly sure where to look on how to do this. Thanks Kal
Re: HashMap< String, ArrayList >: Unable to populate the Array List from JSP
hi, Thanks for he help. i am using as follows: < s:checkboxlist name="mapOfList['key']" /> I see that this is not working and the mapOfList is not getting populated at all. I tried out StrutsTypeConverter... then only convertToString() method is being called. Any ideas as how to go with this issue??? sorry for the wrong example prev. regards, ravi -- View this message in context: http://www.nabble.com/HashMap%3C-String%2C-ArrayList%3CString%3E-%3E%3A-Unable-to-populate-the-Array-List-from-JSP-tp16975469p17129314.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Injecting Spring Services into Struts 2 Actions
Is this a Spring 2.5 thing? I'm not using 2.5 yet and haven't had to do anything to get my actions to be injected with Spring beans (at least I don't think so; I remember having to set the object factory to "spring" in earlier days?) Dave --- Laurie Harper <[EMAIL PROTECTED]> wrote: > Asleson, Ryan wrote: > > > > Hello, > > > > I found this guide to injecting Spring beans into Struts 2 Actions: > > > > http://cwiki.apache.org/WW/spring.html > > > > According to the red box at the bottom of the document, the Struts > 2 > > Action does not need to be registered with Spring. So far so good. > > Er, that's not as clear as it could be; I believe it means that > 'registering Actions with Spring is not required *if you don't want > Spring dependency injection for that action*'. In other words, you > *do* > need Spring to know about the action if you want it to inject > dependencies. > > > However, I'm a little unclear as to how exactly it "knows" what > Spring > > beans to inject into the Struts 2 Action. Assuming I have a Struts > 2 > > Action that depends on a PersonService, I assume that the Struts 2 > > Action would have a public mutator for the PersonService like this: > > > > public void setPersonService(PersonService service) { > > this.personService = service; > > } > > > > How does the injection system "know" that this method should be > used for > > injecting a Spring bean? Imagine that the Struts 2 Action has > several > > "set" methods, and that there are a number of configured Spring > beans. > > It would take way too long for the injection system to look through > > every "set" method on the Action and try to find a matching Spring > bean, > > especially if there are a lot of Spring beans (and there usually > are). > > > > The document above includes this comment: > > > > We strongly recommend that you find declarative ways of letting > Spring > > know what to provide for your actions. > > > > But it doesn't give an example of how to let Spring know what to > provide > > to the actions. > > > > So, the question is: How do I tell Spring what beans need to be > > injected into the Action? > > You can either configure the action as a Spring bean in your > applicationContext.xml and use the normal declarative syntax to do > this, > or you can use Spring 2.5's @Component, @Resource, etc. annotations > and > skip the XML. But you do need to do one or the other. > > L. > > > - > 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]
s:doubleselect problem
Hi, I have struts 2.0.11. I am getting following exception when I use s:doubleselect tag. I referred to struts2-showcase example to use this tag in my application. Any ideas on what can be wrong ? Leena Exception is -- ==> ${parameters.formName} [on line 98, column 41 in template/simple/doubleselect.ftl] in include "/${parameters.templateDir}/simple/doubleselect.ftl" [on line 25, column 1 in template/xhtml/doubleselect.ftl] -- Java backtrace for programmers: -- freemarker.core.InvalidReferenceException: Expression parameters.formName is undefined on line 98, column 43 in template/simple/doubleselect.ftl. at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124) at freemarker.core.Expression.getStringValue(Expression.java:118) .. s:doubleselct tag look like this
Re: and javascript
umainb wrote: Hello, I have a link in my jsp which deletes a record from the list of numbers. When the user clicks on the link above, we need a javascript popup "Are you sure you want to delete the number?" with "OK" and "Cancel" How I can achieve that? Use html:link's onclick attribute to invoke the popup dialog just as you would with vanilla HTML. html:link supports all the Javascript event hook attributes you'd expect: http://struts.apache.org/1.3.8/struts-taglib/tlddoc/html/link.html L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Injecting Spring Services into Struts 2 Actions
Asleson, Ryan wrote: Hello, I found this guide to injecting Spring beans into Struts 2 Actions: http://cwiki.apache.org/WW/spring.html According to the red box at the bottom of the document, the Struts 2 Action does not need to be registered with Spring. So far so good. Er, that's not as clear as it could be; I believe it means that 'registering Actions with Spring is not required *if you don't want Spring dependency injection for that action*'. In other words, you *do* need Spring to know about the action if you want it to inject dependencies. However, I'm a little unclear as to how exactly it "knows" what Spring beans to inject into the Struts 2 Action. Assuming I have a Struts 2 Action that depends on a PersonService, I assume that the Struts 2 Action would have a public mutator for the PersonService like this: public void setPersonService(PersonService service) { this.personService = service; } How does the injection system "know" that this method should be used for injecting a Spring bean? Imagine that the Struts 2 Action has several "set" methods, and that there are a number of configured Spring beans. It would take way too long for the injection system to look through every "set" method on the Action and try to find a matching Spring bean, especially if there are a lot of Spring beans (and there usually are). The document above includes this comment: We strongly recommend that you find declarative ways of letting Spring know what to provide for your actions. But it doesn't give an example of how to let Spring know what to provide to the actions. So, the question is: How do I tell Spring what beans need to be injected into the Action? You can either configure the action as a Spring bean in your applicationContext.xml and use the normal declarative syntax to do this, or you can use Spring 2.5's @Component, @Resource, etc. annotations and skip the XML. But you do need to do one or the other. L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 2.1.2 action url fails (possible bug)
I did one more test to verify the problem [I also changed the context root - just to get crazy] and the problem is there [you will find the server partial dump beflow]: I first typed: https://localhost:9445/ccol/index.html The url got redirected to the following url [after I was prompted to basic http authentication dialog]: https://localhost:9445/ccol/example/HelloWorld.action Now from within the same browser, I can type anyother existing url (including those that end with .action], everything works fine. Then, I opened a new browser, copied the above link in it [https://localhost:9445/ccol/example/HelloWorld.action], and I got "page not found" error [not to mention that I even did not get prompted for authentication]. Then I uninstalled the app, and installed the same app [blank.war] for struts 2.0.11 and It works like charm with no problem. Here is the partial server dump: [5/8/08 9:23:38:095 EDT] , key = java.io.FileNotFoundException com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.handleRequest 573 Exception = java.io.FileNotFoundException Source = com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.handleRequest probeid = 573 Stack Dump = java.io.FileNotFoundException: /example/HelloWorld.action at com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:414) at com.ibm.ws.wswebcontainer.extension.DefaultExtensionProcessor.handleRequest(DefaultExtensionProcessor.java:113) at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3276) at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:267) at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:811) at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1455) at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:113) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:454) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:383) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:263) at com.ibm.ws.ssl.channel.impl.SSLConnectionLink.determineNextChannel(SSLConnectionLink.java:1002) .. __ Looking for the perfect gift? Give the gift of Flickr! http://www.flickr.com/gift/
Re: OGNL
I initially shied away from doing that because I figured that later on in the show we might want to use Collection sub-class x, y or z. However the alternatives were too time-consuming, so I have done just what you said. I am now the proud owner of BidirectionalChildList() which takes the parent entity and the name of the property on the children in its constructor. It's pretty restrictive - but I guess if other Collection sub-classes are needed, it's pretty quick to knock up another implementation. Thanks Adam Chris Pratt on 08/05/08 16:39, wrote: How about adding a specific list implementation rather than using a generic list. Then your list implementation can maintain the relationships instead of the action. (*Chris*) On Thu, May 8, 2008 at 7:04 AM, Adam Hardy <[EMAIL PROTECTED]> wrote: Adam Hardy on 08/05/08 12:21, wrote: when the Params interceptor populates my entity beans, it must be setting the member variables directly without using the setters. Is there a way to tell it to use the setters? There is some logic in the setters which it would be good if it executed. It gives precedence to the setters. Why would it not be able to see or set the property? Really? That's good to know - any work-around was looking distinctly horrific. These are JPA pojos, so the setters should be available. Maybe it's breaking the javabean spec in some subtle way - I double-checked the memvar, getter, setter and constructor though and it looks OK. I'm not sure. I ran into this same issue recently and cursed at lot at OGNL only to find out it was caused by erasure of the generic type (ie. the class of the setters argument was Object, not what I thought). It's worth debugging this with a breakpoint. The OGNL implementation is quite straight-forward in the way it searches for properties/methods/members matching the right signature. As it loops through all the properties you should see why it missed the one it should have set. Doing that now - hopefully the answer will point to a simple solution. I can already see that Hibernate has got its grubby nose in there. Debugging unmasked what the problem was. OGNL was calling getChildren() and modifying the collection of children, rather than calling setChildren(newList) at any point - logically. I thought I had disabled that by returning a Collections.unmodifiableList(list) but in this case I had forgotten. Unfortunately for me, returning an unmodifiable collection breaks OGNL. I need to maintain the consistency of entity relationships, insuring that the "one" and the "many" sides of a bidirectional relationship are consistent with one another when the application updates the relationship at runtime. I'll have to find another way rather than trying to control the list. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Transfer user to login page on session timeout
Hi, You should be able to use servlet filters to block the request from going to the actions: http://java.sun.com/products/servlet/Filters.html I would do it your way and check for timeout by checking for the presence of session objects. There may be better ways, but I can't think of any other. (A different way may be to check whether the session was started in this request. I don't know how to do it in struts though and I don't see a reason why it would actually be advantageous to use that check.) -Vivek. bhaarat Sharma wrote: Hello I am using struts 1 I am working on some legacy code. Have a requirement where the user should be fwded to the login page after session times out. Currently there are 100's of action classes and it wont be feasible to touch each one and check if the session exists. Can we do something in struts 1 so that all requests go through the initial action...there I can check for session object..if it does not exist then I can forward it to the login page. Thanks for any help!! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: tomcat/struts ---> flash/.swf >> hang problem
John, Install Live HTTP Headers / Header Monitor plugin into Firefox and then watch the HTTP traffic between your browser and the server. Your answer will most likely be there. My assumption is that the MIME Type .swf is not enabled in your Tomcat but that is just a wild guess. regards, Doug On Thu, May 8, 2008 at 11:58 AM, Laurie Harper <[EMAIL PROTECTED]> wrote: > That doesn't answer most of my questions. You need to determine what is > being sent to the browser (if anything) when it requests the .swf file from > your web application, then post details of what you find out along with the > relevant configuration details (including web.xml and struts.xml excerpts). > > L. > > > john lee wrote: > >> Laurie, >>tks for your advise. >>hang forever, > browser lockup if use IE >>but, if use firefox, just nothing happen(return blank screen), but >> browser not freeze. >>above test under regular Tomcat, which is >> http://localhost:8080/sample.html ( it contains sample.swf inside) >>after test above, check the logfile under >> /home/apache-tomcat-5.5.23/logs, but not showing anything. >>if use regular apache web server, the sample.html(sample.swf) running >> fine. >>any configuration need to make in tomcat before run flash .swf file? >>tks in advance again. >>john >> >> Laurie Harper <[EMAIL PROTECTED]> wrote: >> john lee wrote: >> >>> Any expert can tell me why for the following? >>> >>> i have an flash file (.swf), it is running fine under regular apache >>> server. >>> >>> But, it hang forever after i put it under tomcat/struts home directory. >>> >> >> What do you mean by 'hang forever'? Do you mean the browser locks up? The >> HTTP response is never sent? -- in which case does any response data get >> sent? How is your Struts application configured? Is the .swf file being >> served by Struts or directly by Tomcat? >> >> If you're not sure how to answer those questions, I would suggest using >> Firebug or some other tool that lets you monitor the HTTP conversation to >> get a clearer picture of what's happening. >> >> L. >> >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> >> >> - >> Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it >> now. >> > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- What profits a man if he gains the whole world yet loses his soul?
Transfer user to login page on session timeout
Hello I am using struts 1 I am working on some legacy code. Have a requirement where the user should be fwded to the login page after session times out. Currently there are 100's of action classes and it wont be feasible to touch each one and check if the session exists. Can we do something in struts 1 so that all requests go through the initial action...there I can check for session object..if it does not exist then I can forward it to the login page. Thanks for any help!!
Re: html:multibox read but not write
[EMAIL PROTECTED]; [EMAIL PROTECTED] would be the customer support channel for the Nabble list browser/forum system. L. houser wrote: By the way.. to which email address should I post my message using the email program? is it: [EMAIL PROTECTED] or [EMAIL PROTECTED] thanks Laurie Harper wrote: None of the JSP code made it out of your mail client into the message I'm afraid. Try re-posting with your mail program set for plain text instead of multipart/mime. L. houser wrote: Hi All, I am in very strange situation, and stuck! please help, I have found one thread that much more or less but does not help.. http://www.nabble.com/Check-a-multibox-dynamically-to6630704.html#a6630704 http://www.nabble.com/Check-a-multibox-dynamically-to6630704.html#a6630704 I have already use some example and it works.. Now the situation is lsightly different: I have a form: Start Code FunctionProForm extends ActionForm { private List functionProList = new ArrayList(); ... public List getSelectedPros(FunctionDto fun){ List result = new ArrayList(); for(FunProMap fp : functionProList){ if(fp.getFunction().getName().equals(fun.getName())){ for(int i = 0; i < fp.getSelectedPros().length; i++){ result.add(fp.getSelectedPros()[i]); } return result; } } return result; } } --the serializable object FunProMap -- public class FunProMap implements Serializable{ private static final long serialVersionUID = 1L; private FunctionDto function = new FunctionDto(); private List pros = new ArrayList(); private String[] selectedPros = {}; } --- in JSP: - - in the SaveAction -- SaveAction extends Action { protected ActionForward doExecute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response){ FunctionProForm myForm = (FunctionProForm) form; ... List functions = myService.listFunctions(); for(FunctionDto fun : functions){ fun.setPros(myForm.getSelectedPros(fun)); myService.updateFunction(fun); } return mapping.findForward("success"); } } End Code The check boxes are populated correctly from the database, i.e. for each FUnction, the corresponding checkbos is checked according to the list of available Pros (function.pros). The problem is that if I edit these boxes, check and uncheck, and click the Submit button, the changed is not saved to the database. I have run the debug and find that the method myForm.getSelectedPros(fun) returns the old values but not the new checked-unchecked boxes' values :-( !! I have used with a simple form according to: http://www.jguru.com/faq/view.jsp?EID=925277 http://www.jguru.com/faq/view.jsp?EID=925277 MyForm extends ActionForm { List myList; String[] selectedValues; // } and and this works fine.. Please help... ruga - 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:multibox read but not write
Sorry, I don't see a repost with the JSP readable so there's still nothing to take another look at :-/ L. houser wrote: Thanks for your reply.. I have already changed it by using tag and the JSP pieces of code are displayed.. can give it another look please? houser Laurie Harper wrote: None of the JSP code made it out of your mail client into the message I'm afraid. Try re-posting with your mail program set for plain text instead of multipart/mime. L. houser wrote: Hi All, I am in very strange situation, and stuck! please help, I have found one thread that much more or less but does not help.. http://www.nabble.com/Check-a-multibox-dynamically-to6630704.html#a6630704 http://www.nabble.com/Check-a-multibox-dynamically-to6630704.html#a6630704 I have already use some example and it works.. Now the situation is lsightly different: I have a form: Start Code FunctionProForm extends ActionForm { private List functionProList = new ArrayList(); ... public List getSelectedPros(FunctionDto fun){ List result = new ArrayList(); for(FunProMap fp : functionProList){ if(fp.getFunction().getName().equals(fun.getName())){ for(int i = 0; i < fp.getSelectedPros().length; i++){ result.add(fp.getSelectedPros()[i]); } return result; } } return result; } } --the serializable object FunProMap -- public class FunProMap implements Serializable{ private static final long serialVersionUID = 1L; private FunctionDto function = new FunctionDto(); private List pros = new ArrayList(); private String[] selectedPros = {}; } --- in JSP: - - in the SaveAction -- SaveAction extends Action { protected ActionForward doExecute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response){ FunctionProForm myForm = (FunctionProForm) form; ... List functions = myService.listFunctions(); for(FunctionDto fun : functions){ fun.setPros(myForm.getSelectedPros(fun)); myService.updateFunction(fun); } return mapping.findForward("success"); } } End Code The check boxes are populated correctly from the database, i.e. for each FUnction, the corresponding checkbos is checked according to the list of available Pros (function.pros). The problem is that if I edit these boxes, check and uncheck, and click the Submit button, the changed is not saved to the database. I have run the debug and find that the method myForm.getSelectedPros(fun) returns the old values but not the new checked-unchecked boxes' values :-( !! I have used with a simple form according to: http://www.jguru.com/faq/view.jsp?EID=925277 http://www.jguru.com/faq/view.jsp?EID=925277 MyForm extends ActionForm { List myList; String[] selectedValues; // } and and this works fine.. Please help... ruga - 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: tomcat/struts ---> flash/.swf >> hang problem
That doesn't answer most of my questions. You need to determine what is being sent to the browser (if anything) when it requests the .swf file from your web application, then post details of what you find out along with the relevant configuration details (including web.xml and struts.xml excerpts). L. john lee wrote: Laurie, tks for your advise. hang forever, > browser lockup if use IE but, if use firefox, just nothing happen(return blank screen), but browser not freeze. above test under regular Tomcat, which is http://localhost:8080/sample.html ( it contains sample.swf inside) after test above, check the logfile under /home/apache-tomcat-5.5.23/logs, but not showing anything. if use regular apache web server, the sample.html(sample.swf) running fine. any configuration need to make in tomcat before run flash .swf file? tks in advance again. john Laurie Harper <[EMAIL PROTECTED]> wrote: john lee wrote: Any expert can tell me why for the following? i have an flash file (.swf), it is running fine under regular apache server. But, it hang forever after i put it under tomcat/struts home directory. What do you mean by 'hang forever'? Do you mean the browser locks up? The HTTP response is never sent? -- in which case does any response data get sent? How is your Struts application configured? Is the .swf file being served by Struts or directly by Tomcat? If you're not sure how to answer those questions, I would suggest using Firebug or some other tool that lets you monitor the HTTP conversation to get a clearer picture of what's happening. L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problem
Arpan Debroy wrote: I have a JPA query like that Query query = em.createQuery("*SELECT c.name, c.id FROM Group c ORDER BY c.name*"); List resultList = query.getResultList(); Have you verified that the query is returning a non-empty list -- i.e. resultList really contains data to display? What does the result object JPA produces for an ad-hoc query like that look like? I don't recall off the top of my head, but I suspect it's something like List> or possibly List>? In Action class I have *resultList *and *GroupId *declared with getter and setters private List resultList ; private long GroupId; In JSP I have written like that : ** That should be 'groupId' not 'GroupId'; case is important, and the convention is specified by the JavaBeans spec. But nothing is displaying in my drop down box when I put listkey and listvalue. According to your previous reply on this thread, the options are rendered correctly but none is selected. Is that right? That would be explained by the mis-spelled 'GroupId'. If that doesn't fix it, make sure the type of the groupId property matches the type of the 'id' property in the JPA result object. L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OGNL
How about adding a specific list implementation rather than using a generic list. Then your list implementation can maintain the relationships instead of the action. (*Chris*) On Thu, May 8, 2008 at 7:04 AM, Adam Hardy <[EMAIL PROTECTED]> wrote: > Adam Hardy on 08/05/08 12:21, wrote: >> >> when the Params interceptor populates my entity beans, it must be >> setting the member variables directly without using the setters. >> >> Is there a way to tell it to use the setters? There is some logic in >> the setters which it would be good if it executed. > > It gives precedence to the setters. Why would it not be able to see or > set the property? Really? That's good to know - any work-around was looking distinctly horrific. These are JPA pojos, so the setters should be available. Maybe it's breaking the javabean spec in some subtle way - I double-checked the memvar, getter, setter and constructor though and it looks OK. >>> I'm not sure. I ran into this same issue recently and cursed at lot at >>> OGNL only to find out it was caused by erasure of the generic type (ie. the >>> class of the setters argument was Object, not what I thought). It's worth >>> debugging this with a breakpoint. The OGNL implementation is quite >>> straight-forward in the way it searches for properties/methods/members >>> matching the right signature. As it loops through all the properties you >>> should see why it missed the one it should have set. >> >> Doing that now - hopefully the answer will point to a simple solution. I >> can already see that Hibernate has got its grubby nose in there. > > Debugging unmasked what the problem was. OGNL was calling getChildren() and > modifying the collection of children, rather than calling > setChildren(newList) at any point - logically. > > I thought I had disabled that by returning a > Collections.unmodifiableList(list) but in this case I had forgotten. > > Unfortunately for me, returning an unmodifiable collection breaks OGNL. > > I need to maintain the consistency of entity relationships, insuring that > the "one" and the "many" sides of a bidirectional relationship are > consistent with one another when the application updates the relationship at > runtime. > > I'll have to find another way rather than trying to control the list. > > Thanks > Adam > > - > 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]
and javascript
Hello, I have a link in my jsp which deletes a record from the list of numbers. When the user clicks on the link above, we need a javascript popup "Are you sure you want to delete the number?" with "OK" and "Cancel" How I can achieve that? Thanks. -- View this message in context: http://www.nabble.com/%3Chtml%3Alink%3E-and-javascript-tp17127304p17127304.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Injecting Spring Services into Struts 2 Actions
Related to this question, I'm leveraging Spring's use of the @Resource annotation to the private member variable (no setter needed), thus fully relying on Spring's injection mechanism. I supposed it all depends on tight coupling to Spring you want to add. Relph,Brian wrote: The actions are auto-wired by name by default - so if any of its properties match bean-ids in your spring config, and they have setters, then those properties will get set. The part about declaring the dependencies means you disable the auto-wiring, and declare your actions as spring beans. So, instead of this: /WEB-INF/view/index.jsp You would do this: /WEB-INF/view/index.jsp Along with additional spring config: Notice this does not actually disable auto-wiring (you would have to set the auto-wire attribute in the spring config, either globally or per-bean), but it does declaratively state what to set on the action as properties. Brian Relph -Original Message- From: Asleson, Ryan [mailto:[EMAIL PROTECTED] Sent: Thursday, May 08, 2008 8:29 AM To: Struts Users Mailing List Subject: Injecting Spring Services into Struts 2 Actions Hello, I found this guide to injecting Spring beans into Struts 2 Actions: http://cwiki.apache.org/WW/spring.html According to the red box at the bottom of the document, the Struts 2 Action does not need to be registered with Spring. So far so good. However, I'm a little unclear as to how exactly it "knows" what Spring beans to inject into the Struts 2 Action. Assuming I have a Struts 2 Action that depends on a PersonService, I assume that the Struts 2 Action would have a public mutator for the PersonService like this: public void setPersonService(PersonService service) { this.personService = service; } How does the injection system "know" that this method should be used for injecting a Spring bean? Imagine that the Struts 2 Action has several "set" methods, and that there are a number of configured Spring beans. It would take way too long for the injection system to look through every "set" method on the Action and try to find a matching Spring bean, especially if there are a lot of Spring beans (and there usually are). The document above includes this comment: We strongly recommend that you find declarative ways of letting Spring know what to provide for your actions. But it doesn't give an example of how to let Spring know what to provide to the actions. So, the question is: How do I tell Spring what beans need to be injected into the Action? Thanks -Ryan This e-mail message is being sent solely for use by the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by phone or reply by e-mail, delete the original message and destroy all copies. Thank you. -- CONFIDENTIALITY NOTICE This message and any included attachments are from Cerner Corporation and are intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under international, federal, or state securities laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by e-mail or you may call Cerner's corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Alberto A. Flores http://www.linkedin.com/in/aflores - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: tomcat/struts ---> flash/.swf >> hang problem
Laurie, tks for your advise. hang forever, > browser lockup if use IE but, if use firefox, just nothing happen(return blank screen), but browser not freeze. above test under regular Tomcat, which is http://localhost:8080/sample.html ( it contains sample.swf inside) after test above, check the logfile under /home/apache-tomcat-5.5.23/logs, but not showing anything. if use regular apache web server, the sample.html(sample.swf) running fine. any configuration need to make in tomcat before run flash .swf file? tks in advance again. john Laurie Harper <[EMAIL PROTECTED]> wrote: john lee wrote: > Any expert can tell me why for the following? > > i have an flash file (.swf), it is running fine under regular apache server. > > But, it hang forever after i put it under tomcat/struts home directory. What do you mean by 'hang forever'? Do you mean the browser locks up? The HTTP response is never sent? -- in which case does any response data get sent? How is your Struts application configured? Is the .swf file being served by Struts or directly by Tomcat? If you're not sure how to answer those questions, I would suggest using Firebug or some other tool that lets you monitor the HTTP conversation to get a clearer picture of what's happening. L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.
RE: Injecting Spring Services into Struts 2 Actions
The actions are auto-wired by name by default - so if any of its properties match bean-ids in your spring config, and they have setters, then those properties will get set. The part about declaring the dependencies means you disable the auto-wiring, and declare your actions as spring beans. So, instead of this: /WEB-INF/view/index.jsp You would do this: /WEB-INF/view/index.jsp Along with additional spring config: Notice this does not actually disable auto-wiring (you would have to set the auto-wire attribute in the spring config, either globally or per-bean), but it does declaratively state what to set on the action as properties. Brian Relph -Original Message- From: Asleson, Ryan [mailto:[EMAIL PROTECTED] Sent: Thursday, May 08, 2008 8:29 AM To: Struts Users Mailing List Subject: Injecting Spring Services into Struts 2 Actions Hello, I found this guide to injecting Spring beans into Struts 2 Actions: http://cwiki.apache.org/WW/spring.html According to the red box at the bottom of the document, the Struts 2 Action does not need to be registered with Spring. So far so good. However, I'm a little unclear as to how exactly it "knows" what Spring beans to inject into the Struts 2 Action. Assuming I have a Struts 2 Action that depends on a PersonService, I assume that the Struts 2 Action would have a public mutator for the PersonService like this: public void setPersonService(PersonService service) { this.personService = service; } How does the injection system "know" that this method should be used for injecting a Spring bean? Imagine that the Struts 2 Action has several "set" methods, and that there are a number of configured Spring beans. It would take way too long for the injection system to look through every "set" method on the Action and try to find a matching Spring bean, especially if there are a lot of Spring beans (and there usually are). The document above includes this comment: We strongly recommend that you find declarative ways of letting Spring know what to provide for your actions. But it doesn't give an example of how to let Spring know what to provide to the actions. So, the question is: How do I tell Spring what beans need to be injected into the Action? Thanks -Ryan This e-mail message is being sent solely for use by the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by phone or reply by e-mail, delete the original message and destroy all copies. Thank you. -- CONFIDENTIALITY NOTICE This message and any included attachments are from Cerner Corporation and are intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under international, federal, or state securities laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by e-mail or you may call Cerner's corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OGNL
Adam Hardy on 08/05/08 12:21, wrote: when the Params interceptor populates my entity beans, it must be setting the member variables directly without using the setters. Is there a way to tell it to use the setters? There is some logic in the setters which it would be good if it executed. It gives precedence to the setters. Why would it not be able to see or set the property? Really? That's good to know - any work-around was looking distinctly horrific. These are JPA pojos, so the setters should be available. Maybe it's breaking the javabean spec in some subtle way - I double-checked the memvar, getter, setter and constructor though and it looks OK. I'm not sure. I ran into this same issue recently and cursed at lot at OGNL only to find out it was caused by erasure of the generic type (ie. the class of the setters argument was Object, not what I thought). It's worth debugging this with a breakpoint. The OGNL implementation is quite straight-forward in the way it searches for properties/methods/members matching the right signature. As it loops through all the properties you should see why it missed the one it should have set. Doing that now - hopefully the answer will point to a simple solution. I can already see that Hibernate has got its grubby nose in there. Debugging unmasked what the problem was. OGNL was calling getChildren() and modifying the collection of children, rather than calling setChildren(newList) at any point - logically. I thought I had disabled that by returning a Collections.unmodifiableList(list) but in this case I had forgotten. Unfortunately for me, returning an unmodifiable collection breaks OGNL. I need to maintain the consistency of entity relationships, insuring that the “one” and the “many” sides of a bidirectional relationship are consistent with one another when the application updates the relationship at runtime. I'll have to find another way rather than trying to control the list. Thanks Adam - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Injecting Spring Services into Struts 2 Actions
Hello, I found this guide to injecting Spring beans into Struts 2 Actions: http://cwiki.apache.org/WW/spring.html According to the red box at the bottom of the document, the Struts 2 Action does not need to be registered with Spring. So far so good. However, I'm a little unclear as to how exactly it "knows" what Spring beans to inject into the Struts 2 Action. Assuming I have a Struts 2 Action that depends on a PersonService, I assume that the Struts 2 Action would have a public mutator for the PersonService like this: public void setPersonService(PersonService service) { this.personService = service; } How does the injection system "know" that this method should be used for injecting a Spring bean? Imagine that the Struts 2 Action has several "set" methods, and that there are a number of configured Spring beans. It would take way too long for the injection system to look through every "set" method on the Action and try to find a matching Spring bean, especially if there are a lot of Spring beans (and there usually are). The document above includes this comment: We strongly recommend that you find declarative ways of letting Spring know what to provide for your actions. But it doesn't give an example of how to let Spring know what to provide to the actions. So, the question is: How do I tell Spring what beans need to be injected into the Action? Thanks -Ryan This e-mail message is being sent solely for use by the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by phone or reply by e-mail, delete the original message and destroy all copies. Thank you.
Re: How to build Struts 2.0.11.1?
Hi, > I'm unsatisfied that not all tests are ok but I'll look for that > separately. > Probably you have problem with DataTimePickerTagTest, if yes, don't borrow, there is some problem with Locale settings to parse data. I've tried to figure what it is, but till now I don't know how to solve the problem. Maybe someone who write this tag will be know. Regards -- Lukasz http://www.linkedin.com/in/lukaszlenart http://jdn.pl/blog/416 http://www.lenart.org.pl/
Re: Struts 2 file upload size validation
Yes if the file size is OK everything is fine. At first we used the default stack. Then we took the default and modified it by moving the fileUploadInterceptor below the params interceptor so it would look something like this: interceptor-stack name="ourUploadStack" interceptor-ref name="exception" interceptor-ref name="alias" interceptor-ref name="servletConfig" interceptor-ref name="prepare" interceptor-ref name="i18n" interceptor-ref name="chain" interceptor-ref name="debugging" interceptor-ref name="profiling" interceptor-ref name="scopedModelDriven" interceptor-ref name="modelDriven" interceptor-ref name="checkbox" interceptor-ref name="staticParams" interceptor-ref name="params" param name="excludeParams"dojo\..*param interceptor-ref interceptor-ref name="conversionError" interceptor-ref name="fileUpload" interceptor-ref name="validation" param name="excludeMethods"input,back,cancel,browseparam interceptor-ref interceptor-ref name="workflow" param name="excludeMethods"input,back,cancel,browseparam interceptor-ref interceptor-stack Thanks R Laurie Harper wrote: > > Rubbinio wrote: >> Hi, >> >> we are trying to use file upload in Struts 2 and run into the following >> problem. >> >> We have a form with multiple fields among which one is a file input >> field. >> The user must complete the form and then select a file to upload. If the >> file size is larger than what we specify in the struts.properties the >> FileUploadInterceptor validates and adds the error. Up to here everything >> is >> fine however upon having the error passed to the action we want to return >> to >> the same form, display the error and have the rest of fields populated >> with >> the values the user has inputed (except the file field). >> >> The problem is that when we get in the action (validate method) none of >> the >> request parameters (form values) are populated. Everything is empty. >> >> The question is why is this happening and how can we have the form values >> populated in the action so that we can display the page correctly ? > > What interceptor stack are you using? Does everything work as expected > if the file size does not exceed the size you specify? > > L. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Struts-2-file-upload-size-validation-tp17112411p17125070.html Sent from the Struts - User mailing list archive at Nabble.com.
Re: Can you set parameters in using in the tag body?
Jeromy Evans wrote: No, that's not supported. It would have to append the parameters to the query string or create post parameters after the specific submit button is pressed. That would need to be implemented using a javascript listener attached to the click or submit event. It's a nice idea though. - I should add that the action and method attributes of work by appending the action or method value into the name/value of the for the submit button. The selected submit button's name/value are one of the submitted form's parameters. Embedding an arbitrary number of params into the name/value of the submit would not be as elegant. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Can you set parameters in using in the tag body?
Could you use s:hidden on the form to store your params? On Wed, May 7, 2008 at 10:47 PM, Eduardo Dela Rosa <[EMAIL PROTECTED]> wrote: > Hi, > > I was trying to use the and invoke it with *some *parameters > using . > > i.e., > > * > > > > * > > However, the parameters don't seem to be getting through to the > HttpServletRequest object > when interrogated inside the Action. > > I know I can use the instead, but I preferred the . > > I'm implementing ServletRequestAware interface, by the way. > > Thanks. > > -- > Eduardo Dela Rosa > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Can you set parameters in using in the tag body?
Are these parameters static? If they are you could set them up in struts config and get the submit button to direct to a specific action mapping with these parameters defined. Cheers, Steve On Thu, May 8, 2008 at 9:24 PM, Jeromy Evans <[EMAIL PROTECTED]> wrote: > Eduardo Dela Rosa wrote: > > Hi, > > > > I was trying to use the and invoke it with *some *parameters > > using . > > > > i.e., > > > > * > > > > > > > > * > > > > However, the parameters don't seem to be getting through to the > > HttpServletRequest object > > when interrogated inside the Action. > > > > I know I can use the instead, but I preferred the . > > > > I'm implementing ServletRequestAware interface, by the way. > > > > Thanks. > > > > > > > > No, that's not supported. It would have to append the parameters to the > query string or create post parameters after the specific submit button is > pressed. That would need to be implemented using a javascript listener > attached to the click or submit event. It's a nice idea though. > - > 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: Can you set parameters in using in the tag body?
Eduardo Dela Rosa wrote: Hi, I was trying to use the and invoke it with *some *parameters using . i.e., * * However, the parameters don't seem to be getting through to the HttpServletRequest object when interrogated inside the Action. I know I can use the instead, but I preferred the . I'm implementing ServletRequestAware interface, by the way. Thanks. No, that's not supported. It would have to append the parameters to the query string or create post parameters after the specific submit button is pressed. That would need to be implemented using a javascript listener attached to the click or submit event. It's a nice idea though. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OGNL
Jeromy Evans on 08/05/08 11:41, wrote: Adam Hardy wrote: Jeromy Evans on 08/05/08 09:26, wrote: Adam Hardy wrote: Hi, when the Params interceptor populates my entity beans, it must be setting the member variables directly without using the setters. Is there a way to tell it to use the setters? There is some logic in the setters which it would be good if it executed. Hi Adam, It gives precedence to the setters. Why would it not be able to see or set the property? Really? That's good to know - any work-around was looking distinctly horrific. These are JPA pojos, so the setters should be available. Maybe it's breaking the javabean spec in some subtle way - I double-checked the memvar, getter, setter and constructor though and it looks OK. Could it be the way I am using converters? I set up a converter to instantiate an entity bean, rather than doing it in the ModelDriven interceptor. Could that force OGNL to set its fields directly rather than using its setters? I'm not sure. I ran into this same issue recently and cursed at lot at OGNL only to find out it was caused by erasure of the generic type (ie. the class of the setters argument was Object, not what I thought). It's worth debugging this with a breakpoint. The OGNL implementation is quite straight-forward in the way it searches for properties/methods/members matching the right signature. As it loops through all the properties you should see why it missed the one it should have set. Doing that now - hopefully the answer will point to a simple solution. I can already see that Hibernate has got its grubby nose in there. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to build Struts 2.0.11.1?
Thanks for the help! The hint with the property -Dmaven.test.skip=true was sufficient for me to come forward I'm unsatisfied that not all tests are ok but I'll look for that separately. Hans-Georg -- View this message in context: http://www.nabble.com/How-to-build-Struts-2.0.11.1--tp17100141p17124816.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problem
Without listKey and listValue, it just display the whole list. But while displaying doesn't get selected according to the "value" attribute. My result list directly comes from the JPA query list(please refer the first mail). On Wed, May 7, 2008 at 9:51 PM, Rushikesh Thakkar < [EMAIL PROTECTED]> wrote: > On Wed, May 7, 2008 at 6:10 PM, Arpan Debroy <[EMAIL PROTECTED]> > wrote: > > > > > But nothing is displaying in my drop down box when I put listkey and > > listvalue. > > > > If it's working without using listKey and listValue, then make sure you > have defined getters and setters for "id" and "name" attributes of > *Result* > (I'm assuming it as the name of list is resultList) object. > -- Thanks & Regards Arpan Debroy AOL Online India Private Ltd RMZ EcoSpace Campus 1A Outer Ring Road, Bellandur, Bangalore - 560037 India Mobile No :+9886006306 on-board :+91 (80) 4035 4528 E-mail : [EMAIL PROTECTED]
Re: OGNL
Adam Hardy wrote: Jeromy Evans on 08/05/08 09:26, wrote: Adam Hardy wrote: Hi, when the Params interceptor populates my entity beans, it must be setting the member variables directly without using the setters. Is there a way to tell it to use the setters? There is some logic in the setters which it would be good if it executed. Hi Adam, It gives precedence to the setters. Why would it not be able to see or set the property? Really? That's good to know - any work-around was looking distinctly horrific. These are JPA pojos, so the setters should be available. Maybe it's breaking the javabean spec in some subtle way - I double-checked the memvar, getter, setter and constructor though and it looks OK. Could it be the way I am using converters? I set up a converter to instantiate an entity bean, rather than doing it in the ModelDriven interceptor. Could that force OGNL to set its fields directly rather than using its setters? I'm not sure. I ran into this same issue recently and cursed at lot at OGNL only to find out it was caused by erasure of the generic type (ie. the class of the setters argument was Object, not what I thought). It's worth debugging this with a breakpoint. The OGNL implementation is quite straight-forward in the way it searches for properties/methods/members matching the right signature. As it loops through all the properties you should see why it missed the one it should have set. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OGNL
Jeromy Evans on 08/05/08 09:26, wrote: Adam Hardy wrote: Hi, when the Params interceptor populates my entity beans, it must be setting the member variables directly without using the setters. Is there a way to tell it to use the setters? There is some logic in the setters which it would be good if it executed. Hi Adam, It gives precedence to the setters. Why would it not be able to see or set the property? Really? That's good to know - any work-around was looking distinctly horrific. These are JPA pojos, so the setters should be available. Maybe it's breaking the javabean spec in some subtle way - I double-checked the memvar, getter, setter and constructor though and it looks OK. Could it be the way I am using converters? I set up a converter to instantiate an entity bean, rather than doing it in the ModelDriven interceptor. Could that force OGNL to set its fields directly rather than using its setters? rgds Adam - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OGNL
Adam Hardy wrote: Hi, when the Params interceptor populates my entity beans, it must be setting the member variables directly without using the setters. Is there a way to tell it to use the setters? There is some logic in the setters which it would be good if it executed. Hi Adam, It gives precedence to the setters. Why would it not be able to see or set the property? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
OGNL
Hi, when the Params interceptor populates my entity beans, it must be setting the member variables directly without using the setters. Is there a way to tell it to use the setters? There is some logic in the setters which it would be good if it executed. Thanks Adam - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: dojo 1.1 in struts 2.0.11 portlets
tom tom wrote: dojo 1.1 Grid looks very good, but it is still under dojox project, because of that we are thinking twice How flexible the YUI datagrid and how about the integration with Struts 2, Is that grid in beta like dojo grid or ready for production support Thanks, The YUI datagrid is very flexible and works great with Struts 2. Just get in an try it out in a little test application. Don't forget though that it is a completely different appropriate to client-side programming compared to Dojo. You also need to consider where your application is going and what other widgets you may need. YUI deliberately leave a lot of things out that may want. Instead they provide APIs. In terms of stability, the YUI grid is fine. The known issues are discussed at the bottom of the documentation. It's beta because the API is subject to change, and there was a significant change between 2.5.0 and 2.5.1. I can only speculate, but I expect there'll be some more changes as their Charting widget uses the same DataSource API as the datagrid and charting is experimental, but my experience with these guys has only been positive so far. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Internalization problem: two internalizations for the same key
We're using Struts 2.1.1 and i18n interceptor. Resource files are named ApplicationResources_??.properties . The following values are set for i18n constants: It seems like using getText in jsp universally fails the way I described in my original post. However, when getText is used in action classes to get a string before going to result jsp, it returns the correct internationalization. On Thu, May 8, 2008 at 9:38 AM, Toni Lyytikäinen <[EMAIL PROTECTED]> wrote: > Which version of Struts 2 are you using? 2.0.11.1 works fine for me in the > same situation. Are you using the i18n interceptor? Also, how did you name > your resource files? > > > On Wed, May 7, 2008 at 11:30 AM, Jukka Välimaa <[EMAIL PROTECTED]> > wrote: > > > Hi everyone, > > > > I have the following lines in my jsp file: > > >label="%{getText('workingTeam.team')}" name="teamId" listKey="id" > > listValue="name" > >list="workingTeams" /> > > > > > > > > Of these two, using text tag gives me the internalization that has been > > selected as internationalization for the application. Using getText for > > select label gives me internalization in Finnish, no matter what is the > > selected internationalization. All internationalizations are in their own > > global ApplicationResources files. getText method is the standard method > > from ActionSupport. > > > > Any idea what is the cause of this, and what might be the solution? > > >
Re: dojo 1.1 in struts 2.0.11 portlets
dojo 1.1 Grid looks very good, but it is still under dojox project, because of that we are thinking twice How flexible the YUI datagrid and how about the integration with Struts 2, Is that grid in beta like dojo grid or ready for production support Thanks, --- Jeromy Evans <[EMAIL PROTECTED]> wrote: > tom tom wrote: > > Thanks Jeromy, > > > > Is there any reason why YUI datagrid instead of > dojo > > 1.1 grid, > > > > Isn't it risky to depend on YUI datagrid, > > > > Thanks > > > > > > Moving to YUI datagrid is no riskier than moving to > Dojo 1.1. They're > both good libraries. Dojo 1.1 is very different > than 0.4 but not as > different as YUI. > Each use different programming models and approaches > (as do the other > libraries I referenced) so choose one that you're > comfortable or > productive with. > > In fact, the very first thing I did with YUI was > create a small test > action with an ajax datagrid. > > Anyway watch this video tutorial about the DojoX > datagrid: > http://dojocampus.org/content/2008/02/17/dojox-grid/ > > Hope that helps, > Jeromy Evans > > - > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:multibox read but not write
By the way.. to which email address should I post my message using the email program? is it: [EMAIL PROTECTED] or [EMAIL PROTECTED] thanks Laurie Harper wrote: > > None of the JSP code made it out of your mail client into the message > I'm afraid. Try re-posting with your mail program set for plain text > instead of multipart/mime. > > L. > > houser wrote: >> Hi All, >> >> I am in very strange situation, and stuck! please help, I have found one >> thread that much more or less but does not help.. >> >> http://www.nabble.com/Check-a-multibox-dynamically-to6630704.html#a6630704 >> http://www.nabble.com/Check-a-multibox-dynamically-to6630704.html#a6630704 >> >> I have already use some example and it works.. Now the situation is >> lsightly >> different: >> >> I have a form: >> >> Start Code >> >> >> FunctionProForm extends ActionForm { >> private List functionProList = new ArrayList(); >> >> ... >> >>public List getSelectedPros(FunctionDto fun){ >> >> List result = new ArrayList(); >> for(FunProMap fp : functionProList){ >> >> if(fp.getFunction().getName().equals(fun.getName())){ >> >> for(int i = 0; i < fp.getSelectedPros().length; >> i++){ >> result.add(fp.getSelectedPros()[i]); >> } >> return result; >> } >> } >> >> return result; >> } >> } >> >> >> --the serializable object FunProMap -- >> >> >> public class FunProMap implements Serializable{ >> >> private static final long serialVersionUID = 1L; >> >> private FunctionDto function = new FunctionDto(); >> private List pros = new ArrayList(); >> private String[] selectedPros = {}; >> >> >> } >> >> >> --- in JSP: - >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> - in the SaveAction -- >> >> >> SaveAction extends Action { >> protected ActionForward doExecute(ActionMapping mapping, >> ActionForm form, HttpServletRequest request, >> HttpServletResponse response){ >> >> FunctionProForm myForm = (FunctionProForm) form; >> ... >> >> List functions = myService.listFunctions(); >> >> for(FunctionDto fun : functions){ >> >> fun.setPros(myForm.getSelectedPros(fun)); >> >> myService.updateFunction(fun); >> } >> >> return mapping.findForward("success"); >>} >> } >> >> >> End Code >> >> The check boxes are populated correctly from the database, i.e. for each >> FUnction, the corresponding checkbos is checked according to the list of >> available Pros (function.pros). >> >> The problem is that if I edit these boxes, check and uncheck, and click >> the >> Submit button, the changed is not saved to the database. >> >> I have run the debug and find that the method myForm.getSelectedPros(fun) >> returns the old values but not the new checked-unchecked boxes' values >> :-( >> !! >> >> I have used with a simple form according to: >> >> http://www.jguru.com/faq/view.jsp?EID=925277 >> http://www.jguru.com/faq/view.jsp?EID=925277 >> >> >> MyForm extends ActionForm { >> List myList; >> String[] selectedValues; >> // >> } >> >> >> and >> >> >> >> >> >> >> >> >> >> >> >> and this works fine.. >> >> Please help... >> >> ruga > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/html%3Amultibox-read-but-not-write-tp17100080p17121623.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:multibox read but not write
Thanks for your reply.. I have already changed it by using tag and the JSP pieces of code are displayed.. can give it another look please? houser Laurie Harper wrote: > > None of the JSP code made it out of your mail client into the message > I'm afraid. Try re-posting with your mail program set for plain text > instead of multipart/mime. > > L. > > houser wrote: >> Hi All, >> >> I am in very strange situation, and stuck! please help, I have found one >> thread that much more or less but does not help.. >> >> http://www.nabble.com/Check-a-multibox-dynamically-to6630704.html#a6630704 >> http://www.nabble.com/Check-a-multibox-dynamically-to6630704.html#a6630704 >> >> I have already use some example and it works.. Now the situation is >> lsightly >> different: >> >> I have a form: >> >> Start Code >> >> >> FunctionProForm extends ActionForm { >> private List functionProList = new ArrayList(); >> >> ... >> >>public List getSelectedPros(FunctionDto fun){ >> >> List result = new ArrayList(); >> for(FunProMap fp : functionProList){ >> >> if(fp.getFunction().getName().equals(fun.getName())){ >> >> for(int i = 0; i < fp.getSelectedPros().length; >> i++){ >> result.add(fp.getSelectedPros()[i]); >> } >> return result; >> } >> } >> >> return result; >> } >> } >> >> >> --the serializable object FunProMap -- >> >> >> public class FunProMap implements Serializable{ >> >> private static final long serialVersionUID = 1L; >> >> private FunctionDto function = new FunctionDto(); >> private List pros = new ArrayList(); >> private String[] selectedPros = {}; >> >> >> } >> >> >> --- in JSP: - >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> - in the SaveAction -- >> >> >> SaveAction extends Action { >> protected ActionForward doExecute(ActionMapping mapping, >> ActionForm form, HttpServletRequest request, >> HttpServletResponse response){ >> >> FunctionProForm myForm = (FunctionProForm) form; >> ... >> >> List functions = myService.listFunctions(); >> >> for(FunctionDto fun : functions){ >> >> fun.setPros(myForm.getSelectedPros(fun)); >> >> myService.updateFunction(fun); >> } >> >> return mapping.findForward("success"); >>} >> } >> >> >> End Code >> >> The check boxes are populated correctly from the database, i.e. for each >> FUnction, the corresponding checkbos is checked according to the list of >> available Pros (function.pros). >> >> The problem is that if I edit these boxes, check and uncheck, and click >> the >> Submit button, the changed is not saved to the database. >> >> I have run the debug and find that the method myForm.getSelectedPros(fun) >> returns the old values but not the new checked-unchecked boxes' values >> :-( >> !! >> >> I have used with a simple form according to: >> >> http://www.jguru.com/faq/view.jsp?EID=925277 >> http://www.jguru.com/faq/view.jsp?EID=925277 >> >> >> MyForm extends ActionForm { >> List myList; >> String[] selectedValues; >> // >> } >> >> >> and >> >> >> >> >> >> >> >> >> >> >> >> and this works fine.. >> >> Please help... >> >> ruga > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/html%3Amultibox-read-but-not-write-tp17100080p17121224.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]