This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
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

HTML (Application page) not automatically loading

 
Dan Grindstaff
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • 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.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64631
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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
  • 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
Author and ninkuma
Marshal
Pie
Posts: 64631
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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
  • 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
Author and ninkuma
Marshal
Pie
Posts: 64631
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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
  • 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
Author and ninkuma
Marshal
Pie
Posts: 64631
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic