Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Servlet Interest »

Re: silent post?

Timo Neumann

2003-09-24

Replies:

wallace neikirk wrote:

Hi Wallace!

Maybe it's just the "action=logoff" in the URL?



> can anyone out there provide some insight???
>
> we have a home grown portal for our faculty & staff.
> we'd like to integrate ( in a simple way ) crystal enterprise reporting.
>
> in a simple way means ...
> * provide a link to crystal enterprise in one of our channels,
> * when clicked, we do a "silent post" to crystal with their
> userid/password,
> * then forward their ePortfolio page to a new browser window.
>
> this provides a seamless link from our portal to their set of reports :)
>
> the code i'm using is shown below, but it doesn't seem to do the trick.
> when i make the request, crystal redirects me back to its logon page :(
>

>
>   URL url;
>   URLConnection urlConn;
>   DataOutputStream   printout;
>   DataInputStream   input;
>
>   url = new
> URL("http://crystal.wright.edu/crystal/enterprise9/ePortfolio/en/logon.csp?action=logoff");


>
>   urlConn = url.openConnection();
>   urlConn.setDoInput (true);
>   urlConn.setDoOutput (true);
>   urlConn.setUseCaches (false);
>   urlConn.setRequestProperty("Content-Type",
> "application/x-www-form-urlencoded");
>
>   printout = new DataOutputStream (urlConn.getOutputStream ());
>   String content =
>    "usr="   + URLEncoder.encode(userId) +
>    "&pwd="  + URLEncoder.encode(passWd) +
>    "&aut="  + URLEncoder.encode("secEnterprise");
>   printout.writeBytes (content);
>   printout.flush ();
>   printout.close ();
>
>   ServletOutputStream out = response.getOutputStream();
>   response.setContentType("text/html");
>
>   input = new DataInputStream (urlConn.getInputStream ());
>   String str;
>   while (null != ((str = input.readLine()))) {
>    out.println(str1);
>   }
>   input.close ();
>
>   out.flush();
>   out.close();

--
F&F Computer Anwendungen     Tel: +49 89 51727-352
und Unternehmensberatung GmbH  Fax: +49 89 51727-111
Westendstr. 195           Mail: t.neumann@(protected)
D-80686 Muenchen           http://www.ff-muenchen.de

___________________________________________________________________________
To unsubscribe, send email to listserv@(protected)
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html


©2008 junlu.com - Jax Systems, LLC, U.S.A.