Syntax highlighting in JSPs: How do they do that?

In this forum, for example, if write code tags you write Java code that is automatically highlighted:// a comment
public static void Main( String args[] )
   /* blah blah blah*/
}which is great!
I'd like to know how it's done, esp if there's a generic prcedure to it as I'm developing a site that will require syntax highlighting for several languages.
Thanks JSP gurus!

You can do this yourself. Create a table of key
words. You can scan
through the text to get the individual words. If they
are in your
table then add the bold tags. The trickiest part
would be finding
the end of comments, but this is not too difficult
either.Yeah, this really isn't too difficult, having finished something myself. With comments, if you open with a //, you can simply consider everything between that and a newline as a comment, and with the /* comment, everything between it and a */ is also a comment.
If all goes well, and you plan everything out, you should be able to place all necessary code formatting tags into the code with one iteration.

Similar Messages

  • How do they do that?

    Some websites permit visitors to view webpage freely. Only when a visitor click through any restricted page, login page appear. And when authentication completes, the visitor will be relocated back to that restricted page immediately.
    How do they do that? I mean how to make the login page know which page to forward to.

    Hi,
    I think there a two possibilities.
    1. You pass a parameter (url) to the login page to forward (redirect) to after a sucessfull login.
    response.sendRedirect("login.jsp?followUrl="+request.getRequestURI());you may also set the url in a bean or the session.
    2. You take a look at the referer that is part of the request header.
    request.getHeader("referer");

  • New York Jets - How Did They Get That Name?

    I remember the old New York Titans of the AFL, but then one day, they were called the Jets. How did they get that name (West Side Story?), and where did it come from?
    Rod, are you home?
    Hunt

    hiya...hehe... was crying ...jets lost...boo hoo....
    gotta admit ne pats defense and offense were just too good...couple turnovers and jets = dead ducks ( making that gargling sound in throat as they bit the dust ).
    why jets name ??? dont know really...not definitetively...
    My dad was into gymnastics pretty much entirely ( a little into figure skating ). not baseball or football. bowling a little as a " do it " sport, not a "watch it " sport. The only "watch it " sports us kids did ( only had 1 tv ) was gymnastics and skating olympic stuff mostly but some other competitions too.
    Gymnastics is weird in a way...( as was my father ). It is extremely personal ( about beating your "self" ..doing better than you did " before" ).. very individualistic ...even though you are on a " team "... it's just points mostly for the team to win , accumulation of individual scores...  father was very anti weight lifting, very opinionated about these things to his kids... so even when I got into wrestling, for example, or football ..in high school, he was very critical of any weight lifting that was part of the practice and training. He " coached " or " taught " gymnastics on Saturdays at my high school in a sorta unofficial (unpaid ) position...so me and my brother got sorta hooked into that more than doing football, wrestling etc. In fact, we started doing gymnastics when we were like 1 year old.. and it is so stated in some newspaper clipping by howard cosell (when he was a newspaper columnist before radio ) interviewing my father after a ny athletic club gymnastic competition ( trials for olympics sorta thing )... " Yes, Howard, I have 3 children, and they are already doing floor excercises and some tumbling... kirk, age 3, rodney age 2, and susan age 1 .... "  that sorta thing.  We were famous !
    We could roll on the floor with pet dog real good !
    This gives you general idea how I never got into "watching" football seriously, or baseball...I am basically ( like my brother ) a sport idiot re: following football and baseball like normal american kids.  Of course I did follow favorite teams for a while in high school... ( oakland raiders were my favorite with a couple other teams kinda floating in and out of my interest ) but I have only been to 2 pro baseball game, never to any pro football game, and only 1 college football game ( army navy as guest of family who's son went to west point .. they got season tickets and tailgate spot etc ).
    Baseball games were 1 polo grounds where the only thing I remember is having a hot dog and I dropped my plastic thing of mustard and for some stupid reason stomped on it... and it squirted mustard like it was shot from a canon onto this lady's leg ( stocking ).. and she yelled at me and I felt bad and said I was sorry and she tried to get it off but I think her leg was stained with mustard forever.
    Other baseball game was yankee stadium box seat next to yankee dugout roof as guest of guy who's brother in law owns the boxes complete with free parking nearby and tickets to some yankee club after games.  fancy seats ( 4 of them ).  I put my beer on the roof of the yankee dugout, it was like right in front of me. I got a ball thrown to me by a yankee after pre-game practice ( as they came to dugout to start game ). Actually he faked me out at first...went to throw, I ( startled by his hand action ) put my hands up fast to catch.. but he didnt throw ( like faked me out )... but then as he disappeared under dugout roof his hand came up and flipped the ball right to me ( which of course I caught since I am so quick with my reactions due to rolling with dog when 2 years old ).
    So thats my only baseball story of any interest. It was the game " after" the boston yankee game with the pine tar incident in boston with billy martin.. so this was the next day IIRC in ny with boston again... yankees won.  and didnt have to do tricky stuff to win ( like complain about pine tar ).  The mustard story doesn't get told often.
    So now you know that I am a total idiot re: sports in general due to total immersion in gymnastics, and most of THAT was just doing it, not following particular athletes ( though of course some became sorta famous at the olympics etc ) We had high bar and parallel bars IN THE BACK YARD !  LOL... I once saw a friend try a giant swing ( we had no mat.. just grass ) and fly off and landed about 20 feet away ... he let go cause all the skin on his girly hands got ripped off as he was twirling around... goes to show you... be careful when trying new things.
    His eyes had rolled up into his head so you could only see " white" for a little while... but then he came back to life ( whew ! ) .  We quit for the day doing gymnastics.
    Sooo, in answer to your question.. given my idiocy about these matters.. the Jets ( from Titans at polo grounds and 1 season I think at the new Shea Stadium --where the METS were ) with change in ownership and all that going on... could have been from west side story ( cause I think there's a long history of some stadium dreams over on the west side of manhattan ( which would be a total nightmare for traffic by the way ) ).. and since it rhymes with METS maybe.. and also maybe because when you go to shea stadium all you can hear most of the time are GIANT JETS FLYING LOW OVERHEAD on way to and from LaGuardia Airport which is like 100 feet away from home base.
    A lot of New Yorkers liked the Jets at first because Joe Namath go them to the superbowl and won, much to the surprise of everyone on earth and mars too..   but really because it was a ny stadium instead of NJ ( everyone in NY makes fun of people in NJ ).  The giants suffer for this cause a lot of people call them the NJ Giants. And now ( of course ) a lot of people call the Jets the NJ Jets too... since they left shea stadium ( which was a mess because they had to go on road games till the METS were done playing baseball...and then that stadium on the west side got blackballed again by a couple lawmakers in Albany ( they actually OWN the city and state, Sheldon Silver and some other guy ). Im not really up on that whole history of west side stadium but in part the cablevision guys who own madison sq garden dont want competition. They got it with the javits center for conventions but not for sports teams.. so I guess they're happy for now.
    Now we got citi field and met life field and will probably rename the midtown tunnel " JP Morgan Tunnel " soon... but as I say, .... I don't go to any of these games and travel as little as possible so who cares.

  • Looking for a scroller [was: How do they do that?]

    http://ca.yahoo.com/?p=us, in their section "HOT videos & photos". I was expecting the scroller to be flash
    but it isn't. How do you do that?
    If i can save some bucks not purchasing any xml-scroller...
    [Subject line edited by moderator to indicate nature of question]

    Dynamic Drive Step Carousel Viewer
    http://www.dynamicdrive.com/dynamicindex4/stepcarousel.htm
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    www.alt-web.com/
    www.twitter.com/altweb
    www.alt-web.blogspot.com

  • Words on pages are highlighted and linked, how do i stop that?

    i understand that links are in blue, but i am getting suggested links in other colors and things that may or may not be link is different colors. i even have pictures pop up when i move my mouse over these highlighted words. it's like there are KEY WORDS that LIGHT UP... can i stop this?
    here is an example:
    Psychic Society International certification: 12-1-1998
    Ordained, Reverend, Universal Life Church: 4-21-1999
    certification, Ordained, and Universal Life are all HIGHLIGHTED and when in put my mouse over it a picture will show up.
    how can i stop this??

    hello, this sounds like a problem possibly caused by adware/malware on your pc. please go to ''firefox > addons > extensions'' & remove any suspicious entries (toolbars, things that you have not installed intentionally, don't know what purpose they serve, etc). also go to the windows control panel / programs and remove all toolbars or potentially unwanted software from there and run a full scan of your system with the security software that you have in place and different other tools like the [http://www.malwarebytes.org/products/malwarebytes_free free version of malwarebytes] & [http://www.bleepingcomputer.com/download/adwcleaner/ adwcleaner].
    [[Remove a toolbar that has taken over your Firefox search or home page]]
    [[Troubleshoot Firefox issues caused by malware]]
    See also locked duplicate containing a reply [/questions/971288] ~J99 (Thanks for flagging that Philipp)

  • In notes numbers get highlighted and underlined how do I turn that off please

    How do I turn highlight and underline off?  In notes it does this automatically now when I write number.

    Thanks for taking the time to try to help me. . I checked and the Do not disturb is off. The check is still there stopping calls from coming in when phone is locked. Any other ideas? Thanks again!

  • How can you screen your iPad on a keynote presentation? Just like Apple did in last years WWDC when they demo iOS 5 how do they do that

    How can you screen your iPad on a Keynote presentation just like Apple?
    Like when they had last years WWDC when they demoed iOS 5 on the iPod Touch 4G
    Can you do that with an iPad 2?

    AL113-
    Mirroring refers to normal operation of the iPad, where you can see the Home screen on your external display, as well as when setting up a slide show, et cetera.  You may not need to mirror the iPad's display for presentations (but the iPad 2 does mirror).  At least for slide shows and videos, the iPad 2's screen does not show the presentation when an AV cable is connected, it only appears on the external screen.
    The alternative I mentioned about using the Apple TV box with AirPlay is probably easier to do, except you need the Apple TV box to interface to your external display.  One problem with an AV adapter, is that the weight of its cable tends to pull the connector out of the iPad as you are holding it.
    Fred

  • Works on pages are highlighted and linked, how do i stop that?

    duplicate of [/questions/971290] ~j99
    i understand that links are in blue, but i am getting suggested links in other colors and things that may or may not be link is different colors. i even have pictures pop up when i move my mouse over these highlighted words. it's like there are KEY WORDS that LIGHT UP... can i stop this?
    here is an example:
    Psychic Society International certification: 12-1-1998
    Ordained, Reverend, Universal Life Church: 4-21-1999
    certification, Ordained, and Universal Life are all HIGHLIGHTED and when in put my mouse over it a picture will show up.
    how can i stop this??

    Can you provide a URL for a couple of pages that have this problem so a volunteer can take a look at the site?
    Do ads appear when you mouse over those phrases? Some extensions include that advertising technology, but I'd be surprised if someone is using those terms to display ads. Still, worth checking.
    Try disabling ALL nonessential or unrecognized add-ons on these two tabs (if you don't use the add-on every day, disable it, it's easy to re-enable):
    orange Firefox button (or Tools menu) > Add-ons > Plugins category<br>
    orange Firefox button (or Tools menu) > Add-ons > Extensions category
    Usually a link will appear above a disabled extension to restart Firefox. You can complete your work on the add-ons page and click the link as the last step.
    Any improvement?

  • Apple just disabled my Apple ID that has a valid credit card and $13.44 store credit. How can they do that?

    Up to yesterday I was using my Apple ID on itunes and the app store. I have a valid credit card on file and $13.44USD store credit. Prior to 28th September 2012 I had $40.42USD store credit on my account. On the 28th September 2012, I subscribed to itunes match successfully. On the 30th September 2012 I purchased the video ' Take on Me ' for $1.99USD. Only yesterday the 1st October 2012, I used itunes match to update my music library. Today when I logged into my account there was NO $13.44USD showing up next to my Apple ID. And when I tried to download an app, I got a notification saying my Apple ID has been disabled. PLEASE HELP me. Apple disabled another ID sometime before that I have not been able to get reactivated. But I can't afford to lose this Apple ID because I use it ALL the time, plus I have itunes match with this Apple ID account. Please tell me what to do. How can I contact Apple directly???
    <Emails Edited By Host>

    If changing your password does not solve then contact itunes support.
    Click Support at the top of this page, then click the link under Contact Apple Support

  • I want to use the custom request header in JSP How can I use that

    Hi Guys,
    I have following scenerio...
    1: There is one third party tool which is calling my.jsp page from the specified directory.
    2: Before calling the JSP that third party tool is adding some data like <user name> and <password > in the header of that JSP.
    Problem: I am not getting thos custom added header in side the JSP.
    Header information is given below:
    http://localhost:8100/wvsat/brand/ncr/auto.jsp
    GET /<APPLICATION_NAME>/ <JSP_PAGE_NAME>.jsp HTTP/1.1
    Host: localhost:8100
    User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    Accept-Language: en-us,en;q=0.5
    Accept-Encoding: gzip,deflate
    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
    Keep-Alive: 300
    Connection: keep-alive
    Cookie: AreCookiesEnabled=195; JSESSIONID=2a30e33e48384dd13222
    MyUsername: demo*
    MyPassword : demo*
    HTTP/1.x 200 OK
    Date: Wed, 24 Sep 2008 19:42:22 GMT
    Content-Type: text/html; charset=UTF-8;application/x-www-form-urlencoded
    Connection: close
    Server: JRun Web Server
    Now within the JSp page i want the value of MyUserName and MyPassword
    For gettting these value i am using the request.getHeader(MyUserName);But it is returning null.
    Note:+*
    1: I want to forward this value to another servlet which is based on Struts framework_.
    2: For adding the value in the header i am using Http Live header Addons of FireFox_
    Could anyone help me in the same!!!
    Thanks in Advance

    Sorry, perhaps I was not explicit enough.
    Your code snippet: request.getHeader(MyUserName);
    It was missing quotes to make it a String value.
    If that is what you have, then it is using the VARIABLE MyUserName, and not the actual value "MyUserName"

  • NG 7 Billion - How'd they do that?

    Curious if anyone knows how National Geographic achieved launching the ipad email browser filled in with HTML body content directly from their digital magazine? At the beginning of each article, there is an email icon displayed, and when you click on it mac mail launches with html content filled in and ready to share with a friend. From what I can find, the mailto: function won't send html body content.
    Any ideas?

    Thank you so much, Johannes! I did try this earlier, but only tested through the desktop viewer which wasn't working for me. I just followed through to the content viewer on the iPad with success.
    I guess the shortest distance between 2 points was, in this case, a straight line.
    
> 
>
    Johan nes Henseler
    DONE magazine
    What you see is what you get. A HTML mail.
    Crazy.
    
> 
>
    Result:
    http://forums.adobe.com/servlet/JiveServlet/downloadImage/2-4131053-149172/450-581/IMG_000 8.PNG
    —Johannes
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/4131053#4131053
    To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/4131053#4131053. In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in Digital Publishing Suite by email or at Adobe Forums
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • How did they do that?

    Hi all,
    i am new to Flash but have experiance in cfml,php and sql. I
    would like to create an image gallery similer to the one on
    jackjones.com (Collections/jackets). I dont want to copy it but,
    the way you can click on the image to get it to enlarge and move
    and then go back when you click anywhere on the screen.
    I can create the movies via this.createEmptyMovieClip() and
    by drawing the mcclips on the stage and load the images from a text
    file.
    The problem i am having is with the moving, how do i create
    the movement with action script as apposed to useing a motion tween
    and huge numbers of layers and a very long timeline?
    Many thanks in advanced
    Hassan

    Yeah tween with action script is the way to go.
    Try this:
    http://hosted.zeh.com.br/mctween/using.html
    XMXMXMX wrote:
    > Hi all,
    > i am new to Flash but have experiance in cfml,php and
    sql. I would like to
    > create an image gallery similer to the one on
    jackjones.com
    > (Collections/jackets). I dont want to copy it but, the
    way you can click on the
    > image to get it to enlarge and move and then go back
    when you click anywhere on
    > the screen.
    >
    > I can create the movies via this.createEmptyMovieClip()
    and by drawing the
    > mcclips on the stage and load the images from a text
    file.
    >
    > The problem i am having is with the moving, how do i
    create the movement with
    > action script as apposed to useing a motion tween and
    huge numbers of layers
    > and a very long timeline?
    >
    > Many thanks in advanced
    > Hassan
    >
    >

  • Why isn't clock available in notification center? How did they forget that

    If reminders and calendar are available in notification center why isn't clock?

    Do you mean alarms? Because the time is displayed at the top of the screen while in the notification center. If you mean alarms, it's probably because they expect people to stop using the alarm feature for anything other than waking them up in the morning, which probably doesn't need to be displayed in the notification center since it must be dismissed or snoozed immediately. Now that Reminders is a feature, it's much easier to use that as you had used the alarm clock before. You can be 'reminded' at a certain date & time without having to use clocks.
    Is that what you were talking about or am I off the mark?

  • How do they do that: Ocean 11 split screen

    Hi, I have a question on how to get a graphical presentation similar to an effect used (I believe) in Ocean's 11 or the Carpetbagger videos on the New York Time's site. Here is a description of the graphic
    +There are three upright regtangles. The first two rectangles show a "split screen" shot of something. The shot is cut in half between the two rectangles. The third remaining rectangle shows a completely different but thematically related shot.+
    I know how to get the three rectangles in LT and embed video to the glyphs. My question is how to marry one shot "in half" between the first two rectangles?
    Pls. respond if you have any feedback or suggestions. Thanks!

    I would not even consider for a moment attempting to perform screen effects like this in LiveType. Use FCP's conventional cropping tools or go to Motion for ultimate control. Either will be far easier than forcing LiveType to do anything other than text animations.
    Yes, the presets and template libraries for LT appear to offer sophisticated motion graphics capabilities but the energy required to force LT to do them is wasted compared to Motion which is (more or less) designed for this stuff.
    I cannot recall the sequence but creating three masks and populating them is a snap in Motion (after you learn the application—for me that's a few years).
    In FCP you'd simply crop three layers and position them.
    bogiesan

  • JSP Syntax Highlighting

    Does anyone know how to configure Syntax highlighting for JSP's in JDeveloper v3.2?
    Thanks
    Mark

    You need a plugin which supports JSP.
    MyEclipse does (along with a lot of other stuff)
    Lomboz also provides a jsp editor
    You can find a whole lot of eclipse plugins at
    http://www.eclipseplugincentral.com/
    http://eclipse-plugins.2y.net/eclipse/index.jsp
    Cheers,
    evnafets

Maybe you are looking for

  • Upgrade to Yosemite on external hard drive

    I want to try Yosemite out, via an external hard drive, and leave Snow Leopard (for now) as the main OS on my iMac. Would you confirm that what I'm intending to do is the correct procedure? Download Yosemite from the App Store onto my iMac Double cli

  • 2 monitors from MBP?

    Is there any way to run 2 external monitors from a single Macbook Pro with the unit closed? (so the external 2 monitors would be the only 2 monitors on) Thanks

  • ODBC error in BI Launch pad

    hi, am very new to SAP BI/BW/BO i am getting error while running the query in BI launch pad, which i imported from the UDT in UDT the values are being displayed and all the parameters were clearly defined the query is being running perfectly in RICH

  • Query about BPEL functionality

    I'm investigation BPEL's suitability for a project I'm working on and I'm having difficulty finding answers to the following questions: Is there a means to locate all instances that meet common criteria (e.g. all instances in a specific process flow

  • SPM data extraction question: invoice data

    The documentation on data extraction (Master Data for Spend Performance Management) specifies that Invoice transactions are extracted from the table BSEG (General Ledger) . On the project I'm currently working the SAP ERP team is quite worried to run