You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ted Husted <hu...@apache.org> on 2002/06/10 11:49:03 UTC
plz give me the solution
-------- Original Message --------
Subject: plz give me the solution
Date: Mon, 10 Jun 2002 04:14:49 -0400
From: "jayapal reddy" <pj...@lycos.com>
Reply-To: pjayapal@lycos.com
Organization: Lycos Mail (http://www.mail.lycos.com:80)
To: struts-user-owner@jakarta.apache.org,
struts-user-info@jakarta.apache.org
Q).The problem is after using the following action class for
download,there is an HourGlass remained on the screen after
download.this is happening only with ie5 on WINDOWS 98 operating system.
and on all other OS it's working fine.
This is my action class which i am using to download a file.the content
of a file is in the form of a String object.
/*
* $Id: PFDownloadAction.java,v 1.6 2002/06/06 17:21:32 jayapal Exp $
*
* Copyright (c) 2002 General Motors Corporation.
* All Rights Reserved.
*
* This software is the confidential and proprietary information of
* General Motors Corporation ("Confidential Information"). You shall
* not disclose such Confidential Information and shall use it only in
* accordance with the terms of the license agreement you entered into
* with GM.
*/
package com.gm.process.action;
import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Vector;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import COM.gm.egm.tools.PFEditor.PropFileToolManager;
import com.gm.util.PFPageLink;
import com.gm.util.PFUtil;
/**
* This action class allows the user to download the country/locale
specific
* property file.
*
* @author Jayapal Reddy (Cognizant)
* @created May 24, 2002
*/
public final class PFDownloadAction extends Action {
/**
* This method will downloads the property file to the user's disk.
*
* @param actionmapping The ActionMapping used to select this
instance
* @param actionform The optional ActionForm bean for this
* request (no form bean)
* @param request HTTPServletRequest instance
* @param response HTTPServletResponse instance
*
* @exception java.io.IOException - if an input/output error occurs
* @exception javax.servlet.ServletException - if a servlet
exception occurs
*
* @return an ActionForward instance describing where and how
control
* should be forwarded
*/
public ActionForward perform(ActionMapping actionmapping,
ActionForm actionform,
HttpServletRequest request,
HttpServletResponse response)
throws java.io.IOException,
javax.servlet.ServletException {
HttpSession session = null;
PropFileToolManager manager = null;
String final index = "index";
String forwardToPage = index;
OutputStream out = null;
try {
session = request.getSession(false);
manager =
(PropFileToolManager)session.getAttribute("manager");
out = response.getOutputStream();
}catch(Exception e){
e.printStackTrace();
forwardToPage = "failure";
return actionmapping.findForward(forwardToPage);
}
// get Forward page as of Struts-config.xml
forwardToPage = "success";
String buffer = null;
OutputStreamWriter outWriter = null;
try {
buffer = new
String(manager.download().getBytes("ISO8859_1"),"UTF8");
outWriter = new OutputStreamWriter(out, "UTF8");
}catch (UnsupportedEncodingException e){
e.printStackTrace();
forwardToPage = "failure";
return actionmapping.findForward(forwardToPage);
}
response.setContentType("application/x-binary; charset=UTF-8");
response.setHeader("Content-Disposition","attachment;
filename=\""
+request.getParameter("filename")+
"\";");
try {
outWriter.write(buffer);
outWriter.flush();
outWriter.close();
}catch (IOException e){
e.printStackTrace();
forwardToPage = "failure";
return actionmapping.findForward(forwardToPage);
}
return null;
}
}
_______________________________________________________
WIN a first class trip to Hawaii. Live like the King of Rock and Roll
on the big Island. Enter Now!
http://r.lycos.com/r/sagel_mail/http://www.elvis.lycos.com/sweepstakes
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: help me! javascript with taglib
Posted by Mark Nichols <dh...@hotmail.com>.
----- Original Message -----
From: "cello" <ce...@ramanet.it>
To: <st...@jakarta.apache.org>
Sent: Monday, June 10, 2002 9:34 AM
Subject: help me! javascript with taglib
> Can I use a taglib for my function javascript???
> Actually I use taglib <html:rewrite> for url...
> have you some ideas???
>
http://www.tuxedo.org/~esr/faqs/smart-questions.html
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
help me! javascript with taglib
Posted by cello <ce...@ramanet.it>.
Can I use a taglib for my function javascript???
Actually I use taglib <html:rewrite> for url...
have you some ideas???
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>