Solved

Limited text output

Posted on 2006-11-13
3
175 Views
Last Modified: 2012-05-05
How would I limit the amount of html characters printed to a page, so that it only displays say 50?

So if the html generates a 100 characters in a paragraph, how would I limit that to 50 and add a link "more.." to the string?

many thanks.
0
Comment
Question by:Eternal_Student
  • 2
3 Comments
 
LVL 10

Expert Comment

by:mbvvsatish
ID: 17928920
you can use str.substring(0,50); with out.println (servlet/jsp) or with document.write() [javascript]
 
0
 
LVL 10

Accepted Solution

by:
mbvvsatish earned 250 total points
ID: 17928930
0
 
LVL 18

Author Comment

by:Eternal_Student
ID: 17955522
What about using JSTL?
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
issue with pdf generation 2 93
servlet cookie finding by name 1 86
HTML5 vs JSP - REST based application development 4 1,216
Best practices to work on a spring MVC project 1 126
This article shows the method of using the Resultant Set of Policy Tool to locate Group Policy that applies a particular setting.
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question