i-netsource.de

Web development / Java / JSF / Hibernate / SQL …

Export SVN Entries to CSV

Today i faced the problem, that we wanted to create a CSV list out of our SVN Repository … That is not so simple as we thought, so here a quick Solution (with hardcoded Path .. change them )

this creates a XML File with all subfolders of “yourPathToSvn” Now you can just copy [...]

, , , ,

How to create a textual Primefaces Statusbar

If you want to add some status text to your JSF – Page and you need to use a static statusbar and a poll component. Very important is to set async to true! Example

, , , , ,

How to get the current Server path

If you ever needed to create a link inside you managedBean, you might want to know how the server url is.

,

How To Add Cookies In JSF Context

If you want to read a Cookie to your JSF Bean, you can simply do it like that:

To change or add the Cookie, you could try this method

Have Fun!

, ,

How to mock FacesContext with PowerMock and Mockito

I am always facing the problem, to fail testing FacesContext in some classes. If you know how you can do that, it is quite simple. In this case i need to mock away FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap(); So here is an example.

Thats it! Here my Maven Dependencys

, , , , , ,

constructor Service in class javax.xml.ws.Service cannot be applied to given types

If you are trying to create a Webservice with Netbeans, you might get an error like constructor Service in class javax.xml.ws.Service cannot be applied to given types There is a bugreport here: http://netbeans.org/bugzilla/show_bug.cgi?id=195792 which means that this is not a bug, yes .. they are right.., but anyway, if you want to make you code [...]

, , , , , ,

Handling Views without primary key in Hibernate

It may happen that you have to create some Hibernate Classes without having access to the database and you get some nasty views or tables which do not have a valid primary key. So what can we do? The Answer is quite simple. Just create a Class depending on your Class and there you have [...]

, , , , ,

Composite Component in JSF

If you ever wanted to have your own special tag in your JSF Page, you can create a composite component.. Of course, it also helps to avoid written some code twice or even more often. The main problem using “normal” JSF like:

you cannot pass a bean as parameter to a normal JSF page [...]

, , , , , ,

MultipleBagFetchException

Error: org.hibernate.loader.MultipleBagFetchException: cannot simultaneously fetch multiple bags A Solution can look like that: Add @IndexColumn(name=”Your Unique ColumnName”) to your @OneToMany relationship Or you change all your @OneToMany(fetch=FetchType.EAGER) to @OneToMany(fetch=FetchType.LAZY), but keep in mind that you cannot access theses collections anymore Or you change all of your LAZY Collections to a java.util.Set, but keep in mind, [...]

, , , , , , , ,

Run Glassfish without beeing root on Port 80

Hi, if you try to run Glassfish on Port 80 without beeing root, that will fail. It fails because of security reason. Non-root user cannot access ports under 1024. First and often found way is to change you Iptables, which you can do like that.

But that did not really work for me. I [...]

, , , , , , , , , ,

Previous Posts