Hi,

not to forget: in the action you have to return null (return(null);) when 
you will service the request completely within the action.

good luck
Alexander

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 27, 2001 5:01 PM
To: [EMAIL PROTECTED]
Subject: RE: How to send output from Action directly to user


1: You can get data source in your action class :
   DataSource ds =
(DataSource)servlet.getServletContext().getAttribute(Action.DATA_SOURCE_KEY)
;
2: You can use response's PrintWriter to display your out to the user
directly.


-----Original Message-----
From: Maciej Kolodziej [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 27, 2001 10:55 AM
To: Struts Users Mailing List
Subject: How to send output from Action directly to user


Hi,

I  need  a servlet which gets an id as parameter in request, uses it to
fetch  file  location  from a database and sends the file to the user.
Plus  I want the servlet to get DataSource from Action class servlet
field like:

javax.sql.DataSource dataSource = servlet.findDataSource(null);

My question is is it possible to send output from Action directly to a
user,  without redirecting to any jsp's? Other way to do that would be
to  use ordinary servlet, but how can I get the DataSource which is in
struts configuration then?

-- 
Best regards,
Maciej

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to