I have to write a composite component that shows a login form and can be used with the following code snippet:
<login:loginForm username="#{loginBean.username}"
password="#{loginBean.password}"
action="#{loginBean.login}"/>
My loginBean is just a simple serializable @ViewScoped
@ManagedBean
with getters, setters and a public String login()
method.
This is my composite component:
<body>
<cc:interface>
<cc:attribute name="username" required="true" type="java.lang.String" />
<cc:attribute name="password" required="true" type="java.lang.String" />
<cc:attribute name="action" targets="submit" required="true" method-signature="java.lang.String f()"/>
</cc:interface>
<cc:implementation>
<h3><span xml:lang="en">Login</span> Daten </h3>
<h:form>
<div class="formblock">
<fieldset>
<div>
<h:outputLabel value="Username" for="username"/>
<h:inputText id="username" value="#{cc.attrs.username}"/>
</div>
<div>
<h:outputLabel value="Passwort" for="password"/>
<h:inputSecret id="password" value="#{cc.attrs.password}"/>
</div>
</fieldset>
</div>
<div class="buttons">
<h:commandButton id="submit" value="Anmelden" accesskey="r" />
</div>
</h:form>
</cc:implementation>
</body>
But, when I open the login.xhtml page (which contains the login:loginForm
-snippet) in the browser, I can see the following Error in the jetty log:
Apr 29, 2012 11:59:49 PM org.apache.myfaces.view.facelets.FaceletViewDeclarationLanguage retargetMethodExpressions
SEVERE: Inner component submit not found when retargetMethodExpress
But what does that mean? Where is the mistake in my code? I already tried some other solutions for implementing the action
attribute, but without success.