Pls tell me use %@ include file="myfile.jsp"% with endcoding UTF-8??

My jsp pages use some endcoding as UTF-8.
          When I use <%@ include file="myfile.jsp"%> endcoding lose format UTF-8. But
          if I use <jsp:forward page="myfile.jsp"/> it work fine.
          Pls tell me use <%@include %>
          (I use Jbuilder 6 and weblogic server 6.1)
          Thanks .
          

From http://java.sun.com/products/jsp/tags/12/syntaxref1214.html#8828 (emphasis mine):
page="{ relativeURL | <%= expression %> }"
The relative URL that locates the resource to be included, or an expression that evaluates to a String equivalent to the relative URL.
The relative URL looks like a pathname--it cannot contain a protocol name, port number, or domain name. The URL can be absolute or relative to the current JSP page. If it is absolute (beginning with a /), the pathname is resolved by your web or application server.
You could use a servlet in your "path" attribute and have that servlet read and return the page from a different server; there are ways to do what you want, but <jsp:include> isn't one of them.

Similar Messages

  • Error when using %@ include file="/test.jsp"%&

    UsingNitrox version 2.1 M3 (build 419 06022005):
    with jdk version: 1.5.0_03 and Tomcat 5.5.9
    This is the error :cry: when using <%@ include file="/test.jsp"%> in jsp:
    Severity     2
    The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files (test.jsp)
    It used to work in previuos version of Nitrox. I can't use struts tiles because the tiles content is dynamic (run time) and I need it to be static (at compile time).
    Have you encountered this problem? What is the fix? Nitrox bug?
    I need your help please,
    Alberto

    M7,
    I found the problem :wink: . In the java Build path having the default (ALL) is not picking up the content of the package. I had to use add multiple and include all the folders and subfolders (many L) in my packages. After that I added *.java and *.properties to select all the java files. Now it is working. I assume this is a bug in Nitrox. The default ALL should include the all the files in the path.
    Thanks,
    Alberto

  • How use class file in jsp(very urgent)

    i have class file called birds (birds is actually a xslt file transformed to java class file) now this class file i have to use in my jsp file. how can i use them. if possible can any one give me sample code please very urgent
    can any one help me

    java files
    import org.w3c.dom.*;
    import javax.servlet.http.*;
    import javax.xml.transform.*;
    import javax.xml.transform.stream.*;
    import java.io.*;
    public class XmlParser
         public String XmlParser()
              try
    String strXML= "employee.xml";
                   String xslFile = "employeeId.xsl";
                   TransformerFactory tFactory = TransformerFactory.newInstance();
                   StreamResult theTransformationResult = new StreamResult( new ByteArrayOutputStream() );
                   Transformer transformer = tFactory.newTransformer(new StreamSource(xslFile));
                   transformer.transform(new StreamSource(new StringReader(strXML)), theTransformationResult);
                   String output = theTransformationResult.getOutputStream().toString()
              catch(Exception e)
                   System.out.println(" ***** XmlParser.XmlParser ERROR ***** " + e);
    return output;
    using class files in jsp
    <%@ page import="com.qqqq.aaaa.XmlParser"%>
    <%
         XmlParser xmlParser          =     new XmlParser();
    out.println(xmlParser.XmlParser());
    %>
    i think it will help you.

  • Include file in jsp not working

    Hi ,
    I have an include file statement in my jsp file which is not working. Not getting any error message either only the page is displayed without the jsp file included.
    My include code looks like this :
    <%@ include file ="Includes/hello.jsp" %>Also i tried including an html file or an image in the same place neither of the two displayed.
    <!--#include virtual="includes/footer.html" -->
    My jsp file is hosted on IIS

    nb123 wrote:My jsp file is hosted on IIS
    Hi ,
    I have an include file statement in my jsp file which is not working. Not getting any error message either only the page is displayed without the jsp file included.
    My include code looks like this :
    <%@ include file ="Includes/hello.jsp" %>Also i tried including an html file or an image in the same place neither of the two displayed.
    <!--#include virtual="includes/footer.html" -->
    My jsp file is hosted on IIS
    Check the path you've specified. It may well be;
    <%@include file="hello.jsp" %>or
    <%@include file="/Includes/hello.jsp" %>

  • Dynamic include file in JSP page

    <span class="value">Hi
    i have index.jsp , this page can include jsp
    pages dynamically by passing the name of the page to be included to the
    index page with out .jsp , so if i want to include page "code.jsp" i
    put: .../index.jsp?page=code , this have to include code.jsp page
    i made the following code , but it did not find the file
    so can any one help plz ?
            String pg=request.getParameter("page");
            if( pg!= null && ! "".equals(pg)){
                    File f=new File(request.getParameter("page")+".jsp");
                    if(f.exists()){
                            out.print("file exist");
                            %>
                            <jsp:include page="<%=request.getParameter("page")+".jsp" %>" />
            <%
                    }else{
                            out.print("file not exist");
         

    What does the file existing or not really have to do with it?
    You can try it like this:
    String pg=request.getParameter("page");
            if( pg!= null && ! "".equals(pg)){
                    String webPath = pg + " .jsp";
                    String realPath = request.getRealPath(webPath);
                    File f=new File(realPath);
                    if(f.exists()){
                            out.print("file exist");
                            %>
                            <jsp:include page="<%= webPath %>" />
            <%
                    }else{
                            out.print("file not exist");
            }Alternatively you could try using a request dispatcher:
    RequestDispatcher rd = request.getRequestDispatcher(webPath);
    if (rd == null){
      // doesn't exist
    }

  • How to use .class files from jsp

    hi i want to use .class files in my jsp program can any one help me

    so if you are using pacakges here is normal example...
    say you .java code is something like...
    package com.util;
    public Class BeanUtility{
    }place the .class file at WEB-INF/classes/com/util folder if those folders are missing create it and place the .class file there. or pacakage it as a jar file & put it into WEB-INF/lib folder
    Now in jsp you can either use jsp:Usebean tag or use normal scriplets to create an instance of the nessary class...
    here is an example for you
    <%@ page language="java" import="com.util.BeanUtility" %>
    <%
    BeanUtility bn = new BeanUtility();
    %>however,i'd suggest you to make use of JSTL / Inbuilt tag libraries /MVC 2.0 approach for better maintainance & readablity.
    Hope this might help
    REGARDS,
    RaHuL

  • Not getting connection using DBC file in JSP page

    Hi,
    I have a custom page. I am trying to open a JDBC connection using DBC file. Below is the command I am using for that -
    ctx = new WebAppsContext(dbfilename);
    Connection conn = ctx.getJDBCConnection();
    My dbc file location is 'C:\OA\jdevhome\jdev\dbc_files\secure'.
    the code is raising exception after getJDBCConnection is called.
    Any Idea where I am missing?
    Regards,
    Adarsh

    This is not an OA question...
    The DBC information is already set in the JVM for the Oracle Application Server:
    WebAppsContext ctx = new WebAppsContext(System.getProperty("JTFDBCFILE"));
    Connection conn = ctx.getJDBCConnection();
    And always check for if the WebAppsContext or the Connection objects are null.

  • Modifying the search path of the include files when compiling with CC

    Hi All,
    In my current task, i am working on a new module.
    - There are many source-files where header-files of type, "#include <something.h>" are included.
    - The new Module just replaces the body of "something.h".
    Originally <something.h> is present in system-wide location.
    Now, i am trying to compile the code with the new files created, using "-I-" option.
    http://download.oracle.com/docs/cd/E19205-01/821-1384/bjadq/index.html
    Section 2.16.1 in above says:
    For include files of the form #include "foo.h", search the directories in the following order:
    1. The directories named with -I options (both before and after -I-).
    2. The directories for compiler-provided C++ header files, ANSI C header files, and special-purpose files.
    3. The /usr/include directory.
    For include files of the form #include <foo.h>, search the directories in the following order:
    1.The directories named in the -I options that appear after -I-.
    2. The directories for compiler-provided C++ header files, ANSI C header files, and special-purpose files.
    3. The /usr/include directory.
    When i used the "-I-" option,[[ -I-  -I/my/own/module/path ]] it could not include the common header files. [like <functional>, <algorithm>...etc]
    If "-I-" option is not used it could find the above headers.
    Could someone tell me what am i doing wrong here?
    Thanks & Regards,
    Sreekar

    Extension to the above. [could't edit and save it, hence placing it here]
    I know that specifying a system-wide locations manually is not standard, but tried the following to see if there is any work-around.
    I manually included "/usr/include/c++/4.1.1" to search for <algorithm> and then CC complained saying that, it could not find "bits/c++locale.h" which is internally included in "<algorithm>" .
    I am working on RHEL 5.4 (x86_64 arhictecture)
    When included "/usr/include/c++/4.1.1/x86_64-redhat-linux", got the following error:
    $ CC -m32 -c -library=rwtools7,iostream,Crun,no%Cstd -I- -I/data1/users/nfr1dev2/include -I. -I./gen  -I/data1/users/nfr1dev2/pvcs/cms_ba2ap/cms/source/include -I/usr/include -I/usr/include/c++/4.1.1 -I/usr/include/c++/4.1.1/x86_64-redhat-linux -o utsislist.o utsislist.cc
    "/usr/include/c++/4.1.1/x86_64-redhat-linux/bits/c++locale.h", line 55: Error: uselocale is not defined.
    "/usr/include/c++/4.1.1/x86_64-redhat-linux/bits/c++locale.h", line 55: Error: __uselocale is not defined.
    "/usr/include/c++/4.1.1/x86_64-redhat-linux/bits/c++locale.h", line 56: Error: "__gnu_cxx::__typeof()" is expected to return a value.
    "/usr/include/c++/4.1.1/x86_64-redhat-linux/bits/c++locale.h", line 61: Error: __locale_t is not defined.
    "/usr/include/c++/4.1.1/x86_64-redhat-linux/bits/gthr-default.h", line 593: Error: PTHREAD_MUTEX_RECURSIVE is not defined.
    "/usr/include/c++/4.1.1/bits/stl_algobase.h", line 577: Error: memset is not a member of __gnu_cxx::std.
    "/usr/include/c++/4.1.1/bits/stl_uninitialized.h", line 119: Error: memmove is not a member of __gnu_cxx::std.
    "/usr/include/c++/4.1.1/bits/allocator.h", line 124: Error: A declaration does not specify a tag or an identifier.
    "/usr/include/c++/4.1.1/bits/allocator.h", line 124: Error: Use ";" to terminate declarations.
    "/usr/include/c++/4.1.1/limits", line 378: Error: __CHAR_BIT__ is not defined.
    "/usr/include/c++/4.1.1/limits", line 378: Error: An integer constant expression is required here.
    Compilation aborted, too many Error messages.Cheers,
    Sreekar

  • Connect to dbf file from jsp with servletexec??

    I am trying to connect to a dbf file from a jsp page on an win2003Server with ServletExec. But i get the exception "no suitable driver".
    It works fine with the exact same code and file on my winxp machine. This is the connectionstring: url = "jdbc:odbc:;DRIVER=Microsoft dBase VFP Driver (*.dbf);Sourcedb=E:\\Data\\der\\Solutions;Sourcetype=dbf";
    I can create a "Microsoft dBase VFP Driver" odbcConnection from the controlPanel and than use the connection from MicrosoftAccess and it works as it should. But I can't use it from the jsp code like this: url="jdbc:odbc:testdriver" .
    It feels like I am missing something in servletexec. Like a classpath to the odbcdriver. But in all my other installations I have not done anything more than installed the servletexc correctly and added the classpath for parser.jar and jaxp.jar.
    Am I missing something here???
    Zoktrax

    Try putting a Class.forName( "my.jdbc.DriverClass" ) before DriverManager.getConnection( url, user, password ), where "my.jdbc.DriverClass" is the fully-qualified class name of the JDBC driver class. I think that JDBC driver classes have static initializers that register the driver class with the DriverManager. I had a similar problem and the Class.forName( ) fixed it.
    If that doesn't work, double-check your URL.
    - Jesse

  • How to use dreamweaver files in jsp?

    Hello All
    I am developing jsp files in which i want to use macromedia dreamweaver files i.e flash button and flash text. I am building jsp files in JBulider. Can anyone tell me how to use or bring in these dreamweaver files in the JSP files? Will be greatful for any help given.
    Arshad

    You should be able to just bring the files into DreamWeaver. It should edit the HTML part of the JSP just fine.

  • How to write to log files using java files from JSP

    Anybody knows different options in writing to log files using JSP?

    Do you have an example?in the init() method of the servlet put the following
            FileOutputStream out = new FileOutputStream("your-log-file");
            PrintStream ps = new PrintStream(out);
            System.setOut(ps);
            System.setErr(ps);load the servlet on startup using <load-on-startup> in web.xml

  • How to use cab files in jsp & ear

    I have a jsp page and a cab file which helps change printer settings.. I have embedded the activex control(cab file) as follows.. Is this ok?
    <object id="factory" style="display:none" viewastext
    classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814"
    codebase="ScriptX.cab#Version=5,60,0,375">
    </object>
    Also where do I place the cab file? I want that the file should be downloaded the first time the user visits the jsp page.

    You should be able to just bring the files into DreamWeaver. It should edit the HTML part of the JSP just fine.

  • How to use configuration files in jsp

    Hi all,
    I need to handle the data from a properties file (txt file). Where should I keep this file in tomcat. Any examples related to this in jsp ? Plz help me.
    Regards,
    Sam

    You can have this file in any location under Tomcat ROOT Directory.
    preferably under conf/ directory

  • Pls tell me the jar file required

    Hi All,
    Please tell me which is the jar file for the following import.
    Can you please send me the jar file to : [email protected]
    import javax.resource.cci.Connection;
    import javax.resource.cci.ConnectionFactory;
    import javax.resource.cci.Interaction;
    import javax.resource.cci.MappedRecord;
    import javax.resource.cci.RecordFactory;
    import javax.resource.cci.ResultSet;
    import javax.resource.spi.ManagedConnectionFactory;
    Regards
    George

    Hi George,,
    The jars required are
    connector1.0.jar,
    connector.jar,
    GenericConnector.jar,
    com.sap.portal.ivs.connectorserviceapi.jar
    Cheers,
    Swathi
    Do offer pts nd ncourage:-)

  • Include File doesnt work with URLs

    Hi guys,
    Im using <jsp:include page="/topper.htm" flush="true"/> to include topper. Can i use the full URL ex <jsp:include page="http://www.hotelrooms2bid.com/topper.htm" flush="true"/>. Since the topper and footer will come from different Web Server, i have to use the full URL
    the Full URK path is not working in this case.
    pls help me.any inputs or ideas will be highly appreciated
    thanks,
    Sachin

    From http://java.sun.com/products/jsp/tags/12/syntaxref1214.html#8828 (emphasis mine):
    page="{ relativeURL | <%= expression %> }"
    The relative URL that locates the resource to be included, or an expression that evaluates to a String equivalent to the relative URL.
    The relative URL looks like a pathname--it cannot contain a protocol name, port number, or domain name. The URL can be absolute or relative to the current JSP page. If it is absolute (beginning with a /), the pathname is resolved by your web or application server.
    You could use a servlet in your "path" attribute and have that servlet read and return the page from a different server; there are ways to do what you want, but <jsp:include> isn't one of them.

Maybe you are looking for

  • How can I reference value of a field from a diffrent line in formatted search

    I want to use a formatted search for this I want to set a field value based on a value from a previous row. ( is this possible at all ?) I have a udf called Test at Line Level on AR Order The user enters a value for test on line 1 he will have a lot

  • Rendering Issue with FCP 5

    Whenever I try to render my sequences I get a "File Error: The specified file is open and in use by this or another application." And it halts my render until I click okay, which is a problem as I leave sequences to render overnight and they're not c

  • Blotching of JButtons

    I am not sure if its a bug but this really seems like one. When i add a JPanel to a JFrame and add a JToolbar in vertical orientation with the buttons having the bevel raised border in java 1.5, these wierd blotching occur on the edges of the buttons

  • Nokia 5530 no Gate way problem .. pls help

    I Bought my nokia 5530 i have wifi router Tp link Tl-WR340G i have done every thing to connect my phone to internet via router but a stupid msg saying no web gate acess appears .. al the time pls help me is there a universal solution to this problem.

  • Can you download ibooks author for ipad?

    ibooks author for ipad