wood burning stoves 2.0*
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


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlets-HTML" Watch "Servlets-HTML" New topic
Author

Servlets-HTML

Joe Lopes
Greenhorn

Joined: Dec 27, 2000
Posts: 4
Hi,
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
Greenhorn

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.
Ashwin
Anonymous
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..
thanks
Randall Twede
Ranch Hand

Joined: Oct 21, 2000
Posts: 4347
    
    2

Joe,
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='http://javaguy.yi.org/examples/LastChance.jsp?name=" + name + "'\">
[This message has been edited by Randall Twede (edited February 13, 2001).]


SCJP
Visit my download page
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
"cibi",
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp . 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.
Thanks.

Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Servlets-HTML