• Post Reply Bookmark Topic Watch Topic
  • New Topic

How do I get the '� ' symbol to appear in a JSP

 
Mario Ciliotta
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I was wondering if someone could help me. I am trying to get the '�' symbol (UK pound sterling) to appear in my out but nothing happens.

This is the error message that I get in the logs:

<Jan 6, 2005 5:30:10 PM EST> <Error> <HTTP> <BEA-101019> <[ServletContext(id=2064443,name=mario,context-path=/mario)] Servlet failed with IOException
java.io.IOException: javax.servlet.jsp.JspException: The taglib validator rejected the page: "java.io.UTFDataFormatException: Invalid byte 1 of 1-byte UTF-8 sequence., "
at weblogic.servlet.jsp.Jsp2Java.outputs(Jsp2Java.java:130)
at weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java:258)
at weblogic.servlet.jsp.JspStub.compilePage(JspStub.java:367)
at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:223)
at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:172)
at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:518)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:362)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6350)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3635)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2585)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
>

-------------------------------------------------------------------------

This is my code so far. Basically what I am doing is trying to pass the database output to a FLASH movie. I am new to JSP/JSTL so I am sure that the way I am doing it is no the best. Any help would be greatly appriciated.

<%@ page language="java" contentType="text/html"
import="com.javaexchange.dbConnectionBroker.*,javax.sql.*,java.sql.*,oracle.jdbc.pool.*
,javax.servlet.jsp.jstl.core.Config,java.lang.*,java.lang.Number,java.io.*,javax.mail.*,javax.mail.internet.*,java.util.*,java.net.URLEncoder" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://java.sun.com/jstl/sql" prefix="sql" %>
<%@ taglib uri="http://java.sun.com/jstl/x" prefix="x" %>

<c:if test="${application.connect == null}">
<%
OracleConnectionCacheImpl ds = null;
try {
ds = new OracleConnectionCacheImpl();
ds.setURL("jdbc racle:thin:@pdcdevxx.corpny.csfb.com:1521 nyfbc0xx1");
ds.setMaxLimit(20);
ds.setUser("xxxxxxxxxv");
ds.setPassword("xxxxxxxx");
Config.set(application,Config.SQL_DATA_SOURCE,ds);
}
catch (Exception e){
application.log("Failed to create data source:"+e.getMessage());
out.write(e.getMessage());
}
%>
<c:set var="connect" value="yes" scope="application" />
</c:if>

<sql:query var="pgroups">
Select Item_Nbr, Item_Name, description, To_Char(Price, '$9,999.99') Price, LTRIM(To_Char(UK_Price, '9,999.99')) UK_Price FROM impsapp.logo_items WHERE item_nbr = ?
<sql aram value="${param.ID}" />
</sql:query>

<c:set var="row_count" value="0" scope="page" />
<c:forEach items="${pgroups.rows}" var="row">
<c:set var="Item_Name" value="${row.item_name}"/>
<c:set var="Item_Description" value="${row.description}"/>
<c:set var="Item_Nbr" value="${row.item_nbr}"/>
<c:set var="Item_Price" value="${row.price}"/>
<c:set var="Item_UK_Price" value="${row.uk_price}"/>

<% String Item_Name_Unencoded = (String)pageContext.getAttribute("Item_Name");
String Item_Name_Encoded = URLEncoder.encode(Item_Name_Unencoded);
String Item_Description_Unencoded = (String)pageContext.getAttribute("Item_Description");
String Item_Description_Encoded = URLEncoder.encode(Item_Description_Unencoded);
String Logo_Item = "&item_name=CS-" + pageContext.getAttribute("Item_Nbr") + " " + Item_Name_Encoded + "&price=" + pageContext.getAttribute("Item_Price") + "/�" + pageContext.getAttribute("Item_UK_Price")
+ "&item_desc=" + Item_Description_Encoded;
out.println(Logo_Item);
%>
</c:forEach>
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
 
ashish verma
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Try this it will work
<font color="#4A2839" size="2" face="Arial, Helvetica, sans-serif">Price
</font>

this will show pound in out.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!