• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

HTML (Application page) not automatically loading

 
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello, I have a serlet that is supposed to 'serve up' an html page with the application loaded. Currently I can deploy to the application server and when it starts it gives an error HTTP Status 404 - requested resource is not available. I can append the html page and bring up the application no problem and it runs fine. I tried adding the html page to web.xml welcome-file but no luck. Any ideas? TIA.
 
Sheriff
Posts: 67747
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
Not getting your issue. Please explain in more detail.
 
Dan Grindstaff
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, thanks for the quick reply. I have a servlet that should some up as http://localhost:8080/MyServlet/spallChecker.html. Currently, only http://localhost:8080/MyServlet/ comes up and the html page is left off. The html page is where I have referenced all my javascript that creates the application window. I need it to come up right away without the user having to type it in. Thanks.
 
Bear Bibeault
Sheriff
Posts: 67747
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
That makes no sense, you have a servlet OR an HTML page, not both. Which is it?

The URL with .html will not address a servlet but the HTML page.

You'll need to do a better job explaining what you need.
 
Dan Grindstaff
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are exactly right. If memory serves I can code the Html into the servlet. Am I on the right track?
 
Bear Bibeault
Sheriff
Posts: 67747
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 considered bad form to generate markup in a servlet, that's the strength of JSP.

You haven't yet revealed what it is you are really trying to accomplish. What's the purpose of "mixing" the HTML with Servlets and JSP? Why not just serve the HTML?
 
Dan Grindstaff
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Bear, thanks for the continued tips and questions. I have some javascript that creates an editor embedded in the html page. In thinking about this and your comments perhaps I need to rewrite the html page as a jsp page that 'hosts' this editor. The background, for what it's worth, is that Ajax grabs the text, passes it to the servlet, processes the stream against the Jazzy API, and passes spelling suggestions back through JSON to the page. Maybe this html business is a waste of time. Thanks, Dan.
 
Bear Bibeault
Sheriff
Posts: 67747
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
I'm still seeing no reason why this can't just be an HTML page.

Just because it is using Ajax to connect to a servlet has no ramifications for the page itself.
 
So I left, I came home, and I ate some pie. And then I read this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic