Forums Register Login

JSTL c:out tag is displaying value in JSP

+Pie Number of slices to send: Send
Hi ALL,

We are migrating from JSF 1.5 to 2.1 version and facing problem with JSTL tags in some flows only.
We are using JSTL 1.2 version.

Still we are using JSP file not xhtml file.

Working Flow :

Calling action method and action method return a String , then based on the string value(defined navigation rule) will redirected to test.JSP.
In that test.JSP we are using c:forEach and c:out which are working fine without any problem.

<h:commandButton value="Submit" id="searchNonCustomer" action="#{UserSearchBean.searchUsers}">

Not working flow:

Opening popup window through href link.

<td style="width:180px;text-align:center" class="boldContentText">
<div align="left">
<a href="javascript:MM_openBrWindow('../user/test1.faces','updateWin','resizable=yes,width=800,height=680,top=10,scrollbars=yes')">View Users List</a>
</div>
</td>

Once the popup is opened and test1.jsp will load the action method through custom tag. Given below the related code

<body onload="useStyleAgain('cpStyle');">
<f:view>

<!-- Calling the action method through custom tag -->
<bl:bload method="getUserDetails"/>

<table style="width:775px" border="0" cellpadding="2" cellspacing="0">
<b><c:out value="${userDetailsBean.userName}" /></b>

But if we change from c:out to h:outputText (JSF tag) which is working fine. But i need to fix this through JSTL since there are lot of JSTL changes are involved.

userDetailsBean is defined as request scope in face-config.xml.

The same was working fine in JSF 1.5 and JSTL 1.1 versions ... I mean before this migration.

Any help appreciated.






+Pie Number of slices to send: Send
You're not going to get very far.

JSF2 does not support JSP view templates. At all. Only xhtml.

In any event, JSTL and JSF do not get along well. Actually, they got along even worse in JSF1, but regardless, despite certain Oracle documents, I cannot recommend using JSTL with JSF. JSF has native equivalents that work much better.

For example, instead of:


Use:
+Pie Number of slices to send: Send
The JSP file was working fine with JSF 2.1 version Since we are using the below name spaces in JSP,

<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>


I can use h:outputText instead of c:out but ui:repeat(equilant of c:forEach) will not work in JSP view. It will work only xhtml.
+Pie Number of slices to send: Send
Lack of support for JSPs in JSF2 is very explicity stated by Oracle. I'm not simply saying that.

The ui:repeat tag is a facelets tag and never was intended to work with JSP, only xhtml. That was been true even in JSF1 where Facelets was an add-on, rather than part of the JSF core as it is in JSF2.
Think of how stupid the average person is. And how half of them are stupider than that. But who reads this tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 2658 times.
Similar Threads
(Begginer on JSF) need help with a4j:support and c:forEach
Stuck in URL parameter to JSF problem
need help :: multiple rows update without primary key
Passing check box value to servlet.
Implementation of google charts in JSP
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 03:57:44.