*
The moose likes JSP and the fly likes can c:forTokens be used for creating new paragraphs 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 » JSP
Bookmark "can c:forTokens be used for creating new paragraphs" Watch "can c:forTokens be used for creating new paragraphs" New topic
Author

can c:forTokens be used for creating new paragraphs

Rauhl Roy
Ranch Hand

Joined: Aug 01, 2006
Posts: 401

Hi,

can any one please tell me if we can use c:forTokens inorder to devide our textarea into diffrent paragraphs when user clicks on enter button?

if this is possible with c:fortokens please give me example/sample code.

regards,
rahul
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60752
    
  65

Do you mean immediately when the user clicks something, or do you mean after the data is submitted to the server?

If the former, then no. JSP runs on the server in order to format the HTML page to send to the browser. Once sent, any reaction to user input must take place on the client using HTML and JavaScript.

If the latter, then that's the realm of data processing and should be taking place in a servlet, not in a JSP.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Rauhl Roy
Ranch Hand

Joined: Aug 01, 2006
Posts: 401

No, not imeadeatly Mr. Bear Bibeault, I want to save, the data entered in the textarea, to back end system like sap, oracle or any thing.

Can you send me some sample code please.

regards,
rahul
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60752
    
  65

Then the form should be submitted to a servlet that can perform whatever splitting of the text area data is necssary. A JSP will not be involved.

How are you determining what a "paragraph" is? Blank lines? Something else?
Rauhl Roy
Ranch Hand

Joined: Aug 01, 2006
Posts: 401

\n in other words enter button from the key board
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: can c:forTokens be used for creating new paragraphs
 
Similar Threads
jstl - specify how many tokens
c:forEachToken is there?
Problem while generating PDF report from Servlet
Regular Expressions in String's split() method.
Passed SCWCD with 94%