File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes HTML (Application page) not automatically loading Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "HTML (Application page) not automatically loading" Watch "HTML (Application page) not automatically loading" New topic
Author

HTML (Application page) not automatically loading

Dan Grindstaff
Ranch Hand

Joined: Sep 24, 2006
Posts: 138
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

Joined: Jan 10, 2002
Posts: 61756
    
  67

Not getting your issue. Please explain in more detail.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Dan Grindstaff
Ranch Hand

Joined: Sep 24, 2006
Posts: 138
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

Joined: Jan 10, 2002
Posts: 61756
    
  67

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

Joined: Sep 24, 2006
Posts: 138
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

Joined: Jan 10, 2002
Posts: 61756
    
  67

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

Joined: Sep 24, 2006
Posts: 138
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

Joined: Jan 10, 2002
Posts: 61756
    
  67

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HTML (Application page) not automatically loading