• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

Calling HTML Page from Servlets

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to display an HTML page from servlet depending upon request parameters received from another HTML page.What should I do?
 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!,
Just try this...
resonse.sendRedirect("test.html");
Considerations:
1. response here is your response object of HttpServlet
2. if the web server you are using to display html requires a particular path them you'll have to provide that in addition to the file name.
3. The servlet's running port if not changed is by default 8080. Check at what port your web server is serving html. you'll have to provide that in the path too.
Finally...
Suppose the site is http://www.vikinsa.com
Suppose the servlet is "BaseServlet"
So the current running path will be http://www.vikinsa.com:8080/BaseServlet
For HTMl it would be http://www.vikinsa.com/test.html
If html lies in a folder ir would be http://www.vikinsa.com/HTMLS/test.html

response.sendRedirect("

Originally posted by Indira Shukla:
I want to display an HTML page from servlet depending upon request parameters received from another HTML page.What should I do?



------------------
Vikas Aggarwal
Technology Associate
http://www.vikinsa.com
 
tumbleweed
Posts: 5089
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vikinsa as much as I appreciate you unselfish help, your user name does not comply with the JavaRanch's naming policy. Pse change it you wish to continue posting in our forums.
Thanks
 
And then the entire population worshiped me like unto a god. Well, me and this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!