Jsp:include tag does not preserve encoding of the text

hi
I am using Apache web server and Tomcat 4.1.
I have a jsp:include tag (in say test1.jsp) and I am trying to include a data1.html file. This html file contains UTF-8 encoded text. When this JSP is executed, the UTF-8 text is displayed as garbage characters.
I have included following in the JSP
<%@ page contentType="text/html; charset=UTF-8" %>
I have included following in the info.html
<meta HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8">
However if I rename the info.html to data1.jsp and then include, the UTF-8 text gets displayed correctly.
I suppose, the JSP engine does not interprete the content of the html file correctly according to its encoding.
Where as if it is a .jsp, then it is int erpreting it appropriately?
Can anybody throw some lite on this?
regards
haresh
sample files.......
test1.jsp..........
<%@ page contentType="text/html; charset=UTF-8" %>
<%
response.setContentType("text/html; charset=UTF-8");
%>
<HTML>
<HEAD>
<meta HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8">
</HEAD>
<BODY>
<jsp:include page="data1.html" flush="true"/>
</BODY>
</HTML>
data1.html.....
<meta HTTP-EQUIV="content-type" CONTENT="text/html; charset=UTF-8">
<br>
&#2361;&#2366;&#2340;&#2368; &#2328;&#2381;&#2351;&#2366;&#2354; &#2340;&#2375; &#2340;&#2337;&#2368;&#2360; &#2344;&#2381;&#2351;&#2366;.
<br>

Your generated HTML will be flawed.
The output of the included JSP is included in the outputstream of the enclosing one.
Browsers will normally skip any illegal tags when encountered. This included your complete html headers from the included jsp and may (depending on the browser) include all code after the html close tag from that jsp.
Stricter browsers may simply refuse to display anything at all.
Read up on what the include mechanism exactly does and on wellformed HTML.

