Kevin,

I had to create an action class for each type of file that can be
downloaded. In my MVC setup I can map action WITH extension to the action
class. So, if extension is "do", it gets truncated, otherwise the full name
is used.  On the downside, I also need to map the designated name to the
controller servlet in the web.xml descriptor, i.e.,
    <servlet-mapping>
 <servlet-name>main</servlet-name>
 <url-pattern>*.do</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
 <servlet-name>main</servlet-name>
 <url-pattern>/report.txt</url-pattern>
    </servlet-mapping>

This works for me since I only use two file names. As an alternative, I was
also thinking about enhancing my MVC infrastructure so it would handle
multiple extensions.

Hope this helps,
Alexander Ananiev.


----- Original Message -----
From: "Duffey, Kevin" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, November 10, 2000 8:39 PM
Subject: contentType="Application" always uses the name of the jsp page (o r
action)??


> Hi..
>
> We are inacting a "download" feature on our site..where we create some
files
> dynamically, and allow people to download them.
>
> First, let me explain how we did it and see if anyone agrees.
>
> We have a MVC setup, so all requests go to a single controller servlet, it
> then calls an action class. That action class calls an EJB (or
session/logic
> class), does the logic to generate a dynamic file (in memory). We then
> populate a bean with the text, and finally forward to a JSP page. The JSP
> page is simple:
>
> <%@ page contentType="application" %>
> <jsp:useBean id="beanName" scope="session" class="..." />
> <%= beanName.getText() %>
>
>
> So..the question is..how do we use a "decided" name for the dialog that
pops
> up to save the file? Right now, it says Action.do in the file save-as
input
> box. We would like to supply a name ourselves that gets put in there.
>
> Thanks.
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to