• 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

How to use servlets in POJO

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Hi,

Since am new to this, apologize me if my question is silly

I have created a servlet to print "Hello World" in the web page using Apache-Tomcat server.
which is working fine. My Boss wants it to be done with POJO.

How to do this with pojo

Am new to this, please help me out asap.

 
Rancher
Posts: 377
Android Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey,

I'm assuming you know what a POJO is.
This is best used in conjunction with both servlets and JSPs.
You create your POJO, set a value and add to request in servlet.
You output the value in the JSP.

Sean
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

What does he mean by that? Surely the servlet can instantiate some other Java object -that does not implement any interface- to do the work of creating the "Hello World" string for it. Is that what you're asking?
 
kirthika Mohan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks,

servlet and pojo are combined is it???

if i want to write it out in pojo can you give me the sample please.
Because am confused with the annotations they are trying to say.

 
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Kirthika Mohan wrote:servlet and pojo are combined is it???


No they're NOT combined by ANY yard of imagination! They work in conjunction.

Probably a little reading on POJO and Servlet will help you in the long run.
 
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
kirthika .......!!
pojo is just a way of separating your bussiness from your application.........so if in future if you want to change the logic you can simply go to your mvc (model view control)
.......and change the logic !!

try to refer HFJS......THAT WILL HELP YOU A LOT....its OVER COOL but fine it have all we ever wanted in a book !!!
 
reply
    Bookmark Topic Watch Topic
  • New Topic