This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Servlets and the fly likes new to servlets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "new to servlets" Watch "new to servlets" New topic
Author

new to servlets

andy
Greenhorn

Joined: Dec 01, 2000
Posts: 2
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

Joined: Oct 15, 2000
Posts: 255
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


"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."
Carl Trusiak
Sheriff

Joined: Jun 13, 2000
Posts: 3340
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).]


I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
Carl Trusiak
Sheriff

Joined: Jun 13, 2000
Posts: 3340
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

Joined: Oct 17, 2000
Posts: 68
Inaddition to what others said u have to include this as well
response.setContentType("text/html");
andy
Greenhorn

Joined: Dec 01, 2000
Posts: 2
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.
 
 
subject: new to servlets
 
Similar Threads
how does the servlet knows that the client has closed the browser
again session
Re: Servlet Problem
Browser Back Button
Disabling the Back button of the browser