During learn and experience

۷ مطلب در مهر ۱۳۸۶ ثبت شده است

RUP defination ?

Hi friends

It is important that we know about RUP definition and use cases .

RUP definition : The Rational Unified Process, or RUP, is a software engineering process framework developed and marketed by Rational Software .
۳۰ مهر ۸۶ ، ۱۵:۴۹ ۰ نظر موافقین ۰ مخالفین ۰
سعید زرین فام

Using ObjectArrayDataProvider component for show list of objects in table component in VWP

Hi friends

For showing list of object in the table component best choose is ObjectListDataProvider component like this sample
But until now the ObjectListDataProvider component in the palette have not worked and we must write a class that extends ObjectListDataProvider .
But there is a component that can act return ObjectListDataProvider . this is ObjectArrayDataProvider .
We can easily drag and drop this component into design page and then set array property .
For this propose first declare an array in the page :

private Entity.Person[] arrayPerson ;

public Person[] getArrayPerson()
{
return this.arrayPerson;
}

public void setArrayPerson(Person[] arrayPerson)
{
this.arrayPerson = arrayPerson;
}

Then drag and drop ObjectArrayDataProvider component into design page and then set array property with array person.
Now we can right click on the table component in the page and select Bind to data then select ObjectArrayDataProvider1 .

please insert your comment .

bye friends
۳۰ مهر ۸۶ ، ۱۳:۲۵ ۱ نظر موافقین ۰ مخالفین ۰
سعید زرین فام

Retrieve value from ListBox component in Netbeans VWP

Hi friends

In the com.sun.webui.jsf.model.Option constructor we can set an Object for value but for retrieving this object in the next level I encounter some problem.
I write this code for create an Option for a ListBox :

Option option = new Option(new MyEntity(1,"Saeed"),"Saeed") ;

Then I add this Option in the my ListBox .
In the valueChangeListenerExpression method I want to get MyEntity but I cannot retrieve that object I only access to the toString() value of my Object !!!!!!

Conclusion: we can only set primitive object and their wrapper in the values of ListBox component .

Please insert your comment
Bye friends
۲۸ مهر ۸۶ ، ۰۹:۰۹ ۰ نظر موافقین ۰ مخالفین ۰
سعید زرین فام

How to use multiple persistence unit in EJB 3 ?

Hi friends

I wanted to use two EntityManager in my EJB 3 application but i encountered this exception from container : java.lang.IllegalStateException: Local transaction already has 1 non-XA Resource: cannot add more resources.

For solving this problem i find a solution . I inject a UserTransaction object into my stateless session bean then when i want to use two EntityManager i begin UserTransaction and finally commit UserTransaction like below :

@Stateless
@TransactionManagement(TransactionManagementType.BEAN)
public class BusinessBean implements BusinessRemote
{
@Resource()
private UserTransaction utx;

@PersistenceContext()
private EntityManager em1 ;

@PersistenceContext()
private EntityManager em2 ;

public void someMethod()
{
try
{
utx.begin();
//use em1
utx.commit();

utx.begin();
//use em2
utx.commit();
}
catch (Exception ex)
{
ex.printStackTrace();
}
}
}


Please insert ur comment.

bye friends

۲۳ مهر ۸۶ ، ۱۲:۰۰ ۰ نظر موافقین ۰ مخالفین ۰
سعید زرین فام

Solve Glassfish v1 as windows service problem !!!

Hi friends

Problem:
When Sun Java application server or Glassfish v1 installed on Windows 2003 server as windows service . it works proper, but when the user logs off, the application server does not have any service.

Solution :
For solve this problem you must start admin console and go to application server section and go to JVM setting and add new option -Xrs.

bye friends
۲۱ مهر ۸۶ ، ۲۱:۲۱ ۰ نظر موافقین ۰ مخالفین ۰
سعید زرین فام

Attach an Entity With Merg() Method (for method parameters)

Hi friends

I found that In the Java Persistence API EntityManager.merge() method cannot attach method parameter.

This sample code is wrong because merge method cannot attach method parameter, then remove method cannot execute.

public void delete(MyEntity myEntity)
{
em.merge(myEntity);
em.remove(myEntity);
}

This code is correct.

public void delete(MyEntity myEntity)
{
Object entity = em.merge(myEntity);
em.remove(entity);
}
۱۷ مهر ۸۶ ، ۰۸:۳۳ ۰ نظر موافقین ۰ مخالفین ۰
سعید زرین فام

Use expression language in Netbeans VWP

hi friens

Expression language is a powerful tool for writing JSF pages .
in this post i describe how to using this functionality in Netbeans VWP for creating flexible table .

1. Drag a table from component palette into page
















2. From travel Java DB database drag Person table into your table














3. Right click on the table component and select table layout then add a table column like following image




















4. Add following property to button1 in the JSP section like image

visible="#{(currentRow.value['PERSON.FREQUENTFLYER']==1)}"





5 . See output . all row dont have action button .




bye friends
۰۹ مهر ۸۶ ، ۱۱:۳۲ ۱ نظر موافقین ۰ مخالفین ۰
سعید زرین فام