Results 1 to 2 of 2

Thread: Binary text

  1. #1
    bizmut is offline Member
    Join Date
    Jun 2008
    Posts
    8
    Rep Power
    0

    Default Binary text

    Hi,

    I am new in JSP...
    Well, I need to make binary field in my JSP, but I don't know how... What I need is ordinary text field, but with restriction towards all other characters except "0" and "1". So, when someone tries to input, for example character "2" or "s" or etc. (character that is not "0" nor "1"), I would like my field not to react at all.

    Is this possible?

    Thanks. Bye, Igor

  2. #2
    Nicholas Jordan's Avatar
    Nicholas Jordan is offline Senior Member
    Join Date
    Jun 2008
    Location
    Southwest
    Posts
    1,018
    Rep Power
    8

    Smile turtle rules

    You have several issues, we will start by making a simple ascii generator:
    Java Code:
    while(char < limit) file.print(char);// char starts at space
    That is overly abbreviated, but the first thing we need to do is move away from the char transmission as binary, there are many tools already in place that transmit a great deal of information using regular Strings, doing it as regular internet traffic. We get a PrintWriter or something like it for free in JSP when the page is invoked, we just have to remember to set the header to text/html.

    Guess what, it does that by shipping a regular String.

    I normally don't smile but I did the smiley to encourage you to do a few steps before getting bogged.
    Introduction to Programming Using Java.
    Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor

Similar Threads

  1. get binary value
    By rushenas in forum New To Java
    Replies: 2
    Last Post: 06-14-2008, 01:51 PM
  2. Replies: 0
    Last Post: 05-26-2008, 04:26 PM
  3. binary conversion
    By thamizhisai in forum New To Java
    Replies: 3
    Last Post: 04-29-2008, 11:55 AM
  4. Binary Addition
    By Deo Favente in forum Advanced Java
    Replies: 11
    Last Post: 04-24-2008, 05:34 AM
  5. binary search
    By tranceluv in forum New To Java
    Replies: 10
    Last Post: 01-14-2008, 07:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •