Is there a way to put session.getAttribute() in a variable

Hi, title says it all.
I'm trying to put session.getAttribute("xxx") in an integer variable and it does not work.
int NoTech = Integer.parseInt(session.getAttribute("noTech"));
does not seems to work.
thanks, any help is appreciated :)

What is the type of "xxx"
Is it a String, and Integer, an Object?
session.getAttribute() returns an Object.
You need to cast that object to its proper type before you can use it.
It would complain about parseInt, because that expects a String as an argument not an Object.
If the attribute is an Integer object then:
int noTech = ((Integer)session.getAttribute("noTech")).intValue();
if the attribute is a String then:
int noTech = Integer.parseInt( (String)session.getAttribute("noTech"));
Cheers,
evnafets

Similar Messages

  • Is there a way of putting firefox bookmarks folder on the dock

    Is there a way of putting firefox bookmarks folder on the dock. not just one bookmark. i have done that. but i want all of them in stack or something.. similar to how windows did it in the start menu. its annoying that you have to open firefox first to access your links.
    i got my first imac yesterday and loving it!!! albeit the text is a bit small but i have found the zoom!
    thanks in advance

    Perhaps you don't know how to bring icons into the Firefox  Toolbar. You can put many things up there, including Bookmarks. You can also remove an icon or rearrange the order of icons.
    From View>Toolbars>Customize
    Here is the Bookmarks icon (next to the History icon) from which you can open all your bookmarks directly. And if you can remember a keyword, it will find that one, or any others that come up with that keyword. It's really quite convenient to use and will stay updated with any new bookmarks that are added.
    This is showing the Bookmarks open, which can be closed by clickng on the small x.

  • Is there a way to put the same event on multiple icloud calendars?

    Is there a way to put the same calendar entry on multiple calendars?  I have five children and most of them use their iTouch to keep there calendar.   My calendar is on icloud and I'd love it if they could see only their events but I need to see all of them.   Many of the events affect more than one child.

    As follow up to the above question,  I am the person putting items on the calendars.  I am not just trying to see calendars that they are maintaining. 

  • My wife and I share an account , is there a way to put both our contact lists in our one iCloud account without merging them., My wife and I share an account , is there a way to put both our contact lists in our one iCloud account without merging them.

    My wife and I both have iPhones and we share an apple ID. Is there a way to put both our contact list in the same iCloud without merging the lists.  We want to be able to use the same iCloud account because we share info .

    Welcome to the Apple community.
    No, there is no way of maintaining two separate contact lists with one account. Ideally you should each have your own iCloud account, you can still share your info by allowing each other to log into the other's account as a secondary account at settings >mail, contact, calendars. You can choose which services you choose to share and which you don't. This way you could maintain separate contact lists but still share them.

  • Is there a way to put the bluetooth icon on the homepage?

    I pair my iphone with my car when I'm driving. Is there a way to put the bluetooth icon on the homepage so I don't have to go through settings to turn the bluetooth on and off?
    I don't like to leave the bluetooth on all the time because it drains the battery, but it's kinda a pain to have to go through settings everytime I want to use this feature.
    On my last cell phone I could assign a "hot key" to automatically turn the bluetooth on and off. I really liked that. This bluetooth system seems a little dated to me.

    No not yet, hopfully soon.

  • Is there a way to put the cursor at a specific location in a RichTextBox?

    Is there a way to put the cursor at a specific location in a RichTextBox?
    The following code places the cursor at the start of a RichTextBox:
        RichTextBox RTbx
        RTbx.Focus();
        TextPointer tp = RTbx.CaretPosition;
        tp = tp.DocumentStart;
        RTbx.CaretPosition = tp;
    Not sure how to place it at a specific location other than start and end.
    The RichTextBox has contents.  At this point in the code, I do know the specific "word" in the contents, as well as the position (number of chars) where that word is located.  I just need to programmatically place the cursor at that location.
    bhs67

    Oh sorry, I see I missed something out my original reply.
    I have markup:
    <Grid>
    <RichTextBox Name="rtb">
    <FlowDocument>
    <Paragraph >This is the first paragraph</Paragraph>
    <Paragraph >TSecond paragraph is here</Paragraph>
    </FlowDocument>
    </RichTextBox>
    </Grid>
    Code - this is the window contentrendered event
    private void Window_ContentRendered(object sender, EventArgs e)
    rtb.Focus();
    // TextPointer moveTo = rtb.CaretPosition.GetNextInsertionPosition(LogicalDirection.Forward);
    TextPointer moveTo = rtb.CaretPosition.GetPositionAtOffset(9, LogicalDirection.Forward);
    if (moveTo != null)
    rtb.CaretPosition = moveTo;
    I see the cursor between the t and he of the second "the".
    Note that there are numerous other options such as the commented out line.
    Hope that helps.
    Recent Technet articles: Property List Editing;
    Dynamic XAML

  • Is there a way to put links within documents in Pages

    Is there a way to put a link on the first page of a Pages document that would take you to a certain location within the same document or to another document?

    Barry,
    See "Using Hyperlinks and Bookmarks" on page 110 of the Pages User Guide PDF. You can download the guide from the Help menu.
    Jerry

  • Is there a way to put a large amount of music on your iPod without having to keep all the files in iTunes on your computer as well? I want to put my entire music collection (including cds) on my iPod but don't want to take up the space on my computer.

    is there a way to put a large amount of music on the ipod without having to keep all the files on itunes as well? I want to use my ipod as an externa drive and put all of my music on it without taking up the space on my computer. I also don't want to lose all my files everytime I plug ipod into my computer. Is this possible? Is there a way to avoid using itunes and only use the ipod as an external drive?

    You cannot put music onto your iPod without using iTunes, that what iTunes is for.
    It's also not a good idea to wipe the music from your computer and having it only on your iPod. We see countless posts here from people who have done just that - and then lost everything when the iPod needs a Restore. Even if you never need to Restore your iPod, what happens when you eventually replace the iPod? You'll be back here asking how to get the music from one iPod to another. That's not easy to do, we see countless posts about that too!
    A much better idea is to buy an external drive (a proper external drive, not simply an iPod) and put your large amount of music onto that drive. Then point your iTunes Library to that drive. However, you need to remember two things:
    You still need a backup of that Library.
    Using an external drive as your iTunes Library means that the drive must be connected and ready to read before starting your iTunes programme. If it isn't, then iTunes will look on the C: drive - and you will find no music in your Library. (Once again, lots of posts about that as well!)

  • Is there a way to put a playlist on my phone from my computer without erasing the other music from my phone?

    Is there a way to put a playlist on my phone from my computer without erasing the other music from my phone?

    Not if you set up very carefully what you want synced from your computer.  Make sure you have not set things to sync automatically and manually choose the settings of what gets synced

  • When streaming a movie from an imac to apple tv, is there a way of putting the imac display off? I find it a waste having the screen on in another room. Any advice?

    When streaming a movie from an imac to apple tv, is there a way of putting the imac display off? I find it a waste having the screen on in another room. Any advice?

    No problem.
    This is a user forum so you are not addressing Apple. There's nothing to fix, that's how home-sharing works. There would be no way for the ATV to recognize your library and display content if the computer is in sleep mode.
    You can always airplay from an IOS device or use icloud if you don't wish to keep the computer on.

  • Is there any way to put the mini calendar on the monthly calendar as in Leopard?

    I downloaded Lion about a month ago and the only dislike is ical. For one is there any way to put the mini calendar on the monthly display as it was in Snow Leopard. It makes it much easier instead of flip flopping back and forth to see last month or previous months?

    Nope

  • I sent iTunes to trash. I was able to recover the program but have to "put back" songs one at a time. Is there any way to put back from trash using the "select all" command?

    I sent iTues to trash by mistake (trying to delete files from "yesterday"). I got the program back but have to "put back" songs one at a time. Is there a way to put back multiple songs using the "select all" command or anything else? Thanks for the help.

    The prgram is in one location and the library (media + library files) are in another. Sending it all to the trash would take some pretty delibrate multiple actions and digging through multiple folders, so I don't know how this was managed unless there's something in Snow Leopard that's new. Occasionally I have moved a file to the trash in Finder that I didn't want to and I can use Finder's "undo" to undo the last move. With many files...?

  • I brought a new computer is there any way to put the items that i have on my iphone and ipad on my itunes with out erasing and reformating my divices.

    I brought a new computer is there any way to put the items that i have on my iphone and ipad in my itunes. I know the music and apps i paid for but what about the songs and photos. that are not paid for. and having it sync with out it telling me that it has to erase all my things.

    See Recover your iTunes library from your iPod or iOS device.
    tt2

  • Is there a way to put additional text alert sounds on an iPhone 3GS?

    Is there a way to put additional text alert sounds on an iPhone 3GS?

    If you think this is silly and would like to let Apple know this, you can contact them here:
    http://www.apple.com/feedback/iphone.html

  • HT5610 have lost all my itunes files, however they are on ipod. is there a way to put them back in itunes

    my itunes program lost all files.  howwever they are on the ipod.  is there a way to put them back from the ipod?

    Recovering your iTunes library from your iPod or iOS device
    https://discussions.apple.com/docs/DOC-3991

Maybe you are looking for