Re: Is Multiple Forms(s:form) in one Jsp possible?
Dave Newton wrote: --- Jeromy Evans <[EMAIL PROTECTED]> wrote: The commenting effect is something one of the browsers does when viewing invalid html (forget which browser). It comments out the html for nodes that were impossible to include in the DOM. I've seen it when forms are accidentally nested as the OP must have done. Oh, interesting; I've never seen that. This, of course, leads to the obvious conclusion that my HTML is always perfect. On a related note, watch for my auction of my bridge on e-bay Real Soon Now (tm). Dave lol :-) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: open new window using Struts action
http://wiki.apache.org/struts/OpenWindowFromAction -- Frank W. Zammetti 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) and "Practical DWR 2 Projects" (2008, Apress, ISBN 1-59059-941-1) Java Web Parts - http://javawebparts.sourceforge.net Supplying the wheel, so you don't have to reinvent it! jeppy wrote: Hi I'm using Struts 1.2.9, what i want is, if it's failed on validation then the error message display on the same page, but if the validation success then I want the result display in new window. Question: how can I trigger open new window using Struts (I don't want to open new window using form target or windows open). can anyone help me? thanks Regards, jeppy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Is Multiple Forms(s:form) in one Jsp possible?
--- Jeromy Evans <[EMAIL PROTECTED]> wrote: > The commenting effect is something one of the browsers does when viewing > invalid html (forget which browser). It comments out the html for nodes > that were impossible to include in the DOM. I've seen it when forms are > accidentally nested as the OP must have done. Oh, interesting; I've never seen that. This, of course, leads to the obvious conclusion that my HTML is always perfect. On a related note, watch for my auction of my bridge on e-bay Real Soon Now (tm). Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Is Multiple Forms(s:form) in one Jsp possible?
Dave Newton wrote: --- Thomas Ramapuram <[EMAIL PROTECTED]> wrote: I just wanted to know if it is possible to have multiple s:form in one jsp. Each of the forms submit to a diffrent action. The problem I faced is that. If I place multiple forms in one jsp. The initials forms closing tags are commented out when the tag is rendered. Is this expected behaviour or is it a bug. I can't reproduce this; I have many pages with multiple forms. Including a source code snippet might be helpful. Dave The commenting effect is something one of the browsers does when viewing invalid html (forget which browser). It comments out the html for nodes that were impossible to include in the DOM. I've seen it when forms are accidentally nested as the OP must have done. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
open new window using Struts action
Hi I'm using Struts 1.2.9, what i want is, if it's failed on validation then the error message display on the same page, but if the validation success then I want the result display in new window. Question: how can I trigger open new window using Struts (I don't want to open new window using form target or windows open). can anyone help me? thanks Regards, jeppy -- View this message in context: http://www.nabble.com/open-new-window-using-Struts-action-tp15348402p15348402.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Dynamic indexed field name in validation?
I have a dynamic multi line collection of dates with a date converter doing its job perfectly - populating dates or reporting conversion errors by field as it should. What I'm wondering is if it's possible to dynamically reference these fields without providing individually fixed definitions for each possible field. For example, I can define each named field as follows: true ${getText("errors.invalid.date")} true ${getText("errors.invalid.date")} etc. This approach does work. However, I'd prefer have a single definition perhaps using a wildcard/regex since I don't know how many fields the user will submit. Is it possible to substitute some kind of wildcard or regex here? Thanks, Grant Notice Regarding Confidentiality This email, including any and all attachments, (this "Email") is intended only for the party to whom it is addressed and may contain information that is confidential or privileged. Sierra Systems Group Inc. and its affiliates accept no responsibility for any loss or damage suffered by any person resulting from any unauthorized use of or reliance upon this Email. If you are not the intended recipient, you are hereby notified that any dissemination, copying or other use of this Email is prohibited. Please notify us of the error in communication by return email and destroy all copies of this Email. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: File upload issues when maxFileSize is exceeded.
--- Martin Gainty <[EMAIL PROTECTED]> wrote: > take a look at implementing FileUploadAction > http://jsourcery.com/api/apache/struts/2.0.6/org/apache/struts2/showcase/fil > eupload/FileUploadAction.html "Adam Gordon" <[EMAIL PROTECTED]> wrote: > > We're using Struts 1.2.9 Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [struts] servletOutputStream in S2 action
bhaarat Sharma wrote: What you need to do is provide the result with a source of the >data to be sent to the client. and that data has to be in java.io.InputStream?? An InputStream is a source of data. An OutputStream is a destination for data. even if my getExcelStream method returns java.io.OutputStream...I still get an exception Because the result can't read() from an OutputStream. so what TYPE of data should getExcelStream be returning :( It should be returning something that extends InputStream. I don't think your workbook method is doing what you think it's doing. It might make sense if it took an output stream as a parameter, like wb.write(outputStream), but if it is returning an output stream then it's really asking for input... -Dale - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: File upload issues when maxFileSize is exceeded.
Adam- take a look at implementing FileUploadAction http://jsourcery.com/api/apache/struts/2.0.6/org/apache/struts2/showcase/fil eupload/FileUploadAction.html M-- - Original Message - From: "Adam Gordon" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" Sent: Thursday, February 07, 2008 6:35 PM Subject: File upload issues when maxFileSize is exceeded. > We're using Struts 1.2.9 and the problem we're seeing is that if a user > tries to upload a file that does not exist or upload a file that exceeds > the maxFileSize attribute the FormFile object on the ActionForm is null > and so we cannot distinguish between the two. > > We thought about removing the maxFileSize parameter and doing the check > ourselves in the ActionForm, but it appears that the file upload has > already begun at that point and while we can look at the Content-Length > header from the HttpServletRequest object in the Struts Action, it's a > moot step because the file has already begun to upload. > > Is there a method on Action or DispatchAction (or perhaps something > else) that we can override to prevent the file upload if it exceeds a > size we determine? My concern is that Apache commons-fileupload gets > the request to upload the file first before Struts gets it and we might > be hozed in this regard. > > Any thoughts? Thanks. > > --adam > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [struts] servletOutputStream in S2 action
>What you need to do is provide the result with a source of the >data to be sent to the client. and that data has to be in java.io.InputStream?? even if my getExcelStream method returns java.io.OutputStream...I still get an exception so what TYPE of data should getExcelStream be returning :( seems i am so close to fixing this On 2/7/08, Dale Newfield <[EMAIL PROTECTED]> wrote: bhaarat Sharma wrote: > > Thanks for that. that gives me a better idea to go about things + i > > didnt know we can call methods from struts.xml > > http://struts.apache.org/2.x/struts2-core/apidocs/org/apache/struts2/dispatcher/StreamResult.html > > describes how that result works, stating taht the \"inputName\" parameter > is \"the name of the InputStream property from the chained action > (default = inputStream)\" > > The filename expression works because this result extends > http://struts.apache.org/2.x/struts2-core/apidocs/org/apache/struts2/dispatcher/StrutsResultSupport.html > which allows for ognl expressions in result parameters (if the parse > parameter is true, which is the default). > > > java.lang.ClassCastException: org.apache.coyote.tomcat5.CoyoteOutputStream > > > > org.apache.struts2.dispatcher.StreamResult.doExecute(StreamResult.java:182) > > > > org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:178) > > > > com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:348) > > > > com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:253) > > That\'s saying that it can\'t cast a \"CoyoteOutputStream\" as an > InputStream. The result will manage the output to the client. You > shouldn\'t need to deal with the response or the servlet. What you need > to do is provide the result with a source of the data to be sent to the > client. > > Note that every call to getExcelStream needs to return an independent > InputStream. For example, when you don\'t tell the result the > contentLength it has no choice but to step through the entire stream to > find the length, then it\'ll ask for a new stream to actually pull the > data out of to send to the client. > > -Dale > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
File upload issues when maxFileSize is exceeded.
We're using Struts 1.2.9 and the problem we're seeing is that if a user tries to upload a file that does not exist or upload a file that exceeds the maxFileSize attribute the FormFile object on the ActionForm is null and so we cannot distinguish between the two. We thought about removing the maxFileSize parameter and doing the check ourselves in the ActionForm, but it appears that the file upload has already begun at that point and while we can look at the Content-Length header from the HttpServletRequest object in the Struts Action, it's a moot step because the file has already begun to upload. Is there a method on Action or DispatchAction (or perhaps something else) that we can override to prevent the file upload if it exceeds a size we determine? My concern is that Apache commons-fileupload gets the request to upload the file first before Struts gets it and we might be hozed in this regard. Any thoughts? Thanks. --adam - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [struts] servletOutputStream in S2 action
bhaarat Sharma wrote: Thanks for that. that gives me a better idea to go about things + i didnt know we can call methods from struts.xml http://struts.apache.org/2.x/struts2-core/apidocs/org/apache/struts2/dispatcher/StreamResult.html describes how that result works, stating taht the "inputName" parameter is "the name of the InputStream property from the chained action (default = inputStream)" The filename expression works because this result extends http://struts.apache.org/2.x/struts2-core/apidocs/org/apache/struts2/dispatcher/StrutsResultSupport.html which allows for ognl expressions in result parameters (if the parse parameter is true, which is the default). java.lang.ClassCastException: org.apache.coyote.tomcat5.CoyoteOutputStream org.apache.struts2.dispatcher.StreamResult.doExecute(StreamResult.java:182) org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:178) com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:348) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:253) That's saying that it can't cast a "CoyoteOutputStream" as an InputStream. The result will manage the output to the client. You shouldn't need to deal with the response or the servlet. What you need to do is provide the result with a source of the data to be sent to the client. Note that every call to getExcelStream needs to return an independent InputStream. For example, when you don't tell the result the contentLength it has no choice but to step through the entire stream to find the length, then it'll ask for a new stream to actually pull the data out of to send to the client. -Dale - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [struts] servletOutputStream in S2 action
Thanks for that. that gives me a better idea to go about things + i didnt know we can call methods from struts.xml i implemented this but am getting this error java.lang.ClassCastException: org.apache.coyote.tomcat5.CoyoteOutputStream org.apache.struts2.dispatcher.StreamResult.doExecute(StreamResult.java:182) org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:178) com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:348) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:253) my getExcelStream looks like this public ServletOutputStream getExcelStream() { return this.stream; } excelDownload method has this that sets up the stream. stream = response.getOutputStream(); wb.write(stream); wb is the worksheet... On 2/7/08, Dale Newfield <[EMAIL PROTECTED]> wrote: bhaarat Sharma wrote: > > I think its better if i post some code. > > > > This is the action mapping for > > > class=\\\"action.reports.AccessRequestReportResult\\\"> > > > name=\\\"showReport\\\">/useradmin/AccessRequestReport.jsp > > login.jsp > > application/vnd.ms-excel > excelStream > name=\"contentDisposition\">attachment;filename=\"${excelFilename}\" > 1024 > > > > > > > > this is my execute method: > > > > > > public String execute() throws IOException, ServletException { > > > > //we dont enter here for excel > > if (getServletRequest().getParameter(\\\"isExcel\\\")==null) > > { > > setData(getActionValue()); > > return \\\"showReport\\\"; > > } > > //enter here for excel > > else > > { >do whatever it takes to set the action up so that when > getExcelStream() is called the appropriate stream is returned, and when > getExcelFilename() is called, the appropriate filename is returned. >return \"excel\"; > > } > > > > } > > -Dale > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [struts] servletOutputStream in S2 action
bhaarat Sharma wrote: I think its better if i post some code. This is the action mapping for /useradmin/AccessRequestReport.jsp login.jsp application/vnd.ms-excel excelStream name="contentDisposition">attachment;filename="${excelFilename}" 1024 this is my execute method: public String execute() throws IOException, ServletException { //we dont enter here for excel if (getServletRequest().getParameter(\"isExcel\")==null) { setData(getActionValue()); return \"showReport\"; } //enter here for excel else { do whatever it takes to set the action up so that when getExcelStream() is called the appropriate stream is returned, and when getExcelFilename() is called, the appropriate filename is returned. return "excel"; } } -Dale - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [struts] servletOutputStream in S2 action
I think its better if i post some code. This is the action mapping for /useradmin/AccessRequestReport.jsp login.jsp this is my execute method: public String execute() throws IOException, ServletException { //we dont enter here for excel if (getServletRequest().getParameter(\"isExcel\")==null) { setData(getActionValue()); return \"showReport\"; } //enter here for excel else { setData(getServletRequest().getParameter(\"action\")); excelReport();//this does all the excel stuff and writes to the HttpServletResponse. return \"stream\";//i also tried return SUCCESS but even then got illegalStateException } } Everything works dandy but i have an IllegalStateException in my logs. saying no result defined for \"stream\"... is there a workaround here...:( On 2/7/08, Dale Newfield <[EMAIL PROTECTED]> wrote: bhaarat Sharma wrote: > > ..what should my execute method be returning? > > As always, it should return the name of the appropriate result (in this > case, the name of the result of type \"stream\"). > > -Dale > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [struts] servletOutputStream in S2 action
bhaarat Sharma wrote: ..what should my execute method be returning? As always, it should return the name of the appropriate result (in this case, the name of the result of type "stream"). -Dale - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: servletOutputStream in S2 action
just read the link you sent. I cant make my execute method void because it is being used for another page which requires it to send something back. :( - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [struts] servletOutputStream in S2 action
Mike Jennings wrote: You can do this by creating a custom result type. Or you can use a result type that's already provided that does exactly what you need. http://struts.apache.org/2.x/struts2-core/apidocs/org/apache/struts2/dispatcher/StreamResult.html How can i do the same in my execute method for S2?? what should the execute method return? because when user clicks get Excel link..the page stays the same but just the user is presented with open/save dialog. What the browser does with the data (attempt to display it/save it) is determined by the "contentDisposition" You want that to read something like: "attachment;filename=${something.dynamic}.xls" -Dale - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: servletOutputStream in S2 action
I was trying stuff out and i hve got it working perfectly. Only thing is my that my execute is returning a SUCCESS when everything is done. However I do not have any in my struts.xml for this action. since the user shouldnt be moved to another page. Now I am able to see open /save dialog box as well and excel opens fine too but in my logs i ssee the following exception.. StandardWrapperValve[default]: Servlet.service() for servlet default threw exception java.lang.IllegalStateException at org.apache.coyote.tomcat5.CoyoteResponseFacade.sendError(CoyoteResponseFacade.java:390) at org.apache.struts2.dispatcher.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:127) at org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:178) at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:348) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:253) at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:221) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86) ..what should my execute method be returning? On 2/7/08, Mike Jennings <[EMAIL PROTECTED]> wrote: You can do this by creating a custom result type. > > A example of a custom result type for streaming images from a action to > a img tag is here. > > http://struts.apache.org/2.x/docs/how-can-we-display-dynamic-or-static-images-that-can-be-provided-as-an-array-of-bytes.html > > You can use this as a example, but will probably have to have a modify > it slightly so that your action will have a getter and setter to pass a > output stream to the result type. In the result type you can write the > output stream to the response output stream. > > Mike Jennings > > bhaarat Sharma wrote: > > Hello > > > > I have a S2 action working perfectly fine. But on one page of my web > > App I would like the user to be able to download report in Excel. We > > have this functionality in other pages as well but they arent using S2 > > and are doing this via a custom servlet which has doGet doPost and > > processRequest methods. > > > > Inside the processRequest..they do bunch of stuff to get the excel > > read and in the end do this: > > > > ServletOutputStream stream = null; > > String fileName = \\\"something\\\"; > > > > > > response.addHeader(\\\"Content-Disposition\\\", \\\"attachment; > > filename=\\\" + fileName); > > response.setContentType(\\\"application/vnd.ms-excel\\\"); > > stream = response.getOutputStream(); > > wb.write(stream); > > > > this is a void method. > > > > My question is, since in my case I already have a S2 action..I dont > > want to make a new servlet to do this. > > > > How can i do the same in my execute method for S2?? what should the > > execute method return? because when user clicks get Excel link..the > > page stays the same but just the user is presented with open/save > > dialog. > > > > Woudl appreciate any help. > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > Spam/Virus scanning by CanIt Pro > > > > For more information see > > http://www.kgbinternet.com/SpamFilter.htm > > > > To control your spam filter, log in at > > http://filter.kgbinternet.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: servletOutputStream in S2 action
You can do this by creating a custom result type. A example of a custom result type for streaming images from a action to a img tag is here. http://struts.apache.org/2.x/docs/how-can-we-display-dynamic-or-static-images-that-can-be-provided-as-an-array-of-bytes.html You can use this as a example, but will probably have to have a modify it slightly so that your action will have a getter and setter to pass a output stream to the result type. In the result type you can write the output stream to the response output stream. Mike Jennings bhaarat Sharma wrote: Hello I have a S2 action working perfectly fine. But on one page of my web App I would like the user to be able to download report in Excel. We have this functionality in other pages as well but they arent using S2 and are doing this via a custom servlet which has doGet doPost and processRequest methods. Inside the processRequest..they do bunch of stuff to get the excel read and in the end do this: ServletOutputStream stream = null; String fileName = \"something\"; response.addHeader(\"Content-Disposition\", \"attachment; filename=\" + fileName); response.setContentType(\"application/vnd.ms-excel\"); stream = response.getOutputStream(); wb.write(stream); this is a void method. My question is, since in my case I already have a S2 action..I dont want to make a new servlet to do this. How can i do the same in my execute method for S2?? what should the execute method return? because when user clicks get Excel link..the page stays the same but just the user is presented with open/save dialog. Woudl appreciate any help. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Spam/Virus scanning by CanIt Pro For more information see http://www.kgbinternet.com/SpamFilter.htm To control your spam filter, log in at http://filter.kgbinternet.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
servletOutputStream in S2 action
Hello I have a S2 action working perfectly fine. But on one page of my web App I would like the user to be able to download report in Excel. We have this functionality in other pages as well but they arent using S2 and are doing this via a custom servlet which has doGet doPost and processRequest methods. Inside the processRequest..they do bunch of stuff to get the excel read and in the end do this: ServletOutputStream stream = null; String fileName = \"something\"; response.addHeader(\"Content-Disposition\", \"attachment; filename=\" + fileName); response.setContentType(\"application/vnd.ms-excel\"); stream = response.getOutputStream(); wb.write(stream); this is a void method. My question is, since in my case I already have a S2 action..I dont want to make a new servlet to do this. How can i do the same in my execute method for S2?? what should the execute method return? because when user clicks get Excel link..the page stays the same but just the user is presented with open/save dialog. Woudl appreciate any help. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[s2] handling "Unable to instantiate action" exception
I use wildcard mappings and Spring integration. When a bad url is entered, no Spring bean is mapped and it results in an exception page. I would like to swap this to a nice "Sorry, this page does not exist" message. However, the Exception Interceptor does not catch this, probably because it happens before the chain of interceptors. How can I solve this? kuvera - http://javatar.hu Java EE programming -- View this message in context: http://www.nabble.com/-s2--handling-%22Unable-to-instantiate-action%22-exception-tp15341966p15341966.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts2, collection of objects and JSP
newton.dave wrote: > > Piotr Falenczyk <[EMAIL PROTECTED]> wrote: >> I need to display all the names of Imports, and allow to edit every one >> of >> them in one page. What I do now is somethin like that ion JSP. Displaying >> values work just fine, but I canno't change them (not stored back in the >> session) >> >> >> >> >> > > One way is to the "status" attribute to your tag and use > it > in your tag as part of the name: > > > > > > that as the index in your 's name value. (The syntax may > be > a bit off, but that's the idea.) > > Dave > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > Thanks, that solved the problem. Dave saved my day. Regards Piotr -- View this message in context: http://www.nabble.com/Struts2%2C-collection-of-objects-and-JSP-tp15331960p15338160.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [struts] Is Multiple Forms(s:form) in one Jsp possible?
Thomas Ramapuram wrote: I just wanted to know if it is possible to have multiple s:form in one jsp. Each of the forms submit to a diffrent action. Just make sure they're not nested inside one another, and that no two elements on the rendered page have the same id attribute. -Dale - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Multiple submit buttons in a single JSP
Hi, You can use and Action class with three methods, the same like execute() http://struts.apache.org/2.x/docs/submit.html Regards -- Lukasz http://www.linkedin.com/in/lukaszlenart - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Multiple submit buttons in a single JSP
Hi all, In my JSP, i have three submit buttons, i want to know which button user has clicked. I tried from this site, http://struts.apache.org/2.x/docs/html-form-buttons-howto.html http://struts.apache.org/2.x/docs/html-form-buttons-howto.html It's not working. Give me some ideas, i have added my code, public String execute() { if (buttonOnePressed) { message = "You pressed the first button"; Save(); } else if (buttonTwoPressed) { Update(); message = "You pressed the second button"; } else if (buttonThreePressed) { Show(); message = "You pressed the second button"; } else { return ERROR; } return SUCCESS; } In My Struts.xml file, /JSP/user_details.jsp /JSP/user_details.jsp /JSP/user_details.jsp In Jsp, -- View this message in context: http://www.nabble.com/Multiple-submit-buttons-in-a-single-JSP-tp15334087p15334087.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Is Multiple Forms(s:form) in one Jsp possible?
--- Thomas Ramapuram <[EMAIL PROTECTED]> wrote: > I just wanted to know if it is possible to have multiple s:form in one > jsp. Each of the forms submit to a diffrent action. > > The problem I faced is that. If I place multiple forms in one jsp. The > initials forms closing tags are commented out when the tag is rendered. > Is this expected behaviour or is it a bug. I can't reproduce this; I have many pages with multiple forms. Including a source code snippet might be helpful. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts2, collection of objects and JSP
Piotr Falenczyk <[EMAIL PROTECTED]> wrote: > I need to display all the names of Imports, and allow to edit every one of > them in one page. What I do now is somethin like that ion JSP. Displaying > values work just fine, but I canno't change them (not stored back in the > session) > > > > > One way is to the "status" attribute to your tag and use it in your tag as part of the name: that as the index in your 's name value. (The syntax may be a bit off, but that's the idea.) Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts2 sesionExpired page
In addition to the other suggestions posted you can also call the request's isValidSessionId() method (or something like that). Dave --- "jignesh.patel" <[EMAIL PROTECTED]> wrote: > > Hi, > I am having struts2 application with hibernate + mysql.I want to create > web app session Expired page,but i am not able to detect weather my > application session expired or not. > > I have given session time out to 1 min also but it still displays active > session. > > 1 > > > My SessionChecking interceptor looks like:- > > public class SessionExpired implements Interceptor { > public void destroy() { > LOG.info("..destroy"); > } > > public void init() { > LOG.info("..init"); > } > > public String intercept(ActionInvocation actionInvocation) throws > Exception { > Map session = actionInvocation.getInvocationContext().getSession(); > if(session == null) { >LOG.info("..interce if"); > } > else { > LOG.info("..interce else"); > } > return actionInvocation.invoke(); > } > } > > After 1..2...3...5 min it still logging ("..interce else"). > > Do anyone know how can i detect my application session time out or not ? > > Thanks & regards > jignesh > -- > View this message in context: > http://www.nabble.com/Struts2-sesionExpired-page-tp15328299p15328299.html > Sent from the Struts - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: STRUTS 2: File tag problem
--- [EMAIL PROTECTED] wrote: >private String fileName;//this is the FULL pathname with filename Depending on the browser this may or may not have the full pathname. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Is Multiple Forms(s:form) in one Jsp possible?
Hi, I just wanted to know if it is possible to have multiple s:form in one jsp. Each of the forms submit to a diffrent action. The problem I faced is that. If I place multiple forms in one jsp. The initials forms closing tags are commented out when the tag is rendered. Is this expected behaviour or is it a bug. Thanks in advance. Regards, Thomas Ramapuram. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Is Multiple Forms(s:form) in one Jsp possible?
Hi, I just wanted to know if it is possible to have multiple s:form in one jsp. Each of the forms submit to a diffrent action. The problem I faced is that. If I place multiple forms in one jsp. The initials forms closing tags are commented out when the tag is rendered. Is this expected behaviour or is it a bug. Thanks in advance. Regards, Thomas Ramapuram. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Do you know ?
I miss the killer scam letter :-) Antonio 2008/2/7, Jose Cardoso <[EMAIL PROTECTED]>: > > > > Hi there ! > > > I have just visited this page : > http://www.easyuktest.co.uk/Yagoogle.html > > Is it OK to use a company name this way ? > > > * > Working Together for a Better Tower Hamlets > Web site : http://www.towerhamlets.gov.uk > > London Borough of Tower Hamlets E-Mail Disclaimer. > > This communication and any attachments are intended for the addressee > only and may be confidential. It may contain privileged and confidential > information and if you are not the intended recipient, you must not copy, > distribute or take any action in reliance on it. If you have received this > E-Mail in error please notify us as soon as possible and delete this E-Mail > and any attachments. This message has been checked for viruses, however we > cannot guarantee that this message or any attachment is virus free or has > not been intercepted or amended. The information contained in this E-Mail > may be subject to public disclosure under the Freedom of Information Act > 2000. Unless the information is legally exempt from disclosure, the > Confidentiality of this E-Mail and your reply cannot be guaranteed. > > If your request relates to a Freedom of Information enquiry, please resend > this to [EMAIL PROTECTED] > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
RE: STRUTS 2: File tag problem
Hi Martin, Thanks for the reply. I didnt quite get what you are trying to say. My code is exactly similar to the example you given except the implementation for method "public File getUpload()". In your example it return SUCCESS and ERROR which are strings but it should return File. I have only one line "return dc". Please help if I am missing something here. I tried to give some logic to getFileName() and getDc() (=getUpload()) methods but the issue is still there, if crap is typed into file field - nothing happens when submit is clicked. Regards, Srikanth -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, 7 February 2008 1:50 PM To: Struts Users Mailing List Subject: Re: STRUTS 2: File tag problem Hi Sri so if the config is configured something like /WEB-INF/classes/struts-fileupload.xml uploadSuccess.jsp uploadError.jsp and the jsp defines the acceptable content-type and a name to call it.. org.apache.struts2.portlet.example.fileupload.FileUploadAction.java { private String fileName;//this is the FULL pathname with filename // since we are using the file name will be obtained through getter/setter of FileName public String getUploadFileName() { return fileName; } public void setUploadFileName(String fileName) { this.fileName = fileName; } // since we are using the File itself will be obtained through getter/setter of public File getUpload() { java.io.File file; try { //try to create the file with the previously provided filename file= new java.io.File( filename ); } catch(java.lang.NullPointerException excp) { return ERROR; } if(file.canRead()) return SUCCESS; else return ERROR; } public void setUpload(File upload) { this.upload = upload; } } I didnt test with the templateDir attribute.. HTH/ M- - Original Message - Wrom: FPEGAUTFJMVRESKPNKMBIPBARHDMNNSKVFVWRKJVZC To: "Struts Users Mailing List" Sent: Wednesday, February 06, 2008 8:50 PM Subject: STRUTS 2: File tag problem Hello, I am using file tag works fine if a file is selected using browse button or the path is entered manually. But if file name/path is rubbish the form is not submitted at all, nothing happens. 1. How do I control this - show error like invalid filename? 2. Or else how to disable manual entry, only browse button works??? 3. I tried javascript options like onKeypress to reset value to null - didnt help. Please help. Regards, Srikanth < s:form action = "/createEnt2.do" method = "POST" enctype = "multipart/form-data" validate = "true" > s:form action = "/createEnt2.do" method = "POST" enctype = "multipart/form-data" validate = "true" > < s:file name = "dc" id = "dc" accept = "text/*" label = "Digital Certificate" onkeydown = "return reset1();" /> < s:file name = "dc" id = "dc" accept = "text/*" label = "Digital Certificate" onkeydown = "return reset1();" /> function reset1() reset1() { var thisForm = document.forms[0]; thisForm.dc.value = 'all' ; window.alert( "sfds" ); thisForm = document.forms[0]; thisForm.dc.value = 'all' ; window.alert( "sfds" ); 'all' ; window.alert( "sfds" ); "sfds" ); } Java ### private File dc ; private String uploadContentType ; //The content type of the file private File dc ; private String uploadContentType ; //The content type of the file private String uploadContentType ; //The content type of the file private String uploadFileName ; //The uploaded file name /** private String uploadFileName ; //The uploaded file name /** /** * @return the dc * @return the dc */ */ public File getDc() { return dc ; } /** public File getDc() { return dc ; } /** return dc ; } /** /** * @param dc the dc to set * @param dc the dc to set */ */ public void setDc(File dc) { this . dc = dc; } /** public void setDc(File dc) { this . dc = dc; } /** this . dc = dc; } /** /** * @return the uploadContentType * @return the uploadContentType */ */ public String getUploadContentType() { return uploadContentType ; } /** public String getUploadContentType() { return uploadContentType ; } /** return uploadContentType ; } /** /** * @param uploadContentType the uploadContentType to set * @param uploadContentType the uploadContentType to set */ */ public void setUploadContentType(String uploadContentType) { this . uploadContentType = uploadContentType; } /** public void setUploadContentType(String uploadContentType) { this . uploadContentType = uploadContentType; } /** this . uploadContentType = uploadContentType; } /** /** * @return the uploadFileName * @return the uploadFileName */ */ public String getUploadFileName() { return uploadFileName ; } /** public String getUploadFileName() { return uploadFileName ; } /**
Re: struts polish application
What You need to do, is to set correct page coding. It can be ISO-8859-2 or UTF-8 Best regards Piotr Falenczyk raghuveerv wrote: > > I have an application that needs to show messages coming from SAP in > polish > language. > > > > What would be the changes in need to do for my web.xml,struts config.xml > and > jsp pages.. > > Certain polish fonts were corrupted and shown question marks.. > > Please advice > > > -- View this message in context: http://www.nabble.com/struts-polish--application-tp15327706p15332072.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts2, collection of objects and JSP
Hello I have a following problem I have an action defined, let's say: public class SomeAction extends ActionSupport implements SessionAware{ private Map sessionMap; @Override public String execute() throws Exception { return SUCCESS; } public void setSession(Map map) { this.sessionMap = map; } public long getSideId() { return sideId; } public List getImports() { return (List)sessionMap.get("imports"); } public void setImports(List imports) { sessionMap.set("imports", imports); } } The Import class is a simple POJO public class Import extends Serialicable { private String name; public String getName() { return name; } public void setName(String name) { this.name = name; } } I need to display all the names of Imports, and allow to edit every one of them in one page. What I do now is somethin like that ion JSP. Displaying values work just fine, but I canno't change them (not stored back in the session) What I know is that I need to set for name of every textfield "imports[index_in_list].name" in order to make it work, but how can I do it? Thanks for help in advance Piotr Falenczyk -- View this message in context: http://www.nabble.com/Struts2%2C-collection-of-objects-and-JSP-tp15331960p15331960.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts2 sesionExpired page
Hi, I recommend to you should see *SessionInactivityFilter *on* * http://javawebparts.sourceforge.net/ page for page rejection and forwarding for session inactivity. However you must see to *HttpSessionListener *for created and destroyed sessions. Sample SessionCaptor: /* * */ public class SessionCaptor implements HttpSessionListener { private static int activeSessions = 0; public SessionCaptor() { } public void sessionCreated(HttpSessionEvent se){ HttpSession session = se.getSession( ); session.setMaxInactiveInterval(30 * 60); activeSessions++; System.out.println("Session: " + (new Date( )).toString() + " ID:" + session.getId( ) + " - Active sessions: " + activeSessions); } public void sessionDestroyed(HttpSessionEvent se){ HttpSession session = se.getSession( ); if(activeSessions > 0) activeSessions--; System.out.println("Session Closed: " + (new Date( )).toString() + " ID:" + session.getId() + " - Active sessions: " + activeSessions); session.invalidate(); } public static int getActiveSessions() { return activeSessions; } } in *web.xml * package.SessionCaptor * *Regards. Okan. * *On Feb 7, 2008 8:50 AM, jignesh.patel <[EMAIL PROTECTED]> wrote: > > Hi, >I am having struts2 application with hibernate + mysql.I want to create > web app session Expired page,but i am not able to detect weather my > application session expired or not. > > I have given session time out to 1 min also but it still displays active > session. > >1 > > > My SessionChecking interceptor looks like:- > > public class SessionExpired implements Interceptor { >public void destroy() { >LOG.info("..destroy"); >} > >public void init() { >LOG.info("..init"); >} > >public String intercept(ActionInvocation actionInvocation) throws > Exception { >Map session = actionInvocation.getInvocationContext().getSession(); >if(session == null) { > LOG.info("..interce if"); >} >else { >LOG.info("..interce else"); >} >return actionInvocation.invoke(); >} > } > > After 1..2...3...5 min it still logging ("..interce else"). > > Do anyone know how can i detect my application session time out or not ? > > Thanks & regards > jignesh > -- > View this message in context: > http://www.nabble.com/Struts2-sesionExpired-page-tp15328299p15328299.html > Sent from the Struts - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
Do you know ?
Hi there ! I have just visited this page : http://www.easyuktest.co.uk/Yagoogle.html Is it OK to use a company name this way ? * Working Together for a Better Tower Hamlets Web site : http://www.towerhamlets.gov.uk London Borough of Tower Hamlets E-Mail Disclaimer. This communication and any attachments are intended for the addressee only and may be confidential. It may contain privileged and confidential information and if you are not the intended recipient, you must not copy, distribute or take any action in reliance on it. If you have received this E-Mail in error please notify us as soon as possible and delete this E-Mail and any attachments. This message has been checked for viruses, however we cannot guarantee that this message or any attachment is virus free or has not been intercepted or amended. The information contained in this E-Mail may be subject to public disclosure under the Freedom of Information Act 2000. Unless the information is legally exempt from disclosure, the Confidentiality of this E-Mail and your reply cannot be guaranteed. If your request relates to a Freedom of Information enquiry, please resend this to [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[Struts2.011] Best approach for limited view
Please give me advices what would be the best approach in the struts 2 world to realize a limited view (authorization). In struts 1 I would have created a simple tag which is able to render it childs dependent on authorization of user, something like: ... some content ... Is there a better / more elegant / more flexible alternative in struts2? Thank you very much in advance Basti -- View this message in context: http://www.nabble.com/-Struts2.011--Best-approach-for-limited-view-tp15331144p15331144.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: struts polish application
hi, where do you have these messages? is it in the .properties file? if its in a property file i think it should be in UTF-8 and your jsp page charset also should be in UTF8 Thanks, Nuwan (http://code.google.com/p/struts2-ssl-plugin/) Raghuveer wrote: I have an application that needs to show messages coming from SAP in polish language. What would be the changes in need to do for my web.xml,struts config.xml and jsp pages.. Certain polish fonts were corrupted and shown question marks.. Please advice - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts2 sesionExpired page
Hi, Why dont you check for a particular attribute you have added to the session in your interceptor. eg:- when a user login you add the attribute logedin to true. session.setAttribute("logedin","true"); and in the incerceptor you check if its there or null, if its not there or null that means the session has expired. Thanks, Nuwan (http://code.google.com/p/struts2-ssl-plugin/) jignesh.patel wrote: Hi, I am having struts2 application with hibernate + mysql.I want to create web app session Expired page,but i am not able to detect weather my application session expired or not. I have given session time out to 1 min also but it still displays active session. 1 My SessionChecking interceptor looks like:- public class SessionExpired implements Interceptor { public void destroy() { LOG.info("..destroy"); } public void init() { LOG.info("..init"); } public String intercept(ActionInvocation actionInvocation) throws Exception { Map session = actionInvocation.getInvocationContext().getSession(); if(session == null) { LOG.info("..interce if"); } else { LOG.info("..interce else"); } return actionInvocation.invoke(); } } After 1..2...3...5 min it still logging ("..interce else"). Do anyone know how can i detect my application session time out or not ? Thanks & regards jignesh - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts2 + FCKEditor
Hi All, I am trying to get FCKEditor work with Struts2. I have read that some poeple on list were making a Struts2 plugin for the same. Does the plugin exist? Thanks, Shantur
Re: [STRUTS2] Error in Dojo / Howto update Dojo
Hi Richard, I am also trying to integrate FCKEditor in Struts2. Did you make any plugin for it? I was going through Struts2 Mailing Lists and found that some people were making a plugin for the same a few months back. -Shantur On Jan 29, 2008 2:10 PM, Julien RICHARD <[EMAIL PROTECTED]> wrote: > I use Struts 2.0.11 and i have an dojo error when i wants to used > textearea > with Ajax theme (this create an richtext box).* > After little research, this is an bug in dojo resolved in 2007/11. > Dojo works perfectly for other features in my code, so i need to update > the > dojo in the struts core. > Currently i have integrated FCKEditor instead. > > Regards, > > On Jan 29, 2008 6:37 AM, ravi_eze <[EMAIL PROTECTED]> wrote: > > > > > which version are u using?? > > > > i think u are getting error like dojo not defined. If yes then read the > > following > > > > u need to make dojo available do the following steps: > > > > 1. explode struts core.jar > > 2. create a folder in the war : struts > > 3. search for ajax,dojo,niftycorners,simple,xhtml in the exploded jars > > (step > > 1) > > 4. copy them all into the struts folder (step 2) > > > > start teh tomcat. > > > > view sourcet the page u are tring to use.. u will see the js files its > > tryuing to fetch from the server.. the above steps make sure that they > all > > exist on the server.. > > > > hope this helps. > > > > ravi > > > > > > Julien RICHARD-2 wrote: > > > > > > Hi, > > > > > > I'm new in the mailing list, so hi to all users. > > > Little presentation : french java struts2 developer. > > > > > > I have a question. I want to use richtext box with dojo (textarea > > > theme="ajax") but i cant. In fact, the embedded version of dojo have a > > > error > > > and i need to update the dojo version. How can i make this with > "simple" > > > operation ? > > > > > > Thanks for your answers. > > > > > > > > > > -- > > View this message in context: > > > http://www.nabble.com/-STRUTS2--Error-in-Dojo---Howto-update-Dojo-tp15132308p15152849.html > > Sent from the Struts - User mailing list archive at Nabble.com. > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > -- > RICHARD Julien, > UNILOG >