setting the frame in which a particular result page is displayed
Hi, I have a number of result pages for my action, and I would like them to appear in different frames. Is there a way to define the target frame for each result page? Thanks, Session - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Validating using indexedListProperty
hello guys..its me again.. I have a problem regarding my validation of html:text which is inside the iteration and the validation will depends if the corresponding checkbox has been selected. this is my JSP bitratebox is for the multibox and bitrateTxt is for the text logic:iterate name=metaEntryConfirmForm indexId=index id=item1 property=items1 tr tdhtml:multibox property=bitrateboxbean:write name=item1//html:multiboxbean:write name=item1//td tdhtml:text property=%=bitrateTxt[+index+]% size=50//td /tr /logic:iterate when I tried to write it in my validation.xml a FOR bitrateTxt[0] when bitratebox[0] is checked field property=bitrateTxt[0] indexedListProperty=items1 depends=requiredif arg name = requiredif key = 「500K用ファイル名」を入力 resource = false position=0/ var var-namefield[0]/var-name var-valuebitratebox/var-value /var var var-namefieldTest[0]/var-name var-valueEQUAL/var-value /var var var-namefieldValue[0]/var-name var-value500k/var-value /var /field I used bitrateTxt[0] because the generated html will look like this tr tdinput type=checkbox name=bitratebox value=500k disabled=disabled500k/td tdinput type=text name=bitrateTxt[0] size=50 value= disabled=disabled/td tdinput type=checkbox name=haishinselect value=goohigashi0 disabled=disabled/td tdinput type=checkbox name=haishinselect value=goonishi0 disabled=disabled/td tdinput type=checkbox name=haishinselect value=gooBB0 disabled=disabled/td /tr Actionform private String[] bitratebox = {}; private String[] items1 = {500k,1M,2M,5M,6M}; public String[] getBitratebox() { return this.bitratebox; } public void setBitratebox(String[] bitratebox) { this.bitratebox = bitratebox; } public String[] getItems1(){ return this.items1; private String[] bitrateTxt = {}; public String[] getBitrateTxt() { return this.bitrateTxt; } public void setBitrateTxt(String[] bitrateTxt) { this.bitrateTxt = bitrateTxt; } Is my validdation correct? I cant make this work properly.. Please teach me the incorrect part. Thank you.. -- View this message in context: http://www.nabble.com/Validating-using-indexedListProperty-tf4204569.html#a11959696 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: DownloadAction and a normal Forward
Hi Frank, Paul Thanks again for the tips. The thing is, having a NPE isn't actually a problem for me. I am quite (well, not entirely) happy for the code to throw it since by that time, my RequestDispatcher.forward method has already got my request to the browser by then, and the user is viewing the JSP. The fact that the DownloadAction still thinks it needs to do something with a dummy StreamInfo isn't such a big deal to be honest. It can fail for all I care since it doesn't stop the system from working (I know, it's not the right attitude :-) But, right now I am more concerned about whether using RequestDispatcher.forward is a safe (and/or best) way to redirect the request out of the DownloadAction and back to a real JSP. Appreciate your thoughts. Richard Gundersen Java Developer Email: [EMAIL PROTECTED] Phone: 01618302398 Fax: 01618342536 London Scottish Bank plc 24 Mount Street Manchester M2 3LS -Original Message- From: Frank W. Zammetti [mailto:[EMAIL PROTECTED] Sent: Thursday, August 02, 2007 3:16 AM To: Struts Users Mailing List Subject: Re: DownloadAction and a normal Forward Hehe, your going after the *right* answer Paul :) It's clear the caller of getStreamInfo() doesn't like getting null back, that was the case originally... now, the NPE must be getting thrown from elsewhere after Richard returned the dummied StreamInfo object (I would have been surprised if constructing one with two null arguments *didn't* move the NPE elsewhere, but I was hoping!). Frank Paul Benedict wrote: Who is throwing the NPE? I can't tell by your code what's causing it. On 8/1/07, Frank W. Zammetti [EMAIL PROTECTED] wrote: You know, I just reread what your trying to do... have you tried using a global exception handler? I'm not sure you'll be able to catch the exception with one, but if you give it a try and you can, there you go, you can forward as desired from there. -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com AIM/Yahoo: fzammetti MSN: [EMAIL PROTECTED] Author of Practical Ajax Projects With Java Technology (2006, Apress, ISBN 1-59059-695-1) and JavaScript, DOM Scripting and Ajax Projects (2007, Apress, ISBN 1-59059-816-4) Java Web Parts - http://javawebparts.sourceforge.net Supplying the wheel, so you don't have to reinvent it! On Wed, August 1, 2007 10:38 am, Gundersen, Richard wrote: Hi Thanks for the reply. Tried it and it still gives me a NullPointer. Maybe that's not such a problem though - since the browser still redirects to the JSP I want. However, I was wondering if it's possible to use a ResourceStreamInfo to redirect to an ActionForward (which ultimately leads to a JSP). Would this be preferable to using RequestDispatcher.forward(request, response)? Richard Gundersen Java Developer Email: [EMAIL PROTECTED] Phone: 01618302398 Fax: 01618342536 London Scottish Bank plc 24 Mount Street Manchester M2 3LS -Original Message- From: Frank W. Zammetti [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 01, 2007 2:47 PM To: Struts Users Mailing List Cc: user@struts.apache.org Subject: Re: DownloadAction and a normal Forward It's not the *right* answer, and I'm not sure it won't cause some other exception anyway (in fact, I'd bet it would), but what if instead of returning null you instead do: return new ByteArrayStreamInfo(null, null); ? Frank -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com AIM/Yahoo: fzammetti MSN: [EMAIL PROTECTED] Author of Practical Ajax Projects With Java Technology (2006, Apress, ISBN 1-59059-695-1) and JavaScript, DOM Scripting and Ajax Projects (2007, Apress, ISBN 1-59059-816-4) Java Web Parts - http://javawebparts.sourceforge.net Supplying the wheel, so you don't have to reinvent it! On Wed, August 1, 2007 9:24 am, Gundersen, Richard wrote: Hi I'm using a DownloadAction to generate a PDF and return it the the browser. If there is a problem generating the PDF however, I want to redirect the user to a specific JSP. What's the best way of doing this? At the moment I am using protected StreamInfo getStreamInfo(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { ... ... ... if(problem) servlet.getServletContext().getRequestDispatcher(/admin.do?doAction=alr eadyPrinted).forward(request, response); return null; } else { return new ByteArrayStreamInfo(contentType, myPdfBytes); } } This works, but I always get a NullPointer, because I'm returning null to satisfy the method signature. The exception doesn't cause a problem for the user though, because the forward has already happened by then (and the user is happily viewing the JSP) Is there a better way to do this though - perhaps with ResourceStreamInfo instead?
placing 2 buttons next to each other
Hi, Is there a way to configure an s:form tag so that the 2 submit buttons appear side by side instead of one under the other? I use a css file with input.actionButtons {float: left;} to move both of them to the left, but they're not appearing next to each other. Thanks, Session - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] No more Tabbedpanel in v2.1.0 ?
Hi, There is a Tabbedpanel in the UI Tag's doc (http://struts.apache.org/2.x/docs/tabbedpanel.html) but this seems to have disappeard in v2.1.0. Is there a new packaged way of handeling tabs in JSP ? Thanks.
[S1]minipulate output of bean:write
Hallo list, I have an ActionForm with an attribute (String) to print the value of this attribute I use bean:write name=myBean property=myAttr/. The problem is the String could have small and capital letters but I would like to print it always the same. For example always with capital letters. Exists a way to do this with struts or have I to write my own Tag to do this? Thanks Alex - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Eclipse Editor and struts tags
Hello, I'm using Eclipse 3.2.2, isn't it possible to get tag insight, syntax coloring, code completion etc. when editing JSP pages using struts-tags ? It's currently just raw black text. -- View this message in context: http://www.nabble.com/Eclipse-Editor-and-struts-tags-tf4205171.html#a11961564 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: placing 2 buttons next to each other
Hi, I tried this way. Hope this may help u too. Css file: .button { margin-top: 0; font-size: 10pt; text-align: center; background-color: white; } .buttonbar { padding-top: 1em; text-align: right; } Form: table tr td class=buttonbar colspan=2 s:submit cssClass=button key=button.reset method=reset/ s:submit cssClass=button key=button.save method=update/ /td /tr /table The keys are being resolved from properties file. You can remove them and give values. Thanks Regards, Indu -Original Message- From: Session A Mwamufiya [mailto:[EMAIL PROTECTED] Sent: Thursday, August 02, 2007 1:39 PM To: user@struts.apache.org Subject: placing 2 buttons next to each other Hi, Is there a way to configure an s:form tag so that the 2 submit buttons appear side by side instead of one under the other? I use a css file with input.actionButtons {float: left;} to move both of them to the left, but they're not appearing next to each other. Thanks, Session - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] DISCLAIMER: --- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. --- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] ClassCastException on getParameters
Hi all, I'm having big trouble while trying to acces to the parameters values. I'm simply trying to retrieve a parameter value from my interceptor class. The Action class that is intercepted implements the ParameterAware interface and has getter and setter method related to parameters attribute which is a Map. Here is the sample code. public String intercept(ActionInvocation invocation) throws Exception { ActionSupport action = (ActionSupport) invocation.getAction(); Map session = invocation.getInvocationContext().getSession(); Map parameters = invocation.getInvocationContext().getParameters(); String loginAttempt = (String)parameters.get(Constants.LOGIN_ATTEMPT_KEY); return invocation.invoke (); } When the line in bold is reached, I' getting a ClassCastException. Here is an extract of the stacktrace java.lang.ClassCastException: [Ljava.lang.String; at com.natixis.media.interceptors.AuthenticationInterceptor.intercept(AuthenticationInterceptor.java:42) at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:221) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86) at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223) at com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221) at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:150) at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:48) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86) at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224) at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling Can someone tells me what I'm missing. Thank in advance. Meissa L'integrite de ce message n'etant pas assuree sur internet, Natixis ne peut etre tenu responsable de son contenu. Toute utilisation ou diffusion non autorisee est interdite. Si vous n'etes pas destinataire de ce message, merci de le detruire et d'avertir l'expediteur. Ensemble, faisons un geste pour l'environnement : n'imprimons nos mails que si necessaire The integrity of this message cannot be guaranteed on the Internet. Natixis can not therefore be considered responsible for the contents. Any unauthorized use or dissemination is prohibited. If you are not the intended recipient of this message, then please delete it and notify the sender. Let us mind the environment : let's print our mails only when necessary.
Re: Eclipse Editor and struts tags
Do you have WTP installed in your Eclipse? On 8/2/07, appel [EMAIL PROTECTED] wrote: Hello, I'm using Eclipse 3.2.2, isn't it possible to get tag insight, syntax coloring, code completion etc. when editing JSP pages using struts-tags ? It's currently just raw black text. -- View this message in context: http://www.nabble.com/Eclipse-Editor-and-struts-tags-tf4205171.html#a11961564 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: [s2] Developing Portlets with Eclipse tutorial available
Nils, I love you for that :) It was on my wishlist for so long, but I never found the time to get into it. Cheers, Rene Nils-Helge Garli schrieb: I think I've managed to get all the steps written down: http://portletwork.blogspot.com/2007/07/mvnjetty-and-portlets.html Also, I took a struts 2 portlet archetype project and added the necessary files and configurations and put it on my site for download. You can find the link in the blog. Please let me know if you find any errors. Nils-H On 7/29/07, Don Brown [EMAIL PROTECTED] wrote: Very cool! That has been one of those things I keep meaning to work on. If nothing else, add the lines (commented out, of course) to our portlet archetype. Don On 7/29/07, Nils-Helge Garli [EMAIL PROTECTED] wrote: Good tutorial, and a nice way to get started with portlet development! Maybe not entirely on topic, but inspired by your tutorial and some information I found earlier in the pluto FAQ about embedding pluto, I started playing around with making the maven-jetty-plugin work with a portlet project. The goal was to be able to start up and test my portlet just by typing mvn jetty:run. After collecting information from various sources, and looking through the pluto-portal-driver and the pluto-portal sources, I have finally managed to run my portlet with pluto embedded in jetty, as a real portlet, avoiding the need to run it emulated as a servlet. It wasn't really that hard (just had to add a filter and a listener to the web.xml), and the overhead is hardly noticeable. I'll try to write a tutorial and/or package it as a maven plugin, but until then, if anybody is interested in the details, just let me know. Nils-H On 7/27/07, Don Brown [EMAIL PROTECTED] wrote: I wrote up a simple tutorial showing how to start developing portlets using Struts 2 and Eclipse. It takes advantage of the fact that Struts 2 portlets can be deployed as normal web applications, the tutorial is more how to use a Maven 2 archetype with Eclipse, but with portlet-specific bits. I'm a newbie with Eclipse, so I'd appreciate any corrections, suggestions, etc. Or better yet, submit a CLA and get write access to fix it yourself ;) http://struts.apache.org/2.x/docs/developing-a-portlet-using-eclipse.html Don - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S1]minipulate output of bean:write
On 8/2/07, Alexander Jede [EMAIL PROTECTED] wrote: Hallo list, I have an ActionForm with an attribute (String) to print the value of this attribute I use bean:write name=myBean property=myAttr/. The problem is the String could have small and capital letters but I would like to print it always the same. For example always with capital letters. Exists a way to do this with struts or have I to write my own Tag to do this? Nothing in Struts, but Jakarta taglibs already has such tags: http://jakarta.apache.org/taglibs/doc/string-doc/intro.html Niall Thanks Alex - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: CSS / JavaScript menu libraries for Struts 2 Showcase application
I pretty much like the webfx stuff: http://webfx.eae.net/ They recently changed their license from GPL to ASL2, so no licensing issues here. Note: one of my what-i-would-do-if-i-only-had-time-list point was encapsulating the webfx menu stuff into some s2 tags... Regards, Rene James Holmes schrieb: I'm looking into updating the Struts 2 Showcase application with a new menuing system so that it is easier to use. Anyone have any recommendations on existing CSS / JavaScript libraries? The library will need to be open source and have a license that is compatible with Struts 2. I'd like to hear what type of menu people would like to see as well. Should it be a drop down style? Tabs? It would probably be nice if the menu has a built-in mechanism for breadcrumbs or at least support working with them in some way. All feedback is helpful. Thanks, James - 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: CSS / JavaScript menu libraries for Struts 2 Showcase application
2007/7/31, Frank W. Zammetti [EMAIL PROTECTED]: is the GPL compatible with the ASL? Absolutely not! Neither for binary releases nor for sources. See: http://people.apache.org/~cliffs/3party.html Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Eclipse Editor and struts tags
Hi, Why don't you use MyEclipse. Download and install this. It will search for ur Eclipse and get installed in the appropriate location. Then open all JSP files and xml files using MyEclipse editor. Sahil -Original Message- From: appel [mailto:[EMAIL PROTECTED] Sent: Thursday, August 02, 2007 3:22 PM To: user@struts.apache.org Subject: Eclipse Editor and struts tags Hello, I'm using Eclipse 3.2.2, isn't it possible to get tag insight, syntax coloring, code completion etc. when editing JSP pages using struts-tags ? It's currently just raw black text. -- View this message in context: http://www.nabble.com/Eclipse-Editor-and-struts-tags-tf4205171.html#a1196156 4 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Number Validator
Since entering a NAN value for a number property should result in conversion errors, you might want to checkout this: http://cwiki.apache.org/confluence/display/WW/conversion+validator Richard Sayre schrieb: Is there a way to use the XML validation to check to see if a field is a number? I used integer to check for min and max but if I enter any text into the field it passes the validation. Thanks, Rich - 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: [S2] Is there some BigDecimal validator and conversion routines?
You are right, there is no bundled BigDecimal related validator in place, but it should be quite easy to implement (eg. extend FieldValidatorSupport). For registering, see http://cwiki.apache.org/confluence/display/WW/Validation BTW, is it really validation you are searching for, or is it conversion (or both)? Note that these are two different topics. Regards, Rene Gabriel Belingueres schrieb: Hi, I want to enter numeric data in my form and I want it to go into a BigDecimal action value, however it seems that I can't validate it using some bigdecimal validator in the *-validation.xml file. There is a double validator, but I don't know if it will introduce rounding or truncation errors into my BigDecimal value. Any ideas? TIA, Gabriel - 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]
[S2] Design Advice Needed
I could use some advice from some folks with more experience and knowledge of Struts2 than I to assist me in determining the correct way (or lay out some viable options) to design a solution for the following senario: We need to generate a PDF report real time based on data in a database that is available for download. What we believe that we would like to do is utilize FOP (http://xmlgraphics.apache.org/fop/) and use a JSP page to actually generate the formatting objects and then run the formatting objects through the FOP processor to generate and stream the PDF back to the user. However, we are not real sure how to implement this in Struts2. How do we invoke the JSP page and then get access to the results? Do we just use the stream result type and then use a http call to the JSP as the input source? This would seem like it would not be optimal from a performance standpoint, as we are making another http call to get the formatting objects from the jsp. It also adds the complexity of passing security credentials in the call. Or do we need to somehow create or own result type and if so how do we get those JSP results? I have not really found any good documentation or example on writing your own result types. Thanks in advance! - ***Note:The information contained in this message may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the Sender immediately by replying to the message and deleting it from your computer. Thank you. Premier Inc.
Re: [S2] Design Advice Needed
You should definitely have a look into the struts2-jasperreports-plugin - both for checking out how to write own results and evaluating if you might want to use jasper over FOP, since full s2 result support is already available for jasper. The plugin is part of the struts2 source distribution. Regards, Rene Hoying, Ken schrieb: I could use some advice from some folks with more experience and knowledge of Struts2 than I to assist me in determining the correct way (or lay out some viable options) to design a solution for the following senario: We need to generate a PDF report real time based on data in a database that is available for download. What we believe that we would like to do is utilize FOP (http://xmlgraphics.apache.org/fop/) and use a JSP page to actually generate the formatting objects and then run the formatting objects through the FOP processor to generate and stream the PDF back to the user. However, we are not real sure how to implement this in Struts2. How do we invoke the JSP page and then get access to the results? Do we just use the stream result type and then use a http call to the JSP as the input source? This would seem like it would not be optimal from a performance standpoint, as we are making another http call to get the formatting objects from the jsp. It also adds the complexity of passing security credentials in the call. Or do we need to somehow create or own result type and if so how do we get those JSP results? I have not really found any good documentation or example on writing your own result types. Thanks in advance! - ***Note:The information contained in this message may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the Sender immediately by replying to the message and deleting it from your computer. Thank you. Premier Inc. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Accessing ActionForm from JSP
pageContext.findAttribute(Your formname) will return the ActionForm instance . On 8/2/07, Oleg Konovalov [EMAIL PROTECTED] wrote: Hi, How can I access an ActionForm from my JSP in Struts 1.2-1.3 ? Thank you, Oleg. -- Yoge, AdventNet, Inc. 925-965-6528 [EMAIL PROTECTED] site24x7.com
Re: [S2] Design Advice Needed
I suppose there is a lot of other way to generate pdf with struts2. Certainly a plugin. But I don't know how it works. However, to invoke a jsp and get the result in your action, you can use a requestDispatcher to obtain the resut of a jsp execution. Here is something I already done with struts1. I have problems now with struts2's request dispatcher. So I don't know if it still work ... request.setAttribute(param1, valuepram1); ... Eventally, had a path to an embeded image : request.setAttribute(logo, MyActionClass.class.getClassLoader().getResource(/path/to/th/logo.gif).getFile()); ResponseWrapper responseWrapper = new ResponseWrapper(response); getServlet().getServletContext().getRequestDispatcher(path/to/the/fop-jsp.jsp).include(request, responseWrapper).include(request, responseWrapper); you can use now byte[] bytes = responseWrapper.getBytes(); to get the file generated by the jsp. responseWrapper is a simple class like : public static class ResponseWrapper extends HttpServletResponseWrapper { private ByteArrayOutputStream baos = new ByteArrayOutputStream(); private ServletOutputStream sos = new ServletOutputStream() { public void write(int b) throws IOException { baos.write(b); } }; private PrintWriter osw = new PrintWriter(new OutputStreamWriter(baos)); public ResponseWrapper(HttpServletResponse response) { super(response); } public ServletOutputStream getOutputStream() throws IOException { return sos; } public PrintWriter getWriter() throws IOException { return osw; } public byte[] getBytes() { osw.flush(); return baos.toByteArray(); } } Hoying, Ken a écrit : I could use some advice from some folks with more experience and knowledge of Struts2 than I to assist me in determining the correct way (or lay out some viable options) to design a solution for the following senario: We need to generate a PDF report real time based on data in a database that is available for download. What we believe that we would like to do is utilize FOP (http://xmlgraphics.apache.org/fop/) and use a JSP page to actually generate the formatting objects and then run the formatting objects through the FOP processor to generate and stream the PDF back to the user. However, we are not real sure how to implement this in Struts2. How do we invoke the JSP page and then get access to the results? Do we just use the stream result type and then use a http call to the JSP as the input source? This would seem like it would not be optimal from a performance standpoint, as we are making another http call to get the formatting objects from the jsp. It also adds the complexity of passing security credentials in the call. Or do we need to somehow create or own result type and if so how do we get those JSP results? I have not really found any good documentation or example on writing your own result types. Thanks in advance! - ***Note:The information contained in this message may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the Sender immediately by replying to the message and deleting it from your computer. Thank you. Premier Inc. -- Mike Baroukh --- Cardiweb - 31 Rue de Mogador Paris IXeme 06 63 57 27 22 - 01 53 21 82 63 - Jabber: [EMAIL PROTECTED] http://www.cardiweb.com --- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Eclipse Editor and struts tags
Hi, I cannot install WTP unless I have EMF, and I cannot install EMF unless I have Eclipse 3.3.0 (I have Eclipse 3.2.2). So therefor I cannot install WTP! :| Also, I don't want to install a new Eclipse editor, it's a total pain maintaining 2 or 3 Eclipse installs, with 3 different workspaces. -- View this message in context: http://www.nabble.com/Eclipse-Editor-and-struts-tags-tf4205171.html#a11963283 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: [S1]minipulate output of bean:write
I think we can't specify the string format using bean write may u can handle this thing using CSS - Original Message - From: Alexander Jede [EMAIL PROTECTED] To: user@struts.apache.org Sent: Thursday, August 02, 2007 2:22 PM Subject: [S1]minipulate output of bean:write Hallo list, I have an ActionForm with an attribute (String) to print the value of this attribute I use bean:write name=myBean property=myAttr/. The problem is the String could have small and capital letters but I would like to print it always the same. For example always with capital letters. Exists a way to do this with struts or have I to write my own Tag to do this? Thanks Alex - 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: [S2] Design Advice Needed
Thanks, Rene! I actually just found that after sending my question. Somehow I missed it earlier. We are definitely going to take a look at Jasper and the plugin as it appears a lot of the heavy lifting may already be done for us. Thank you! -Original Message- From: Rene Gielen [mailto:[EMAIL PROTECTED] Sent: Thursday, August 02, 2007 8:07 AM To: Struts Users Mailing List Subject: Re: [S2] Design Advice Needed You should definitely have a look into the struts2-jasperreports-plugin - both for checking out how to write own results and evaluating if you might want to use jasper over FOP, since full s2 result support is already available for jasper. The plugin is part of the struts2 source distribution. Regards, Rene Hoying, Ken schrieb: I could use some advice from some folks with more experience and knowledge of Struts2 than I to assist me in determining the correct way (or lay out some viable options) to design a solution for the following senario: We need to generate a PDF report real time based on data in a database that is available for download. What we believe that we would like to do is utilize FOP (http://xmlgraphics.apache.org/fop/) and use a JSP page to actually generate the formatting objects and then run the formatting objects through the FOP processor to generate and stream the PDF back to the user. However, we are not real sure how to implement this in Struts2. How do we invoke the JSP page and then get access to the results? Do we just use the stream result type and then use a http call to the JSP as the input source? This would seem like it would not be optimal from a performance standpoint, as we are making another http call to get the formatting objects from the jsp. It also adds the complexity of passing security credentials in the call. Or do we need to somehow create or own result type and if so how do we get those JSP results? I have not really found any good documentation or example on writing your own result types. Thanks in advance! - ***Note:The information contained in this message may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the Sender immediately by replying to the message and deleting it from your computer. Thank you. Premier Inc. - 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: [S2] Design Advice Needed
Having used FOP briefly, I would add only one thing. It is generally considered a good practice to generate traditional XML first, then transform your data to XSLFO using a transform (pardon me if I am getting the terms wrong). Basically, create your XML data, then have an XSL file that transforms your data to FO, then use FOP to transform it into a PDF. I saw a few responses that seem to indicate you may choose Jasper, which is likely a better idea anyways. -Wes -Original Message- From: Hoying, Ken [mailto:[EMAIL PROTECTED] Sent: Thursday, August 02, 2007 7:40 AM To: user@struts.apache.org Subject: [S2] Design Advice Needed I could use some advice from some folks with more experience and knowledge of Struts2 than I to assist me in determining the correct way (or lay out some viable options) to design a solution for the following senario: We need to generate a PDF report real time based on data in a database that is available for download. What we believe that we would like to do is utilize FOP (http://xmlgraphics.apache.org/fop/) and use a JSP page to actually generate the formatting objects and then run the formatting objects through the FOP processor to generate and stream the PDF back to the user. However, we are not real sure how to implement this in Struts2. How do we invoke the JSP page and then get access to the results? Do we just use the stream result type and then use a http call to the JSP as the input source? This would seem like it would not be optimal from a performance standpoint, as we are making another http call to get the formatting objects from the jsp. It also adds the complexity of passing security credentials in the call. Or do we need to somehow create or own result type and if so how do we get those JSP results? I have not really found any good documentation or example on writing your own result types. Thanks in advance! - ***Note:The information contained in this message may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the Sender immediately by replying to the message and deleting it from your computer. Thank you. Premier Inc. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: placing 2 buttons next to each other
-Original Message- From: Session A Mwamufiya [mailto:[EMAIL PROTECTED] Sent: Thursday, August 02, 2007 1:39 PM To: user@struts.apache.org Subject: placing 2 buttons next to each other Hi, Is there a way to configure an s:form tag so that the 2 submit buttons appear side by side instead of one under the other? I use a css file with input.actionButtons {float: left;} to move both of them to the left, but they're not appearing next to each other. Thanks, Session I managed to do it by using the simple theme: s:submit theme=simple action=blah / - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] No more Tabbedpanel in v2.1.0 ?
In 2.1 all ajax/javascript related tags where moved to the dojo plugin. musachy On 8/2/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, There is a Tabbedpanel in the UI Tag's doc (http://struts.apache.org/2.x/docs/tabbedpanel.html) but this seems to have disappeard in v2.1.0. Is there a new packaged way of handeling tabs in JSP ? Thanks. -- 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: Where does /struts look?
I think you are missing your application context: http://localhost:8080/myapp/struts/dojo/dojo.js musachy On 8/2/07, Struts2 Fan [EMAIL PROTECTED] wrote: Ok so When I put a s:head theme=ajax/ it creates some js scripts such as the below. script type=text/javascript src=/struts/dojo/dojo.js/script script type=text/javascript src=/struts/simple/dojoRequire.js/script script type=text/javascript src=/struts/ajax/dojoRequire.js/script script type=text/javascript src=/struts/CommonFunctions.js/script when I write http://localhost:8080/struts/dojo/dojo.js on the address bar It shows an empty page. But the other 3 js files can be seen properly. I looked with firebug, too. It cannot display /struts/dojo/dojo.js Any thoughts? -- View this message in context: http://www.nabble.com/Where-does--struts-look--tf4200169.html#a11958581 Sent from the Struts - User mailing list archive at Nabble.com. - 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]
Simple authentication
Hello, I need some simple login page for my web. There is only one account, and I'll probably just hardcode the user/pass in the code. Can't figure out how to do it properly with the struts2 framework, been googling and reading the docs... do I need a interceptor for this or? Thank you! -- View this message in context: http://www.nabble.com/Simple-authentication-tf4206203.html#a11964749 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: [S2] How to apply formatting to s:property?
Dave: Did you give up on this? Neil -- Neil Aggarwal, (832)245-7314, www.JAMMConsulting.com FREE! Eliminate junk email and reclaim your inbox. Visit http://www.spammilter.com for details. -Original Message- From: Neil Aggarwal [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 01, 2007 3:23 PM To: 'Struts Users Mailing List' Subject: RE: [S2] How to apply formatting to s:property? Dave: OK, so I added this to my struts.xml: constant name=struts.custom.i18n.resources value=application.properties/ and I defined application.properties with this content: format.money={0,number,currency} But, I still get format.money for the output. Do I need to use the Il8n interceptor somewhere? Thanks, Neil -- Neil Aggarwal, (832)245-7314, www.JAMMConsulting.com FREE! Eliminate junk email and reclaim your inbox. Visit http://www.spammilter.com for details. -Original Message- From: Dave Newton [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 01, 2007 3:10 PM To: Struts Users Mailing List Subject: RE: [S2] How to apply formatting to s:property? --- Neil Aggarwal [EMAIL PROTECTED] wrote: So, is there no way to define a global format for currency? http://struts.apache.org/2.x/docs/localization.html d. Fussy? Opinionated? Impossible to please? Perfect. Join Yahoo!'s user panel and lay it on us. http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 - 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: [S2] Design Advice Needed
When I used XSLFO (maybe 3-4 years ago) it was really a pain. I can't see how it could have gotten any better - without a visual designer anyway. Have a look at http://www.eclipse.org/birt (Birt) - It can generate PDF's, export data, has a good designer etc. (also if you are thinking about using XML - XSL - PDF, Birt also supports XML Data sources as well as regular DB datasource, Scripted datasources etc. HTH, Oz On 02/08/2007, at 10:35 PM, Wesley Wannemacher wrote: Having used FOP briefly, I would add only one thing. It is generally considered a good practice to generate traditional XML first, then transform your data to XSLFO using a transform (pardon me if I am getting the terms wrong). Basically, create your XML data, then have an XSL file that transforms your data to FO, then use FOP to transform it into a PDF. I saw a few responses that seem to indicate you may choose Jasper, which is likely a better idea anyways. -Wes -Original Message- From: Hoying, Ken [mailto:[EMAIL PROTECTED] Sent: Thursday, August 02, 2007 7:40 AM To: user@struts.apache.org Subject: [S2] Design Advice Needed I could use some advice from some folks with more experience and knowledge of Struts2 than I to assist me in determining the correct way (or lay out some viable options) to design a solution for the following senario: We need to generate a PDF report real time based on data in a database that is available for download. What we believe that we would like to do is utilize FOP (http://xmlgraphics.apache.org/fop/) and use a JSP page to actually generate the formatting objects and then run the formatting objects through the FOP processor to generate and stream the PDF back to the user. However, we are not real sure how to implement this in Struts2. How do we invoke the JSP page and then get access to the results? Do we just use the stream result type and then use a http call to the JSP as the input source? This would seem like it would not be optimal from a performance standpoint, as we are making another http call to get the formatting objects from the jsp. It also adds the complexity of passing security credentials in the call. Or do we need to somehow create or own result type and if so how do we get those JSP results? I have not really found any good documentation or example on writing your own result types. Thanks in advance! - ***Note:The information contained in this message may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the Sender immediately by replying to the message and deleting it from your computer. Thank you. Premier Inc. - 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: [S1]minipulate output of bean:write
Hi Alex, If I understand what you are trying to do, you can use JSTL to accomplish the task as such: c:out value=${fn:toUpperCase(myAttr)} / HTH, -Rod -Original Message- From: Alexander Jede [mailto:[EMAIL PROTECTED] Sent: Thursday, August 02, 2007 04:53 To: user@struts.apache.org Subject: [S1]minipulate output of bean:write Hallo list, I have an ActionForm with an attribute (String) to print the value of this attribute I use bean:write name=myBean property=myAttr/. The problem is the String could have small and capital letters but I would like to print it always the same. For example always with capital letters. Exists a way to do this with struts or have I to write my own Tag to do this? Thanks Alex - 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: CSS / JavaScript menu libraries for Struts 2 Showcase application
Appfuse uses struts-menu http://struts-menu.sourceforge.net/ James Holmes-2 wrote: Anyone know what Matt is using for AppFuse.org? Is that the type of menu people would like to see? -- View this message in context: http://www.nabble.com/CSS---JavaScript-menu-libraries-for-Struts-2-Showcase-application-tf4192955.html#a11964425 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: [S2] How to apply formatting to s:property?
--- Neil Aggarwal [EMAIL PROTECTED] wrote: Did you give up on this? No, I'm just not actually physically attached to my computer and teh intarwebs 24/7 and the boss keeps blathering on and on about some sort of do stuff for me BS. I haven't done anything with setting the i18n.resources property, so I can't help you with that. I'm not sure why you don't just put something in to a package.properties (it's hierarchical, you can put it anywhere) or ActionSupport.properties, etc. I've never run an app w/o the i18n interceptor so I don't know what effect (if any) that would have. I would start by doing what it says on the localization page as a sanity check *then* start to play configuration / etc. games. d. From: Neil Aggarwal [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 01, 2007 3:23 PM Subject: RE: [S2] How to apply formatting to s:property? Dave: OK, so I added this to my struts.xml: constant name=struts.custom.i18n.resources value=application.properties/ and I defined application.properties with this content: format.money={0,number,currency} But, I still get format.money for the output. Do I need to use the Il8n interceptor somewhere? Thanks, Neil -- Neil Aggarwal, (832)245-7314, www.JAMMConsulting.com FREE! Eliminate junk email and reclaim your inbox. Visit http://www.spammilter.com for details. -Original Message- From: Dave Newton [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 01, 2007 3:10 PM To: Struts Users Mailing List Subject: RE: [S2] How to apply formatting to s:property? --- Neil Aggarwal [EMAIL PROTECTED] wrote: So, is there no way to define a global format for currency? http://struts.apache.org/2.x/docs/localization.html d. Fussy? Opinionated? Impossible to please? Perfect. Join Yahoo!'s user panel and lay it on us. http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 - 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] Shape Yahoo! in your own image. Join our Network Research Panel today! http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] Bug v2.1.0 double validation
Hi, I try to validate a double, but it generates this in my JSP : // field name: familleProduit.chargeTravail // validator name: double if (form.elements['familleProduit.chargeTravail']) { field = form.elements['familleProduit.chargeTravail']; var error = Le champ doit être un décimal; if (field.value != null) { var value = parseFloat(field.value); if (false || false || false || false) { addError(field, error); errors = true; } } } So the double is not tested. my xxAction-validation.xml : validators field name=familleProduit.nomFamille field-validator type=requiredstring param name=trimtrue/param message key=errors.required/ /field-validator /field field name=familleProduit.chargeTravail field-validator type=double message key=errors.double/ /field-validator /field field name=familleProduit.gamme.idGamme field-validator type=requiredstring param name=trimtrue/param message key=errors.required/ /field-validator /field /validators
Re: Simple authentication
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Appel, appel wrote: I need some simple login page for my web. There is only one account, and I'll probably just hardcode the user/pass in the code. Can't figure out how to do it properly with the struts2 framework, been googling and reading the docs... do I need a interceptor for this or? The easiest thing to use is the authentication built-into your servlet container. Servlet containers are required to provide j_security_check-style authentication and authorization. Apache Tomcat, for instance, allows you to do simple auth using a small XML file containing all of the account information (username, password, and roles). The advantages of using this over a hand-rolled (yet simple) implementation are: 1. Code is less likely to have any bugs. 2. Setup is usually pretty simple if you have limited requirements. 3. Easy to expand to a larger RDBMS-backed user database if/when you need to. I hope that helps, - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGsfIv9CaO5/Lv0PARAuAlAKCf6JDISk8YYDa6jHYp19V3mbORhACgknHZ OaoW5HWQKQFPQKDHtWvoKhs= =IFuW -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: DownloadAction and a normal Forward
The thing is, I'm not entirely sure there's another viable option. I could certainly see extending DownloadAction in some way so that there is kind of a verify() method called first that detects the problem that your checking for (the if(problem) statement)... if a problem is detected, i.e., file doesn't exist or something, then do the forward. That should avoid the NPE (I think), but then your probably overwriting the page on the browser, so maybe that's worse. In any case, that's no quick fix since there's some RD involved. The only thing I can think of is if you can detect you have a problem before the download call... could you maybe do an AJAX call before the download call to see if the file is available and downloadable? If so, then make the actual download request. Or possibly make the download link point to a regular Action that does that check, then forwards to the mapping leading to the DownloadAction? That way the check and the download are in the same request... I'm not sure that would work frankly though and I think you'd have the same problem as I mentioned earlier. Yeah, you may have to live with the NPE... I guess if it's an exceptional situation and isn't going to happen often it may not be a big deal. If it's frequent though, I think I'd do some more creative thinking to avoid it somehow. Frank -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com AIM/Yahoo: fzammetti MSN: [EMAIL PROTECTED] Author of Practical Ajax Projects With Java Technology (2006, Apress, ISBN 1-59059-695-1) and JavaScript, DOM Scripting and Ajax Projects (2007, Apress, ISBN 1-59059-816-4) Java Web Parts - http://javawebparts.sourceforge.net Supplying the wheel, so you don't have to reinvent it! On Thu, August 2, 2007 4:17 am, Gundersen, Richard wrote: Hi Frank, Paul Thanks again for the tips. The thing is, having a NPE isn't actually a problem for me. I am quite (well, not entirely) happy for the code to throw it since by that time, my RequestDispatcher.forward method has already got my request to the browser by then, and the user is viewing the JSP. The fact that the DownloadAction still thinks it needs to do something with a dummy StreamInfo isn't such a big deal to be honest. It can fail for all I care since it doesn't stop the system from working (I know, it's not the right attitude :-) But, right now I am more concerned about whether using RequestDispatcher.forward is a safe (and/or best) way to redirect the request out of the DownloadAction and back to a real JSP. Appreciate your thoughts. Richard Gundersen Java Developer Email: [EMAIL PROTECTED] Phone: 01618302398 Fax: 01618342536 London Scottish Bank plc 24 Mount Street Manchester M2 3LS -Original Message- From: Frank W. Zammetti [mailto:[EMAIL PROTECTED] Sent: Thursday, August 02, 2007 3:16 AM To: Struts Users Mailing List Subject: Re: DownloadAction and a normal Forward Hehe, your going after the *right* answer Paul :) It's clear the caller of getStreamInfo() doesn't like getting null back, that was the case originally... now, the NPE must be getting thrown from elsewhere after Richard returned the dummied StreamInfo object (I would have been surprised if constructing one with two null arguments *didn't* move the NPE elsewhere, but I was hoping!). Frank Paul Benedict wrote: Who is throwing the NPE? I can't tell by your code what's causing it. On 8/1/07, Frank W. Zammetti [EMAIL PROTECTED] wrote: You know, I just reread what your trying to do... have you tried using a global exception handler? I'm not sure you'll be able to catch the exception with one, but if you give it a try and you can, there you go, you can forward as desired from there. -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com AIM/Yahoo: fzammetti MSN: [EMAIL PROTECTED] Author of Practical Ajax Projects With Java Technology (2006, Apress, ISBN 1-59059-695-1) and JavaScript, DOM Scripting and Ajax Projects (2007, Apress, ISBN 1-59059-816-4) Java Web Parts - http://javawebparts.sourceforge.net Supplying the wheel, so you don't have to reinvent it! On Wed, August 1, 2007 10:38 am, Gundersen, Richard wrote: Hi Thanks for the reply. Tried it and it still gives me a NullPointer. Maybe that's not such a problem though - since the browser still redirects to the JSP I want. However, I was wondering if it's possible to use a ResourceStreamInfo to redirect to an ActionForward (which ultimately leads to a JSP). Would this be preferable to using RequestDispatcher.forward(request, response)? Richard Gundersen Java Developer Email: [EMAIL PROTECTED] Phone: 01618302398 Fax: 01618342536 London Scottish Bank plc 24 Mount Street Manchester M2 3LS -Original Message- From: Frank W. Zammetti [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 01, 2007 2:47 PM To: Struts Users Mailing
RE: [S2] How to apply formatting to s:property?
Dave: Thanks for getting back to me. I was not assuming you were available 24x7. I just wondered if you were frustrated by my inexperience. I put a package.properties file in my WEB-INF/classes/page directory since that is the package that contains the action class. It works perfectly! Thanks for that. I tried moving the package.properties to WEB-INF/classes so it would be application wide but that seems to be ignored. I would still really like a way to make a global properties file if possible. Any suggestions on how to do that? Thanks, Neil -- Neil Aggarwal, (832)245-7314, www.JAMMConsulting.com FREE! Eliminate junk email and reclaim your inbox. Visit http://www.spammilter.com for details. -Original Message- From: Dave Newton [mailto:[EMAIL PROTECTED] Sent: Thursday, August 02, 2007 9:12 AM To: Struts Users Mailing List Subject: RE: [S2] How to apply formatting to s:property? I haven't done anything with setting the i18n.resources property, so I can't help you with that. I'm not sure why you don't just put something in to a package.properties (it's hierarchical, you can put it anywhere) or ActionSupport.properties, etc. I've never run an app w/o the i18n interceptor so I don't know what effect (if any) that would have. I would start by doing what it says on the localization page as a sanity check *then* start to play configuration / etc. games. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE [S2] Bug v2.1.0 for double and int validation
Same with int validation. field name=familleProduit.chargeTravail field-validator type=int message key=errors.int/ /field-validator /field generates : // field name: familleProduit.chargeTravail // validator name: int if (form.elements['familleProduit.chargeTravail']) { field = form.elements['familleProduit.chargeTravail']; var error = Le champ doit être un entier; if (field.value != null) { var value = parseFloat(field.value); if (false || false) { addError(field, error); errors = true; } } } [EMAIL PROTECTED] 02/08/2007 16:52 Veuillez répondre à Struts Users Mailing List user@struts.apache.org A Struts Users Mailing List user@struts.apache.org cc Objet [S2] Bug v2.1.0 double validation Hi, I try to validate a double, but it generates this in my JSP : // field name: familleProduit.chargeTravail // validator name: double if (form.elements['familleProduit.chargeTravail']) { field = form.elements['familleProduit.chargeTravail']; var error = Le champ doit être un décimal; if (field.value != null) { var value = parseFloat(field.value); if (false || false || false || false) { addError(field, error); errors = true; } } } So the double is not tested. my xxAction-validation.xml : validators field name=familleProduit.nomFamille field-validator type=requiredstring param name=trimtrue/param message key=errors.required/ /field-validator /field field name=familleProduit.chargeTravail field-validator type=double message key=errors.double/ /field-validator /field field name=familleProduit.gamme.idGamme field-validator type=requiredstring param name=trimtrue/param message key=errors.required/ /field-validator /field /validators
Using Nested tag and JavaScript
Hey guys, I need some help using nested tag library and javascript. I have an actionForm named RegistrationForm that has two AddressForm; mailing and billing addresses. I need to implement a requirement if a user clicks a checkbox say 'same as mailing', I need to copy the textfield values from mailing address to billing address. I can easily use the javascript something like this: function copyMailingAddress { if (document.forms[0].copyMailCB.checked) { document.forms[0].billingLine1.value = document.forms[0].mailingLine1.value; . } } The only problem I'm having is to use it with nested tag library. In my jsp, I have following code nested:nest property=mailingAddress nested:text property=line1 / nested:text property=line2 / . /nested:nest Similarly, nested:nest property=billingAddress nested:text property=line1 / nested:text property=line2 / . /nested:nest When this jsp is rendered as html, the code will something like this: input type=text name=mailingAddress.line1 value= input type=text name=mailingAddress.line2 value= input type=text name=billingAddress.line1 value= input type=text name=billingAddress.line2 value= Now how can I copy the values from mailingAddress to billingAddress using above JavaScript? The dot in between name prevents to execute the above javascript... Could anybody point me how I can resolve this problem? Thank you, semaj -- View this message in context: http://www.nabble.com/Using-Nested-tag-and-JavaScript-tf4206847.html#a11966912 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: [S2] How to apply formatting to s:property?
--- Neil Aggarwal [EMAIL PROTECTED] wrote: I tried moving the package.properties to WEB-INF/classes so it would be application wide but that seems to be ignored. Hmm, I guess I would have thought that would work, but I've never tried. I would still really like a way to make a global properties file if possible. Any suggestions on how to do that? If everything extends ActionSupport (my actions do, out of convenience) you can put it in the com.opensymphony.xwork2.ActionSupport package. I'm not sure why the global resources property setting doesn't work, although I would suspect a property file naming / location / packaging issue. Comments on https://issues.apache.org/struts/browse/WW-1647 suggests that it works. d. Shape Yahoo! in your own image. Join our Network Research Panel today! http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
problem with html:cancel
Hi, I've got this tag: html:cancel styleId=cancelButton styleClass=submitbutton / But the isCancelled() in the action then always return false, even if I hit the cancel button. If I replace the tag with a default html:cancel/html:cancel then it works. Looks like something with the generated ID and CLASS attributes that's fishy. Its worth mentioning that the styleId 'cancelButton' isn't defined in my css (but class 'submitbutton' is), I merely use it to get a handle on the button (document.getElementById()) to disable/enabled it using javascript. Any ideas? Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problem with html:cancel
Paste in the generated HTML for both cases please. Thanks, Paul On 8/2/07, Charl Gerber [EMAIL PROTECTED] wrote: Hi, I've got this tag: html:cancel styleId=cancelButton styleClass=submitbutton / But the isCancelled() in the action then always return false, even if I hit the cancel button. If I replace the tag with a default html:cancel/html:cancel then it works. Looks like something with the generated ID and CLASS attributes that's fishy. Its worth mentioning that the styleId 'cancelButton' isn't defined in my css (but class 'submitbutton' is), I merely use it to get a handle on the button (document.getElementById()) to disable/enabled it using javascript. Any ideas? Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problem with html:cancel
input type=submit name=org.apache.struts.taglib.html.CANCEL value=Cancel onclick=bCancel=true; input type=submit name=org.apache.struts.taglib.html.CANCEL value=Cancel onclick=bCancel=true; id=cancelButton class=submitbutton Paste in the generated HTML for both cases please. Thanks, Paul On 8/2/07, Charl Gerber [EMAIL PROTECTED] wrote: Hi, I've got this tag: html:cancel styleId=cancelButton styleClass=submitbutton / But the isCancelled() in the action then always return false, even if I hit the cancel button. If I replace the tag with a default html:cancel/html:cancel then it works. Looks like something with the generated ID and CLASS attributes that's fishy. Its worth mentioning that the styleId 'cancelButton' isn't defined in my css (but class 'submitbutton' is), I merely use it to get a handle on the button (document.getElementById()) to disable/enabled it using javascript. Any ideas? Thanks. - 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: [S2] How to apply formatting to s:property?
Dave: Arrgh. I just figured it out. I need to set the constant to the name of the file *without* the .properties extension. So, in struts.xml, I put this: constant name=struts.custom.i18n.resources value=application/ and it loads application.properties just fine. Thank you for your help on this. Thanks, Neil -- Neil Aggarwal, (832)245-7314, www.JAMMConsulting.com FREE! Eliminate junk email and reclaim your inbox. Visit http://www.spammilter.com for details. -Original Message- From: Dave Newton [mailto:[EMAIL PROTECTED] Sent: Thursday, August 02, 2007 10:55 AM To: Struts Users Mailing List Subject: RE: [S2] How to apply formatting to s:property? I'm not sure why the global resources property setting doesn't work, although I would suspect a property file naming / location / packaging issue. Comments on https://issues.apache.org/struts/browse/WW-1647 suggests that it works. d. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Link in checkbox label
Is there away to stop the label of a checkbox from being escaped? s:checkbox key=legal label=I have read the a href='/about/legal/'legal stuff/a/ results in: label for=_legal class=checkboxLabelI have read the lt;a href='/about/legal/'gt;legal stufflt;/agt;/label TIA Kevin www.junitfactory.com You send us code. We send back tests. For free. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problem with html:cancel
You mean check in my action class? Why should the name change? Its the same for both cancel buttons, one works, the other not just the id and class extras that breaks it. --- Paul Benedict [EMAIL PROTECTED] wrote: This is interesting. The name isn't changing so I don't know what is going on. Can you debug into the Controller and tell me what you see when it tries to detect when the cancel flag? On 8/2/07, Charl Gerber [EMAIL PROTECTED] wrote: input type=submit name=org.apache.struts.taglib.html.CANCEL value=Cancel onclick=bCancel=true; input type=submit name=org.apache.struts.taglib.html.CANCEL value=Cancel onclick=bCancel=true; id=cancelButton class=submitbutton Paste in the generated HTML for both cases please. Thanks, Paul On 8/2/07, Charl Gerber [EMAIL PROTECTED] wrote: Hi, I've got this tag: html:cancel styleId=cancelButton styleClass=submitbutton / But the isCancelled() in the action then always return false, even if I hit the cancel button. If I replace the tag with a default html:cancel/html:cancel then it works. Looks like something with the generated ID and CLASS attributes that's fishy. Its worth mentioning that the styleId 'cancelButton' isn't defined in my css (but class 'submitbutton' is), I merely use it to get a handle on the button (document.getElementById()) to disable/enabled it using javascript. Any ideas? Thanks. - 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]
layout Struts 2
Some Knows how to build my own layout in Struts 2 ?? I want to use Ajax and the UI Tags and make my own layout. Thanks Manuel
Re: problem with html:cancel
OK, more info if I remove the styleId attribute, then it works. Maybe something to do with the actual style id (#submitButton) not being declared in the .css? --- Paul Benedict [EMAIL PROTECTED] wrote: This is interesting. The name isn't changing so I don't know what is going on. Can you debug into the Controller and tell me what you see when it tries to detect when the cancel flag? On 8/2/07, Charl Gerber [EMAIL PROTECTED] wrote: input type=submit name=org.apache.struts.taglib.html.CANCEL value=Cancel onclick=bCancel=true; input type=submit name=org.apache.struts.taglib.html.CANCEL value=Cancel onclick=bCancel=true; id=cancelButton class=submitbutton Paste in the generated HTML for both cases please. Thanks, Paul On 8/2/07, Charl Gerber [EMAIL PROTECTED] wrote: Hi, I've got this tag: html:cancel styleId=cancelButton styleClass=submitbutton / But the isCancelled() in the action then always return false, even if I hit the cancel button. If I replace the tag with a default html:cancel/html:cancel then it works. Looks like something with the generated ID and CLASS attributes that's fishy. Its worth mentioning that the styleId 'cancelButton' isn't defined in my css (but class 'submitbutton' is), I merely use it to get a handle on the button (document.getElementById()) to disable/enabled it using javascript. Any ideas? Thanks. - 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]
FW: layout Struts 2
I want to have one div in the left and when some click in some link refresh the div in the right, with Ajax. Manuel -Original Message- From: Manuel Correa [mailto:[EMAIL PROTECTED] Sent: Thursday, August 02, 2007 1:51 PM To: user@struts.apache.org Subject: layout Struts 2 Some Knows how to build my own layout in Struts 2 ?? I want to use Ajax and the UI Tags and make my own layout. Thanks Manuel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problem with html:cancel
server --- Paul Benedict [EMAIL PROTECTED] wrote: Is the problem with server or client validation? On 8/2/07, Charl Gerber [EMAIL PROTECTED] wrote: OK, more info if I remove the styleId attribute, then it works. Maybe something to do with the actual style id (#submitButton) not being declared in the .css? --- Paul Benedict [EMAIL PROTECTED] wrote: This is interesting. The name isn't changing so I don't know what is going on. Can you debug into the Controller and tell me what you see when it tries to detect when the cancel flag? On 8/2/07, Charl Gerber [EMAIL PROTECTED] wrote: input type=submit name=org.apache.struts.taglib.html.CANCEL value=Cancel onclick=bCancel=true; input type=submit name=org.apache.struts.taglib.html.CANCEL value=Cancel onclick=bCancel=true; id=cancelButton class=submitbutton Paste in the generated HTML for both cases please. Thanks, Paul On 8/2/07, Charl Gerber [EMAIL PROTECTED] wrote: Hi, I've got this tag: html:cancel styleId=cancelButton styleClass=submitbutton / But the isCancelled() in the action then always return false, even if I hit the cancel button. If I replace the tag with a default html:cancel/html:cancel then it works. Looks like something with the generated ID and CLASS attributes that's fishy. Its worth mentioning that the styleId 'cancelButton' isn't defined in my css (but class 'submitbutton' is), I merely use it to get a handle on the button (document.getElementById()) to disable/enabled it using javascript. Any ideas? Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
performing multiple things with a single button
Hi, I have two frames and would like to have the submit button from one frame be handled by that frame's action and do the following: 1. capture values from the frame and put them in the session object 2. load a different page in the current frame 3. force the other frame to reload Getting 1 and 2 are fine with the standard struts 2 flow of events (1 in the action, and 2 as the result page), but how would I be able to do task 3 in addition to these two others? Is there a way to force a particular frame to reload from within the action? Thanks, Session - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problem with html:cancel
Is the problem with server or client validation? On 8/2/07, Charl Gerber [EMAIL PROTECTED] wrote: OK, more info if I remove the styleId attribute, then it works. Maybe something to do with the actual style id (#submitButton) not being declared in the .css? --- Paul Benedict [EMAIL PROTECTED] wrote: This is interesting. The name isn't changing so I don't know what is going on. Can you debug into the Controller and tell me what you see when it tries to detect when the cancel flag? On 8/2/07, Charl Gerber [EMAIL PROTECTED] wrote: input type=submit name=org.apache.struts.taglib.html.CANCEL value=Cancel onclick=bCancel=true; input type=submit name=org.apache.struts.taglib.html.CANCEL value=Cancel onclick=bCancel=true; id=cancelButton class=submitbutton Paste in the generated HTML for both cases please. Thanks, Paul On 8/2/07, Charl Gerber [EMAIL PROTECTED] wrote: Hi, I've got this tag: html:cancel styleId=cancelButton styleClass=submitbutton / But the isCancelled() in the action then always return false, even if I hit the cancel button. If I replace the tag with a default html:cancel/html:cancel then it works. Looks like something with the generated ID and CLASS attributes that's fishy. Its worth mentioning that the styleId 'cancelButton' isn't defined in my css (but class 'submitbutton' is), I merely use it to get a handle on the button (document.getElementById()) to disable/enabled it using javascript. Any ideas? Thanks. - 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: performing multiple things with a single button
Session A Mwamufiya wrote: 1. capture values from the frame and put them in the session object 2. load a different page in the current frame 3. force the other frame to reload Getting 1 and 2 are fine with the standard struts 2 flow of events (1 in the action, and 2 as the result page), but how would I be able to do task 3 in addition to these two others? Is there a way to force a particular frame to reload from within the action? Add your JavaScript to reload other frame to onLoad event of current frame in 2. 3 is fairly easy to do with onLoad or some other way, until 2 is non-conditional and doesn't depend on logic of 1 or 2 (validation for instance). Oleg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
display validation error to simple theme
Hi, How I show the erros(validation) when using simple theme ? Herrera -- View this message in context: http://www.nabble.com/display-validation-error-to-simple-theme-tf4208443.html#a11971725 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: using css with struts 2
Hi, Do you have your form's theme set to css_xhtml ? Leena On 7/31/07, Session A Mwamufiya [EMAIL PROTECTED] wrote: Hi, I have a page with various strut objects in a form (buttons, textfields, and listboxes), and would like to be able to control the layout. I tried using a css file to set the size and font of buttons: - my jsp page contains: td valign=top s:form target=SMIG_Editor s:submit value=Add Category action=CategoryEditor cssClass=actionButton / /s:form /td - I have the following line in my head tag: link href=render.css rel=stylesheet type=text/css - my render.css file contains: input.button { text-align: left; width: 100px; } input.deleteButton { color: red; } Any ideas why struts doesn't follow the css instructions? Also, I've observed that within a s:form tag, br doesn't actually separate any of the elements in the form; all the spaces appear together at the top of the rendered page, but not where they are supposed to be. For example, if I have three submit buttons, each followed by br, I would get a page that started with 3 br and then had the 3 buttons clustered together as before. Any ideas? Thanks, Session - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: using css with struts 2
It also looks like you're referencing the actionButton style class td valign=top s:form target=SMIG_Editor s:submit value=Add Category action=CategoryEditor cssClass=actionButton / /s:form /td But you defined the style as the button class. input.button { text-align: left; width: 100px; } (*Chris*) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] dojo 0.9 and ***-conversion.properties
On 8/1/07, Oguz Kologlu [EMAIL PROTECTED] wrote: Unexpected Exception caught setting 'contacts%5B0%5D.firstName' on 'class easybed.web.struts2.ContactsAction: Error setting expression 'contacts%5B0%5D.firstName' with value '[Ljava.lang.String;@284bf3' Dojo 0.4.3 used to work ok (probably it didn't encode `[` characters). I realise this is a borderline S2 issue since it ships with 0.4.3 but it will eventually have to support 0.9 and will have to solve the issue. Only thing I can think of is that maybe the parameter name is being double escaped with JavaScript. You might be able to test this by manually forming a URL like: http://.../MyAction.do?contacts%5B0%5D.firstName=value and seeing if the value is set properly in your action. I think it should be. But, if you make the following request: http://.../MyAction.do?contacts%255B0%255D.firstName=value which has the parameter name contacts[0].firstName in a double-escaped form, maybe you can reproduce your error. If the first URL is fine, but the second URL fails with the exception you're seeing, then you're double-escaping in your browser. Could be a dojo bug, or just something that's changed from 0.4.3 to 0.9 that users need to be aware of. Not sure. HTH, Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: using css with struts 2
I got it cleared up, it was an issue with not using the absolute path in my link. Thanks, Session Hi, Do you have your form's theme set to css_xhtml ? Leena On 7/31/07, Session A Mwamufiya [EMAIL PROTECTED] wrote: Hi, I have a page with various strut objects in a form (buttons, textfields, and listboxes), and would like to be able to control the layout. I tried using a css file to set the size and font of buttons: - my jsp page contains: td valign=top s:form target=SMIG_Editor s:submit value=Add Category action=CategoryEditor cssClass=actionButton / /s:form /td - I have the following line in my head tag: link href=render.css rel=stylesheet type=text/css - my render.css file contains: input.button { text-align: left; width: 100px; } input.deleteButton { color: red; } Any ideas why struts doesn't follow the css instructions? Also, I've observed that within a s:form tag, br doesn't actually separate any of the elements in the form; all the spaces appear together at the top of the rendered page, but not where they are supposed to be. For example, if I have three submit buttons, each followed by br, I would get a page that started with 3 br and then had the 3 buttons clustered together as before. Any ideas? Thanks, Session - 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:action stopping the result it is called form
The following jsp is a Result in an action called 'listTypes'. %@ include file=/includes/header.jsp% h1s:property value=pageTitle//h1 br/ s:action name=getTypeParamTree executeResult=true/ %@ include file=/includes/footer.jsp% getTypeParamTree result is xslt and is configured as follows: action name=getTypeParamTree class=ca.aps.actions.design.TypeAction method=loadTree result name=success type=xslt param name=location/xsl/TypeListParam.xsl/param /result /action When the listTypes JSP called the getTypeParamTree it stopps the result from finishing. The XSL transform occurs then it stopps so the line %@ include file=/includes/footer.jsp% does not get executed. Is there a way to get around this? Thank you , Rich - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: display validation error to simple theme
Use the s:fielderror/ tag On 8/2/07, Pedro Herrera [EMAIL PROTECTED] wrote: Hi, How I show the erros(validation) when using simple theme ? Herrera -- View this message in context: http://www.nabble.com/display-validation-error-to-simple-theme-tf4208443.html#a11971725 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Locale - make available to JSP
The first page of my app is a Login page. Every other page is correctly localized, because the app gets the user's preferred locale from a DB, and Struts handles it, but until they have logged in the DB is not available. I want it to be localized from cookies. I created a filter which intercepts the requests, gets the cookie from the request, and creates a Locale object for that language. The cookie was stored when the user selected a Locale in a previous session. The question is, where do I store this locale so that it is available to the login page. I looked into the source code for the ActionContext class, LocaleProvider class, etc, and it seems like this code should work, but it doesn't: ActionContext.getContext().put(ActionContext.LOCALE, locale); Any help or advise will be greatly appreciated. Thank you, Ray Clough -- View this message in context: http://www.nabble.com/Locale---make-available-to-JSP-tf4209920.html#a11975561 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Difficulty with submitting variable amouts of form data
Hi, [I'm using struts 1.2.7 (with EL from contrib) on Tomcat 5.5.9]. I'm attempting to submit variable amounts of form data in a table following the model of James Turner: http://www.developer.com/java/ejb/article.php/10931_3321521_1. The goal is to retrieve items (user-configured alerts) from a DB, present descriptions of them as lines in a table, with checkboxes for edit and delete added to each. Here is the relevant part of my struts-config.xml: form-bean name=dynamicEditAlertForm type=org.apache.struts.action.DynaActionForm form-property name=alertsArray type=com...AlertChoiceDesc[] / /form-bean action path=/SetupEditAlertForm name=dynamicEditAlertForm validate=false scope=session type=com...SetupEditAlertFormAction forward name=success path=begin.work/ /action action path=/EditAlert name=dynamicEditAlertForm validate=false scope=session type=com...EditAlertAction forward name=success path=edit.alert/ /action Successful login forwards to /SetupEditAlertForm, which is intended to create the session-scoped form which will be associated with the form for choosing (on page begin.work) the items to be edited; The form action is /EditAlert (see jsp below). Here is the relevant part of the execute code for SetupEditAlertFormAction: ListAlertChoiceDesc alertChoiceDescs = alertsDBMgr.getAlertBeansChoiceDescs(); //get alerts from db AlertChoiceDesc[] alertLines = new AlertChoiceDesc[alertChoiceDescs.size()]; alertChoiceDescs.toArray(alertLines); df.set(alertsArray, alertLines); return mapping.findForward(success); The class AlertChoiceDesc is a vanilla Bean (with properties id, description, etc.) The JSP page 'begin.work' is defined in a struts-tiles.xml definition. The relevant part of the page body is this: html:form action=/EditAlert table border=1 cellspacing=1 cellpadding=1 tr thID/th ... thEdit/th thDelete/th /tr c:forEach var=alertDesc items=${dynamicArrayForm.map.alertsArray} trtdc:out value=${alertDesc.id}//td tdc:out value=${alertDesc.description}//td ... td--/td // placeholders for checkboxes to be added td--/td /tr /c:forEach tr tdhtml:submit value=Edit//td tdhtml:submit value=Delete//td/tr /table /html:form My current db contains 7 user alerts. Debugging SetupEditAlertFormAction shows that the variable alertLines contains the expected 7 AlertChoiceDesc objects at the line:df.set(alertsArray, alertLines); However, the JSP page 'begin.work' displays the table with only the header and the submit buttons -- no data rows. I've tried this using both type=org.apache.struts.action.DynaActionForm as shown here, and with the type type=org.apache.struts.validator.DynaValidatorForm used by Turner. The behavior is the same in both cases I hope someone can help me see what I'm missing here. More generally, I'm not committed to this specific pattern. I'll be happy to use any other technique which would allow me to present a variable number of data items to the user, with checkbox (or radio buttons) attached, and then obtain the user's choices. Thanks in advance, Ken Bowen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] Parameterized File Downloading
Ok, I finally see the error of my ways: I originally defined my parameter like this: s:param name=inputPath value=/images/bg_pattern.gif / when it should be like this: s:param name=inputPath value=%{'/images/bg_pattern.gif'} / now the proper string is passed. Thanks so much for the help! DNewfield wrote: Grish wrote: s:url id=downloadUrl action=download namespace=/filedownload s:param name=inputPath value=/images/test.gif / /s:url s:a href=%{downloadUrl}Get image/s:a So does this generate a link relative to your webapp of filedownload/download.action?inputPath=/images/test.gif ? ( note, .action could be .do, .html or whatever you have that extension set to, apparently even . (I may have to try that in my app...) ) If so, then the problem is somewhere between the receipt of the request and the handoff after the execute() method is run from the bean defined as fileDownloadAction. I leave it to you to trace through the process. Is the setter being called? In the execute method is there a value? Is it using the class you think it's using? You can specify a method (other than the default execute) if you'd like to put your checks there. -Dale - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/-S2--Parameterized-File-Downloading-tf4191759.html#a11976775 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Is it possible to pass a dynamic parameter to a redirectAction?
I have the following situation: a searchfield is on top of a table presenting results. if there is only one result, the user should be redirected without the need of clicking on the list.. now my problem is how to redirect to an action and passing a parameter from within my original action.. I am working around this by putting the ID information into the user session ... but I am sure there is a cleaner way of doing this ;) Piero - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Eclipse Editor and struts tags
Hi, WTP 1.5http://download.eclipse.org/webtools/downloads/drops/R1.5/R-1.5.4-200705021353/with EMF 2.2 http://www.eclipse.org/modeling/emf/downloads/?project=emf will run fine in Eclipse 3.2.2. ;-) On 8/2/07, appel [EMAIL PROTECTED] wrote: Hi, I cannot install WTP unless I have EMF, and I cannot install EMF unless I have Eclipse 3.3.0 (I have Eclipse 3.2.2). So therefor I cannot install WTP! :| Also, I don't want to install a new Eclipse editor, it's a total pain maintaining 2 or 3 Eclipse installs, with 3 different workspaces. -- View this message in context: http://www.nabble.com/Eclipse-Editor-and-struts-tags-tf4205171.html#a11963283 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] Issues with AJAX in IE
I'm not so sure if this is some bug, but I noticed an odd behaviour with my AJAX forms in IE. For Firefox, if I hit the submit button for my form, my output is displayed in my DIV area as exepcted. Same for IE. But in IE, when I hit enter button instead of clicking on my submit button the whole jsp for that ajax call is displayed instead of returning the output in the DIV area. With Firefox there is no issue. I've noticed this in IE 6 and 7. I'm actually modifying the Struts 2 + Spring 2 + JPA + AJAX tutorial. Here's my code: s:form action=searchAjax namespace=/persons validate=true s:textfield id=search label=%{getText('search.label')} name=searchCriteria / s:submit key=search.button theme=ajax targets=persons / /s:form s:url action=listAjax namespace=/persons id=descrsUrl/ div style=width: 300px;border-style: solid s:div id=persons theme=ajax href=%{descrsUrl} loadingText=Loading... / /div I don't know if this is some bug or there's something wrong with my setup. Has anyone encountered a similar problem? -- View this message in context: http://www.nabble.com/-S2--Issues-with-AJAX-in-IE-tf4210453.html#a11977018 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: Is it possible to pass a dynamic parameter to a redirectAction?
Piero Sartini wrote: I have the following situation: a searchfield is on top of a table presenting results. if there is only one result, the user should be redirected without the need of clicking on the list.. If you just want them to see the list for X seconds, then the link to be followed, put this in the head section of the resulting page: meta http-equiv=refresh content=60;url=s:url includeParams=get// Of course, you'll want a different value for that s:url tag, but only you know that value. -Dale - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Where does /struts look?
No I am using Jetty and I have no application context. As I said before I can see all the js files except /struts/dojo/dojo.js Musachy Barroso wrote: I think you are missing your application context: http://localhost:8080/myapp/struts/dojo/dojo.js musachy -- View this message in context: http://www.nabble.com/Where-does--struts-look--tf4200169.html#a11977522 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problem deploying an application
Hi, I have 3 projects (web project, EJB and Java Client) which I have deployed using a single EAR. The EJB and the client reference the web project (will there be a problem with a reference in this direction?). After successful deployment, the Client and the EJB are unable to find the required classes in the web project. Any help is appreciated. Thanks and regards, John. CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS***