[JBoss Seam] - @DataModelSelection problem, outjects the first element in th
by mail.micke@gmail.com
Hi,
I'm learning seam at the moment and wonder what I'm doing wrong.
Note:
Read a previous post with the same problem where the problem was solved by switching form tomahawk datatable to standard datatable.
I have tried with both standard datatable and richfaces one, but the problem persists.
I'm trying to implement a simple search/select/edit/save use case with seam in order to learn how to use some of the features (annotations, scopes and pageflow).
But in the search part of the flow, the first row is always outjected..
And I just started with Seam yesterday, so please point out any tips you have for me :-)
Backing bean:
| @Name("riskAddonBacking")
| @Scope( ScopeType.CONVERSATION)
| public class CountryRiskAddonBacking implements Serializable{
|
| /**
| *
| */
| private static final long serialVersionUID = 1L;
|
| @DataModel
| private List<CountryRiskAddonBean> searchResults;
|
| @DataModelSelection
| @Out(required=false)
| private CountryRiskAddonBean selectedItem;
|
| private String searchPattern;
|
| @Begin(pageflow="countryaddon")
| public void startPageFlow(){
|
| }
|
| public String performSearch(){
|
| int nbrHits = RandomUtils.nextInt()%10;
| List<CountryRiskAddonBean> tmpList = new ArrayList<CountryRiskAddonBean>(nbrHits);
| for(int i=0; i<nbrHits; i++ ){
| CountryRiskAddonBean cab = new CountryRiskAddonBean();
| cab.setTicketNumber("RSK-" + (RandomUtils.nextInt()%10000) );
| cab.setCptyName("CptyXYZ");
| cab.setCountryOfRisk("SWE");
| tmpList.add( cab );
| }
| searchResults = tmpList;
|
| return null;
| }
|
| public String save(){
| System.out.println("SAAAAAAVVVVVVIIIIIIIIINNNNNNNNGGGGGGGG to db");
|
| return "";
| }
|
| public String getSearchPattern() {
| return searchPattern;
| }
|
| public void setSearchPattern(String searchPattern) {
| this.searchPattern = searchPattern;
| }
| }
|
search.xhtml:
| <html xmlns="http://www.w3.org/1999/xhtml"
| xmlns:ui="http://java.sun.com/jsf/facelets"
| xmlns:h="http://java.sun.com/jsf/html"
| xmlns:f="http://java.sun.com/jsf/core"
| xmlns:t="http://myfaces.apache.org/tomahawk"
| xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
| xmlns:rich="http://richfaces.ajax4jsf.org/rich"
| xmlns:s="http://jboss.com/products/seam/taglib">
| <body>
|
|
| <ui:composition template="/WEB-INF/layout/template.xhtml">
| <ui:param name="title" value="Pageflow Start"/>
|
| <ui:define name="body">
| <h:form>
| <s:decorate>
| <h:inputText id="srchPatt" value="#{riskAddonBacking.searchPattern}" required="true"/>
| </s:decorate>
|
| <s:button action="#{riskAddonBacking.performSearch}" value="Search"/>
|
| <h:outputText value="Found #{searchResults.rowCount} hits"
| rendered="#{searchResults.rowCount > 0}"/>
| </h:form>
|
|
| <h:form rendered="#{not empty searchResults}">
| <h:dataTable value="#{searchResults}"
| var="_item">
| <h:column>
| <f:facet name="header">
| Ticket Number
| </f:facet>
| #{_item.ticketNumber}
| </h:column>
| <h:column>
| <f:facet name="header">
| Counterparty
| </f:facet>
| #{_item.cptyName}
| </h:column>
| <h:column>
| <f:facet name="header">
| Country of Risk
| </f:facet>
| #{_item.countryOfRisk}
| </h:column>
| <h:column>
| <f:facet name="header">
| Risk Addon
| </f:facet>
| #{_item.riskAddon}
| </h:column>
| <h:column>
| <f:facet name="header">
| Add/Edit
| </f:facet>
|
| <s:link action="edit" value="Edit" rendered="#{_item.riskAddon > 0}" />
| <s:link action="edit" value="Add" rendered="#{_item.riskAddon == 0}"/>
| </h:column>
| </h:dataTable>
| <!--
| <rich:dataTable value="#{searchResults}"
| var="_item">
| <rich:column>
| <f:facet name="header">
| Ticket Number
| </f:facet>
| #{_item.ticketNumber}
| </rich:column>
| <rich:column>
| <f:facet name="header">
| Counterparty
| </f:facet>
| #{_item.cptyName}
| </rich:column>
| <rich:column>
| <f:facet name="header">
| Country of Risk
| </f:facet>
| #{_item.countryOfRisk}
| </rich:column>
| <rich:column>
| <f:facet name="header">
| Risk Addon
| </f:facet>
| #{_item.riskAddon}
| </rich:column>
| <rich:column>
| <f:facet name="header">
| Add/Edit
| </f:facet>
|
| <s:link action="edit" value="Edit" rendered="#{_item.riskAddon > 0}" />
| <s:link action="edit" value="Add" rendered="#{_item.riskAddon == 0}"/>
| </rich:column>
| </rich:dataTable>
| -->
| </h:form>
|
| </ui:define>
| </ui:composition>
|
| </body>
| </html>
|
countryaddon.jpdl.xml :
| <pageflow-definition
| xmlns="http://jboss.com/products/seam/pageflow"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation=
| "http://jboss.com/products/seam/pageflow http://jboss.com/products/seam/pageflow-1.2.xsd"
| name="countryaddon">
|
| <start-state name="start">
| <transition to="searchPage"/>
| </start-state>
|
| <page view-id="/countryaddon/search.xhtml" name="searchPage">
| <redirect/>
| <transition name="edit" to="editPage"/>
| </page>
|
| <page view-id="/countryaddon/edit.xhtml" name="editPage">
| <redirect/>
| <transition name="approve" to="approvePage"/>
| </page>
|
| <page view-id="/countryaddon/approve.xhtml" name="approvePage">
| <redirect/>
| <transition name="save" to="endPage">
| <action expression="#{riskAddonBacking.save}"/>
| </transition>
| <transition name="prev" to="editPage"/>
| </page>
|
| <page view-id="/countryaddon/end.xhtml" name="endPage">
| <redirect/>
| <end-conversation/>
| </page>
|
| </pageflow-definition>
|
And OT, I get annoying error messages related to there not being a transaction, from the ExceptionFilter. Is there a cure for this, read a post about this problem but it didn't have a solution of how to get rid of it.
Cheers,
Mike
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4046891#4046891
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4046891
18 years, 11 months
Kerberos authentication with JBoss on Linux
by Dion Rowney
Hi,
I am setting up CAS and want to authenticate against our Kerberos domain.
I have determined that CAS' authentication mechanism uses the
login-config.xml policies and arrives at "other".
I have tried the textfile basic auth and it works.
I was hoping to use the built in Sun Kerberos authentication but it can seem
to find it. Here is my config file and the error I get in the logs. Does
anyone know how to make this work?
login-config.xml:
<application-policy name = "other">
<authentication>
<login-module code = "com.sun.security.auth.module.Krb5LoginModule" flag =
"required">
<module-option name = "debug">true</module-option>
<module-option name =
"principal">HTTP/examplehost.yourdomain.com(a)YOURWINDOWSDOMAIN.COM</module-option>
<module-option name = "kdc">adserverhostname</module-option>
<module-option name = "realm">YOURWINDOWSDOMAIN.COM</module-option>
<module-option name = "storeKey">true</module-option>
<module-option name = "useKeyTab">true</module-option>
<module-option name = "doNotPrompt">true</module-option>
<module-option name =
"keyTab">/home/contelligent/contell.host.keytab</module-option>
</login-module>
</authentication>
</application-policy>
server.log:
2007-05-16 12:17:39,824 ERROR [STDERR]
javax.security.auth.login.LoginException: unable to find LoginModule class:
com.sun.security.auth.module.Krb5LoginModule
Thanks.
_________________________________________________________________
Windows Live Hotmail. Now with better security, storage and features.
www.newhotmail.ca?icid=WLHMENCA149
18 years, 11 months
[Beginners Corner] - Re: Problem with deployed .jar files
by monze2
First of all, that that you will take your time to help me.
I don't pack them as EAR files. I'm deploying a jar file, and "forget" to deploy the second jar file.
The content of the jar files is very simply. They both contain another jar file, which have one class, that print text to the screen (it is the way things are written where I work).
e.g.
jar1>
write "I'm alive"
use jar2 to print a line
write "I will never be written"
jar2>
write "I don't exist"
The result is:
"I'm alive"
If I deploy both jar files it works fine. But when I 'forget' the second jar file the program stop.
If I use 'java -cd jar1.jar ...' and it can find the second file, i get a 'ClassNotFoundException'. If I run them from eclipse, I get a 'ClassNotFoundException'. But in JBoss I get nothing...? No print to the error log, no print to the screen, nothing... the first jar files simple stops, and JBoss keep working as nothing has ever happened.
I can show the code, but i guess it will be just as easy for you to create the test your self.
jacob m
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4046880#4046880
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4046880
18 years, 11 months