Increase Memory Space for Tomcat

"Uston, i've a problem: MemoryError: PermGen space; java.lang.OutOfMemoryError: PermGen space"

On Tomcat on Windows (started manually)

If you run Tomcat (eg. from JIRA Standalone) on Windows, and are starting it manually by running bin\startup.bat, edit bin\setenv.bat and add the line:

set JAVA_OPTS=-Xms256m -Xmx256m -XX:MaxPermSize=512m 
and then restart. Adjust 256 to the maximum memory you want to allocate.


If bin\setenv.bat does not exist, create it or edit directly tha catalina.bat

fix eclipse error: "resource is out of sync with the file system: ..."

To fix this problem, right click on the project and select "Refresh"!

wsdl to java

wsdl2java -p org/apache/axis2 -pn CatalogoFattureHttpSoap11Endpoint -uri http://w2k302/CipelPortalBackEnd/services/CatalogoFatture?wsdl

where
-p org/apache/axis2 is the command for create the classes in that package, but the directories must already exist!
-pn CatalogoFattureHttpSoap11Endpoint, is the name of the endpoint
-uri http://w2k302/CipelPortalBackEnd/services/CatalogoFatture?wsdl, is the wsdl referenced

From Array ([]) to Collection

// Fixed-size list
List list = Arrays.asList(array);

// Growable list
list = new LinkedList(Arrays.asList(array));

// Duplicate elements are discarded
Set set = new HashSet(Arrays.asList(array));

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.)