File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Servlets-HTML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlets-HTML" Watch "Servlets-HTML" New topic


Joe Lopes

Joined: Dec 27, 2000
Posts: 4
Is there is anyway to pass a parameters/data to HTML page. I am using response.sendRedirect() in my servlet pgm and wanted to pass the data to my redirect HTML page.
Thanks a Lot
Yuriy Fuksenko
Ranch Hand

Joined: Feb 02, 2001
Posts: 413
You could add "?paramName=value" to the end of your request, and than get this value using javascript.
or you can use JSP instead of HTML and pass parameters using request or session
or use something else...
Ashwin Tadepalli

Joined: Feb 01, 2001
Posts: 27
Hi Joe;
You could use a simple HTML utility package for this provided by some vendor(esp if you want show the results(result set) of the servlet fetched from the database in a HTML page).Let me know if you are interested.
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Hello everybody,
I am facing a problem similar to Joes , and the problem is....
.I need to call an html page from a servlet which is in shared drive in a LAN. I have tried response.sendRedirect and url openConnection .But both seems not to be working.Please let me know a possible alternative.
If any body can give details of the similar discussions earlier..
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4351

I would use JSP but I am fortunate in having a servlet container. I think Yuriy is right you can do it in javascript too. But javascript is not my strong suit.
Wait you said you have servlets, so just use JSP. It is just an html page with java code inside tags.
I have a JSP page that is just an html page with this one extra line:
<p>Are you sure thats all you want <%= request.getParameter("name") %>?
It is called by a servlet generated page:
"<input type='button' value ='Go To Checkout' onClick=\"parent.location='" + name + "'\">
[This message has been edited by Randall Twede (edited February 13, 2001).]

Visit my download page
Frank Carver

Joined: Jan 07, 1999
Posts: 6920
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at . We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please choose a new name which meets the requirements.

Read about me at ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
I agree. Here's the link:
subject: Servlets-HTML
It's not a secret anymore!