Tag Archives: JSF

Simple Captcha in JSF with and without Acegi Security

At first, goto SimpleCaptcha and read all that they are saying.

Right now, I’m using captcha in JSF. I have an jsf application, I built that through Appfuse.

It has Acegi security 1.0.5  and spring 2.5, now i’m trying to integrate Simple captcha 1.2.1 in it.

Read more of this post

Advertisements

Removing Header And Footer For a certain page in Appfuse

I wanted to appfuse theme for a certain page. I just needed to design a pop up window. Upon a button click, a popup will be opened. The pop up will contain a a text field and a button. But problem is whatever i do, appfuse decorators adds default header and footer. In a small pop up window, it doesn’t look good with the big header and footer.
I wanted to remove these header and footer. Because, even if i call an empty page without any html or any other code, the decorator addes the header and footer.
Then I found ‘decorators.xml’ in ‘WEB-INF/decorators.xml’. What I did, i put my view page in directory named ‘popup’ in my webroot. added ‘ <pattern>/popup/*</pattern> ‘ this line under ‘<excludes>’ tag. after adding decorators.xml turned out like this….
<decorators defaultdir=”/decorators”>
<excludes>
<pattern>/40*.jsp</pattern>
<pattern>/*ajax=true*</pattern>
<pattern>/scripts/dojo/*</pattern>
<pattern>/struts/dojo/*</pattern>
<pattern>/resources/*</pattern>
<pattern>/popup/*</pattern>
</excludes>
<decorator name=”default” page=”default.jsp”>
<pattern>/*</pattern>
</decorator>
</decorators>

JSF – tomahawk dataTable and commandLink not working together

I was using tomahawk datatable. datatable’s rows have command link. this link will take to another page with a param. when i started working in it the datatable, it has rows on load and it was working well. then i added a drop down above it. so that i can filter the datatable. but this time it wasn’t working. this list page was binded to one bean and the action method is on the other bean. both of the bean was in request scope. change them to session scope might solve the problem. But i didn’t want to do that. finally I found a solution at http://forums.sun.com/thread.jspa?threadID=549675&start=60&tstart=0
I have just added ‘ <t:saveState id=”pagelist” value=”#{settingsList.settings}” /> ‘ line above the data table tag. and it worked.
<h:selectOneMenu value=”#{settingsList.settingsTypeValue}” id=”settingsType” styleClass=”select”>
<f:selectItems value=”#{settingsList.settingsTypes}” />
</h:selectOneMenu>
<h:commandButton value=”#{text[‘button.go’]}” action=”#{settingsList.show}” id=”go” styleClass=”button” />
<t:saveState id=”pagelist” value=”#{settingsList.settings}” />
<t:dataTable id=”settings” var=”setting” style=”margin-top: 10px” value=”#{settingsList.settings}” rows=”25″ sortColumn=”#{settingsList.sortColumn}” sortAscending=”#{settingsList.ascending}”>
<t:column>
<f:facet name=”header”>
<t:commandSortHeader columnName=”id” arrow=”true”>
<h:outputText value=”#{text[‘settings.id’]}” />
</t:commandSortHeader>
</f:facet>
<h:commandLink action=”#{settingsForm.edit}” value=”#{setting.id}”>
<f:param name=”id” value=”#{setting.id}” />
</h:commandLink>
</t:column>
<t:column>
<f:facet name=”header”>
<t:commandSortHeader columnName=”name” arrow=”true”>
<h:outputText value=”#{text[‘settings.type’]}” />
</t:commandSortHeader>
</f:facet>
<h:outputText value=”#{setting.settingsType}” escape=”true” />
</t:column>
<t:column>
<f:facet name=”header”>
<t:commandSortHeader columnName=”name” arrow=”true”>
<h:outputText value=”#{text[‘settings.name’]}” />
</t:commandSortHeader>
</f:facet>
<h:outputText value=”#{setting.settingsValue}” escape=”true” />
</t:column>
</t:dataTable>

Heading for Appfuse

I was assigned to develop a solution to manage customer applications.

I could have done it with simple solution with php on a simple cms.

But in past few year I worked in J2EE solutions. So headed for that.

But the problem is, when I worked on J2EE projects my seniors provided me the already structured Skeleton. What I didn’t have with me in my new workplace.

I have experienced with JSF, Spring and Hibernate.

So I wanted a skeleton with these three. Along with user management, session management and ready to use JSF-Spring-Hibernate  configuration. I studied and found that it will really painful job to connect them all, if I don’t have any previous experience doing that. Moreover, I will never know, if have done it perfectly and there is no one to check it. Do, I headed for Appfuse ( http://appfuse.org/ ). I was looking for some demo it can use it. I found http://demo.appfuse.org/ . There were four choices. They are –

* JSF + Spring + Hibernate
* Struts 2 + Spring + Hibernate
* Spring MVC + Spring + Hibernate
* Tapestry + Spring + Hibernate

As u can assume, I picked “JSF + Spring + Hibernate”. After spending some time I found that, It was really that, what I was looking for. It has JSF, Spring, Hibernate and ACEGI security already configured and ready to use stage. Now, just i want, to get the source code along with the dependency jars, and the hell working it out.

So I have started work on it, got some awesome facilities with some problem. I will share it on future.