Servlet serving Attachments
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > WebSphere > WebSphere Portal Server > Servlet serving Attachments




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Servlet serving Attachments  


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-21-05 10:55 PM

Hi,
I have a portlet which generates content and has a href link in in portletView.jsp to c
all the servlet to open the attachment in new window ( e.g : http://localhost:9080
/FileS...uth
Flag
=Y" target="_blank) This is an href link, everything works fine, the only is
sue I am having is I cann't get an attribute from Httpsession in the servlet
 it shows null.

This is what I m doing (using JSR168):
In PortletView.jsp
 ========================================
========
I create an attribute to put in the Session==> session.setAttribute("getAuth
","DVSessionTest");

 ========================================
========
In Servlet, I want to read that session attribute but I get null. Code in th
e servlet:
-----------------------------------------------------------
HttpSession  httpS = req.getSession();
String name = (String)httpS.getAttribute("getAuth");
----------------------------------------------------------
Any Help would be appreciated on how to get session attribute which is creat
ed in the Jsp which is part of the portlet and to retrieve in the servlet wh
ich runs as an independant App. I use Websphere Portal V5.1





[ Post a follow-up to this message ]



    Re: Servlet serving Attachments  


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-21-05 10:55 PM

Can I have a look at your code?





[ Post a follow-up to this message ]



    Re: Servlet serving Attachments  


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-21-05 10:55 PM

If you need a servlet code send me an email.

-DV
dvpunia@decisionlabs.com





[ Post a follow-up to this message ]



    Re: Servlet serving Attachments  


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-21-05 10:55 PM

I remember having a similar problem with passing session parameters between 
servlet and JSR 168 portlet. I think PortletSession supports two scopes for 
storing session objects Application and portlet.. Use Application scope to r
efer the variable in servle
t. I will try to search the url which explains this a little better. Hope th
is helps.





[ Post a follow-up to this message ]



    Re: Servlet serving Attachments  


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-23-05 02:02 AM

I dont know whether you solved the issue or not. Here is the JSR 168 FAQ link which exp
lains it. http://wiki.java.net/bin/view/Portl...br />
ortlet_c





[ Post a follow-up to this message ]



    Re: Servlet serving Attachments  


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-23-05 02:02 AM

Hi kss17,
No I haven't solved the problem yet. I appreciate your response and the arti
cle link. I have read the article before and I have tried that approach whic
h works fine for Portlet to Portlet communications. But what I am try to ach
ieve is, invoke a servlet
which runs in a different app but on the same server from the portlet which 
will open the attachment(e.g pdf, txt ...) in a new window, the servlet and 
portlet all works but what I need to do on the servlet side is to get some t
oken which will be stored i
n the portlet session through portlet jsp. This session thing doesn't seem t
o work between portlet and servlet.
-DV
dvpunia@decisionlabs.com





[ Post a follow-up to this message ]



    Re: Servlet serving Attachments  


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-23-05 02:02 AM

Hmm. Okay. I guess you would have tried to obtain the  HttpServletRequest fr
om PortletApiUtils and use HttpSession. Or try to cast the PortletSession to
 HttpSession in the portlet... And I also didnt look at your earlier post ca
refully... It says that you
r servlet and portlet are in different web app.. I think this may be the pro
blem.. try to put the servlet in the same webapp and if see if it works.. If
 this also dosent work then I guess you would need to migrate the servlet to
 a jsr 168 portlet..





[ Post a follow-up to this message ]



    Re: Servlet serving Attachments  


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-23-05 07:51 AM

I have installed Portal Express and a Crystal Reports Server and I think the
y solved this issue using a kind of token. Portlet does a login to the webap
p (Reports Server), obtains a token and then opens a report (similar to down
load a file).
Hope this helps. You can find the portlet sample at IBM's portlet catalog (s
earching for Crystal Reports or Business Objects).





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 07:19 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register