It's not a secret anymore!
The moose likes JSP and the fly likes Need a Text Editor Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Need a Text Editor" Watch "Need a Text Editor" New topic

Need a Text Editor

Rudolf Castelino

Joined: Oct 30, 2002
Posts: 18
I need to create a JSP based text editor. The Text editor is used to insert text, with Formatting into a database.
I cannot use an applet.
Please help
Jon Dornback
Ranch Hand

Joined: Apr 24, 2002
Posts: 137
what exactly do you need help with? if you are just trying to insert text in to a database, then you will need an html text area on the web page, and have that page submit to a jsp. the jsp will transform any text formatting characters in to something that won't corrupt the database, and then use jdbc to connect to the database and insert the information. that's the overview of the process, if that's what you were looking for.
if you need help specifically with how to create a fully-featured text editor on the web page, that is a different story - please post with what you need to do.

use the [CODE] tags - it makes it much easier for people to help you.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17410

At the moment, you're out of luck. The only way to enter multiple lines of text in pure HTML is via the textarea input control and it doesn't support formatting, just raw characters.
We format our text on the JavaRanch using UBB, like so:
This is quoted text

but that requires manual markup - not friendly for casual users. If you want something more like Windows WordPad, you're limited to an ActiveX/.Net-style plugin (I don't recommend this, Unix/Linux and Macintosh users will get a display that's unusable), an Java applet with one of the Swing text editing controls, or a specialized plugin (once again, not all users may be able to work with this).

An IDE is no substitute for an Intelligent Developer.
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63844

Actually if you can deal with something that only works in IE, it has a little-known feature where you can put an iframe element into a special "design mode" where it acts like a small wysiwig editor.
Many web-based email sites use this mode when displayed in IE.
The details are gory so if an IE-only solution is acceptable please post such and I'll look up the details (which are fuzzy in my mind since it's been a while since I used it).

[Asking smart questions] [About Bear] [Books by Bear]
dave nelson

Joined: Nov 27, 2002
Posts: 10
Just to throw in another $.02, you could create a word pad out of javascript and then insert in db as text via hidden field. Heavy DHTML though.
[ December 03, 2002: Message edited by: dave nelson ]
I agree. Here's the link:
subject: Need a Text Editor
It's not a secret anymore!