Similar Messages

  • I can receive texts from one contact but when I reply she does not receive the text. It does not say delivered when the text is sent but does not say that it has not been sent.

    One of my long standing contacts cannot receive texts from me. I can see them from her. We both have iPhones . We have been texting for years.
    My outgoing message is sent as iMessage and stays blue. It does not say delivered but it does not say that it has been unable to send.

    Hello LaurenCheerio,
    The following article provides some additional troubleshooting that may be helpful in getting your messaging issues sorted.
    iOS: Troubleshooting Messages
    http://support.apple.com/kb/TS2755
    Cheers,
    Allen

  • JSP error page does not displayed on its own, includes in the original JSP

    Problem Description: - Exceptions in a Condition cause pages to fail to render.
    The actual issue is, the JSP error page does not displayed on its own, included in the original JSP Page when exception occurs.
    Problem Cause: As per the JSP specification when jsp content reached the buffer size (default 8KB) the page being flushed (Part of condent displays). The default �autoFlush� value is true.
    When the page buffer value is default size (8KB), and if any exception occurs after flushing the part of the content, instead of redirecting into error page, the error page content included in the original page.
    If i specify autoFlush="false" and with default buffer size, at the runtime if the buffer size is reached, i am getting stackoverflow error.
    To solve the above problem we can make it autoFlush=�false� and buffer=�100KB�. But we can�t predict the actual size of the page.
    I found in one of the weblogic forum as no solution for this issue. Ref.
    http://support.bea.com/application?namespace=askbea&origin=ask_bea_answer.jsp&event=link.view_answer_page_clfydoc&answerpage=solution&page=wls/S-10309.htm
    Please provide me any solution to resolve the problem.

    Error-Page tags work best with an error.html pages. If you have an error.jsp page what I would do, and I have, is wrap my classes and jsp pages in a try catch block where you forward to the error jsp page and display anything you want. YOu can also do this with if else statements. I have used the tomcat error pages before but when I've implemented them I used java.lang.Exception as the error to catch not Throwable. I don't know if this would make a difference or have anything to do with your problem.

  • JSP include tag not showing page content

    Below is my code for a JSP page that uses JSP:include tag to include footer.jsp. The footer page does not display on show_email_entry.jsp. The error I am getting is variable emailAddress cannot be resolved. What am I doing wrong?
    Here is my code.
    show_email_entry.jsp
    <!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <%@ include file="../includes/header.htm" %>
    <body>
    <%
    String firstName = request.getParameter("firstName");
    String lastName = request.getParameter("lastName");
    String emailAddress = request.getParameter("emailAddress");
    %>
    <h1>Thanks for joining our email list</h1>
    <p>Here is the information that you entered:</p>
    <table cellspacing="5" cellpadding="5" border="1">
    <tr>
    <td align="right">First name:</td>
    <td><%= firstName %></td>
    </tr>
    <tr>
    <td align="right">Last name:</td>
    <td><%= lastName %></td>
    </tr>
    <tr>
    <td align="right">Email address:</td>
    <td><%= emailAddress %></td>
    </tr>
    </table>
    <jsp:include page="footer.jsp" flush="true" />
    <p>To enter another email address, click on the Back <br>
    button in your browser or the Return button shown <br>
    below.</p>
    <form action="../email6/join_email_list.html" method="post">
    <input type="submit" value="Return">
    </form>
    </body>
    </html>
    FOOTER.JSP page:
    <%@ page import="java.util.Date" %>
    <p><i><%= emailAddress %> was added on <%= new Date() %>.</p>

    The [url http://java.sun.com/products/jsp/syntax/2.0/syntaxref209.html#1003408]@include directive and the [url http://java.sun.com/products/jsp/syntax/2.0/syntaxref2020.html#8828]<jsp:include> have two different functionalities.
    From the [url http://java.sun.com/products/jsp/syntax/2.0/syntaxref20.html] reference page:
    Include Directive : Includes a resource of text or code when the JSP page is translated.
    <jsp:include>
    Includes a static resource or the result from another web component
    (italic emphasis is mine)
    Basically the @include directive is like "copy and paste this file into the JSP and then compile"
    jsp:include is "run this web page, and add the result of that to my current response"
    So jsp:include can only include complete standalone JSPs.
    Do you see now why it would throw an error message with your example?
    Cheers,
    evnafets

  • Problem with flush=true in the jsp:include tag

    Hello
    I have deployed a JSP based application , based on the apache struts framework. The web server is Sun One Webserver 6 Service Pack4, on a windows 2000 machine
    The same application was tried on SunONE application server 7, and it works without any problem. However in this case the following error , on the page
    javax:servlet.jspexception:Illegal to flush within a custom tag
    Does this mean flush="true" is not allowed within custom tags
    Or is there a workaround for this
    Any help is appreciated
    thanks
    - Aniruddha

    Hi,
    This is a known problem, ��flush before you include�� limitation in JSP 1.1.
    As a result, you have to state flush="true" every time you include a jsp using <jsp:include> tag if you are using JSP1.1.
    Fortunately, it is fixed in JSP1.2. The flush attribute controls flushing. If true, then, if the page output is buffered and the flush attribute is given a ��true�� value, then the buffer is flushed prior to the inclusion, otherwise the buffer is not flushed. The default value for the flush attribute is ��false��.
    Gary Wang
    Developer Technical Support
    SUN Microsystems
    http://www.sun.com/developers/support/

  • [JSP/Newbie]: howto write my own jsp:include tag?

    Hi folks,
    I'm trying to write a replacement tag for <jsp:include> (which shall later decide upon its context what to include..), i.e. I want to include another JSP from within a tag.
    Unfortunately right now my best bet does not allow to control the position of the included JSPs output in my output stream - it prints directly :-((
    // index.jsp is my startpage:
    <%@ taglib uri="/cistags" prefix="cis" %>
    index.jsp START:
    <cis:include file="/theincludefile.jsp" />
    index.jsp ENDE
    // theincludefile.jsp is the included file
    -->INCLUDEFILE<--
    // include.java is my current idea to approach this:
    public class include extends TagSupport {
    private String jspName;
    public void setFile(String name) {
    this.jspName = name;
    public int doEndTag() {
    HttpServletRequest request =
    (HttpServletRequest) pageContext.getRequest() ;
    HttpServletResponse response =
    (HttpServletResponse) pageContext.getResponse() ;
    try {
    request.getRequestDispatcher(
    response.encodeURL(jspName)).include(request,response) ;
    catch (Exception e) { }
    return EVAL_PAGE;
    the result expected is:
    index.jsp START:
    -->INCLUDEFILE<--
    index.jsp ENDE
    but instead I receive:
    -->INCLUDEFILE<--
    index.jsp START:
    index.jsp ENDE
    So how can I get hold of the ouput generated by the JSP I'm calling through RequestDispatcher.include so that I can rewrite it into my own output stream here?
    Is someone out there able to point me into the right direction?
    Ingo
    [email protected]

    check this article out
    http://www.javaworld.com/javaworld/jw-09-2000/jw-0915-jspweb.html

  • Scriptlet within a jsp:include tag

    In Jrun 2.3.3 you could include a scriptlet within a <jsp:include> tag like this:
    <%
    String language = "E";
    %>
    <jsp:include page="/Conditions<%= language %>.html"/>
    Since I have to programme for four languages on our site, I used this convenient way of including different language pages on the fly all over the site.
    I then had a problem with 2.3.3 so I got 2.3.8 and discovered that all of these jsp:includes with scriptlets didn't work any more.
    I hastily uninstalled 2.3.8 and have continued with 2.3.3 ever since, thinking that they would sort this out in 3.0., which they didn't.
    Presumably to deal with this when I want to upgrade JRun I will have to use a load of if{} statements instead, but for four languages I will need four if {} statements which is incredibly long-winded compared to the single line of code above.
    <%
    if(language.equals("E")){
    %>
    <jsp:include page="/ConditionsE.html"/>
    <%
    %>
    Can anybody help:
    1) by giving me a neater solution that the one I've come up with.
    2) by explaining what happened at JRun to cause this change.
    Thanks.

    I could be wrong, but at least with WSAD (WebSphere), I couldn't do this:
    <html:text maxlength="14" size="10" property="proofOfClaim[<%=memberAccountIndex%>].sentDate%>"/>
    but could do this:
    <% String property = "proofOfClaim[" + memberAccountIndex +"].sentDate"; %>
    <html:text maxlength="14" size="10" property="<%=property%>%>"/>
    I think the reason is that since <html:text> is a custom tag, any scriptlets <%=...%> must be the ENTIRE value, and not be inserted in the middle of a value, for an attribute. Try it out. :)

  • Flush in the jsp:include tag

    should I state flush="true" every time I include a jsp using <jsp:include> tag in a jsp pages? For example I am trying to include a menu bar on the top of every jsp pages. Should I flush the buffer every time? if not, will it affect the performance?
    Thank you
    Cal

    Hi,
    This is a known problem, ��flush before you include�� limitation in JSP 1.1.
    As a result, you have to state flush="true" every time you include a jsp using <jsp:include> tag if you are using JSP1.1.
    Fortunately, it is fixed in JSP1.2. The flush attribute controls flushing. If true, then, if the page output is buffered and the flush attribute is given a ��true�� value, then the buffer is flushed prior to the inclusion, otherwise the buffer is not flushed. The default value for the flush attribute is ��false��.
    Gary Wang
    Developer Technical Support
    SUN Microsystems
    http://www.sun.com/developers/support/

  • Importing clips from iMovie HD does not preserve capture date

    Hi,
    I am importing iMovie HD projects into iMovie 09.
    The clips in iMovie HD (originally imported from DV) have the correct capture date/time on them.
    However, when I import these clips into iMovie 09, it does not preserve these dates for the events but instead chooses to use the "file create date/time" as the event date time.
    Is this info lost forever in iMovie 09 or is there some setting that can use the original clip capture date info as the event date/time?
    Thanks.

    Hi,
    I am importing iMovie HD projects into iMovie 09.
    The clips in iMovie HD (originally imported from DV) have the correct capture date/time on them.
    However, when I import these clips into iMovie 09, it does not preserve these dates for the events but instead chooses to use the "file create date/time" as the event date time.
    Is this info lost forever in iMovie 09 or is there some setting that can use the original clip capture date info as the event date/time?
    Thanks.

  • Encountering error End tag does not match start tag 'group'

    Hi guys,
    am a newbee to XML Publisher.
    I am encountering the below error:
    Creating XDO Report at: Wed May 25 16:38:14 GMT+05:30 2011
         sql = select 'TEST' from dual;
         description = Learning XML Reporting
         port = 1561
         user = apps
         host = e2dscorhrmdba01.cendant.com
         sid = ABGHRDEV
         ReportParameters = {}
         path = D:\lanosrep\XML\Output\FirstXMLReport
         data_source_name = ABGHRDEV
         name = FirstXMLReport
    oracle.xml.parser.v2.XMLParseException: End tag does not match start tag 'group'.
         at oracle.xml.parser.v2.XMLError.flushErrors1(XMLError.java:205)
         at oracle.xml.parser.v2.XMLReader.popXMLReader(XMLReader.java:516)
         at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1242)
         at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:301)
         at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:268)
         at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:227)
         at oracle.apps.xdo.dataengine.DataProcessor.getSQLSchema(DataProcessor.java:528)
         at oracle.apps.xdo.dataengine.DataProcessor.writeXMLSchema(DataProcessor.java:476)
         at CreateXDOReport.createXDOReport(CreateXDOReport.java:164)
         at CreateXDOReport.process(CreateXDOReport.java:108)
         at CreateXDOReport.main(CreateXDOReport.java:298)
    I have tried reinstalling the patch but of no use.
    Please guide me.

    I changed the sql query
    select 'TEST' from dual;
    to select 'TEST' from dual
    It is working fine now :)

  • SQL CASE statement in XML template- End tag does not match start tag 'group

    Hi All,
    I am developing a report that has the SQL CASE statement in the query. I am trying to load this into RTF with report wizard and it gives me below error
    oracle.xml.parser.v2.XMLParseException: End tag does not match start tag 'group'
    Does XML publisher support CASE statement?
    My query is something like this
    SELECT customercode,
    SUM(CASE WHEN invoicedate >= current date - 30 days
    THEN balanceforward ELSE 0 END) AS "0-30",
    SUM(CASE WHEN invoicedate BETWEEN current date - 60 days
    AND current date - 31 days
    THEN balanceforward ELSE 0 END) AS "31-60",
    SUM(CASE WHEN invoicedate < current date - 60 days
    THEN balanceforward ELSE 0 END) AS "61>",
    SUM(balanceforward) AS total_outstanding
    FROM MyTable
    GROUP BY customercode
    ORDER BY total_outstanding DESC
    Please advice if the CASE statement or the double quotes are causing this error
    Thanks,
    PP

    I got this to work in the XML but the data is returning zeros for all the case statements. When I run this in toad I get results for all the case conditions but when ran in XML the data displayed is all zeros. I am not sure what I am missing. Can someone shed some light on this please
    Thanks!
    PP

  • With using any version of iTunes, whenever I import songs into my library using the "add to library" function, iTunes adds those songs in songs' alphabetical order. This is pretty annoying since it does not preserve the logical track number or album.

    With using any version of iTunes, whenever I import songs into my library using the "add to library" function, iTunes adds those songs in songs' alphabetical order. This is pretty annoying since it does not preserve the logical track number or even the album sort order (for example when adding 2 albums stored in a unique folder). Anyone has any ideas ? Been stumped for a while....!!!

    hi i had the same problem today when i updated my itunes to latest version. however, i have just found my songs in the 'itunes media' folder. this was accessed through 'my music'  then keep clicking through until you find itunes media and all my library songs were in there and i then just added these files to my library and all were restored however, i have lost all my playlists but at least my 700 songs are back. very dissapointed with apple that they have let this happen with their latest update, the previous version was miles better than this one . hope you find them. stevo

  • When I add a quicktime asset directly to my DVD SP project it does not automatically encode to be DVD cmpliant. Says incompatible asset. Any ideas?

    When I add a quicktime asset directly to my DVD SP project it does not automatically encode to be DVD cmpliant. Says incompatible asset. Any ideas?

    You use the term "QuickTime Asset" like it means something.  QuickTime is just a container ... a QuickTime file could be made from any number of codecs, many of which are not compatible with DVD Studio Pro.
    What codec is the file you're trying to import?  Have you considered using Compressor to encode it to the proper format?
    -DH

  • Jsp include tag 1.1

    Hi all,
    i am getting the following error if my code snippet has a <jsp:include> tag
    org.apache.jasper.JasperException: Invalid jsp:include tag
    i am using VAJ3.5.3 and i modified the hosts file to support jsp1.1.
    But when i change to jsp1.0 the code works fine and fetching me the page contents.
    Need inputs.
    Regards
    Ramesh Kesavanarayanan

    Hi kesavramesh,
    I think some time ago, you're looking for something like this
    - Can I use jsp includes inside the taglib ?-
    See point 1 and 2.
    -- Paul
    1. link:
    http://www.jguru.com/faq/view.jsp?EID=115446
    2. text from the link:
    Normally when you call one JSP page from another you have no significant access to the result of the called JSP. So if I have
    Hi, I like nice clean JSP output
    <jsp:include page="gobbledegook.jsp" flush="true"/>
    Doh!
    When it would be much nicer to be able to do this:
    <%@ taglib uri="blahblah" prefix="myTags"%>
    Hi, I like nice clean JSP output
    <myTags:cleanUp>
    <jsp:include page="gobbledegook.jsp" flush="true"/>
    </myTags:cleanUp>
    Wahoo!
    This can be accomplish with the tag class:
    public class TakeOutTheTrashTag extends BodyTagSupport
    public int doStartTag() throws JspTagException
    return EVAL_BODY_TAG;
    public int doAfterBody() throws JspTagException
    try {
    if (bodyContent != null) {
    String messy = bodyContent.getString();
    String clean = takeOutTheTrash(messy);
    bodyContent.getEnclosingWriter().print(clean);
    } catch (IOException ie) {}
    return EVAL_PAGE;
    public int doEndTag() throws JspTagException
    return EVAL_PAGE;
    private String takeOutTheTrash(String messy)
    String cleanedUp = messy;
    return cleanedUp;

  • [svn] 3313: Fix for SDK-16981 - @ param tag does not recognize tab character as delimiter between paramName and paramDescription

    Revision: 3313
    Author: [email protected]
    Date: 2008-09-23 10:02:50 -0700 (Tue, 23 Sep 2008)
    Log Message:
    Fix for SDK-16981 - @param tag does not recognize tab character as delimiter between paramName and paramDescription
    QA: Yes
    Doc:
    Tests: checkintests
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-16981
    Modified Paths:
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/TopLevelClassesGenerator.ja va

Maybe you are looking for

  • I get an error when  downloading itunes 7

    The setup program runs and quicktime downloads and creates an icon and when installing the itunes portion, when the status bar is nearing the end, an error message will come up saying " Could not open key: HKEYLOCALMACHINE\Software\Classes\.cdda\Open

  • Creating a Macro with Adobe Acrobat X v.10.0.0 HELP!

    Hello, I am new to Adobe and was wondering if there is a way to create a macro for my situation. I am recording voting decisions from a pdf into an excel spreadsheet. I need to go through multiple pdf files and find the pages where votes have taken p

  • Adobe PDF printer restore

    I have by mistake deleted the Adobe PDF printer ... how do I get this back? Hugh

  • InCopy vs. Indesign

    I am currently considering whether to purchase the Indesign program or merely "settle" with the InCopy version. Might anyone give some input as regards to when it would be beneficial to choose IC i/o ID? Could I change pictures, text and to some exte

  • HP 2050 J510a software won't scan in some Win 7 user accounts

    I am using Windows 7 and the full feature software for Deskjet HP 2050 J510a. PC has 5 user accounts (4 Administrator and 1 Standard). HP Scan works from 2 of the Administrator user accounts. On the other 3 accounts, scanning box opens, but fails whe