The first 100 Chars in Struts

Hi I am a novice struts user and I need HELP!
I have a string Description in a vector with I then throw at the JSP. Here I am using c:out stuff to get it to print...BUT I need only the first 100 chars or so following by elipses...I know that there is a scriplet for a string but I can't figure out the command for a struts.
Here is my code:
<%@ page language='java'%>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
<html>
<head>
<title>Search Results</title>
</head>
<b> Results:</b><br><br>
<c:forEach var="record" items="${SearchProgram}">
<b> <c:out value="${record.acronym}"/> </b><br>
<a HREF="https://enweb.mitre.org/program.do?programId=<c:out value=${record.programId "/>"><c:out value="${record.longName}"/><br>
<a HREF="https://enweb.mitre.org/spo.do?spoPadId=<c:out value=${record.spoPadId"/>"> Mother SPO Homepage<br>
<c:out value="${record.description}"/><br><br> <!-- THIS IS WHERE I PRINT DESCRIPTION-->
</c:forEach>
</html>

No easy way to do this in JSTL/JSP code.
Obviously you could use scriptlets record.getDescription().substring(0, 100)
The better solution would be to populate the description (or maybe a short description?) field with the shortened value.
ie add a method to your bean getShortDescription which gets the value you want.

Similar Messages

  • How to get the first 4 chars form a var ?

    Hi guys,
    How to get the first 4 chars form a var ?
    i.e  temp type num20 value '00000000000012345678'.
    how to move the first 4 chars to another var?
    thx in advance.

    hi
    use OFFESTS..
    example:
    var1 = '12345678'.
    var2 = var1+0(4).
    now var2 conatins '1234'.
    thx
    pavan

  • Photosmart C7280 only takes the first 4 chars of the WPA Key

    When I try to set the WEP key on the printer it seems to truncate after the first 4 chars. Some one said that there is a way to reset the printer using a reset button - pressing this might fix the problem. 
    Any ideas on how I can printer to work again wireless? 

    How are you trying to enter the key?  What operating system?  What router are you using?
    Say thanks by clicking "Kudos" "thumbs up" in the post that helped you.
    I am employed by HP

  • Char displaying only the first three characters in the cube

    Hi Experts
    I have a char  with lenth 60 and it's active.I am updating this char via the update routine whereby i am reading data from an active table of an ODS as i update in the update rules.
    But surprisingly,once the load is succesful and complete,upon checking the data in the active table it's displayin the way it should be the problem comes in when I view the data on the cube which displays only the first three chars even if the descriptionis a 60 character field.
    Please help

    Hi Herbert,
    Have you checked in the infosource or transfer rules, what is the length of the infoobject, if you are loading the data to PSA, please check there it self, whether it is displaying 60 characters or only 3 characters.
    Thanks
    Sat

  • Delegated Admin web application only requests first 100 accounts?

    Hi,
    - Sun Java System Messenger Express 6.2
    - Delegated Administrator 6.3-0.09 built Sep 6, 2005
    Is this true that the Delegated Admin (DA) web application only requests first 100 accounts?
    Once logged in to DA web application, we only see "Retrieved Users (100)" if we want to see all users; but if we do a search on uid or username, all other users are retrieved.
    One of the admin gave us the following response:
    This is not a directory-related problem, but rather a matter of the design of the DA application you are using. The web-based java app only requests the first 100 accounts from the directory (presented by default as 10 pages of 10 accoints each.) , since you're supposed to be using the search facility to find accounts when you need to modify or delete them.
    This is a deliberate design choice by the Sun programmers who wrote the thing, probably because the directory is capable of holding several thousand accounts and pulling them all would take quite a bit of time (not to mention memory space), so in the interest of response-time speed they limited the data pull.
    I cannot modify this application's functionality. If you need a list of all user accounts in your domain, I can supply an LDIF on request, with any attributes (mail, uid, cn, etc.) that you like.
    Please let us know if there is any way we can view all users (approx. 1000) from DA web application.
    Thank you for your time,
    GJ

    Yes, the terminal commands I gave are changing permissions.
    Properly written OS X apps should run under any user account, and should store any account-specific information in the each user's home folder. Some poorly written apps might only be executable by the administrator. Running the first command I have will make the app executable to all users.
    Some even more poorly written apps will write user data into the application itself rather than to the user's home folder. This is a particularly bad problem with game software, which for example might write high score info into the app itself. If this is the case for your misbehaving apps, the second command I gave will make the app writable by everybody and should solve the problem.

  • Discount for first 100 customers only

    Hi Gurus
       I want to give the first 100 customers 15% discount on a product and after 100th customer  10% discount as usual to be continued. Please tell me how to configure . Thanks in advance
    yezdevan

    Hi ezdevan,
    Other option:
    go to tcode V/06 to Customize the Condition type by checking  the "Condit.update" in Master data subscreen. This will make the condition type updates and you can control whether limit values are relevant for pricing.
    In VK11 for the condition type,  Goto Additional data. Take a look at field named Max.number.of.orders.. and put there the total number of orders (100 in your case). This will make the condition record work for 100 times.
    Regards,
    Gumanti
    > Hi Gurus
    > I want to give the first 100 customers 15%
    > discount on a product and after 100th customer  10%
    > discount as usual to be continued. Please tell me
    >  how to configure . Thanks in advance
    > ezdevan

  • Retrieving first 100 rows

    hi
    I have pretty much rows inside my table.
    I want to retrieve the first 100 records inside the table. Then next 100.
    How can I do it with sql statement
    Message was edited by:
    Ricardinho

    If ranks are unique.
    We can use these solutions.
    --Using subqueryselect SortKey,anyColumns
    from YourTable a
    where (select count(b.SortKey)+1 from YourTable b
            where b.SortKey > a.SortKey
              and RowNum <= EndRank) between StartRank and EndRank
      and RowNum <= (EndRank-StartRank)+1
    order by SortKey desc;
    --Sort in InlineView
    select SortKey,anyColumns from(
        select SortKey,anyColumns,RowNum as Rank from(
            select SortKey,anyColumns from YourTable order by SortKey desc))
    where Rank between StartRank and EndRank
      and RowNum <= (EndRank-StartRank)+1
    order by SortKey desc;
    --Using OLAP
    select SortKey,anyColumns from(
        select SortKey,anyColumns,Row_Number() over(order by SortKey desc) as Rank
          from YourTable)
    where Rank between StartRank and EndRank
      and RowNum <= (EndRank-StartRank)+1
    order by SortKey desc;

  • ITunes skips the first milliseconds when played from the beginning..

    I have created some songs from my DAW that I wish to playback in iTunes.
    But it seems skips the first milliseconds when played from the beginning.. Probably the first 100 milliseconds.
    It plays correct in Quicktime Player.
    Anybody suggestions?

    Sorry, if you restored your iPhone from a backup of your iPod then your iPhone will end up looking just like what was on your iPod. Everything else will be deleted and, if you have no other backup, it is just gone.
    The restore function is not incremental. It does not add or merge content. It simply replaces every thing on the restored device with what is in the backup.

  • When I open a file it normally opens in 12.5% stated on the header. For some reason, it now opens with 100+% on the header and is much smaller in size. How do I go back to the first option I noted? I use AP to work on blueprints for measuring so the accur

    When I open a file it normally opens in 12.5% stated on the header. For some reason, it now opens with 100+% on the header and is much smaller in size. How do I go back to the first option I noted? I use AP to work on blueprints for measuring so the accuracy matters. Any direction would be greatly appreciated. Thank you.

    Are the image all the same size the % files open into a document seems to vary with the number of pixels the image being opened has.  Check the Image size.

  • Is Verizon reducing $100 for the first generation iPad?

    Is Verizon reducing $100 for the first generation iPad?

    Hi Manaka,
    We are not currently aware of any price reduction of $100.00 on the current Ipad. Please check the Verizon Wireless website for current pricing and discounts as pricing is subject to change without notice. I am providing a link for further information.
    http://www.verizonwireless.com/b2c/store/controller?&item=phoneFirst&action=viewPhoneOverviewByDevice&deviceCategoryId=11
    Thank You,
    edw@vzwsupport

  • To skip the first two Digits of the Char in Query

    Iam using County code which is the attribute of Vendor in free-chars of my query. In back-end iam doing some enhancements for this county code and populating the county codes values with region. (For example if the country code value is 021 in back end iam populating by concatenating with region value. so the value in the back-end is 05021.)
    When i run the query the key of county code value i see is 05021. But i need to skip the first two digits in county code and should display in the result. Is there any way to skip the first two digits for the county code values.
    Thanks in Advance
    Sudhakar

    Hi Sudhakar,
    Pls go through the link:
    Remove the last two charecters from right
    Thanks and Regards,
    Ramki

  • Chunk expressions: Need the first and last char position from member.word[x]?

    I need to build a linear list of the string positions of the
    first and last character of each word in a string. For example if I
    have the string myPet = “DOG CAT FISH” then myList =
    [[1,3],[5,7],[9,12]]
    myPet.word[x] will let me access the individual words but
    I’m not sure how to get the char position of the beginning
    and end of each. Please help, it’s Friday and my brain has
    left for the weekend.

    Touche, Sean.
    "Sean Wilson" <[email protected]> wrote in
    message
    news:fqa8ap$bga$[email protected]..
    > Hi Craig,
    >
    > Your's fails if any word is repeated. Try it with "DOG
    CAT FISH DOG"
    >
    > This one seems to work, although there are probably more
    efficient ways to
    > go about it. A regular expression and the PRegEx xtra
    would certainly be
    > quicker, especially as the string gets longer
    >
    > on mGetWordBoundaries aString
    > -- basic error check
    > if stringP(aString) = 0 then return []
    > if length(aString) = 0 then return []
    >
    > lWhitespace = [SPACE, TAB, RETURN, numToChar(10)]
    > tStart = 1
    > tChar = aString.char[tStart]
    > repeat while lWhitespace.getPos(tChar)
    > tStart = tStart + 1
    > tChar = aString.char[tStart]
    > end repeat
    >
    > lPositions = []
    > repeat with w = 1 to aString.word.count
    > tEnd = tStart + aString.word[w].char.count - 1
    > lPositions.append([tStart, tEnd])
    > tStart = tEnd + 1
    > tChar = aString.char[tStart]
    > repeat while lWhitespace.getPos(tChar)
    > tStart = tStart + 1
    > tChar = aString.char[tStart]
    > end repeat
    > end repeat
    > return lPositions
    > end

  • Compare the last Char to the First Char in a Sting

    Hello, this should be easy but I'm having problems so here goes.
    I get the user to input a Stirng and I want it to compare the last Char to the first Char. I have writen this but StartWith can take a Char?
    public static void main(String[] args) {
            // TODO code application logic here
            String strA = new String();
            int length = 0;
            char lastLetter;
            System.out.println("Please input your first String: ");
                   strA = EasyIn.getString();
                 length = strA.length()-1;
                   lastLetter = strA.charAt(length);
           if( strA.endsWith(lastLetter))
                System.out.println("The first letter matches the last");
           else
                       System.out.println("They Don't match");
    }I have tried lastLetter.endsWith(strA) but that dosn't work some thing to do with it not taking Char
    From reading you can go strA.startWith("R") and that would look for R but you can't put a char in that would be a single letter.
    I also tried to lastletter to a string but then charAt wouldn't work.

    fixed it I used substring as its a string object any one recomend a better way let me know
    public static void main(String[] args) {
            // TODO code application logic here
            String strA = new String();
            int length = 0;
            String lastLetter;
            System.out.println("Please input your first String: ");
                   strA = EasyIn.getString();
                 length = strA.length()-1;
                   lastLetter = strA.substring(length);
           if( strA.startsWith(lastLetter))
                System.out.println("The first letter matches the last");
           else
                       System.out.println("They Don't match");
    }

  • HT203167 i have purchased 100 songs in last 2 years on itunes  now i am able to find the first 50 songs i am using the original id in all my devices.i even got the invoice of my purchase where can find them all?

    i have purchased 100 songs in last 2 years on itunes  now i am able to find the first 50 songs, i am using the origial id in all my devices.i even got the invoice of my purshace where can find them all?
    ITS NOT EVEN SHOWING UP IN PURCHASED SECTION

    1. iTunes won't offer cloud downloads for songs that it "thinks" are in your library, even if it "knows" the files are missing. If you've exhaustively searched for the missing files and there is no prospect of repair by restoring to them to their original locations, or connecting to new ones, then delete that tracks that display both the missing exclamation mark and are of media kind Purchased/Protected AAC audio file. Don't hide from iTunes in the cloud when asked, close iTunes, then reopen. You can download from the cloud links or iTunes Store > Quicklinks > Purchased > Music > Not on this computer > All songs > Download all.
    2. Why? Not sure, perhaps 3rd party tools or accidental key presses combined with previously hidden warning messages when trying to organize the library. There is a hint that using the feature to downsample media as it is synced to a device may also be involved, though I've not replicated it. Whatever the reason a backup would protect your media.
    tt2

  • I have a presentation with  100 slides. During the first 10 slides I want one song to start playing from slide

    I have a presentation with +100 slides. During the first 10 slides I want one song to start from the beginning, at the 11th slide a new song starts from the beginning, and so on during the entire presentation. How do I do? Thanks in advance. janfromfinland

    This is a very common request which unfortunately has not been satisfactorily answered albeit for very complicated workarounds using multiple duplicates of your keynote file and hyperlinking them.
    The easiest alternative is to have iTunes play in the background timed to begin when you manually start the keynote. You can create a playlist so the tracks run into each other, or better yet combine them into one track using a free editor like GarageBand. You'll need to rehearse your timings. Hopefully, youre not trying to match lyrics with words or animations as this is not the most exact way to do so.
    The alternative is to create a separate keynote file of those 10 slides and export them to QuickTime, reimport the movie into keynote and add the music track to the file. That will give more accurate timing. The  most accurate timing would be tom import the QuickTime movie into iMovie and add the soundtrack with exact timings. Ive done this successfully except for the fact that exporting this way fools around with any build timings.
    S the final alternative is to do your first 10 slides with music from iTunes and advance the slides manually using screenflow or the latest QuickTime in lion to record the screen Inc music.
    All troublesome but doable workarounds until Apple comes to our aid.
    Les Posen
    Presentation Magic

Maybe you are looking for