File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Redirect from servlet to html (or php) web? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Redirect from servlet to html (or php) web?" Watch "Redirect from servlet to html (or php) web?" New topic
Author

Redirect from servlet to html (or php) web?

Daniel Rodriguez Hernandez
Greenhorn

Joined: Nov 26, 2009
Posts: 13
Hi everybody..

It is my problem.. I have an applet that connects against Servlet for authentification stuff.. If authentificacion is good, I need servlet sends the ID of authentified user to the external Web.

I tried in servlet:
- RequestDispatcher.
- response.sendRedirect
even - PrintWriter out = response.getWriter(); and create an auto-submit form with javascript..

Nothing... When I runs the applet, I used it to authentify, but the servlet doesn't redirect to the new web..
Is possible that the problem was I runs an applet, so the servlet returns the form, or RequestDispatcher to that applet and not to the browser??

I could redirects from Applet, but It had security problems...

Any idea?

Thank you so much.


Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39548
    
  27
How is the applet connecting to the servlet - using (Http)URLConnection? If so, then nothing the servlet does will cause the web page to change. The applet needs to do that using Applet.showDocument. If the next web page needs parameters to work with, then those can be appended as GET parameters to the URL passed to the showDocument method.


Ping & DNS - updated with new look and Ping home screen widget
Daniel Rodriguez Hernandez
Greenhorn

Joined: Nov 26, 2009
Posts: 13
Yes, the applet connects with servlet using HttpURLConnection.

Then, I must return the control to Applet, and redirects from it, ... is it? The Servlet can't redirects.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Redirect from servlet to html (or php) web?
 
Similar Threads
Pass login from applet to new website.
Redirect back to portlet from servlet keeping same parameters
problem with RequestDispatcher
how to redirect servlet to jsp on weblogic
Connecting to a remote servlet from an unsigned applet