Two Laptop Bag*
The moose likes JSF and the fly likes navigating from one page (which has a jsp:include) to another page in jsf Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "navigating from one page (which has a jsp:include) to another page in jsf" Watch "navigating from one page (which has a jsp:include) to another page in jsf" New topic
Author

navigating from one page (which has a jsp:include) to another page in jsf

shrihari mundada
Greenhorn

Joined: Jun 11, 2010
Posts: 4
Hi,

I am using a jsp:include tag in my jsp page. the included jsp has a <h:commandLink action="sucess"/> tag.
Now when my parent jsp gets translated it has the link which i have inlcuded. when i click on the link it does not get navigated to the page which should be on the action success.
i have made appropriate entries in the faces-config.xml. please suggest some solution.

parent jsp will look like below :

<html>
<f:view>
<h:form>
<h:commandLink action="test1">
<hutputText value="link1"/>
</h:commandLink>
<jsp:include page="child.jsp">
</h:form>
</f:view>
</html>

the child.jsp has a link as shown in the above description, now when i click on the link of that included page it should navigate to the page as per the outcome success.

please let me know the solution.

SCJP 91% OCPJWCD 95%
Yahya Arshad
Greenhorn

Joined: May 15, 2011
Posts: 26
are you enclosing <jsp:include> tag in <f:verbatim> tags ??? is there any input field in any of the page....
shrihari mundada
Greenhorn

Joined: Jun 11, 2010
Posts: 4
Thanks for replying.
i am not posting it in f:verbatim tags..

i have tried adding different entries in faces-config.xml.

the structure is parent.jsp has child.jsp included in it.
so i added a navigation rule for the command link which is in child.jsp and ultimately gets included in parent.jsp as:

<from-view-id>parent.jsp</from-view-id>
<from-outcome>success</from-outcome>
<to-view-id>test.jsp</to-view-id>

even i tried changing the from-view-id tag value to child.jsp, yet it does not get navigated to the test.jsp page. it remains on the same page.
please suggest a solution , on how do i navigate from a link to another page which is of the included jsp.
Yahya Arshad
Greenhorn

Joined: May 15, 2011
Posts: 26
First try to use simple navigation for your page than go for using included page...
first try that your navigation rule work fine for single page

correct pattern for navigation rule is




second thing don't use commandLink for just purpose of navigation use it only for doing some thing which need processing on data.
shrihari mundada
Greenhorn

Joined: Jun 11, 2010
Posts: 4
yes i tried navigating from a single page when i click on that link and i navigated successfully.
it is not navigating only when the link is from a included page.
i am using commandLink because i want to perform some action when i click on that link.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: navigating from one page (which has a jsp:include) to another page in jsf