Switch to full style
What's behind JSP & Servlets
Post a reply

Struts2 upload file and ajax

Tue Oct 21, 2008 8:21 pm

Hi,

I am trying to use ajax div and file control in same form.
But div is not loading properly instead it shows [object HTMLDocument]
on firefox and [object] on IE. But if I try to use them separately then
both are working fine. Anyone has has any idea what is happening ???
Here is the code
Code:
/*******************************************************************************\
******************************


<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<s:head theme="ajax" />
<link href="<s:url value="/css/campaign.css"/>" rel="stylesheet"
   type="text/css"/>
     <title>upload and ajax test</title>
</head>
<script>
  function changeApplication()

{
        dojo.event.topic.publish("change_Application");
  }
  </script>
<body>
<s:url id="updateSecondList" action="updateSecondList" />
   
    <s:actionerror />
    <s:fielderror />
     <s:form id="test_form" name="test_form" action="FileAction"
method="POST" theme="ajax" enctype="multipart/form-data">
     
         <s:select
             label="First List"
            list="firstList"
            name="selectedItem"
            onchange="javascript:changeApplication();return false;">
        </s:select>
       
        <tr>
        <td class="tdLabel"><label class="label">Second List</label></td>
        <td>
   
    <s:div showLoadingText="false"
             id="details" href="%{updateSecondList}" theme="ajax"
             listenTopics="change_Application" formId="test_form">
         </s:div>                           
        </td>
       
</tr>
       
        <s:file name="upload" label="File"/>
        <s:submit />
     </s:form>
</body>
</html>
/*******************************************************************************\
**************************/

Regards



Re: Struts2 upload file and ajax

Tue Oct 21, 2008 8:38 pm

A program is said "thread safe" if it handles properly the concurrency
issues (problems and their solutions) when using multiple threads.

"Thread Safe" means that the code will react the same no matter how many
threads are accessing the data at the same time. This can mean:
1) It is known beyond any doubt that only one thread at a time will ever
access the data.
2) There are no class (i.e., "static") variables.
3) There are class / static variables, but all code accessing them is
somehow labelled "synchronized" (which guarantees that only one thread
at a time will run the specified code).

Re: Struts2 upload file and ajax

Sun May 23, 2010 1:52 pm

Hi! Did anybody find any solution to this problem? In my case, the form itself is not getting submitted. Please help.

Post a reply
  Related Posts  to : Struts2 upload file and ajax
 upload file in ajax     -  
 JSP to Upload File     -  
 File Upload in JSP     -  
 Upload PDF file in php     -  
 Upload PHP file code     -  
 Upload File to a new directory     -  
 PHP HTML form with to file upload     -  
 Load file and update content using AJAX and JQuery     -  
 How to save a search fields...in Struts2.0     -  
 What is AJAX, How to start AJAX?     -