struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bryan Tartt (JIRA)" <j...@apache.org>
Subject [jira] Updated: (WW-3339) Form data lost (null) when using post method with Internet Explorer 7. Get method works fine and post works fine with Firefox.
Date Tue, 01 Dec 2009 14:16:13 GMT

     [ https://issues.apache.org/struts/browse/WW-3339?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Bryan Tartt updated WW-3339:
----------------------------


Ended up being an IE bug with authentication.  See http://support.microsoft.com/?id=251404

> Form data lost (null) when using post method with Internet Explorer 7.  Get method works
fine and post works fine with Firefox. 
> --------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: WW-3339
>                 URL: https://issues.apache.org/struts/browse/WW-3339
>             Project: Struts 2
>          Issue Type: Bug
>    Affects Versions: 2.1.8
>         Environment: Tomcat 5.5.28 on IBM ISeries, IE 7, Struts2, Java 5
>            Reporter: Bryan Tartt
>            Assignee: Bryan Tartt
>
> Every form that I have created has a problem retrieving data (returns null) in the Action
when using Internet Explorer 6 and form method is post.  I have not tested against other versions
of IE but FireFox works without any problems.  When I use get as the form method, the data
is passed in IE and FireFox.  I don't know if this is an IE and ISeries issue or a Struts
configuration (Interceptors) problem.  I have been searching for an answer on this problem
for weeks without any luck. 
> form
> <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"
%>
> <%@ page import="com.expensereport.*" %>
> <%--@ page errorPage="/ExpRepErrorHandler.jsp" --%>
> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
> <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
> <%@ taglib prefix="s" uri="/struts-tags" %>
> <%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
> <html>
> 	<head>		
> 		<title>Expense Reports</title>
> 		<sx:head />
> 		<script type="text/javascript" src="HeaderScript.js"></script>
> 		<link rel="stylesheet" href="<s:url value="styles/ExpRepStyles.css"/>" type="text/css">
> 		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
> 		
> 	</head>
> <body topmargin=0 leftmargin=0 bgproperties="fixed" onLoad="checkBrowser()">
> <s:fielderror />
> <s:form name="ReceiptForm" id="ReceiptForm" action="Receipt_upload" method="POST"
validate="true" enctype="multipart/form-data" theme="simple" >
> 	<table align="center">
> 		<tr bgcolor="#003366"><td colspan="2" style="color:white">Receipt Upload</td></tr>
> 		<tr>			
> 		   <s:if test='%{#session.er.erh.reportID eq ""}'>
> 			<td><s:file name="receipt" id="receipt" size="30" disabled="true" /></td>
> 			<td><s:submit name="submit" id="submit" value="Upload Receipt" disabled="true"
/></td>
> 		  </s:if>
> 		  <s:else>
> 			<td><s:file id="receipt" name="receipt" size="30"/></td>
> 			<td><s:submit name="submit" id="submit" value="Upload Receipt" /></td>
> 		  </s:else>
> 		</tr>
> 	</table>
> </s:form>
> </body>
> </html>
> struts.xml
> <!DOCTYPE struts PUBLIC
>     "-//Apache Software Foundation//DTD Struts Configuration 2.1.7//EN"
>     "http://struts.apache.org/dtds/struts-2.1.7.dtd">
> <struts><!-- Configuration for the default package. -->
> 	<package name="expensereport" extends="struts-default">	
> 		
> 		<default-interceptor-ref name="defaultStack"/> 		
> 		
> 		<!--  Global results -->
> 		<global-results>
> 			<result name="bad">/ExpRepBadQueue.jsp</result>
> 			<result name="login">/index.html</result>
> 			<result name="error">/ExpRepBadQueue.jsp</result>
> 		</global-results>
> 		<global-exception-mappings>
> 			<exception-mapping exception="java.lang.Exception" result="bad"/>
> 		</global-exception-mappings>
> 		
> 	<!-- actions -->		
>         <action name="Receipt_upload" class="com.expensereport.ReceiptUpload">

>         	<interceptor-ref name="fileUploadStack"/>
> 	        <interceptor-ref name="basicStack"/>
>         	<result>/ExpRepEntry.jsp</result>
>         	<result name="input">/ExpRepEntry.jsp</result>
>         </action>
>         <action name="ModifyReport" class="com.expensereport.ExpenseReportModify">
>         	<result>/ExpRepEntry.jsp</result>
>         </action>
>         <action name="ReportDelete" class="com.expensereport.ReportDelete">
>         	<result name="confirm">/ExpRepDeleteConfirmation.jsp</result>
>         	<result name="success" type="redirectAction">
>         		<param name="actionName">/ReportQueue</param>
>         		<param name="queueOwner">EMPLOYEE</param>
>         		<param name="queueType">ALL</param>
>         	</result>
>         </action>  
>         <action name="AttendeeInfo" class="com.expensereport.AttendeeInfo">
>         	<result>/AttendeeInput.jsp</result>
>         </action>    
>         <action name="AjaxRemoteForm" class="com.expensereport.AjaxRemoteForm">
>         	<result>/AjaxRemoteForm.jsp</result>
>         </action>
> 	</package>	
> </struts>
> Action
> package com.expensereport;
> import java.io.BufferedReader;
> import java.io.File;
> import java.io.FileInputStream;
> import java.io.FileNotFoundException;
> import java.io.FileOutputStream;
> import java.io.FileWriter;
> import java.io.IOException;
> import java.util.HashMap;
> import java.util.Iterator;
> import java.util.List;
> import java.util.Map;
> import javax.servlet.http.HttpServletRequest;
> import javax.servlet.http.HttpServletResponse;
> import org.apache.commons.fileupload.FileItem;
> import org.apache.commons.fileupload.FileItemFactory;
> import org.apache.commons.fileupload.FileUploadException;
> import org.apache.commons.fileupload.FileUploadBase.SizeLimitExceededException;
> import org.apache.commons.fileupload.disk.DiskFileItemFactory;
> import org.apache.commons.fileupload.servlet.ServletFileUpload;
> import org.apache.commons.fileupload.servlet.ServletRequestContext;
> import org.apache.struts2.ServletActionContext;
> import org.apache.struts2.dispatcher.multipart.MultiPartRequestWrapper;
> import org.apache.struts2.interceptor.ServletRequestAware;
> import org.apache.struts2.interceptor.ServletResponseAware;
> import org.apache.struts2.interceptor.SessionAware;
> import com.expensereport.EasyLog;
> import com.opensymphony.xwork2.ActionContext;
> import com.opensymphony.xwork2.ActionSupport;
> import com.opensymphony.xwork2.Preparable;
> public class ReceiptUpload extends ActionSupport implements SessionAware, Preparable
{
> 	
> 	/**
> 	 * 
> 	 */
> 	private static final long serialVersionUID = -2387150538575396408L;
> 	private File file;
> 	private String contentType;// The content type of the file
> 	private String fileName;// The uploaded file name and path
> 	private Map session;
> 	EasyLog log = new EasyLog();	
> 		
> 	
> 	public String execute(){
> 		
> 				
> 			getReceiptContentType();
> 			log.info("receiptContentType = " + contentType);
> 			getReceiptFileName();
> 			log.info("receiptFileName = " + fileName);
> 			getReceipt();		
> 			log.info("Receipt getName = " + file.getName());
> 					
> 			session = ActionContext.getContext().getSession();	 
> 			String reportID = "0000000";
> 			
> 			ExpenseReport er = (ExpenseReport) session.get("er");
> 			log.info("reportID = " + er.getErh().getReportID());
> 			
> 			if ((er.getErh().getReportID() == null) || (er.getErh().getReportID().trim().length()
< 1)){
> 				er.getErh().setReportID(reportID);		
> 			}
> 			
> 			if (file != null){
> 				log.info("Creating a new file");
> 				boolean renamed = file.renameTo(new File("/home/tomdev/ObjectCache/Expense Reports/"
+ fileName));
> 			} else {
> 				log.error("Attachment was null");
> 			}
> 			
> 			log.info("return success");
> 			return SUCCESS;
> 	}
>        public void prepare() throws Exception {
> 		
> 	}
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message