• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

new to servlets

 
andy
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can we output a grahic item onto a browser through a servlet.
I tried writing this in a servlet
out.println("<input type=button" + " name=\"B1\"" +
" value=\"Add\"" + ">");
but I dont get a button on the browser. Can somebody correct me if I am wrong somewhere.
Thanks in advance
Andy
 
Brett Knapik
Ranch Hand
Posts: 255
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you should to use a string buffer for resource perposes. For a button you need a argument for name, and value, the code should be

------------------
I wish there was a button on my monitor to turn up the intellegince.
Theres a button called 'brightness' but it doesn't work
 
Carl Trusiak
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your viewing this with netscape. If you viewed it with IE you will see your Button. Netscape will not display any input objects unless it is inside a form. Change your code to something like:

Hope this helps


[This message has been edited by Carl Trusiak (edited December 01, 2000).]
 
Carl Trusiak
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
andy,
please read and follow the Naming Policy. It's to your benefit. We periodically do book give aways to people who post to a forum and as a matter of fact one is being conducted on the Servlet forum now. Only those who meet the naming policy are entered in the contest for the give away so....
Looking forward to your posts
 
ram mohan
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Inaddition to what others said u have to include this as well
response.setContentType("text/html");
 
andy
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks guys for the replies. I got it worked out. I forgot to put
the form tag in the servlet. Appreciate your help guys. Carl, I am sorry to use an alias, from now on I am going to use my real name. Thanks Carl, Brett and Ram for your help.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic