Problem getting the Beer Selection Page screen shot
a alph
Ranch Hand
Joined: Nov 18, 2008
Posts: 36
posted
0
Hi,
I am trying to do the Beer Selection Program in page 77 (HFSJ book).
When I type http://localhost:8080/Beer-v1/form.html in my browser, I only get the html file and not the actual screen shot.
I searched the forum for this type of problem and I couldn't solve it.
I don't see any problem with your code, even i copy paste all your code and created new web app using eclipse and deployed it to my local tomcat and its working perfect.
Are you telling us that your browser is actually rendering that html as a text in your browser i.e. instead of parsing it, just showing it as you opened that html file in notepad??
a alph
Ranch Hand
Joined: Nov 18, 2008
Posts: 36
posted
0
Yes, it is showing it as you open a html file as a text.
Just out of curiosity, have you tried going to the folder where you have kept your html page and tried double-clicking it? Does it open in the browser like an html page or does it open like a text version of an html file?
a alph
Ranch Hand
Joined: Nov 18, 2008
Posts: 36
posted
0
I tried going to the folder and double click on the html file, it brings up the text page of the form.html
I don't know what else can I do to get the actual result.
I think your browser has gone insane, I copied the HTML that you posted and created an HTML file and put the code in it and opened it in the browser and I got the page properly. Try a different browser. Also are you sure you copied the whole code of form.html here??
Chinmaya Chowdary
Ranch Hand
Joined: Apr 21, 2008
Posts: 432
posted
0
Hi, Alph.
Have you created or modified <mime-mapping> element in default 'web.xml' in conf/web.xml that relates to 'html' files or have you overriden in 'Beer-v1' application?
Chinmaya that doesn't matter as the browser is opening the html file as text even if opening the html file from the windows explorer. So either there is something wrong with the markup of the page or character set of the page (maybe) or the browser...
Can you please re check the extention of the file? It should be .html.
If you are creating a html file using notepad then the possibility is that you have saved it as html file but if you do not select "all" for "save as type" drop down and do not enclosed the name of the file in double quotes then notepad will add a .txt extention to the file and browser will render that file as as a normal text file.
a alph
Ranch Hand
Joined: Nov 18, 2008
Posts: 36
posted
0
Thanks Harpreet.
I created again those files using notepad and saved it like you said. (Before I didn't use notepad to create these files).
Then only I noticed, the web.xml file was saved as web.html. May be this was the problem.
Now it works fine. Thanks again.