Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Servlets-HTML

 
Joe Lopes
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 413
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4363
2
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).]
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic