• 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
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

servlet calling xhtml file

 
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
I am very new to learning servlet/jsp's. i have a very basic question which i am not able to get through. My aim is that i want to get the list of items. For this my servlet calls the xhtml to do this. But when i get the output from the servlet...it is actually the code of the xhtml file(it is not the output that xhtml file that it is suppose to give). i get the output as code of the xhtml file if i directly hit the xthml file from the browser.

i believe there's some setting to be done in the browser.....

help appreciated
cheers
amal shah
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
set contentType as "application/xhtml+xml" to enable xhtml
 
amal shah
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
setContentType did not made any difference......

even if i directly call the xhtml file from browser it shows the code written in the xhtml file and not the actual output thatit is suppose to show......

help appreciated
cheers
amal shah
 
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How are you 'calling' the XHTML page?
 
amal shah
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
http://localhost:8080/Airtel/product.xhtml?cat=illustrations....

is there some setting to be done in the browser....


help appreciated
cheers
amal shah
 
Tarun Yadav
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I meant how are you trying to invoke the page from your servlet? I would expect you're using RequestDispatcher.include()?
 
amal shah
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator



this is the code which i apply for calling xhtml from servlet

help appreciated
cheers
amal shah

[BPSouther: Narrowed the code to make the thread more legible]
[ October 24, 2007: Message edited by: Ben Souther ]
 
Sheriff
Posts: 67694
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
What are you actually trying to accomplish?

The code you have written will do exactly what you describe: obtain the source code for the xhtml resource.

If you want to do something else, you'll need to let us know what that is so we can point you in the right direction.
 
Bear Bibeault
Sheriff
Posts: 67694
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

even if i directly call the xhtml file from browser it shows the code written in the xhtml file

What URL are you using to hit the file? Are you sure that your xhtml file is properly formatted?
 
reply
    Bookmark Topic Watch Topic
  • New Topic