JSF-Hiberneat Integration
Respected Friend
Right now I am using JSF with Simple RMI server as Application server . Now I would like to use Hibernet Technology with my JSF Application . please give some ideas or sample code to integrate Hiberneat with JSF and also please explain me why should I use Hiberneat , instead of , Simple JDBC.
Thanks
Selvakumar
rryrtyrt wrote:
Respected Friend
Right now I am using JSF with Simple RMI server as Application server . Now I would like to use Hibernet Technology with my JSF Application . It is called Hibernate. If you use the right spelling, then you might find more accurate results in Google.
please give some ideas or sample code to integrate Hiberneat with JSF There is nothing special which you need to do. Just create a data layer which is based on Hibernate and plug it in your business layer. If you already have an existing JSF application which uses the DAO pattern, then there is simply nothing you have to change in the business layer.
and also please explain me why should I use Hiberneat , instead of , Simple JDBC. Increased portability (e.g. easy switch between different DB vendors) and maintainability (e.g. XML configuration files and reverse-engineering tools without need to (re)write Java code).
Similar Messages
-
Reg. JSF Spring Integration issue.
Hi All,
I am using JSF for the front end and using the Spring Core, DAO and AOP for the BO and DAO layers. When i try to inject the Objects using the DI to the JSF, i am getting the following error and the objects are not getting set from the Spring.
Error Log:*
javax.servlet.ServletException: Unable to create managed bean dataUploadControllerBean. The following problems were found:
- Bean or property class #{dataUploadVO} for managed bean dataUploadControllerBean cannot be found.
- Bean or property class #{dataUploadVO} for managed bean dataUploadControllerBean cannot be found.
- Bean or property class #{dataUploadVO} for managed bean dataUploadControllerBean cannot be found.
javax.faces.webapp.FacesServlet.service(FacesServlet.java:325)
org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:112)
i have defined the respective entries correctly to integrate the JSF & Spring. But still the JSF&Spreing is not integrated successfully. Please find the configs defined and help to resolve the issue. i am stuck in this for 2 days...
Web.xml
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>WEB-INF/applicationContext.xml</param-value>
</context-param>
Faces-Config.xml
<application>
<el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver> <!-- have used this ELResolver to injects objects from Spring-->
</application>
<managed-bean>
<managed-bean-name>dataUploadControllerBean</managed-bean-name>
<managed-bean-class>com.sgspace.model.dataupload.DataUploadControllerBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>dataUploadBean</property-name>
<value>#{dataUploadBean}</value> _<!-- Already present in the faces-config.xml-->_ </managed-property>
<managed-property>
<property-name>dataUploadVO</property-name>
<property-class>#{dataUploadVO}</property-class> _<!-- Injected from Spring DI. This is currently not working.-->_
<value></value>
</managed-property>
<managed-property>
<property-name>dataUploadBO</property-name>
<property-class>#{dataUploadBO}</property-class>_<!-- Injected from Spring DI. This is currently not working.-->_ <value></value>
</managed-property>
</managed-bean>
applicationContext.xml:_
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<bean id="dataUploadDAO"
class="com.sgspace.dao.dataupload.DataUploadDAOImpl">
<property name="dataSource" ref="dataSource"></property>
</bean>
<bean id="dataUploadBO"
class="com.sgspace.bo.dataupload.DataUploadBOImpl">
<property name="dataUploadDAO" ref="dataUploadDAO"></property>
</bean>
<bean id="dataUploadVO" class="com.sgspace.vo.dataupload.DataUploadVO"></bean>
</beans>
Warm Regards,
Praveen SThe TestBean have a property for DeviceManager along with setter/getter methods as shown below. Sorry for not including in earlier posting
TestBean.java (Backing Bean)
private DeviceTypeManager deviceManager;
public DeviceTypeManager getDeviceManager() {
return deviceManager;
public void setDeviceManager(DeviceTypeManager deviceManager) {
this.deviceManager = deviceManager;
Here are the two scenarios
Scenario 1 : without <managed-property> the code works fine
Scenario 2 : with <managed-property> the code results in following error
javax.faces.FacesException: Cannot get value for expression '#{test.selectedDevice}'
Scenario 1 has only JSF whereas Scenario 2 has JSF-Spring integration
The Scenario 1 works absolutely fine as the expression '#{test.selectedDevice}' gets its value from setter/getter method in the backing bean(TestBean.java) . This is expected behaviour & wondering why it doesn't work similarly in Scenario 2 instead it complains
Cannot get value for expression '#{test.selectedDevice}'
I am willing to upload the war file. Any pointers/suggestions in resolving the error will be highly appreciated
Regards
Bansi -
Hi there,
i want to integrate spring with my existing application. is there any good tutorials in net to give good view on that. i google it but not fully satisfied.
please help me if you have any idea..
Regards,
A.The TestBean have a property for DeviceManager along with setter/getter methods as shown below. Sorry for not including in earlier posting
TestBean.java (Backing Bean)
private DeviceTypeManager deviceManager;
public DeviceTypeManager getDeviceManager() {
return deviceManager;
public void setDeviceManager(DeviceTypeManager deviceManager) {
this.deviceManager = deviceManager;
Here are the two scenarios
Scenario 1 : without <managed-property> the code works fine
Scenario 2 : with <managed-property> the code results in following error
javax.faces.FacesException: Cannot get value for expression '#{test.selectedDevice}'
Scenario 1 has only JSF whereas Scenario 2 has JSF-Spring integration
The Scenario 1 works absolutely fine as the expression '#{test.selectedDevice}' gets its value from setter/getter method in the backing bean(TestBean.java) . This is expected behaviour & wondering why it doesn't work similarly in Scenario 2 instead it complains
Cannot get value for expression '#{test.selectedDevice}'
I am willing to upload the war file. Any pointers/suggestions in resolving the error will be highly appreciated
Regards
Bansi -
JSF/Spring integration - managed-property problem
I am using JSF 1.1_01 (MyFaces 1.1), Spring 1.2, Ajax4Jsf.
The JSF application has h:selectOneMenu .
On change event of h:selectOneMenu sets "selectedValue" into backing bean as shown below:
page.jsp
<h:selectOneMenu value="#{test.selectedDevice}" >
<f:selectItem itemValue="0" itemLabel="--New--"/>
<f:selectItem itemValue="1" itemLabel="WorkStation"/>
<f:selectItem itemValue="2" itemLabel="Router"/>
<f:selectItem itemValue="3" itemLabel="Switch"/>
<ajax:support action="#{test.loadDevice}" event="onchange" reRender="t2,t3,t4,t5"/>
</h:selectOneMenu>
TestBean.java (Backing Bean)
public String getSelectedDevice() {
logger.info(" *** In getSelectedDevice *** ");
if (selectedDevice == null) {
selectedDevice = "0"; // This will be the default selected item.
return selectedDevice;
public void setSelectedDevice(String selectedDevice) {
logger.info(" *** In setSelectedDevice *** ");
this.selectedDevice = selectedDevice;
Here are the configuration file snippets for integrating JSF Spring
web.xml
<listener>
<listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
faces-config.xml
<application>
<variable-resolver>org.springframework.web.jsf.DelegatingVariableResolver</variable-resolver>
</application>
<managed-bean>
<managed-bean-name>test</managed-bean-name>
<managed-bean-class>test.TestBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>deviceManager</property-name>
<property-class> test.DeviceTypeManager </property-class>
<value>#{deviceManager}</value>
</managed-property>
</managed-bean>
The above code results in the following error
javax.faces.FacesException: Cannot get value for expression '#{test.selectedDevice}'
The error occurs only if i include <managed-property> inside the <managed-bean> in faces-config.xml.
The moment i remove <managed-property> from face-config.xml the error disappears & page gets rendered properly.
The purpose in having <managed-property> inside managed-bean is to call Spring's Manager class (i.e. deviceManager) from JSF application
Any pointers/suggestions in resolving the error will be highly appreciated
Regards
BansiThe TestBean have a property for DeviceManager along with setter/getter methods as shown below. Sorry for not including in earlier posting
TestBean.java (Backing Bean)
private DeviceTypeManager deviceManager;
public DeviceTypeManager getDeviceManager() {
return deviceManager;
public void setDeviceManager(DeviceTypeManager deviceManager) {
this.deviceManager = deviceManager;
Here are the two scenarios
Scenario 1 : without <managed-property> the code works fine
Scenario 2 : with <managed-property> the code results in following error
javax.faces.FacesException: Cannot get value for expression '#{test.selectedDevice}'
Scenario 1 has only JSF whereas Scenario 2 has JSF-Spring integration
The Scenario 1 works absolutely fine as the expression '#{test.selectedDevice}' gets its value from setter/getter method in the backing bean(TestBean.java) . This is expected behaviour & wondering why it doesn't work similarly in Scenario 2 instead it complains
Cannot get value for expression '#{test.selectedDevice}'
I am willing to upload the war file. Any pointers/suggestions in resolving the error will be highly appreciated
Regards
Bansi -
hello All
Has anyone come across the issue with JSF ajax integration in JSF 2. When I try to use jsf 2 F:ajax TAG i GET THE following error
JSF1064: Unable to find or serve resource, jsf.js.xhtml
Thanks for your help
NekUnfortunately you are not giving us enough information. How are you using the tag?
-
Getting error in simple Jsf-Spring Integration
Hi,
I am getting error in setting class attribute through Spring when I am integrating spring1.2 and jsf 1.1. Alone JSF is working fine.
The error I am getting is
Class org.springframework.web.jsf.DelegatingVariableResolver is no javax.faces.el.VariableResolverI m using JSF1.1, Spring 1.2 and jdk 1.4
How I did is I added a class First.java initialized by application.xml as follows
<beans>
<bean id="first" class="com.tst.beans.First" >
<property name="name">
<value type="java.lang.String">abc</value>
</property></bean>
</beans>I have added Delegating Variable resolver and other stuff in faces-config.xml as follows
<application>
<variable-resolver>org.springframework.web.jsf.DelegatingVariableResolver</variable-resolver>
<locale-config>
<default-locale>en</default-locale>
</locale-config>
<message-bundle>com.Messages</message-bundle>
</application>
<navigation-rule>
<from-view-id>/third.jsp</from-view-id>
</navigation-rule>
<managed-bean>
<managed-bean-name>secBean</managed-bean-name>
<managed-bean-class>com.tst.beans.SecBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>ft</property-name>
<value>#{first}</value>
</managed-property>
</managed-bean>In web.xml I did the following change for Spring
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>/WEB-INF/faces-config.xml</param-value>
</context-param>
<!--Loads Spring application context upon application startup.-->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>SpringContextServlet</servlet-name>
<servlet-class>org.springframework.web.context.ContextLoaderServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
I added this first class in backing bean as a property. My faces-config.xml code is
<managed-bean>
<managed-bean-name>EducInfo</managed-bean-name>
<managed-bean-class>
com.view.beans.StudentEducInfo
</managed-bean-class>
<managed-property>
<property-name>ft</property-name>
<value>#{first}</value>
</managed-property>and in JSP page, I called the managed property as
<h:outputText value="#{secBean.ft.name}" ></h:outputText>Any pointers? Any workaround would also be highly appreciated
Regards,
ArsalanThere is a working apache example in the SVN...might be worth taking a look at that.
-
JSF Struts Integration Action lost on submit
Hi All
I've been tearing my hair out with this one for half a day. I am producing a web app using struts and jsf in conjunction. I have succesfully used the integration library on several pages, so I know the framework is in place. However for the following page I can produce valuechange events and process them on a javascript submit, and perform a quick return render, but when I press the submit button, the action is not forwarded through to struts action.
The jsp page :
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
<%@ taglib prefix="s" uri="http://struts.apache.org/tags-faces" %>
<f:view>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<s:html>
<head>
<s:base/>
<title>selectplot.jsp</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
</head>
<body>
<s:form action="/redirectSelectSite">
<table border="0">
<tr>
<td>Site Code</td>
<td><h:selectOneMenu id="siteSelect" value="#{SelectPlotForm.sitecode}" valueChangeListener="#{SelectPlotForm.processSiteChange}" onchange="this.form.submit();">
<f:selectItems id="siteSelectItem" value="#{SelectPlotForm.sites}" />
</h:selectOneMenu>
</td>
</tr>
<tr>
<td>Plot Number</td>
<td><h:selectOneMenu id="plotSelect" value="#{SelectPlotForm.plotno}" >
<f:selectItems id="plotSelectItem" value="#{SelectPlotForm.plots}" />
</h:selectOneMenu>
</td>
</tr>
<tr>
<td colspan="2" align="center"><h:commandButton id="submit" type="SUBMIT" value="Continue"/></td>
</tr>
</table>
<s:errors/>
</s:form>
</body>
</s:html>
</f:view>Backing Bean:
public class SelectPlotForm extends ActionForm {
// Omitted unwanted detail.
* @param event
* @throws AbortProcessingException
public void processSiteChange(ValueChangeEvent event)
throws AbortProcessingException {
if (null != event.getNewValue()) {
sitecode = ((String)event.getNewValue());
// Get the list of plots for the new sitecode.
this.setPlots(ChoicesInterface.getPlotsList(sitecode));
// Do a quick render response
FacesContext.getCurrentInstance().renderResponse();
}struts-config.xml extract
<action attribute="SelectPlotForm" name="SelectPlotForm" path="/redirectSelectSite" scope="session"
type="com.millwood.struts.action.RedirectSelectPlot"
validate="false" input="/selectPlot.faces" >
<forward name="success" path="/printchoices.faces" />
</action>and finally the struts action file :
package com.millwood.struts.action;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.config.ForwardConfig;
import com.millwood.Choices.Web.SelectPlotForm;
* Redirects the user of the selectPlot page to the appropriate action.
* @author James Salt
* @since 0.1
public class RedirectSelectPlot extends Action {
public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) {
SelectPlotForm scf = (SelectPlotForm) form;
// Construct the foward entity on the fly.
ForwardConfig fc = new ForwardConfig();
fc.setName("result");
fc.setPath(scf.getActionurl()+ ".do?plotno=" + scf.getPlotno() + "&sitecode="+ scf.getSitecode());
mapping.addForwardConfig(fc);
return (mapping.findForward("result"));
}Sorry about the massive posting but I thought it better to provide all the information relevant as currently I am at a bit of a loss.
I have placed debug points at all the accessible parts of code, but non are triggered, so it must be being bounced in the ActionListener either in Struts or Faces before it tries to get the action.
Any help would be really, really appreciated.
Yours thankfully,
james saltChange you action from:
<s:form action="/redirectSelectSite">
To:
<s:form action="/redirectSelectSite.do">
So that your request gets processed by the Srtuts Controller. Assuming you have *.do mapped to your struts controller in web.xml. -
[ANN] JSF/Spring integration solution
We developed a solution for integrating JSF with the Spring framework (http://www.springframework.org/), a well-designed, extensible and easy-to-use Java framework built around an Inversion of Control container (see http://martinfowler.com/articles/injection.html).
Our glue code wraps the JSF context into a Spring context and thus merges them. This way, the JSF context becomes part of Spring and vice versa. This is done in a implementation independent way so that it can be used with any JSF implementation.
For source code, documentation and an example application see http://sourceforge.net/projects/jsf-spring.
Any comments are greatly appreciated!I'm experiencing problem in using the
jsf-spring-2.4-example sample application. The
following errors was returned:
============================================
javax.servlet.ServletException:
javax.servlet.jsp.JspException:
org.springframework.beans.factory.BeanDefinitionStoreException:
IOException parsing XML document from resource
[WEB-INF/faces-config.xml] of ServletContext; nested
exception is java.net.UnknownHostException:
java.sun.com
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:821)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
org.apache.jsp.showNames_jsp._jspService(showNames_jsp.java:91)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:147)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
org.springframework.web.jsf.RequestHandledFilter.doFilter(RequestHandledFilter.java:116)
============================================
As far as I understand, the error was caused by some
class within the sample application which tries to
connect to the Internet. When I'm currently connected
to the Internet which I cannot always do because I'm
using a prepaid connection, the error suddenly
disappear. This makes testing of the application
difficult when constant Internet connection is absent.
I hope you can shed light to me regarding this matter.
Thank you very much! -
Getting a problem in JSF - Spring Integration
Hi,
We have a web application in which we are working on JSF using MyEclipse. I am now trying to integrate spring framework into the project for having IOC for middle layer.
well I am getting problem in setting class attribute through Spring.
How I did is I added a class First.java initialized by application.xml The code is
<beans>
<bean id="first" class="com.model.service.impl.first"
abstract="false" singleton="false" >
<property name="name">
<value type="java.lang.String">to enter</value>
</property></bean>
</beans>In web.xml I did the following change for Spring
<servlet>
<servlet-name>SpringContextServlet</servlet-name>
<servlet-class>org.springframework.web.context.ContextLoaderServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>I added this first class in backing bean as a property. My faces-config.xml code is
<managed-bean>
<managed-bean-name>EducInfo</managed-bean-name>
<managed-bean-class>
com.view.beans.StudentEducInfo
</managed-bean-class>
<managed-property>
<property-name>ft</property-name>
<value>#{first}</value>
</managed-property>and I called it from jsp(JSF) page as
<h:outputText value="#{EducInfo.tstFirst}" />the function tstFirst in EducInfo (backing bean) is
private first ft;
public String getTstFirst() {
tstFirst=ft.getName();
return tstFirst;
I am getting error 'Expression Error: Named Object: 'first' not found.'
Any idea? Any workaround would also be appreciated.
Thanks,
ArsalanYour server is not able to find anything matching the requested file.
Well, just explore your archive file (possibly your .war file) and look at the path of the index file.
Please post your url. If pro11 is your project name (the root) then ensure that the index file is by itself ie the path should be shown as blank in your war file.
Or mention the exact path of your index file in the url. -
Need JSF & tiles integration using any implementation
Hi Freinds,
I m new to JSF and I m looking for some tutorial or war file which uses the JSF implementation with tiles.
Myfaces will be best.
Need urgently.
Thanking in advance.
regards,
NovinHi Freinds,
I m new to JSF and I m looking for some tutorial or war file which uses the JSF implementation with tiles.
Myfaces will be best.
Need urgently.
Thanking in advance.
regards,
Novin -
Hi Freinds,
I m new to JSF and I m looking for some tutorial/article/guide or war file which uses the JSF implementation with tiles.
Need urgently.
Thanking in advance.
regards,
NovinHello,
i'm trying to use MyFaces+Tiles.
I done this steps:
1) put struts.jar in WEB-INF/lib
2) add follow lines in web.xml
<context-param>
<param-name>tiles-definitions</param-name>
<param-value>/WEB-INF/tiles-defs.xml</param-value>
</context-param>
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.tiles</param-value>
</context-param>
<!-- Faces Servlet Mapping -->
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>3) add follow in application tag of faces-config.xml
<view-handler>org.apache.myfaces.tomahawk.application.jsp.JspTilesViewHandlerImpl</view-handler>4) make file tiles-defs.xml and put it in WEB-INF dir, some its lines are
<!DOCTYPE tiles-definitions PUBLIC
"-//Apache Software Foundation//DTD Tiles Configuration//EN"
"http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd">
<tiles-definitions>
<definition name="layout.base" path="/index.jsp" >
<put name="header" value="/header.jsp" />
<put name="body" value="" />
<put name="footer" value="/footer.jsp" />
</definition>
<definition name="/index.tiles" extends="layout.base" >
<put name="body" value="/body_index.jsp" />
</definition>
...5) index.jsp is this (partial)
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
<%@ taglib uri="https://ajax4jsf.dev.java.net/ajax" prefix="a4j"%>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<f:view>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title><f:verbatim>index</f:verbatim></title>
<link rel="stylesheet" type="text/css" href="css/style.css" />
</head>
<body >
<div id="topPanel">
<f:subview id="header">
<tiles:insert attribute="header" flush="false"/>
</f:subview>
</div>
<div id="bodyPanel">
<f:subview id="body">
<tiles:insert attribute="body" flush="false"/>
</f:subview>
</div>
<div id="footerPanel">
<f:subview id="footer">
<tiles:insert attribute="footer" flush="false"/>
</f:subview>
</div>6) header.jsp follow
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
<%@ taglib uri="https://ajax4jsf.dev.java.net/ajax" prefix="a4j"%>
<h:form>
<ul>
<li><h:commandLink action="login">Contattaci</h:commandLink></li>
<li><h:commandLink action="login">Chi siamo</h:commandLink></li>
<li class="active"><h:commandLink action="index">Home</h:commandLink></li>
</ul>
...other pages are similar
7) i used a html page for redirect it follow
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Refresh" content="0; URL=faces/index.tiles" />
<title>Index</title>
</head>
<body>
</body>
</html>The problem is: the page displayed (after invoke index.html) is empty, no errors on server.
Why?
How i can solve?
Regards. -
Hi,
At my work place we r trying to integrate JSF and Struts. After doing some research we found out that Struts-Faces is d way we can achieve d same. But d problem is that struts-faces is not available...........
Wat we need 2 know, are there any other alternatives and from where do we get d struts-faces package.........
Thanks a lot in advance.Change you action from:
<s:form action="/redirectSelectSite">
To:
<s:form action="/redirectSelectSite.do">
So that your request gets processed by the Srtuts Controller. Assuming you have *.do mapped to your struts controller in web.xml. -
Problem with jsf-tiles integration
Hi , I'm trying to integrate jsf and tiles but I have some problems..
I add
<context-param>
<param-name>tiles-definitions</param-name>
<param-value>/WEB-INF/tiles.xml</param-value>
</context-param>
to web.xml and
<view-handler>
org.apache.myfaces.application.jsp.JspTilesViewHandlerImpl
</view-handler>
in jsf-config.xml
template file looks like:
<f:view>
<body>
<table width="100%" border="1">
<tr>
<td colspan="2">
<f:facet name="header">
<f:subview id="header">
<tiles:insert attribute="header" flush="false" />
</f:subview>
</f:facet>
</td>
</tr>
when I display the page I get all jsf code at beginning and the body without any jsf output bottom...
I don't understand how I mistake
Thanks for any help
LucaTry to use <h:panelGrid> instead of the <table> tag.
-
I'm new to JSF and would like to know if JSF provide front controller or is it simply to develop UI. I need to know if I can replace SPRING MVC with JSF.
JSF provides a front controller in form of the FacesServlet. All you basically need to do is to develop UI (JSF pages) and the backing beans (javabeans with action methods).
No idea about that Spring part though. But I know that you can just use the both technologies in one webapp. Google for "jsf spring integration" or something straightforward like that. -
Integrating Struts, Tiles, and JavaServer Faces
I have tried some sample applications in jsf. They are working properly. Basically, our application is based on struts. We fee that that it will be difficult to convert struts based application into jsf. So we plan to integrate jsf components into struts application. I found a site http://www.ibm.com/developerworks/library/j-integrate/ where jsf-struts integration material has been given. For this integaration, struts-faces.jar is required. when i try to start the server after struts-faces-1.3.8.jar placed in Tomcat 5.5\common\lib folder, server is not started properly. I have found struts-faces-1.3.8.jar in struts-1.3.8-lib. Should I user struts-faces.jar? if it is so, Where to find struts-faces.jar Please provide a solution for this problem.
Wow, Srikanth. What a great contribution! I'm right at the begining of the design phase of a project that will hopefully go live in March and while I had already settled on a Tiles/Struts approach, I was really wanting to bring in JSF as well. I'm glad to see that someone is actively working on the integration components. I hope that the code modifications you propose make it into the Struts-Faces libraries soon.
One question. While I've been deveolping J2EE webapps for a couple of years now,
I'm still a little new to the Struts/Tiles arena. After reading your article at IBM developerWorks I wasn't able to ascertain whether or not what you proposed worked with the idea of individual controllers for each tile, which is a pattern that my project will need to adopt (I read about it in the short article here - http://www.theserverside.com/resources/article.jsp?l=Tiles101).
Can you shed some light on the subject? Will the modifications you proposed allow Tiles to continue to work in that fashion?
-Matt Welch
Hi,
Currently JSF, Struts and Tiles cannot work together
out of the box.
Craig McClanahan has come up with Struts-Faces which
lets you integrate Struts and JSF. This is ideal for
projects who want to protect their code investment in
Struts and also want to take advantage of JSF once it
is final.
Unfortunately if you are also using Tiles, this is not
possible because of some showstoppers on your way. I
started on this venture a while back and ran into the
same problems and decided to write some code - on top
of Struts-Faces and was pretty successful.
I am sharing this knowledge with the rest of you with
this article of mine on IBM developerWorks
http://www-106.ibm.com/developerworks/library/j-integra
e/
As already pointed out in this forum earlier, this
article covers the steps to integrate the three and
provides complete source code and also a working
example.
Hope you will find the article and the code useful.
Thanks,
Srikanth
Maybe you are looking for
-
Too many java processes.
Hi, I have installed Forms & Reports Services Standalone 10.1.2.0.2 on RHEL 5 and applied the 10.1.2.3 patch to it. After the patch, the java processes continue to grow so fast that sometimes when I open a new session and try to switch to oracle user
-
USB TV tuner software for OS X?
I just bought a USB TV tuner, and right now I have to boot my Mac Pro into boot camp in order to use it. Is there some kind of software for OS X that I can use so that I don't have to do that? EDIT: I found EyeTV, but I would rather have something t
-
Hi, I played a little on my test machine and get interesting results so if someone could explain me what happens here I would be grateful. It is obvious that some data corruption happened but still interesting situation. OS: Linux 32bit Oracle: 10.2.
-
[DataGrid] Line font color
Hi, I would like to know if it's possible to change the font color of a specific line in a datagrid. I mean if I have x lines in my dataprovider, how can I detect a line (using a property of the object inserted) to change its font color ? For example
-
HT201272 Where are the audiobooks and how do I get them back?
I can't find the audiobooks I have deleted from my iPhone and iPad to download again. Can anyone explain how to do this?