It's not a secret anymore!
The moose likes IDEs, Version Control and other tools and the fly likes Which mode shoud be used for jsp? ascii or binary Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Which mode shoud be used for jsp? ascii or binary" Watch "Which mode shoud be used for jsp? ascii or binary" New topic

Which mode shoud be used for jsp? ascii or binary

James Lee
Ranch Hand

Joined: Oct 16, 2006
Posts: 36

When we create a jsp in eclipse, should ascii or binary mode be used? I know the two modes are related to data transfer between local and cvs but there is no difference and impact in my project by switing them. Can anyone say something about the modes? Usually which one should be used for jsp?

Peter Johnson

Joined: May 14, 2008
Posts: 5852

JSPs are text files so ascii mode would be best (though the ascii-vs-binary question brings to mind FTP and not version control where usually the issue is binary vs text, but then I don't use CVS and different products use different terminology for the same thing)

JBoss In Action
Mourouganandame Arunachalam
Ranch Hand

Joined: Oct 29, 2008
Posts: 396
When you check-in files into any version control systems for textual source codes you can use the default text or ascii mode, however, when check-in word doc, xls, image or class files you may need to use the binary mode.

Open Source leads to Open Mind
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17417

The crucial differences are: A) What is the code page and B) what are the end-of-line characters.

The code page is almost always going to be ASCII unless you're working with IBM mainframes (EBCDIC).

The end-of-line characters may be CR (Macintosh), CR/LF (DOS/Windows) or LF (Unix, most others). LF is also referred to as NL (Newline).

When you indicate text mode - and this applies to both CVS and FTP - the server will translate to the appropriate code page and end-of-line sequence for yout target machine. When you indicate binary (a/k/a image) mode, the bytes will pass unmodified.

Binary mode is always safe, but because not all tools are smart, text mode is preferable when dealing with things that are 100% text. If you download a text file with in Unix mode end-of-line characters, Windows Notepad won't work right, although Wordpad and most IDE's will accommodate.

On the other hand, if you create a Unix shell script or C/C++ source file on a Windows machine and upload it in binary mode and it uses the end-of-line continuation (backslash) to semantically glue 2 lines together as though they were a single long line, binary mode will propagate the CR/LF. And most Unix tools won't like that, resulting in compile errors and scripts that won't execute.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: Which mode shoud be used for jsp? ascii or binary
It's not a secret anymore!