How to access a session scope bean usign HttpServletRequest

0

I needed this for a school project and since it was so hard to find I want to share it!

 

usign a session javaBean to store the logged user information and then obtaining it from the Http session.

 

the method

public static <T> T getBean( FacesContext facesContextInstance, String beanName ){
        HttpServletRequest request = (HttpServletRequest)facesContextInstance.getExternalContext().getRequest();

        return (T)request.getSession().getAttribute(beanName);
    }

the method call is:

LoggedUserBean loggedUserBean = (LoggedUserBean)Utils.getRequestBean(FacesContext.getCurrentInstance(), "loggedUsr");

//now you've got your bean
Integer id = loggedUser.getId();

mind that loggedUsr is the bean name that you used on the faces-config.xml

<managed-bean>
    <managed-bean-name>loggedUsr</managed-bean-name>
    <managed-bean-class>userBeans.LoggedUser</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
</managed-bean>
wikiProtest

Support to Wikipedia’s protest against SOPA and PIPA

0

dammuozz.com supports Wikipedia’s protest against SOPA and PIPA. Make your voice heard!!

go to Wikipedia.org to learn more.

 

#nosopa #wikipediablackout!

 

xml-ico

Sistemi Informativi – Materiale Utile

0

 

Secondo studi ufficiali l’utilizzo di meme nei riassunti diminuisce sensibilmente i livelli di tensione ed incentiva l’apprendimento.

Solo i riassunti migliori approvati sia dall’uomo del monte che da Chuck Norris arrivano su dammuozz.com

ScreenShots_clip_image002

Reti di Calcolatori Applicazioni – Materiale Utile

0

Ecco un altro riassunto frutto del lavoro dei nostri migliori scienziati

i riassunti di Reti di Calcolatori Applicazioni DOWNLOAD PDF Reti applicazioni a few things you might need to know

I ringraziamenti si riconducono agli autori Antiufo e Sykom, dammuozz fornisce il solo servizio di mirroring della risorsa =)

adobe_flash_player_ico

install Adobe Flash Player 11 in Ubuntu

0

 

Since the apt link on adobe.com seems not to work I managed to install it using the tarball…I’ll show you how!!

  1. First you need to have at least Adobe Flash Player 10 installed. It’s very likely that you do but otherwise just install it (open a Terminal and enter these commands)

    sudo apt-get update sudo apt-get install adobe-flashplugin

  1. Download Adobe Flash player 11 tarball ( .tar.gz ) from adobe.com
  2. go to the Download folder (or where you downloaded the tar.gz)

    cd Downloads/

  3. untar it

    tar zxvf install_flash_player_11_linux.i386.tar.gz

  4. copy it into the flash player folder

    sudo cp libflashplayer.so /usr/lib/adobe-flashplugin/.

 

restart your browser and enjoy =)

P.S.: don’t forget to comment and subscribe to RSS for more interesting posts and more!!

firefox-adblock-plus

How to enable and disable adblock plus using keyboard shortcut

0

easily done in 4 steps:

  • open a new tab and put in the address bar

    about:config

  • in the filter box type

    extensions.adblockplus.enable_key

  • double-click on the value column and write the shortcut you prefer!

    I choose Ctrl+Shift+B so my value is

    Accel Shift B

    then press OK

  • restart firefox and you will see adblock toggle on and off when you press the keys

 

If you get any problem or have questions leave a comment below!!

gmail-icon1

Gmail notifier

0

Are you looking for a simple notifier for gmail that looks nice and integrates well in your ubuntu??

Here’s your choice!!

Highly Ubuntu integrated GMail Notifier – homepage

 

You only need to:

  1. install it from Ubuntu Software center searching for gm-notify or by terminal typing

    sudo apt-get install gm-notify

  2. insert your username and password on “Gmail Notifier Configuration” and…that’s it!

enjoy!!

linux-tux-code

Sistemi Operativi 2 – Materiale Utile

0

  • Riassunto creato a partire dalle slide del corso, gentilmente prodotto da Sykom e Antiufo DOWNLOAD PDF RiassuntoSistemiOperativi2

NB: manca la parte di appunti sul costrutto complention, il riassunto verrà aggiornato al più presto.

 

Stay tuned on dammuozz.com

SAMSUNG

Live USB: unknown keyword in configuration file

0

Sometimes Linux Live USBs won’t work. During the boot this error occours:

Attempting boot from USB Device … SYSLINUX … Unknown keyword in configuration file

boot:

To solve the situation:

  1. write “help” and hit Enter,
  2. close the help hitting Enter again

this sholud solve the problem!

 

Dammuozz

Go to Top