From Collection to Array ([ ])

Create an array containing the elements in a list:
MyClass[] array = (MyClass[])list.toArray(new MyClass[list.size()]);

Create an array containing the elements in a set:
MyClass[] array = (MyClass[]) set.toArray(new MyClass[set.size()]);

from set to list and viceversa

Set theSet=...
List list = new ArrayList(theSet); 
 
//Viceversa
List theList=... 
Set theSet = new LinkedHashSet(theList);

don't clip web content overflow for printing

Please IE, Please Firefox don't cut the content overflow of a web page that i want to print!
Go to the next page, please!

Maybe i've to say: "Please web designer, set overflow:visible for that element that overflow one page!"
Or set float:none for that floated element
Or set position:relative for that element that has a absolute position

And set display:none for that element that has no value in a print page!!!!!!

Thanks

add policy in oracle db

Do you add a policy in oracle db for simulate a virtual db?
Ok! the dbms_rls.add_policy function do it for you!
Buuuuut, one moment please!
Do you have the two rights?
1) Privilege rights?
2) DB rights (Enterprise Edition)?

The first, you can get it from sys user, executing this grant:
GRANT EXECUTE ON dbms_rls TO YOUR_USER

The second one, you can get it only if you have the right oracle db version. Don't you know if your versione is Enterprise? ok! this is the query for to know the version of your oracle db:
select * from v$version

Uhm! Don't you understand if the db is standard or enterrprise?
OK! the following query can says you if you have the function for add policy:
select * from v$option where parameter like 'Fine%';

if true then
you can add policy
else
YOU CANNOT add policy

if you can't add policy you'll get this error:
ORA-00439:
function not enabled: Fine-grained access control

OK?!

how to use f:attribute

the f:attribute tag is very useful when you want to pass an attributer inside a commandButton tag.
It plays in this way:

<h:commandButton id="bottoneForm"
actionListener="#{managebBean.actionListenerFunction}">
<f:attribute name="attributeName" value="attributeValue" >
</f:attribute>
</h:commandButton>


For to read it in the called actionListener function of the managebBean:

public void actionListenerFunction(ActionEvent e){
Object valueOfAttribute = e.getComponent().getAttributes().get("attributeName");
}


That's all Folks!

How to use h:selectOneRadio

Example

<h:selectOneRadio binding="#{visProfiliManagedBean.profiloDefaultModificato}" immediate="true"
value="#{visProfiliManagedBean.profDaModificare.profiloDefault}"
rendered="#{f.codProfilo==visProfiliManagedBean.profDaModificare.codProfilo&&visProfiliManagedBean.visModifica}">
<f:selectItem itemLabel="Si" itemValue="1" />
<f:selectItem itemLabel="No" itemValue="0" />
</h:selectOneRadio>

where
visProfiliManagedBean.profiloDefaultModificato is a HtmlSelectOneRadio object and visProfiliManagedBean.profDaModificare.profiloDefault is a boolean, but it can be any type of object (ex.: String, int, etc.)

Empty JBoss Cache

I did a new Login page for my web application. I spent 3 days for the new layout.
So the only thing that separeted me from my new satisfaction was the deploy in the production environment
After the deploy in Jboss, i connect with the web application and ... oops: the login page was not changed!
OK! The first thing i I thinked was IE cache! But it wasn't...
The problem was the JBoss cache.
you've to delete the file {jboss_home}\server\{default}\tmp\deploy\tmpxxx{webApplicationName}.war
and {jboss_home}\server\{default}\tmp\deploy\tmpxxx{webApplicationName}