• 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

JSTL c:out tag is displaying value in JSP

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.






 
Saloon Keeper
Posts: 27764
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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:
 
Raj GuruRaj
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Tim Holloway
Saloon Keeper
Posts: 27764
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
The problems of the world fade way as you eat a piece of pie. This tiny ad has never known problems:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic