• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem: Embedd JSF into JSF page

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to embedd JSF pages into a JSF page .



Problem 1:



<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>

<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>



<%@ taglib uri="http://myfaces.apache.org/trinidad" prefix="tr"%>

<%@ taglib uri="http://myfaces.apache.org/trinidad/html" prefix="trh" %>



try1.jsp



<body>

<f:view>

<html>

<head>

</head>



Template text from try1

<h:outputText value="Enter your name below"/><br><br>

<h:inputText id="ab11" value="#{MessageBean.testValue}" required="true"/>

<h:message for="ab11" /><br><br>

<tr:commandButton action="#{MessageBean.click}" rendered="true" partialSubmit="true" immediate="true" actionListener="#{MessageBean.actionEvent}" /><br><br><br>

<h:outputText value="Inside main Page"/>

<jsp:include page="/try2.jsp" />



</html>

</f:view></body>





try2.jsp







<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>

<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>



<f:subview id="test" rendered="true">

<h:outputLabel value="Hi"/>

</f:subview>





My Managed BEan is:







package test;



import javax.faces.event.ActionEvent;



public class MessageBean {



private String testValue;

/** Creates a new instance of MessageBean */

public MessageBean() {

}



public String getTestValue() {

return testValue;

}



public void setTestValue(String testValue) {

this.testValue = testValue;

}



public String click(){

System.out.println("Yahoo yaha aa gaya....!");

return null;

}





public void actionEvent(ActionEvent ev){

System.out.println("Yahoo yaha aa gaya....!");



}



}





Whats wrong with this code???

My command button in try1.jsp does not work...

after including try2.jsp.

i.e jsf page does not post back to the server...

What to do???

Any one please help???
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic