Le 25 mai 04, � 15:55, Jason Shindler a �crit :

Hello,
I wish to email the contents of a page from inside of my Jetspeed
portlet. The page requires authentication, so I'm passing the current
session's JSESSIONID as a cookie so my program can be authenticated. For
some reason this is not working:


<snip code>

The code requests the page, but returns a login screen instead of the page I want. I believe it is somehow ignoring the cookie, but can't put my finger on why. Any ideas?


I'm not sure exactly how you have constructed your email module but I would
strongly advise you *against* using sub-HTTP connections to generate your
mail messages.


Since you seem ti be able to rely on the user session, your code is probably
called during a user request, in which case Jetspeed will have populated
the RunData object with all the necessary context.


Then define a custom velocity template for your mail and in this template use
$jetspeed.getPane(pagename). It should work but you will want to save
the Profile stored in rundata before rendering the velocity template and restore
it after because $jetspeed.getPane() will set the page globally for the request.


Make sure to take a look at

src/java/org/apache/jetspeed/util/template/JetspeedTool.java
webapp/WEB-INF/templates/vm/screens/html/Home.vm

to have a better idea of what you can do with this JetspeedTool (viewed as
$jetspeed in Velocity templates)


--
Rapha�l Luta - [EMAIL PROTECTED]
Apache Jetspeed - Enterprise Portal in Java
http://portals.apache.org/


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



Reply via email to