How to access a session scope bean usign HttpServletRequest
0I 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>
Support to Wikipedia’s protest against SOPA and PIPA
0dammuozz.com supports Wikipedia’s protest against SOPA and PIPA. Make your voice heard!!
go to Wikipedia.org to learn more.
#nosopa #wikipediablackout!
Sistemi Informativi – Materiale Utile
0
- Riassunto del corso gentilmente offerto da SyKoM e antiufo DOWNLOAD PDF Sistemi informativi_teoria e XML
Solo i riassunti migliori approvati sia dall’uomo del monte che da Chuck Norris arrivano su dammuozz.com
Reti di Calcolatori Applicazioni – Materiale Utile
0Ecco 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 =)
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!!
- 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
- Download Adobe Flash player 11 tarball ( .tar.gz ) from adobe.com
- go to the Download folder (or where you downloaded the tar.gz)
cd Downloads/
- untar it
tar zxvf install_flash_player_11_linux.i386.tar.gz
- 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!!
How to enable and disable adblock plus using keyboard shortcut
0easily 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 notifier
0Are 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:
- install it from Ubuntu Software center searching for gm-notify or by terminal typing
sudo apt-get install gm-notify
- insert your username and password on “Gmail Notifier Configuration” and…that’s it!
enjoy!!
how to auto start firefox on login
0This is only an example, you can add any application in the same way!
- click the menu in the upper-left screen corner and go to system-> preferences -> startup applications, or simply type “startup applications” if you are using unity!
- Press the Add button.
- Fill in the form like on this picture
- Press Add!
From now on firefox will be started on every login
If you want to remove it just open “Startup Applications”, select the application and press Remove.
All clear?!! feel free to comment!!
Live USB: unknown keyword in configuration file
0Sometimes 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:
- write “help” and hit Enter,
- close the help hitting Enter again
this sholud solve the problem!
Dammuozz
Recent Comments