06-29-06 12:21 AM
Hello, fellows.
I'm trying to implement a file download functionality in an IBM Struts Portl
et. I've read several posts on the subject and I decided to go to the servle
t option. However, I've not found any tested and reliable code that does tha
t and I've not even success
fully generate the URL to the servlet. It's been 3 days and no luck!
This is my progress so far:
I was able to add the servlet to my portlet project. Code fragment in the We
b.xml:
<web-app id="WebApp">
..
<servlet id="Servlet_2">
<servlet-name>FileDownloadServlet</servlet-name>
<display-name>FileDownloadServlet</display-name>
<servlet-class>com.gedas.omegaq.docmgr.servlet.FileDownloadServlet</servlet-
class>
</servlet>
..
<servlet-mapping>
<servlet-name>FileDownloadServlet</servlet-name>
<url-pattern>/FileDownloadServlet</url-pattern>
</servlet-mapping>
Note: The webapp is the same that contains the WpsStrutsPortlet.
And in my JSP I coded the following:
<html:link page='<%=response.encodeURL("FileDownloadServlet")%>'>A File</htm
l:link>
The generated URL stills contains portlet context and therefore it doesn't r
each the servlet:
http://localhost:9081/wps/myportal/!ut/p/_s.7_0_A/7_0_16IE/.cmd/ad/.ar/sa.sp
f_ActionListener/.c/6_0_16FA/.ce/7_0_16IG/.p/5_0_16C5/.d/2?PC_7_0_16IG_spf_s
trutsAction=%212f. OMQ_PSA_Definition%212fFileDownloadServl
et#7_0_16IG
I've read in a topic that the request and response objects should not be the
portlet ones but I've not found any reference on how to do that.
Any help or reference will be enormously appreciated.
Best regards!
[ Post a follow-up to this message ]
|