• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

RequestDispatcher Include

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can anyone clarify the include for me?

My understanding is that I can:


which I have in my doGet(), and that should include the order.html file:



This isn't working, so I'm wondering if my understanding is correct and I'm just implementing it wrong?
 
Sheriff
Posts: 67645
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's be much more common to forward rather than include (once the resource is included, what else would you be doing in the servlet)?

In any case, please explain "not working". It could mean anything.

Is the HTML file located in the root of the web context? That's where your path says it should be.
 
john krem
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is my setup now.


That is my start page. The user selects which item they want and it then takes me to my servlet:



In the servlet, I am populating the user inputs and creating a textbox that I want the user to be able to enter a quantity of the number of orders of each item they would like.
I have the forward working fine, where if they do not select anything, they get forwarded to the error page.

With my order.html page, I only have a button that I am trying to get to show up on the servlet. I want to use the button to calculate the quantities that the user inputs in the textboxes for each item.



My understanding is that, if I use the include, the button from the order.html should show up on the servlet page, and I can then use that button to do my calculations?
 
john krem
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Odd, it works as expected if I include a .jsp page, but not an .html page but the api says:


include(ServletRequest request, ServletResponse response)
Includes the content of a resource (servlet, JSP page, HTML file) in the response.



??

found the problem - working now.
 
reply
    Bookmark Topic Watch Topic
  • New Topic