Re: Null Pointer Exception when i use execand Wait with file upload
:) Apologies package employee; import com.opensymphony.xwork2.ActionSupport; import org.apache.struts2.ServletActionContext; import javax.servlet.ServletContext; import java.io.File; /** * Created with IntelliJ IDEA. * User: love4059 * Date: 13/03/13 * Time: 8:10 PM * To change this template use File | Settings | File Templates. */ public class SingleFileUploadAction extends ActionSupport { private String description; private File attachment; private String attachmentContentType; private String attachmentFileName; private int complete = 0; public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public String getAttachmentContentType() { return attachmentContentType; } public void setAttachmentContentType(String attachmentContentType) { this.attachmentContentType = attachmentContentType; } public File getAttachment() { return attachment; } public void setAttachment(File attachment) { this.attachment = attachment; } public String getAttachmentFileName() { return attachmentFileName; } public void setAttachmentFileName(String attachmentFileName) { this.attachmentFileName = attachmentFileName; } public String upload(){ System.out.println(description); System.out.println(attachmentContentType); System.out.println(attachmentFileName); ServletContext servletContext = ServletActionContext.getServletContext(); (NULL POINTER Exception at this LINE) if (attachment != null) { // attachment will be null if there's an error, // such as if the uploaded file is too large String dataDir = servletContext.getRealPath("/WEB-INF"); System.out.println(dataDir); File savedFile = new File(dataDir, attachmentFileName); attachment.renameTo(savedFile); } return "success"; } public int getComplete() { complete += 10; return complete; } } 2013/3/16 Martin Gainty > Not much anyone can do here if we cant see the code for > employee.SingleFileUploadAction.java > > Martin > __ > Verzicht und Vertraulichkeitanmerkung > Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene > Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte > Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht > dient lediglich dem Austausch von Informationen und entfaltet keine > rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von > E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. > > > > Date: Sat, 16 Mar 2013 10:21:08 +1100 > > Subject: Null Pointer Exception when i use execand Wait with file upload > > From: stalin.pran...@gmail.com > > To: user@struts.apache.org > > > > Hello I am trying to use execandWait interceptor with fileUpload > > interceptor as below. i tried completestack in place of default and i get > > Null pointer exception. > > > > > > > method="upload"> > > > > 10 > > > > image/gif,image/jpeg,image/png > > > > > > > > > > 1500 > > > > /jsp/wait.jsp > > /jsp/SingleUpload.jsp > > > > > > > > java.lang.NullPointerException > > > org.apache.struts2.ServletActionContext.getServletContext(ServletActionContext.java:139) > > > employee.SingleFileUploadAction.upload(SingleFileUploadAction.java:58) > > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > > java.lang.reflect.Method.invoke(Method.java:597) > > > com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:446) > > > com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:285) > > > org.apache.struts2.interceptor.BackgroundProcess$1.run(BackgroundProcess.java:57) > > java.lang.Thread.run(Thread.java:680) > > > > > > > > Please advise what i can do. > > > > > > -- > > Warm Regards > > Pranava S Balugari > > > > "Keep Looking Don't Settle" > > -- Warm Regards Pranava S Balugari "Keep Looking Don't Settle"
RE: Null Pointer Exception when i use execand Wait with file upload
Not much anyone can do here if we cant see the code for employee.SingleFileUploadAction.java Martin __ Verzicht und Vertraulichkeitanmerkung Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. > Date: Sat, 16 Mar 2013 10:21:08 +1100 > Subject: Null Pointer Exception when i use execand Wait with file upload > From: stalin.pran...@gmail.com > To: user@struts.apache.org > > Hello I am trying to use execandWait interceptor with fileUpload > interceptor as below. i tried completestack in place of default and i get > Null pointer exception. > > > method="upload"> > > 10 > > image/gif,image/jpeg,image/png > > > > > 1500 > > /jsp/wait.jsp > /jsp/SingleUpload.jsp > > > > java.lang.NullPointerException > > org.apache.struts2.ServletActionContext.getServletContext(ServletActionContext.java:139) > employee.SingleFileUploadAction.upload(SingleFileUploadAction.java:58) > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > java.lang.reflect.Method.invoke(Method.java:597) > > com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:446) > > com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:285) > > org.apache.struts2.interceptor.BackgroundProcess$1.run(BackgroundProcess.java:57) > java.lang.Thread.run(Thread.java:680) > > > > Please advise what i can do. > > > -- > Warm Regards > Pranava S Balugari > > "Keep Looking Don't Settle"
Re: [ANN] Struts 2.3.12 GA release available
2013/3/15 Emi Lu : > Good morning list, > > To share with you the updates that I did for more than 300 jsp pages, in the > new version, required="false" has be removed. > > list="list_vlb" > listKey="bean_value" >listValue="bean_label" > multiple="true" > required="false" -need to be removed!!! > theme="simple" > size="6" > cssStyle="color:#6677AA;font-weight:bold;" > /> > > The highlighted red border is good. But it seems that required="false" and > required="true" returns the same warning message now :-( required attribute was renamed to requiredLabel so if you want to persist the same behaviour rename all the required="***" attributes into requiredLabel="***". Thus changes is related to conflict with HTML5 required attribute. Regards -- Łukasz + 48 606 323 122 http://www.lenart.org.pl/ - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: [ANN] Struts 2.3.12 GA release available
Good morning list, To share with you the updates that I did for more than 300 jsp pages, in the new version, required="false" has be removed. The highlighted red border is good. But it seems that required="false" and required="true" returns the same warning message now :-( All for now. Emi On 03/15/2013 04:16 AM, Lukasz Lenart wrote: The Apache Struts group is pleased to announce that Struts 2.3.12 is available as a "General Availability" release. The GA designation is our highest quality grade. Apache Struts 2 is an elegant, extensible framework for creating enterprise-ready Java web applications. The framework is designed to streamline the full development cycle, from building, to deploying, to maintaining applications over time. All developers are strongly advised to update existing Struts 2 applications to Struts 2.3.12. Struts 2.3.12 is available in a full distribution, or as separate library, source, example and documentation distributions, from the releases page. * http://struts.apache.org/download.cgi#struts2312 The release is also available from the central Maven repository under Group ID "org.apache.struts". The 2.3.x series of the Apache Struts framework has a minimum requirement of the following specification versions: * Java Servlet 2.4 and JavaServer Pages (JSP) 2.0 * Java 2 Standard Platform Edition (J2SE) 5 The release notes are available online at: * http://struts.apache.org/development/2.x/docs/version-notes-2312.html Should any issues arise with your use of any version of the Struts framework, please post your comments to the user list, and, if appropriate, file a tracking ticket.appropriate, file a tracking ticket: * https://issues.apache.org/jira/browse/WW - The Apache Struts group. Regards - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Tooltip not getting updated when radio button is changed
2013/3/15 : > if (whichANM == "2") { Maybe try === instead and whichANM is what kind of type? Did you try to use JavaScript debugger? Did you check the source code of the generated page? Is it related to Struts? Regards -- Łukasz + 48 606 323 122 http://www.lenart.org.pl/ - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
[ANN] Struts 2.3.12 GA release available
The Apache Struts group is pleased to announce that Struts 2.3.12 is available as a "General Availability" release. The GA designation is our highest quality grade. Apache Struts 2 is an elegant, extensible framework for creating enterprise-ready Java web applications. The framework is designed to streamline the full development cycle, from building, to deploying, to maintaining applications over time. All developers are strongly advised to update existing Struts 2 applications to Struts 2.3.12. Struts 2.3.12 is available in a full distribution, or as separate library, source, example and documentation distributions, from the releases page. * http://struts.apache.org/download.cgi#struts2312 The release is also available from the central Maven repository under Group ID "org.apache.struts". The 2.3.x series of the Apache Struts framework has a minimum requirement of the following specification versions: * Java Servlet 2.4 and JavaServer Pages (JSP) 2.0 * Java 2 Standard Platform Edition (J2SE) 5 The release notes are available online at: * http://struts.apache.org/development/2.x/docs/version-notes-2312.html Should any issues arise with your use of any version of the Struts framework, please post your comments to the user list, and, if appropriate, file a tracking ticket.appropriate, file a tracking ticket: * https://issues.apache.org/jira/browse/WW - The Apache Struts group. Regards -- Łukasz + 48 606 323 122 http://www.lenart.org.pl/ - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org