• 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 <Head><Title> not showing the title

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, is there a reason why my title is not visible on the page?



only Testing Servlet is shown
 
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Don't use "\n" ,it will not work.

You are using "println()" for writing in a new line.
 
Sonx Nkuks
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ankit Tripathi wrote:Don't use "\n" ,it will not work.

You are using "println()" for writing in a new line.



Any character in Java has to be a string enclosed with double quotes
 
Sonx Nkuks
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ankit Tripathi wrote:Don't use "\n" ,it will not work.

You are using "println()" for writing in a new line.



I've removed all the '\n' but still get the same results
 
Ankit Tripathi
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Any character in Java has to be a string enclosed with double quotes



Most probably I am aware of this thing.........

Line saparators are dependent of OS and are different in case of different OSs and are stored as system properties.
You can use System.getProperty("line.separator"); to find the the Line-Saparator specific to that OS.
put \n in single quotes and use it like that <html>+'\n'.
Windows programs often process a '\n' separated text file correctly but there are some exceptions.

If it'll not work-
try this-

String ls=System.getProperty("line.separator");

out.println("<html>"+ls+"<head>");

it should work.....
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HTML is completely oblivious of the type of line ending being used - it's all just whitespace, and interpreted as a single space. So that has nothing to do with the problem.
 
Sonx Nkuks
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:HTML is completely oblivious of the type of line ending being used - it's all just whitespace, and interpreted as a single space. So that has nothing to do with the problem.



Ulf do you perhaps know what could be the problem?
 
Ranch Hand
Posts: 54
Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@sonx your code worked perfectly for me, Object ut in your code is of what type ? I removed those two statements alone..
 
Sonx Nkuks
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Deepakkumar Devarajan wrote:@sonx your code worked perfectly for me, Object ut in your code is of what type ? I removed those two statements alone..





mhh, so the Title BATCH OVERRIDE LIST is displayed? strange
 
Deepakkumar Devarajan
Ranch Hand
Posts: 54
Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yeah it works. I used IE7 to view the page.
 
Bartender
Posts: 543
4
Netbeans IDE Redhat Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Sonx Nkuks wrote:Hi, is there a reason why my title is not visible on the page?


only Testing Servlet is shown


You do realize that the <title> tag in the <head> section shows the title on your browser window, and nothing on your page? you use <H1> etc. for page titles, <title> is just for your browser's title bar.
 
I'm a lumberjack and I'm okay, I sleep all night and work all day. Lumberjack ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic