Remove all Scriplets ??  and change to tags.

I have a shopping cart aproximately 2 years old that is jsp/servlet.
The jsp pages look more like servlets as they have TONS of java code in them.
The shopping cart currently has no taglibs in it, and I am in the process of re-writing all jsp pages.
Is there an easy way or good tutorial to convert these scriplets into nice tags ?? I have had success in creating simple tags to connect to database on first page, but not sure if I am going in right direction.
or do I just keep trying google till I stumble on something.??
Should I post an example jsp page of the sriplet code??

My brain is turned off today, having a tuff time starting it..
Here is the beginning of the shopping.jsp, first page a user would see.
<%
          shopping.jsp
     String shoppingServlet = (String) session.getAttribute("shoppingServlet");
       System.out.println("Shopping servlet path : " + shoppingServlet);
     ItemBean[] items = (ItemBean[]) session.getAttribute("items");
     String isFromCredit = (String) session.getAttribute("isFromCredit");
     Formatter formatter = new Formatter();
%>
<!--some html stuff -->
<form name='form' action='<%= shoppingServlet%>' method='post'>
<!--some more html stuff -->
<%     for (int i=0; i < items.length; i++) {
               ItemBean item = (ItemBean) items; %>
          <tr height=10>
               <td valign='middle'>
                    <a href='/shopping/description.jsp target='product'
                         onClick='window.open("/shopping/description.jsp?item=<%= item.getID()%>", "product", "toolbar=no,status=no,height=500,width=650,scrollbars=yes,resizable=no");return false'>
                         <%= item.getName() %>
                    </a>
               </td>
               <td valign='middle'>
                    <%= item.getShortDesc() %>
               </td>
               <td valign='middle' align='right'>
                    <%= item.getSize() %>
               </td>
               <td valign='middle' align='right'>
                    <%= formatter.formatMoney(Float.toString(item.getPrice())) %>
               </td>
               <td valign='middle' align='center'>
                    <input type=image src='../images/addToCart.gif' alt='Add To Cart'
                         onClick='document.form.action.value="cart", document.form.itemToAdd.value="<%= item.getID() %>"'>
               </td>
          </tr>
How do I deal with the session attributes at top of page??
How can I put that code into a servlet ??
and the for loop will just be a little work on the servlet side , right ??

Similar Messages

  • How can you create a paragraph style that removes all spaces and forces everything to lower case?

    Hi,
    Is there anyway of using GREP (or some other magical wizardry) to create a paragraph style that automatically removes all spaces and forces words into lower case?
    Strange request i know....I'm wanting to use it for datamerged email addresses.
    Thanks

    so doing it through InDesign is a work around I'm exploring.
    Excel has the 'LOWER' function and the ability to record macros for a quick find/replace on the spaces - so that's definitely a good option if it can't be solved purely in InDesign.
    You can change case via scripting in InDesign. This AppleScript (OSX only) will set the case of the selected paragraph style to lower. It would be possible to add some code that would strip spaces as well:
    tell application "Adobe InDesign CS6"
        activate
            set StyleList to name of every paragraph style of active document
        set myDialog to make dialog with properties {name:"Document Paragraph Styles"}
        tell myDialog
            tell (make dialog column)
                tell (make border panel)
                    tell (make dialog column)
                        make static text with properties {static label:"Choose a Style", min width:150}
                    end tell
                    tell (make dialog column)
                        set myPresetsDropdown to make dropdown with properties {string list:StyleList, selected index:0, min width:150}
                    end tell
                end tell
            end tell
        end tell
        set myResult to show myDialog
        if myResult = true then
            --+1 gets the correct name because list starts at 0
            set myStyle to item ((selected index of myPresetsDropdown) + 1) of StyleList
        else
            return
        end if
        destroy myDialog
        tell active document
            set myStyle to paragraph style myStyle
            repeat with j from 1 to (count stories)
                repeat with i from 1 to (count paragraphs in story j)
                    if applied paragraph style of paragraph i of story j is myStyle then
                        --defines a variable to replace the generic this_text parameter in the handler
                        set SCText to the contents of paragraph i of story j
                        set contents of paragraph i of story j to my change_case_of(SCText)
                    end if
                end repeat
            end repeat
        end tell
    end tell
    on change_case_of(this_text)
        set the_comparison_string to "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
        set the_source_string to "abcdefghijklmnopqrstuvwxyz"
        set the_new_text to ""
        repeat with thisChar in this_text
            set x to the offset of thisChar in the_comparison_string
            if x is not 0 then
                set the_new_text to (the_new_text & character x of the_source_string) as string
            else
                set the_new_text to (the_new_text & thisChar) as string
            end if
        end repeat
        return the_new_text
    end change_case_of

  • How can I remove all photos and directories from iPhoto?

    How can I remove all photos and directories from iPhoto as if it was a brand new install?
    I am new to iPhoto and was unaware of how it works, honestly I still am a little confused as to when pics I am using 1/2 the time, some from iPhoto and some from MyPics.
    Anyhow, I am looking to remove all photos from iPhoto because during the migration of all my photos from PC to MAC, somehow my timeline became messed up and all my photos that have been logged my dates since 1998 are now all messed up.
    Although all my year folders are still in tact, IE 1998-2006, the subfolders and like pics are all intertwined somehow.
    And when I search iPhoto for a given year, photos from 2,4, 8 yrs back show up in 2006.
    Anyhow, I have selected and deleted all photos and folders within iPhoto, and then import the desired photos from MyPics, only to have the photos double up in the library. ( The old ones that should be deleted and the new imports)
    I simply don't get it, they fill the trash and disappear when it's emptied, then reappear when iPhoto re-opens!
    Can someone help????
    I have completely reworked all my photos so that they are all in the correct folders outside of iPhoto, and now I want to import those and only those pics with that file structure.
    IE Structure = YEAR > MONTH > DAY ( or if needed) > DAY/EVENT

    Do you want to remove the existing full sized image files also? If so then just drag the iPhoto Library folder from the Pictures folder to the Trash and empty it. But be warned you'll lose all of your image files.
    You are dragging the files to the iPhoto Trash bin and then using the iPhoto->Empty Trash menu, right?
    In copying your photos to myspace and then back the original capture date may not be retained and then either the created date or modified date will be used by iPhoto. If the files in the current library are the originals from your camera then those have the best chance of retaining the correct Captured Date. You can check that out by dragging the Originals folder from your iPhoto Library folder to the desktop and then trash what remains of the iPhoto Library folder. Then launch iPhoto and it will ask you to create an new library. Then import that Originals folder and it's subfolders by dragging it into iPhoto's open window. You'll keep the same rolls that was. The roll dates may change but you can check the captured date of the files by using the calendar in the Source pane.
    You won't be able to keep your folder structure within iPhoto. Each outside folder will result in a roll with the same title as the folder. You'll be able to create folders in the Source pane to put albums inside. You can create a smart album to include all photos in a certain date range, line one month.
    Do you Twango?
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    G5 Dual Core 2GHz, 2G RAM, 250G HD; G4 Dual 1Ghz, 1.5G RAM, 80G HD,   Mac OS X (10.4.7)   22 LCD Display, 200G & 160G FW HDs, Canon S400, i850 & LIDE 50, Epson R200

  • FF very slow on shopping sites or news sites. OK temporarily when I remove all cookies and offline content storage, but the slows again

    FF very slow on shopping sites or news sites. OK temporarily when I remove all cookies and offline content storage, but then slows again

    Reload web page(s) and bypass the cache.
    * Press and hold Shift and left-click the Reload button.
    * Press "Ctrl + F5" or press "Ctrl + Shift + R" (Windows,Linux)
    * Press "Cmd + Shift + R" (MAC)
    Clear the cache and the cookies from sites that cause problems.
    "Clear the Cache":
    * Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
    "Remove Cookies" from sites causing problems:
    * Tools > Options > Privacy > Cookies: "Show Cookies"
    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.com/kb/Safe+Mode

  • Accept all editions and changes with one click in a PDF document

    In Adobe Acrobat (7.09) I see how to accept changes in a PDF document individually, but is is possible to accept all editions and changes with one click, as it is in Word for example. For tips thanks in advance.

    Hi,
    To save usernames/passwords, you may have to make sure that '''Remember passwords for sites''' is still enabled in '''Tools''' ('''Alt''' + '''T''') > '''Options''' > '''Security''' while at the same time in the '''Privacy''' tab, '''Never remember history''' or '''Always use Private Browsing''' shouldn't be enabled and if '''Settings''' is visible here, make sure that '''Saved Passwords''' is not enabled (ticked).
    [https://support.mozilla.org/en-US/kb/Options%20window%20-%20Security%20panel?as=u Security panel]
    [https://support.mozilla.org/en-US/kb/Options%20window%20-%20Privacy%20panel?as=u Privacy panel]

  • How to remove all columns and cells in numbers

    how to remove all columns and cells in numbers

    Click on the Table's icon in the Sheets list. Press delete.
    Done.
    Regards,
    Barry

  • HT1386 Since 8th May , I am not able to synchronize my iPhone with iTunes. Have tried removing previous back up data , removed all photos and videos on iPhone , switched  on and of and  reset iPhone  a million times , restarted my Mac a thousand times :(

    Since 8th May , after updating the iphone software to 5.1.1  I am not able to synchronize my iPhone with iTunes. Have tried removing previous back up datas , removed all photos and videos on iPhone , switched  on and of and  reset iPhone  a million times , restarted my Mac a thousand times Please Help !!!

    I have tried both options .. back up on this computer and also back up on icloud.
    The backingup is fine .. there is no problem .. even synchronizing songs , applications , calender , mail accounts is fine .. only the contacs are not synchronizing. The itune goes on and on .. showing synchronizing contacs .. but nothing happens. When i uncheck contacts synchronisation .. everything works fine . I have also reorganized my address book . but it does not help

  • HT1918 how can i remove my billing and change it into a free apple id user?

    how can i remove my billing and change it into a free apple id user?

    iTunes Store: Changing Account Information
              http://support.apple.com/kb/HT1918
    Select None under your payment method.

  • Had a hard time all of sudden opening photos in PS via Bridge. Updated all my software and now halfway through editing a photo, my actions don't work properly. Should I remove all programs and re-install?

    Had a hard time all of sudden opening photos in PS via Bridge. Updated all my software and now halfway through editing a photo, my actions don't work properly. Should I remove all programs and re-install?

    <moved from Adobe Creative Cloud to Photoshop General Discussion>

  • I have unlocked my iPhone 3G with Vodafone via iTunes, but now the downloaded apps crash immediately when opened. I've tried a Restore, but this didn't help. I've also tried removing all apps and re-installing them, but they still don't work. Any ideas?

    I have unlocked my iPhone 3G with Vodafone via iTunes, but now the downloaded apps crash immediately when opened. I've tried a Restore, but this didn't help. I've also tried removing all apps and re-installing them, but they still don't work. Any ideas? Thanks.

    yep, unfortunately can't reset without the passcode either.
    With regards to doing a restore, do you mean:
    open itunes on my computer
    click on my device on the left
    go to the device summary
    click restore
    it then asks if i want to back up before i restore (to which i say no)
    then it asks me if i'm sure I want to restore to factory settings and that all of me media and data will be erased and replaced with the newest version ( to which I say yes)
    then it takes about 90 mins to do this but when I look at my phone, everything is exactly the same.
    Am I missing something? Obviously I'm technologically challenged, but I HAVE to get to the bottom of this!

  • My iPod nano screen is frozen and will not respond. It shows the song which was playing is paused, but will not resume playing. I have held down all controls, and changed the slide switch, but nothing happens

    my iPod nano screen is frozen and will not respond. It shows the song which was playing is paused, but will not resume playing. I have held down all controls, and changed the slide switch, but nothing happens

    Hi Goofy Goat,
    Welcome to the Apple Support Communities!
    It sounds like you have done some great troubleshooting for your iPod nano that is not responding. In this situation, if resetting it did not resolve, I would suggest restoring the iPod back to its factory settings and then sync your content back onto it from iTunes. Please use the following article as a resource for restoring.
    Restoring iPod to factory settings
    http://support.apple.com/kb/HT1339
    Have a great day,
    Joe

  • PSE 8: "Auto-analysis" and change of tag icon not working

    Hi, in the organizer of PSE8/Win i have two problems:
    I select some thumbnails and use "auto analyze" (for quality level etc.). Then i get a status bar "auto analyzing starts" - and it never gets beyond that stage. I have to click "cancel" to get out. That's also true with one single image selected.
    The icons for tags like "Mary" automatically get a small picture. It is possible to change this tag picture after right-clicking. But then, the button "Edit symbol" is greyed out.
    The menu for sorting by date in ascending/descending order doesn't change anything (i always see oldest pictures first).
    There's lot of available hard disk in Elements' drive, but only 800 MB on the C: drive. I changed NONE of Elements preferences.  When i change preference to "auto analyze on organizer's start-up", it still doesn't work. In the task manager, i do NOT see a task like "PhotoshopElementsAutoAnalyzer.exe" or so. I believe i saw this task in a slightly earlier version where everything worked fine. The problem exists with old catalogs as well as with newly created catalogs. Re-starts and re-booting didn't help either. I have perfectly normal camera JPEGS - and the face recognition works fine. It seems that the sub-application "PhotoshopElementsAutoAnalyzer.exe (?)" misses - could you advise me which file to look for?
    Btw, i have Win XP SP2 with 4 GB memory on a non-English system with appropriate non-English PSE8 retail version. Premiere Elements 8 is installed too.
    I would like to try "auto analyzing" and i would like to change tag icon pictures. Of course i could re-install, but that's just so tedious and i don't know if it helps. Would you have any other ideas? Thanks a lot!

    Barbara, John,
    thanks again for your considerations! After some more testing and input from the PrE 8 forum, i can say the following:
    - Ascending/descending order: Now i know: If you have only pictures of one single day, there is no change in thumbnail order when you switch from "ascending" to "descending" and back. Of course pics from morning and evening should change position, but they don't. BUT: If you add one pic from another day, switching from "ascending" to "descending" suddenly fully works - including pics taken on one same day changing position. (To test Organizer, auto analysis and face recognition under fast clear conditions, i had originally only 20 pics in the catalog, all from one family day trip. And there, i couldn't change the order.)
    - I checked "auto analyze" again. Now i can say: When i start "auto analyze" manually, i see "ElementsAutoAnalyzer.exe" for half a second in the task manager. Then it disappears, and on the Organizer screens, the status bar keeps claiming "Starting analysis" until i click "Cancel". I ONLY tried it on regular JPEGs so far. There is no way to get a "smart tag". If i try a second time, no more "ElementsAutoAnalyzer.exe" appears in the task manager. I also switched users on my PC to a user which has no utilities whatsoever running, less than 10 processes in the task manager, turned off anti-virus - still the same problem with "auto analyze".
    - The face recognition tags btw are not written into the image file as IPTC, that has to be done with the "File" menu command. Also if i drag "smart tags" like "low quality" manually over a thumbnail, they get assigned only via catalog, not written as IPTC straight into the image file.
    I don't think it's worth wasting more of one's time before there is a bugfix delivered that expressively acknowledges the issues mentioned. I am not a computer geek, just like to play with pictures and videos; i thought Elements was made for people like that.
    Thanks again for your input!

  • I want to empty the Safari cache in OS 10.8.5, but cannot find the cache in the drop down menus. Where is it? Or do I go to preferences-privacy and select remove all cookies and website data?

    I received a 'bogus' email saying I had a virus and to click to scan my entire OS. I did not click - I trashed the email.
    I wanted to empty my cache but couldn't find it (OS 8.10.8.5) -- In the main menu, under Safari, the only thing I found was to select preferences, then privacy -- where a window showed an option of removing some or all cookies and other website data.
    Is that what I should do or is there a cache somewhere on the laptop?
    Thanks

    You were scammed. There's nothing wrong with your computer. You don't need to empty the cache.
    Helpful Links Regarding Malware Problems
    If you are having an immediate problem with ads popping up see The Safe Mac » Adware Removal Guide and AdwareMedic. If you require anti-virus protection Thomas Reed recommends using ClamXAV. (Thank you to Thomas Reed for this recommendation.)
    Open Safari, select Preferences from the Safari menu. Click on Extensions icon in the toolbar. Disable all Extensions. If this stops your problem, then re-enable them one by one until the problem returns. Now remove that extension as it is causing the problem.
    The following comes from user stevejobsfan0123. I have made minor changes to adapt to this presentation.
    Fix Some Browser Pop-ups That Take Over Safari.
    Common pop-ups include a message saying the government has seized your computer and you must pay to have it released (often called "Moneypak"), or a phony message saying that your computer has been infected, and you need to call a tech support number (sometimes claiming to be Apple) to get it resolved. First, understand that these pop-ups are not caused by a virus and your computer has not been affected. This "hijack" is limited to your web browser. Also understand that these messages are scams, so do not pay any money, call the listed number, or provide any personal information. This article will outline the solution to dismiss the pop-up.
    Quit Safari
    Usually, these pop-ups will not go away by either clicking "OK" or "Cancel." Furthermore, several menus in the menu bar may become disabled and show in gray, including the option to quit Safari. You will likely have to force quit Safari. To do this, press Command + option + esc, select Safari, and press Force Quit.
    Relaunch Safari
    If you relaunch Safari, the page will reopen. To prevent this from happening, hold down the 'Shift' key while opening Safari. This will prevent windows from the last time Safari was running from reopening.
    This will not work in all cases. The shift key must be held at the right time, and in some cases, even if done correctly, the window reappears. In these circumstances, after force quitting Safari, turn off Wi-Fi or disconnect Ethernet, depending on how you connect to the Internet. Then relaunch Safari normally. It will try to reload the malicious webpage, but without a connection, it won't be able to. Navigate away from that page by entering a different URL, i.e. www.apple.com, and trying to load it. Now you can reconnect to the Internet, and the page you entered will appear rather than the malicious one.

  • How to remove all in and out points from extendscript code?

    Hi,
         I am creating a sequence from a clip from extendscript code to automateToSequence function.
         But if there are some in and out points in the clip only the select clip part is converted as a sequence, what is the solution to remove all those in and out points from extendscript code, or to get the full clip to sequence even there are some in and out points.
    I am using the function like this; qe.project.getItemAt(i).automateToSequence(seq,0,0,1,1);
    Please suggest,
    Thanks and Regards,
    Anoop NR

    Double click the pre-comp or nested comp, open comp settings from the menu or by using the keyboard shortcut Ctrl/Cmnd + k.
    Note, changing the length of the comp will not extent the length of footage or layers inside the comp. You have to do that manually and it depends on your footage type.

  • Windows updates removes all tabs and tab groups so I have to regularly do a system restore to get them back.

    When there is an automatic update from Windows or Microsoft Security Essentials, it regularly has removed all my tabs and tab groups. A very frustrating occurance so I have to do a system restore to get all these back. Any solutions to this issue?

    After your computer restarts, you should be able to choose '''[[Session Restore|"Restore Previous Session" from Firefox's History menu]]''' to restore all your tabs and groups from last time.
    For this to work, Firefox must be set to remember history in the [[Options window - Privacy panel]].

  • How do I remove all fonts and just set them to factory?

    I have three computers that all have had free fonts added by an employee. They just keep multiplying and are up to nearly 1500 fonts now. When I try to open excel it tells me certain fonts are corrupt. I just want to remove all of them and start over with a legit font program. Any suggestions?

    They shouldn't have added any fonts to the /System/Library/Fonts/ folder (though they could have), so they should all be in one of two folders.
    1) Empty out the /Library/Fonts/ folder.
    2) Empty out the ~/Library/Fonts/ folder (the tilde means the current logged in user account).
    3) Read the last section in my article on how to reinstall just the fonts OS X came with in my article, Font Management in OS X
    Links my give me compensation.

Maybe you are looking for

  • Why will itunes not open on my macbook pro

    i recently got a new charger for my macbook pro because my old one had stopped working, so my computer had not been charged for about a week or a little longer. once i started up my computer i noticed that it started to freeze alot and itunes would n

  • Error while executing Query with Variable.

    Hi All, I have written a query to fetch values from some user tables and sap tables. The query is as below. select a.docentry,a.u_scname,e.block,e.[City], e.[Country], e.[State1], e.[StreetNo], e.[ZipCode], e.[Building], e.[Cellular],a.[U_WONo], a.[U

  • Flash Builder 4 Enterprise Deployment/Silent Install

    I am attempting to put together a package for Flash Builder 4, to be deployed to developers via SCCM.  Is there a guide on silent deployment with the Volume Licensed FB4 installer? I've not been able to find any documentation on doing this, and the m

  • Confirming Inventory Document

    Hi, I am trying to write off stock for a particular material. As WM has been implemented  I have created a transfer order (through T-code LT01) with movement type 999 and destination storage bin INVCLR . I have created an inventory document (LI01N)fo

  • Youtube video playback is jumpy.

    Youtube was working fine for me a few days ago. Now, when I play videos they are jumpy and shaky. The audio is fine. I have already tried a software update, flash update, and rebooting. What can I do to fix it?