PDA

View Full Version : JSF and Resin


mabsito
08-24-2010, 10:26 PM
Hello,
i am working for years with jsp on resin and i am trying now to use jsf with but i have some problems. I started with the example that I found in the caucho webseite http://caucho.com/resin/examples/jsf-webbeans/index.xtp I just copied alors the files to my server without changing anything but when I try to test it the browser just displays the jsp code:

<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
<f:view>
<h:messages/>
<h:form>
<h:inputText value="#{calc.a}" size="4"/>
+ <h:inputText value="#{calc.b}" size="4"/>
= <h:outputText value="#{calc.sum}" style="color:red"/>
<br>
<h:commandButton value="Add"/>
</h:form>
</f:view>


and resin doesn´t compile the file. Should I make a special configuration to my resin.xml or should i add some jars to my libraries?

Thanks

alex
08-26-2010, 05:50 PM
Hi,
Can you post some finer logs so we can see what's going on?
Thanks!

mabsito
08-27-2010, 09:10 PM
[10-08-27 23:16:56.932] {resin-850}
[10-08-27 23:16:56.932] {resin-850} 1: <beans xmlns="urn:java:ee">
[10-08-27 23:16:56.932] {resin-850} 2: <!--
[10-08-27 23:16:56.932] {resin-850} 3: - The beans.xml marks a class root for Java Inject to search for
[10-08-27 23:16:56.932] {resin-850}
[10-08-27 23:16:56.932] {resin-850}
[10-08-27 23:16:56.932] {resin-850} <beans xmlns="http://java.sun.com/xml/ns/javaee"> is expected.
[10-08-27 23:16:56.932] {resin-850}
[10-08-27 23:16:56.932] {resin-850} Syntax: <beans>

emil
08-27-2010, 09:50 PM
Hi,

The problem is in your namespace declaration:

<beans xmlns="urn:java:ee">

This defines the namespace of the <beans> tag to be "urn:java:ee", which is incorrect. The example shown in the logs is what you should follow:

<beans xmlns="http://java.sun.com/xml/ns/javaee">
...

If you want a custom bean, you would define it like so:
<beans xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:custom="urn:java:com.example.custom>
<custom:MyCustomBean>...</custom:MyCustomBean>
...
</beans>

Emil