Unsavory Characters doodling in JSP page

Hi All,
I have a jsp page which i precompiled into a servlet using Tomcat.
When I access the JSP page it displays the Copyright symbol correctly but when i dispose of the JSP page and use the servlet class the following characters are displayed.
Copyright �?�� 2003-2005.
Please tell me why this is happening.
Thanks in advance,
Phani

Post the encoding-related statements from your JSPs - there are a number of different ones that may be relevant.
It may also be relevant which database you store the strings in (Oracle, DB2, etc.), since some require an encoding parameter to be passed.

Similar Messages

  • Writing UTF-8 characters to a JSP page (URGENT).

    Hello everybody!
    I am trying to write UTF8 encoded characters to a jsp page, but is seems as if the PrinterWriter I get back in the getWriter call keep returning a writer parametrized for the ISO-8859-1 character set.
    I am calling setContentType with "text/html; charset=UTF-8" as parameter but it does not help.
    Anyone know what I should do?
    Thanx alot!
    Regards Daniel

    I put the following in a "page" directive at the top of my JSPs:
    contentType="text/html; charset=UTF-8"
    That handles getting a jspWriter that write UTF-8.
    You also need to convert the parameters you get from the browser's form input fields to UTF-8 encoded Strings.
    Like this:
    String temp = req.getParameter(parmName);
      // bail out if nothing here
      if (temp ==null) return "";
      try
        temp  = new String(temp.getBytes("ISO-8859-1"),"UTF-8");
      catch (Exception e)
        Mydebug("UTF-8 conversion exception");
      }When you get the parameter it is UTF-8 encoded, but Java's default encoding is ISO-8859-1. After executing the conversion above, temp is a UTF-8 encoded String.

  • French characters in a JSP page

    I have an HTML page with a form that has a text field that can accept text from the user. This text can be multilanguage and when French charcters are in the text field, when the user submits the HTML form, my JSP that retrieves the text from the text field is not encoding the characters properly.
    For example, this line:
    �nonc� sur la sant�, la s�curit� et le milieu de travail
    Into a String object in my JSP page as this:
    �?nonc�� sur la sant��, la s��curit�� et le milieu de travail
    This is no doubt an encoding problem but I am not sure hot to fix it.
    Anyone have any recommendations?

    That indeed helped.
    I had this page directive in the JSP page that contained the form:
    <%@ page contentType="text/html;charset=UTF-8" language="java" %>But I needed to add this line to the JSP page that the form was being posted to:
    request.setCharacterEncoding( "UTF-8" );

  • Junk characters like" � � "displayed in the jsp page please help.

    Hi,
    I am getting junk characters like � � displayed in the jsp page.
    In the JSP page i used javascript "& nbsp" for appending spaces to a string "CCR" to get "CCR " .
    Now the Resultant string "CCR " has three spaces appended to its right.
    This String is set in session in that JSP page.
    In the next JSP page i am getting that string from session.
    After getting the string the "substring" function is performed to get only the first 5 charcters of the string. Now the result is displayed as " CCR� � " with has last 2 characters as junk values � � insteed of displaying as "CCR ". Please help me in solving this issue.
    Please note that initially the sting "CCR" is got from the Oracle database in Solaris Machine.
    Regards,
    Vijay

    have you tried:
    strenuously inspecting the string that is coming from the db? do an actual loop over the string, character by character, dumping to System.out to make sure the characters are EXACT coming out of the db.
    note you have to append " " not just "& nbsp"
    post the code that is doing the output. the relevant bean code, the jsp, everything relevant - WITH COMMENTS discussing where things are happening.
    Also, is it "weird characters" in the browser only? have you done a view source on the actual html source that the browser is rendering (right click in IE and click view source). browsers can act odd if you don't feed then exactly what they want, and it looks like you're feeding it escaped characters that it is rendering as something else.

  • Displaying Japanese characters in JSP page

    Hi,
    I am calling an application which returns Japanese characters from my JSP. I am getting the captions in Japanese characters from the application and I am able to display the Japanese captions. After displaying the Japanese captions, user will select the particular captions by selecting the check box against the caption and Press Save button. Then I am storing the captions in the javascript string separated by :: and passing it to another JSP.
    The acton JSP retrieves that string and split it by using tokenizer and store it in the database. When I retrieve it again from the database and display it, I am not able to see the Japanese characters, it is showing some other characters, may be characters encoded by ISO.
    My database is UTF-8 enabled and in my server I am setting the UTF-8 as default encoding. In my JSP pages also, I am setting the charset and encoding type as UTF-8.
    I shall appreciate you if you can help me in resolving the issue.

    Post the encoding-related statements from your JSPs - there are a number of different ones that may be relevant.
    It may also be relevant which database you store the strings in (Oracle, DB2, etc.), since some require an encoding parameter to be passed.

  • Special characters are not displaying in ADF jsp page

    Hi All,
    By using ADF view controller,I am getting the data from database table but when I display the data in jsp page after special character < what ever the data is there it is not displaced.Provide any suggestions.
    Thanks in Advance
    Mani

    Hi Mani,
    < is a special HTML character and obviously it may not me displayed correctly.
    Here is a reference of all HTML special characters: http://www.w3schools.com/tags/ref_entities.asp
    In your case you can replace < with its special symbol representation - *&amp;#60; or &amp;lt;*
    I also advice you to do so for all special HTML characters.
    You can use this Java library for that purpose : http://commons.apache.org/lang/api/org/apache/commons/lang3/StringEscapeUtils.html
    Nikolay

  • Urgent: SAX parser bean is not working in JSP page

    Hi All,
    I have created a bean "ReadAtts" and included into a jsp file using
    "useBean", It is not working. I tried all possibilities. But Failed Plz Help me.
    Below are the details:
    Java Bean: ReadAtts.java
    package sax;
    import java.io.*;
    import javax.xml.parsers.SAXParser;
    import javax.xml.parsers.SAXParserFactory;
    import java.util.*;
    import org.xml.sax.*;
    import org.xml.sax.helpers.DefaultHandler;
    import javax.xml.parsers.ParserConfigurationException;
    public class ReadAtts extends DefaultHandler implements java.io.Serializable
         private Vector attNames = new Vector(); //Stores all the att names from the XML
         private Vector attValues = new Vector();
         private Vector att = new Vector();
         private Locator locator;
         private static String start="",end="",QueryString="",QString1="",QString2="";
    private static boolean start_collecting=false;
         public ReadAtts()
         public Vector parse(String filename,String xpath) throws Exception
    QueryString=xpath;
         StringTokenizer QueryString_ST = new StringTokenizer(QueryString,"/");
         int stLen = QueryString_ST.countTokens();
         while(QueryString_ST.hasMoreTokens())
              if((QueryString_ST.countTokens())>1)
              QString1 = QueryString_ST.nextToken();
    else if((QueryString_ST.countTokens())>0)
                   QString2 = QueryString_ST.nextToken();
         SAXParserFactory spf =
    SAXParserFactory.newInstance();
    spf.setValidating(false);
    SAXParser saxParser = spf.newSAXParser();
    // create an XML reader
    XMLReader reader = saxParser.getXMLReader();
    FileReader file = new FileReader(filename);
    // set handler
    reader.setContentHandler(this);
    // call parse on an input source
    reader.parse(new InputSource(file));
         att.add("This is now added");
         //return attNames;
    return att;
    public void setDocumentLocator(Locator locator)
    this.locator = locator;
    public void startDocument() {   }
    public void endDocument() {  }
    public void startPrefixMapping(String prefix, String uri) { }
    public void endPrefixMapping(String prefix) {  }
    /** The opening tag of an element. */
    public void startElement(String namespaceURI, String localName,String qName, Attributes atts)
    start=localName;
    if(start.equals(QString2))
    start_collecting=true; //start collecting nodes
    if(start_collecting)
    if((atts.getLength())>0)
    for(int i=0;i<=(atts.getLength()-1);i++)
    attNames.add((String)atts.getLocalName(i));
    attValues.add((String)atts.getValue(i));
    /** The closing tag of an element. */
    public void endElement(String namespaceURI, String localName, String qName)
    end = localName;
    if(end.equals(QString2))
         start_collecting=false; //stop colelcting nodes
    /** Character data. */
    public void characters(char[] ch, int start, int length) { }
    /** Ignorable whitespace character data. */
    public void ignorableWhitespace(char[] ch, int start, int length){ }
    /** Processing Instruction */
    public void processingInstruction(String target, String data) { }
    /** A skipped entity. */
    public void skippedEntity(String name) { }
    public static void main(String[] args)
    String fname=args[0];
    String Xpath=args[1];
    System.out.println("\n from main() "+(new ReadAtts().parse(fname,Xpath)));
    //System.out.println("\n from main() "+new ReadAtts().attNames());
    //System.out.println("\n from main() "+new ReadAtts().attValues());
    JSP File:
    <%@ page import="sax.*,java.io.*,java.util.*,java.lang.*,java.text.*;" %>
    <jsp:useBean id="p" class="sax.ReadAtts"/>
    Data after Parsing is.....
    <%=p.parse"E:/Log.xml","/acq/service/metrics/system/stackUsage")%>
    Expected Output:
    The jsp file should print all the vector objects from the "ReadAtts" bean
    Actual Output:
    Data after Parsing.......[]
    Thanks for your time.....
    Newton
    Bangalore. INDIA

    the problem is not because of java code insdie jsp page
    I have removed all things but the form and it is still not working
    here is the modified code:
    <!-- add news-->
    <%
    if(request.getParameter("addBTN") != null){
            out.print("addBTN");
    %>
    <!-- end of add news-->
    <form action="" method="post" enctype="multipart/form-data" name="upform" >
      <table width="99%" border="0" align="center" cellpadding="1" cellspacing="1">
        <tr>
          <td colspan="2" align="right" bgcolor="#EAEAEA" class="borderdTable"><p>'6'A) .(1 ,/J/</p></td>
        </tr>
        <tr>
          <td width="87%" align="right"><label>
            <input name="title" type="text" class="rightText" id="title">
          </label></td>
          <td width="13%" align="right">9FH'F 'D.(1</td>
        </tr>
        <tr>
          <td align="right"><textarea name="elm1" cols="50" rows="10" id="elm1" style="direction:rtl" >
              </textarea></td>
          <td align="right">*A'5JD 'D.(1</td>
        </tr>
        <tr>
          <td align="right"><label>
            <input type="file" name="filename" id="filename">
          </label></td>
          <td align="right">5H1)</td>
        </tr>
        <tr>
          <td align="right"><label>
            <input name="addBTN" type="submit" class="btn" id="addBTN" value="  '6'A) .(1 ">
          </label></td>
          <td align="right"> </td>
        </tr>
      </table>
    </form>
    <!-- TinyMCE -->
    <script type="text/javascript" src="jscripts/tiny_mce/tiny_mce.js"></script>
    <script type="text/javascript">
            tinyMCE.init({
                    mode : "textareas",
                    theme : "simple",
                    directionality : "rtl"
    </script>
    <!--end of TinyMCE -->

  • Engineering character issue in conversion of jsp page to ms-excel format

    Hi,
    I have a requirement of down loading the jsp page into an ms-excel sheet. for this I am using following code:
    response.setContentType("application/vnd.ms-excel;charset=UTF-8");
    the conversion is fine but the numeric fields whose length exceeds 11 characters is appearing in the engineering format (i.e.,11E+3211). But it should appear as plain number.
    The following are the constraints that I do have:
    1. The version of java in client machine is 1.2.1
    2. I cannot use external jar files like (JExcel, EZJCom or POI)
    So please can you find some feasible solution.

    Reading between the lines, it appears that the issue is that the generated file is referencing a hard coded path to the CSS file. If the client does not actually have the file C:\LTS\CSS\main.css on their system at the time of the request, then the response is logical.
    This is clearly going to create issues with portability (why would an unknown client have the file C:\LTS\CSS\main.css) so unless you are doing this for your singular use, then you need to look at another method of relaying the css data. The most reliable mechanism would be to embed it directly in the generated file inside a <style> tag. You could also serve the css as its own page from your webserver, but it could create problems if the users are saving the generated files and then attempting to use them when disconnected from the network.

  • How to display XML file(as markup) in jsp page..?

    Hi All,
    * I have to display the XML file(as markup) in jsp page (Tree Format)....
    * My XML file is an java.io.file object , and how to view this XML file on my JSP page...........
    Thanks in Advance,
    JavaImran

    You mean you want to see the XML source?
    You need to replace the characters '<' and '&' with corresponding entities '&lt;' and '&amp;'. You can use replaceAll, but do the ampersands first.
    Then I suggest you probably want to put them in a <PRE> block.

  • Euro(�) character in JSP -page

    I'have a JSP-page where is html-textbox for adding salary wish for the job and the problem is that I can't � character from request!
    I have to pages. In first one i have form where the text box is and a second one for saving the info to a bean.
    I have tried to use this tag in JSP pages :
    <%@ page contentType="text/html; charset=windows-1252" %>
    and after this code:
    String salaryWish = request.getParameter("salaryWish");
    System.out.println("Salary wish(�): " + salaryWish);
    String euro = "�";
    System.out.println("euro: " + euro);
    makes this kind of prints to Tomcat 3.2 window
    Salary wish(�): 1233 ?
    euro: �
    and if I print the same to textfile those � characters are actually � characters as they should be. But now the euro mark that I filled to salaryWish textbox and got from request is changed to ?.
    Does anyone know how to make those encodings work also in html-textboxes?

    Can't get working with that UTF-8 conversion! Causes compiler exception while loading JSP page.
    Instead I tried this and it seems to work
    String salaryWish = request.getParameter("salaryWish");
    try
    salaryWish = new String(salaryWish.getBytes("ISO-8859-1"),"windows-1252");
    catch (Exception e){ }
    Anyway,
    thanks robert!

  • Problem in Retrieve Image from DB and display in the JSP page

    Hi All,
    I did one JSP Program for retriveing image from DB and display in the JSP Page. But when i run this i m getting "String Value" output. Here i have given my Program and the output. Please any one help to this issue.
    Database Used : MS Access
    DSN Name : image
    Table Name: image
    Image Format: bmp
    Output : 1973956
    Sample Program:_
    <%@ page contentType="text/html;charset=windows-1252"%>
    <%@ page import="java.io.*" %>
    <%
         try{
              Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
              Connection conn = DriverManager.getConnection("jdbc:odbc:image");
              Statement st = conn.createStatement();
              ResultSet rs = st.executeQuery("SELECT images FROM image");
              String imgLen="";
              if(rs.next()){
                   imgLen = rs.getString(1);
                   out.println(imgLen.length());
              if(rs.next()){
                   int len = imgLen.length();
                   byte [] rb = new byte[len];
                   InputStream readImg = rs.getBinaryStream(1);
                   int index=readImg.read(rb, 0, len);
                   System.out.println("index"+index);
                   st.close();
                   response.reset();
                   response.setContentType("image/jpg");
                   response.getOutputStream().write(rb,0,len);
                   response.getOutputStream().flush();
         }catch(Exception ee){
              out.println(ee);
    %>
    Thanks,
    Senthilkumar S

    vishruta wrote:
    <%
    %>Using scriptlets is asking for trouble. Java code belongs in Java classes. Use a Servlet.
                   out.println(imgLen.length());Your JSP was supposed to write an image to the output and you wrote some irrelevant strings to the output before? This will corrupt the image. It's like opening the image in a text editor and adding some characters before to it.
                   byte [] rb = new byte[len];Memory hogging. Don't do that.
              out.println(ee);You should be throwing exceptions and at least printing its trace, not sending its toString() to the output.
    You may find this article useful to get an idea how this kind of stuff ought to work: [http://balusc.blogspot.com/2007/04/imageservlet.html].

  • Japanese charcters displaying as "?" on a JSP page

    Hi
    My database is UTF-8. I am loading some japaneese data using sql*loader and using Java.IO mechanism(Reader classes). Both ways it is storing the data on database in proper(Japanese) format. If I print it on dos-prompt then same Japanese characters are printing, no problem till here. But if I try to print the same data in database on a JSP page then it is printing "?"(question marks). Also, if I insert any data from a JSP page then it is inserting it as "?" on database. Any help, I really appreciate that.
    Thanks
    Ram

    I am using Chinese Windows NT 4.0
    I succeed in displaying Big5 chinese using Unicode encoding in JSP.
    Now I encounter problem in displaying HK fonts.
    Nevertheless,
    Have your tried to set the charset in your jsp file ?
    <meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>
    Or have tried to set the browser encoding method to your desired one shift-jfs
    <% response.setContentType("text/html; charset=UTF8");%>
    Lastly, have you tried including a parameter in your getBytes stream
    String temp = rs.getString("headline");
    String newResult = new String(temp.getBytes("UTF-8"),"UTF-8");
    Hope this is related!

  • How to display japanese charecters in the JSP page

    Hi,
    Below is my jsp page where i am trying to read the japan character from the properties file
    through the Resource bundle.
    ===============================================
    <%@page contentType="text/html" %>
    <%@page pageEncoding="UTF-8"%>
    <%@ page import ="java.util.*" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
         <title>JSP Page</title>
    </head>
    <body>
    <h1>JSP Page</h1>
    <%Locale locale = new Locale(request.getParameter("country"));
    ResourceBundle bundle = ResourceBundle.getBundle("com.sunit.regtool.resources.RegTool",locale);
    String namelabel =bundle.getString("userName");
    String passwordlabel= bundle.getString("password");
    %>
    <%=namelabel %>
    </body>
    </html>
    =========================================================
    In the above code i am getting the value of the country from request object i.e its value
    will be en for English ,ja for japanese etc.
    I am able to get the value from Resource bundle but when my country is japan
    i am not able to see the same japan characters in the browser when i get the JSP on the browser at runtime .
    It shows me " �����&#133;� &#136;�&#131;&#149;�&#130;��&#131;��&#131;��&#131;&#137;" where the charecters are different.
    But when i see in the properties file it is fine.
    Please help me what need to be done furher for this.
    Thanks,
    Kiran

    I think you need to install japanese language fonts in your browser.

  • Error doing simple navigation in a JSP page

    Hi
    When I do a click on the login.jsp page of a project, the next page do not show. Instead of that, JBoss shows the next dump in its console:
         at javax.faces.component.UIComponentBase.isIdValid(UIComponentBase.java:1050)
         at javax.faces.component.UIComponentBase.setId(UIComponentBase.java:274)
         at javax.faces.webapp.UIComponentTag.createComponentInstance(UIComponentTag.java:721)
         at javax.faces.webapp.UIComponentTag.findComponent(UIComponentTag.java:596)
         at javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:312)
         at org.apache.jsp.consulta.listardestinos_jsp._jspx_meth_t_navigationMenuItem_0(listardestinos_jsp.java:264)
         at org.apache.jsp.consulta.listardestinos_jsp._jspService(listardestinos_jsp.java:159)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
         at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
         at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:416)
         at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
         at org.jenia.faces.template.handler.ViewHandler.renderView(ViewHandler.java:74)
         at org.jenia.faces.template.handler.ViewHandler.renderView(ViewHandler.java:74)
         at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:144)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
         at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
         at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
         at java.lang.Thread.run(Unknown Source)
    19:41:59,109 ERROR [[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception
    javax.faces.FacesException: Subsequent characters of component identifier must be a letter, a digit, an underscore ('_'), or a dash ('-')! But component identifier contains " "
         at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:422)
         at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
         at org.jenia.faces.template.handler.ViewHandler.renderView(ViewHandler.java:74)
         at org.jenia.faces.template.handler.ViewHandler.renderView(ViewHandler.java:74)
         at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:144)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
         at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
         at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
         at java.lang.Thread.run(Unknown Source)
    Caused by: org.apache.jasper.JasperException: Subsequent characters of component identifier must be a letter, a digit, an underscore ('_'), or a dash ('-')! But component identifier contains " "
         at org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:512)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:395)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
         at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
         at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:416)
         ... 27 more
    19:50:25,968 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
    java.lang.IllegalArgumentException: Subsequent characters of component identifier must be a letter, a digit, an underscore ('_'), or a dash ('-')! But component identifier contains " "
         at javax.faces.component.UIComponentBase.isIdValid(UIComponentBase.java:1050)
         at javax.faces.component.UIComponentBase.setId(UIComponentBase.java:274)
         at javax.faces.webapp.UIComponentTag.createComponentInstance(UIComponentTag.java:721)
         at javax.faces.webapp.UIComponentTag.findComponent(UIComponentTag.java:596)
         at javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:312)
         at org.apache.jsp.consulta.listardestinos_jsp._jspx_meth_t_navigationMenuItem_0(listardestinos_jsp.java:264)
         at org.apache.jsp.consulta.listardestinos_jsp._jspService(listardestinos_jsp.java:159)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
         at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
         at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:416)
         at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
         at org.jenia.faces.template.handler.ViewHandler.renderView(ViewHandler.java:74)
         at org.jenia.faces.template.handler.ViewHandler.renderView(ViewHandler.java:74)
         at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:144)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
         at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
         at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
         at java.lang.Thread.run(Unknown Source)
    19:50:25,968 ERROR [[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception
    javax.faces.FacesException: Subsequent characters of component identifier must be a letter, a digit, an underscore ('_'), or a dash ('-')! But component identifier contains " "
         at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:422)
         at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
         at org.jenia.faces.template.handler.ViewHandler.renderView(ViewHandler.java:74)
         at org.jenia.faces.template.handler.ViewHandler.renderView(ViewHandler.java:74)
         at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:144)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
         at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
         at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
         at java.lang.Thread.run(Unknown Source)
    Caused by: org.apache.jasper.JasperException: Subsequent characters of component identifier must be a letter, a digit, an underscore ('_'), or a dash ('-')! But component identifier contains " "
         at org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:512)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:395)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
         at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
         at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:416)
         ... 27 more
    the faces-config.xml is this:
    <?xml version='1.0' encoding='UTF-8'?>
    <!DOCTYPE faces-config PUBLIC
    "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
    "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
    <faces-config>
         <application>
         <locale-config>
         <default-locale>es</default-locale>
         <supported-locale>en</supported-locale>
         <supported-locale>de</supported-locale>
         <supported-locale>fr</supported-locale>
         </locale-config>
         </application>
         <navigation-rule>
              <description>Navegaci�n desde p�gina de login</description>
              <from-view-id>/general/login.jsp</from-view-id>
              <navigation-case>
                   <from-outcome>loginAction</from-outcome>
                   <to-view-id>/consulta/listardestinos.jsp</to-view-id>
              </navigation-case>     
         </navigation-rule>
         <navigation-rule>
              <description>Reglas de Navegacion del Men�</description>
         <from-view-id>*</from-view-id>     
         <!-- Incluir aca cada uno de los casos de navegaci�n del men� -->
         <navigation-case>
         <from-outcome>listDestiniesAction</from-outcome>
         <to-view-id>/consulta/listardestinos.jsp</to-view-id>
         </navigation-case>
         <navigation-case>
         <from-outcome>createPackageAction</from-outcome>
         <to-view-id>/envio/crearpaquete.jsp</to-view-id>
         </navigation-case>
         <navigation-case>
              <from-outcome>createLoadAction</from-outcome>
              <to-view-id>/envio/crearpaquete.jsp</to-view-id>
         </navigation-case>
         <navigation-case>
              <from-outcome>confirmLoadAction</from-outcome>
              <to-view-id>/envio/confirmardespachocarga.jsp</to-view-id>
         </navigation-case>
         </navigation-rule >
         <!-- Beans -->
         <managed-bean>
         <description>Este objeto maneja los envios</description>
         <managed-bean-name>envioBean</managed-bean-name>
         <managed-bean-class>despachador.web.bean.EnvioBean</managed-bean-class>
         <managed-bean-scope>session</managed-bean-scope>
         </managed-bean>
         <managed-bean>
         <description>Este objeto maneja las consultas</description>
         <managed-bean-name>consultaBean</managed-bean-name>
         <managed-bean-class>despachador.web.bean.ConsultaBean</managed-bean-class>
         <managed-bean-scope>session</managed-bean-scope>
         </managed-bean>
    </faces-config>
    Could somebody help me with this problem?

    It is a pretty weird problem indeed.
    I know little about Oracle Portal. When I googled, I found the following in http://www.oracle.com/technology/obe/obe1014portal/standards_portlets/stdsplts.htm
    "Note: If you receive the following message, then the portlet is in a transient state. Simply refresh the page.
    Error: Could not get markup. The cookie or session is invalid or there is a runtime exception."
    In case you are still searching for an answer, it should be better that you post to one of the portal forums in Fusion Middleware forums

  • Multilingual JSP page

    I am trying to build a multilingual web page using ResourceBundle class.
    What I want is to have the table title to be multilingual. I have defined
    two properties files "title_en_US.properties" and "title_zh_CN.properties".
    I have earlier used the native2ascii tool to convert the chinese characters
    to string as shown below for the chinese properties file
    name=\u00e5\u00b8\ufffd\u00e5\ufffd\u00b7
    In my "Load.jsp", I notice that in IE 5.5 it will display
    the chinese title as garbage character as the page content type
    is defaulted to Western ISO language encoding.
    If I manually change encoding to Unicode using via the IE menu with
    steps "View/Encoding/Unicode", the garbage characters becomes Chinese.
    I tried to have another JSP "LoadUTF8.jsp" which specifies the page encoding
    as UTF-8. The IE browser shows the page encoding defaults to Unicode but
    the chinese title is still displayed as garbage characters.
    Where did I go wrong? Any help on this is much appreciated.
    Thank you.
    Regards,
    Chee Keong
    Here is a brief code of the "Load.jsp" JSP
    <%@ page language="java" contentType="text/html" %>
    <%@ page import="java.util.Locale" %>
    <%@ page import="java.util.ResourceBundle" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <!-- Load.jsp -->
    <%
    Locale mylocale = null;
    String language = request.getParameter("lang");
    if ("zh".equalsIgnoreCase(language))
    mylocale = new Locale("zh","CN");
    else
    mylocale = new Locale("en","US");
    ResourceBundle bundle = ResourceBundle.getBundle("title", mylocale);
    %>
    <head>
    <title>Testing</title>
    </head>
    <body>
    <h3> Welcome </h3>
    <table border="1">
    <tr><td><%= bundle.getString("name") %></td></tr>
    </table>
    </body>
    </html>
    Here is a brief code of the "LoadUTF8.jsp" JSP
    <%@ page contentType='text/html; charset=UTF-8' %>
    <%@ page import="java.util.Locale" %>
    <%@ page import="java.util.ResourceBundle" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <!-- LoadUTF8.jsp -->
    <%
    Locale mylocale = null;
    String language = request.getParameter("lang");
    if ("zh".equalsIgnoreCase(language))
    mylocale = new Locale("zh","CN");
    else
    mylocale = new Locale("en","US");
    ResourceBundle bundle = ResourceBundle.getBundle("title", mylocale);
    %>
    <head>
    <title>Testing</title>
    </head>
    <body>
    <h3> Welcome </h3>
    <table border="1">
    <tr><td><%= bundle.getString("name") %></td></tr>
    </table>
    </body>
    </html>

    I'm not sure what is wrong with your code, but here's a test JSP page I was using to test Chinese input and display:
    <%@ page language="java" contentType="text/html; charset=UTF-8" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
         <title></title>
         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
         <meta name="Generator" content="TextPad 4.0" />
         <meta name="Author" content="" />
         <meta name="Keywords" content="" />
         <meta name="Description" content="" />
    </head>
    <body bgcolor="#ffffff" background="" text="#000000" link="#ff0000" vlink="#800000" alink="#ff00ff">
    <%
    request.setCharacterEncoding("UTF-8");
    String str = "\u7528\u6237\u540d";
    String name = request.getParameter("name");
    if(name != null) {
         // instead of setCharacterEncoding...
         //name = new String(name.getBytes("ISO8859_1"), "UTF8");
    System.out.println(application.getRealPath("/"));
    System.out.println(application.getRealPath("/src"));
    %>
    req enc: <%= request.getCharacterEncoding() %><br />
    rsp enc: <%= response.getCharacterEncoding() %><br />
    str: <%= str %><br />
    name: <%= name %><br />
    <form method="GET" action="_lang.jsp" encoding="UTF-8">
    Name: <input type="text" name="name" value="" >
    <input type="submit" name="submit" value="Submit" />
    </form>
    </body>
    </html>

Maybe you are looking for