How to include a .class file in a jsp page

hi everyone,
i know the syntax as:
<%@ include file = "filename.class" %>
then at run time the server could not find the class file
if i use,
<%@ page import = "FileName.class" %>
then also the same problem persists
& if i use
<jsp:include page = "Relative address"/>
the problem still remains as it is...
please help me out...i am working on developing an EJB application in which client interacts with server's Stateful session bean through a jsp page...it is necessary for me to include the home interface class file in my jsp page.
P.S. do not suggest me to include the class file in a package & then use
<%@ page import = "packageName.ClassFileName" %>
i
Edited by: Ankit_JIITU on 6 Jul, 2008 1:55 AM

Ankit_JIITU wrote:
i have already included the remote interface class file by <%@ page import = "University.RemoteInterfaceName" %>in my jsp page ...
if i try to make a new package called test & then include my home interface in that package...i need to import University.*to generate the class file of my home interface ; but the class file generation is not taking place as i am getting the error..
"package University does not exist".How can i overcome this problem. The package University, which you are trying to import, must be in the classpath. If you removed it then you will have to add it back.
i have tried my best..but tell me if there's any possible way of including a class file in the jsp page without involving a package.No, there isn't.
If not,then pls help me to generate the class file of my home interface within a package called test.Read the New To Java Tutorial and understand how packages work.
>
i am assuming that u have a deep knowledge of developing EJB applications.

Similar Messages

  • How to include a js file in the JSP page

    Hi
    i have included a script tag like the following in the JSP file
    <SCRIPT language="JavaScript">vDateFormat='mm/dd/yyyy';</SCRIPT>
    while deploying i am getting an error 'vDateFormat' unidentified
    Can any one help me

    under view put a new tag
    <f:view>
    <ui:script url="page.js"/>
    and thats it

  • How to Generate a Java file for a JSP Page

    Hi ,
    I am using weblogic11 .
    I am working on a JSP page which nearly consists of 4000 lines of code.
    I need to debug the file , but weblogic server is not generating the java file for the JSP pages .
    Please let me know how can i genertae Java file for the jsp pages ??

    JSPs are compiled into servlets automatically and those classes are stored in WEB-INF/classes folder. Servlet engine handles servlets.

  • How to call a class file in a jsp without deploying anything in j2ee

    Hi,
    I am new in J2EE. I have some jsps, which I configured using web.properties(documentroot=c:/jsp/). I am able to get
    those pages by the web browser. I have some import statements in some jsps, now I
    am trying to access those page but it is failing, it says
    org.apache.jasper.JasperException: Unable to compile class for
    JSPD:\j2sdkee1.3\repository\pradip\web\_0002fLogin_0002ejspLogin_jsp_0.java:1:
    Class com.gui.UPMGuiGlobalConstants not found in import.
    import com.gui.UPMGuiGlobalConstants;
    Actually I have not deployed any class file or jsps.. Now my question is can I access
    these jsps without deploying anything, like can I put my .jar file in any j2ee
    directory(like lib or anywhere else, I already tried after putting in /lib) and restart the
    j2ee and use it. So how can I call a class file from a jsp without any kind of
    deployment?
    Please send me the reply as soon as possible.
    Regds,
    Pradip

    After you put the jar containing the class to import into the WEB-INF/lib directory, you still need to include it in the jsp.
    Putting the jar into the lib dir, will make it available to the vm, but as in any other java class, you still need to import it into the class, that the jsp will be compiled into.
    And you do that by putting
    <%@page import="com.gui.UPMGuiGlobalConstants" %>somewhere near the top of your jsp. (well you don't need to put it there, but it good style ;)
    That should do it.

  • How to call a class method from a jsp page?

    Hi all,
    i would like to create a basic jsp page in jdev 1013 that contains a button and a text field. When clicking the button, i would like to call a method that returns a string into the text field.
    The class could be something like this:
    public class Class1 {
    public String getResult() {
    return "Hello World";
    How do i go about this?
    Thanks

    Here is a sample:
    HTML><HEAD><TITLE>Test JDBC for Oracle Support</TITLE></HEAD><BODY>
    <%@ page import="java.sql.*, oracle.jdbc.*, oracle.jdbc.pool.OracleDataSource" %>
    <% if (request.getParameter("user")==null) { %>
    <FORM method="post" action="testjdbc.jsp">
    <H1>Enter connection Parameters</H1>
    <H5>Please enter host name:</H5><INPUT TYPE="text" name="hostname" value="localhost" />
    <H5>Please enter port number:</H5><INPUT TYPE="text" name="port" value="1521" />
    <H5>Service nanme:</H5><INPUT TYPE="text" name="service" value="XE" />
    <H5>Please enter username: </H5><INPUT TYPE="text" name="user" />
    <H5>Please enter password</H5><INPUT TYPE="password" name="password" />
    <INPUT TYPE="submit" />
    </FORM>
    <% } else { %>
    <%
    String hostName = request.getParameter("hostname");
    String portNumber = request.getParameter("port");
    String service = request.getParameter("service");
    String user = request.getParameter("user");
    String password = request.getParameter("password");
    String url = "jdbc:oracle:thin:" + user + "/" + password + "@//" + hostName + ":" + portNumber + "/" + service;
    try {
    OracleDataSource ods = new OracleDataSource();
    ods.setURL(url);
    Connection conn = ods.getConnection();
    // Create Oracle DatabaseMetaData object
    DatabaseMetaData meta = conn.getMetaData();
    // gets driver information
    out.println("<TABLE>");
    out.println("<TR><TD>");
    out.println("<B>JDBC Driver version</B>");
    out.println("</TD>");
    out.println("<TD>");
    out.println(meta.getDriverVersion());
    out.println("</TD>");
    out.println("</TR>");
    out.println("<TR><TD>");
    out.println("<B>JDBC Driver Name</B>");
    out.println("</TD>");
    out.println("<TD>");
    out.println(meta.getDriverName());
    out.println("</TD>");
    out.println("</TR>");
    out.println("<TR><TD>");
    out.println("<B>JDBC URL</B>");
    out.println("</TD>");
    out.println("<TD>");
    out.println(meta.getURL());
    out.println("</TD>");
    out.println("<TABLE>");
    conn.close();
    } catch (Exception e) {e.printStackTrace(); }
    %>
    <%-- end else if --%>
    <% } %>
    </BODY>
    </HTML>

  • How to create a xml file from the jsp page?

    I'm a beginner of the develop xml,my question like this,
    there has a jsp page,some parameters in it,I wanna get the parameters and create a xml file,so,what parser method should I use?
    And how to create a new xml file,when the file haven't exist at first?
    pls give some code,thanks.

    a ggod link for u http://www.theserverside.com/resources/article.jsp?l=JSP-XML2

  • How to embed a .swf file to my jsp page in eclipse

    I had a swf file which i want to include in my jsp page.
    To embed it i m using this code
    <OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
    codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"
    WIDTH="550" HEIGHT="400" id="Main">
    <PARAM NAME=movie VALUE="Main.swf">
    <PARAM NAME=quality VALUE=high>
    <PARAM NAME=bgcolor VALUE=#FFFFFF>
    <EMBED src="images/Main.swf" quality=high bgcolor=#FFFFFF WIDTH="550" HEIGHT="400"
    NAME="Main" ALIGN="" TYPE="application/x-shockwave-flash"
    PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">
    </EMBED>
    </OBJECT>
    but its not working i had also checked the path of the swf.
    I am using eclipse 3.1
    Thanks,
    Leozeo
    Edited by: leozeo on Mar 27, 2008 4:22 AM

    Hi,
    Did you try Object-> insert HTML, see if that helps

  • How to Include a HTML file in a UIX Page

    I have an old .html file (content.html) which contains some infomation and now I want to present that information inside a Uix Page! Is it possible to do so if then how.
    I tried using uix include tag but no luck.
    Any help is greatly appreciated.
    Thanks
    Kolluru

    Here is the .jsp file and the serverinclude tag is written in the 4th line from last.
    <uix:servletInclude source="layout.html" />
    I want the content of the layout.html in the main content pane but instead it is getting added on to the top or to the SideNav.
    Thanks for the help anyway.
    ====================================================
    <%@ page errorPage="errorpage.jsp" contentType="text/html;charset=windows-1252"%>
    <%@ taglib uri="http://xmlns.oracle.com/uix/ui" prefix="uix" %>
    <%@ taglib uri="/webapp/DataTags.tld" prefix="jbo" %>
    <jbo:ApplicationModule id="MyBC4JModule" definition="MyUIX.MyBC4JModule" releasemode="Stateful" />
    <jbo:DataSource id="ds1" appid="MyBC4JModule" viewobject="EmpView1" rangesize="4" />
    <%-- user interface begins here --%>
    <HTML>
    <HEAD>
    <TITLE>Oracle Migration Maps </TITLE>
    <uix:styleSheet/>
    </HEAD>
    <BODY>
    <uix:pageLayout>
    <uix:pageHeader>
    <uix:globalHeader selectedIndex="0">
    <uix:contents>
    <uix:link text="Migration Maps" destination="uixpage1.jsp" />
    <uix:link text="Migration Checklist" destination="http://www.oracle.com" />
    <uix:link text="Templates" destination="http://www.oracle.com" />
    <uix:link text="Scripts" destination="http://mtg.ie.oracle.com" />
    <uix:link text="Release" destination="http://www.oracle.com/" disabled="true" />
    </uix:contents>
    </uix:globalHeader>
    </uix:pageHeader>
    <uix:productBranding>
    <uix:image source="productBrand.gif" shortDesc="product" />
    </uix:productBranding>
    <uix:cobranding>
    <uix:image source="cobrand.gif" shortDesc="brand" />
    </uix:cobranding>
    <uix:copyright>
    <uix:flowLayout>
    <uix:contents>
    <uix:image source="images/info.gif" />
    <uix:link text=" @Copyright 2003, Oracle Corp. " destination="http://www.oracle.com" />
    </uix:contents>
    </uix:flowLayout>
    </uix:copyright>
    <uix:privacy>
    <uix:flowLayout>
    <uix:contents>
    <uix:image source="images/info.gif" />
    <uix:link text="privacy statement" destination="http://www.oracle.com" />
    </uix:contents>
    </uix:flowLayout>
    </uix:privacy>
    <uix:globalButtons>
    <uix:globalButtonBar>
    <uix:contents>
    <uix:globalButton icon="images/returntoportal.gif" text="Home"
    destination="uixpage1.jsp"/>
    <uix:globalButton icon="images/logout.gif" text="Logout"
    destination="http://www.oracle.com"/>
    <uix:globalButton icon="images/preferences.gif" text="Preferences"
    destination="http://www.oracle.com"/>
    <uix:globalButton icon="images/help.gif" text="Help"
    destination="http://www.oracle.com" targetFrame="_blank"/>
    </uix:contents>
    </uix:globalButtonBar>
    </uix:globalButtons>
    <uix:breadCrumbs>
    <uix:contents>
    <uix:link text="Home" destination="uixpage1.jsp" />
    <uix:link text="Qualification" destination="qualification.jsp" />
    <uix:link text="Customer Survey" destination="customersurvey.jsp" />
    </uix:contents>
    </uix:breadCrumbs>
    <uix:quickSearch>
    <uix:messageTextInput prompt="Search" name="QSearch" text="Cabo">
    <uix:end>
    <uix:submitButton accessKey="g" text="Go" />
    </uix:end>
    </uix:messageTextInput>
    </uix:quickSearch>
    <uix:start>
    <uix:sideNav>
    <uix:link text="Home" destination="uixpage1.jsp" />
    <uix:link text="Help" destination="/site1/PageTemplate.jsp" />
    <uix:link text="Migration Process Guide" destination="http://pta.us.oracle.com:9999/" />
    <uix:link text="MSMS v1.1" destination="http://amgdev1.ie.oracle.com/mtg/" />
    <uix:link text="Knowledge Base" destination="http://webiv.oraclecorp.com" />
    <uix:link text="Factory Infrastructure" destination="http://webiv.oraclecorp.com" />
    <uix:link text="BugDB" destination="http://bug.us.oracle.com" />
    <uix:link text="Oracle Migration Workbench " destination="http://webiv.oraclecorp.com" />
    <uix:link text="Application SQL Tools" destination="http://webiv.oraclecorp.com" />
    <uix:link text="Support" destination="http://webiv.oraclecorp.com" />
    <uix:link text="Migration Technology Centre" destination="http://otn.oracle.com/tech/migration/content.html" />
    <uix:link text="Migration Technology Group" destination="http://mtg.ie.oracle.com" />
    </uix:sideNav>
    </uix:start>
    <uix:end>
    <uix:contentContainer text="Related Maps" background="light" icon="testInfo.gif" width="100%">
    <uix:link text="Customer Surveys" destination="http://www.oracle.com" />
    <uix:link text="Survey Request" destination="http://www.oracle.com" />
    <uix:link text="Customer Analysis" destination="http://www.oracle.com" />
    </uix:contentContainer>
    </uix:end>
    <%-- Main page contents go here --%>
    <uix:contents>
    <uix:header styleClass="OraLightHeader" text="Qualification Stage" />
    <uix:styledText styleClass="OraHeaderSubSub" text="" />
    <uix:spacer width="10" height="15" />
    <uix:styledText styleClass="OraDarkHeaderSubSub" text="Qualifying the Customer - Receiving Customer Surveys" />
    <uix:spacer width="10" height="10" />
    <bc4juix:TableDetail></bc4juix:TableDetail>
    <uix:styledText styleClass="OraInstructionText" text="Prospective customers
    are identified by a variety of sources, such as sales consultants and
    Oracle Direct. These customers are asked to complete a customer survey and
    the results are automatically sent to the Migration Factory. The table below
    lists the location of the customer surveys once they are released on the
    Oracle eMarketing system." />
    <uix:spacer width="10" height="20" />
    <uix:servletInclude source="layout.html" />
    </uix:contents>
    </uix:pageLayout>
    </BODY>

  • How I can include js (javascript) file in a jsp page?

    Hi,
    I�ve tried to include a js (javascript) file in jsp file but it doesn�t work.
    When I try to use a js function in the browser I always receive an error. Oh, of course, I�m including the correct tag <script src= ...
    What can I do? Does the problem in the WebServer?

    I cheated and put the scripts in another '.jsp' file and had no problem...then put an include b4 the closing 'head' tag, like this:
    <jsp:include page="scrpt.jsp" flush="true" />
    I had to do it this way for debugging using JDeveloper (it doesnt seem to like '.js' files). But when the jsp is on the server I used the following line instead:
    <script language='JavaScript' src='scrpt.js'></script>
    hope this helps.

  • Is anyone know how to create dynamic pdf file from a JSP page or Servlet ?

    Hi
    Is any one know how to create a dynamic PDF file from JSP or servlet. I need to have standard form format needs to be created and want to send the info to that form dynamically.
    Is there any libraries available?
    Thanks

    I posted a link in this thread to a lib that lets you create PDFs from an app. They have a Java version. I have not used it but I know someone who used it with Microsoft ASP and they liked it.
    http://forum.java.sun.com/thread.jsp?forum=31&thread=287285
    -S-

  • How to convert a class file to exe file and how to cteate a class file to d

    how to convert a class file to exe file

    Hi Bhaskarq,
    Hi,
    It is not at all possible.
    But it is a really worst method.
    Please go through it.
    This is a very common question asked in the comp.lang.java newsgroup. Its often useful to have an
    executable application when deploying your
    applications to a specific platform, but remember to
    make your .class files available for users running
    Unix/Macintosh/other platforms.
    Microsoft provide a free system development kit (SDK),
    for Java, which includes the jexegen tool. This
    will convert class files into a .EXE form. The only
    disadvantage is that users need a Microsoft Java
    Virtual Machine (JVM) installed. If your target
    platform is Win32, you can either redistribute the
    virtual
    machine, or raise the level of your system
    requirements, to include Windows 98, or Windows 95
    with
    Internet Explorer 4. Systems matching these
    requirements will already have a copy of the Microsoft
    Java Virtual Machine installed.
    Note : You must specify all of the class files your
    application needs (except for standard java packges)
    as a parameter, so if you have third party libraries,
    you'll need to include them as well. You can use wildcards * though, and you don't need the original source code.
    Also please see this Forum which will give a good idea
    http://forum.java.sun.com/thread.jsp?forum=31&thread=149733
    I hope this will help you.
    Thanks
    Bakrudeen
    Technical Support Engineer
    Sun MicroSystems Inc, India

  • How to include a .js file into .jsp file.[.js file resides in a package]

    Hi,
    How do i include an external .js(JavaScript) file into a JSP file?My .js file is located in some package(lets say abc.jar). Below is my application structure:-
      jsp
       |
       ->MyJsp.jsp
      lib
       |
       |
    abc.jar
        |
        |
        ->com.abc.test
                     |
                     |
                     ->Test.java
                     ->abc.jsHow do i include "abc.js" file in "MyJsp.jsp" file?
    Please help.
    Thanks,
    Kiran
    Edited by: Adimulam on Jun 2, 2008 1:22 PM

    Even this is also not possible because, the code in that package is developed by DWR and i am just adding it to my lib folder and importing the respective classes. In the same manner i need to include the *.js* file in the JSP.It took me about 3 minutes reading through the [DWR Getting Started|http://getahead.org/dwr/getstarted] page to learn that you don't have to do any of that. Perhaps you should read that page?

  • How to include external .js file into .ear file using NetBean 5.5.1?

    is it possible to include external .js file into .ear file using NetBean 5.5.1? if not, then where should I placed the external .js file and how to write the src="xxx" element? (that is , how to write the path of "xxx"?)
    I am using JBOSS 4.2.2 GA as server
    thx!!

    Even this is also not possible because, the code in that package is developed by DWR and i am just adding it to my lib folder and importing the respective classes. In the same manner i need to include the *.js* file in the JSP.It took me about 3 minutes reading through the [DWR Getting Started|http://getahead.org/dwr/getstarted] page to learn that you don't have to do any of that. Perhaps you should read that page?

  • How to include assigned .as files in MXMLC ant task ?

    When i use mxmlc ant task, i found that
    the tag <include-sources/> doesn't support !
    ( described by http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7a63.html )
    neither SDK version 3.x nor 4.x
    Are they lying?!
    How to include assigned .as files ?
    Thank you !

    My understanding is that mxmlc will use all available resources in the source path, as needed. Instead of giving it individual resources to include, you simply need to give it the source-path that contains those resources. This is different from a library project, which may need to include individual classes that are never used in that library.

  • ANT how to include NetBeans Jar  files in my script of ANT ??

    ANT how to include NetBeans Jar files in my script of ANT ??

    I mean the library say swing layout ...
    which is SwingLayOuts1.0.jar ...
    in side this there is folder org.jDesktop....
    I want this folder in my jar file ...
    also ....
    My question ... i know the path of the jar file of NetBeans .... i can copy that ...dirctly ... but if m using Netbeans editor ... can i give NetBeans class to my jar command for ANT...........

Maybe you are looking for

  • [Xtra] "An error occured while setting up drive

    I just bought a Creative Nomad Jukebox Zen Xtra 60GB.When I try to install the NOMAD Explorer, I get the following error ''An error occured while setting up drivers''. I tried to install drivers before plugging the device but it still gives me an err

  • Issues enabling AlwaysON in SQL Server 2014 Standard

    Hi  I am trying to configure AlwaysOn and having issues enabling in SQL Server configuration manager OS : Windows Server 2012 R2 SQL : SQL Server 2014 Standard Edition Here is what i see in config manager :  The AlwaysOn Availability Groups feature r

  • SQL Loader in .csh file (KSH)

    Hi, We have some scripts (.sh and .csh) in on our UNIX boxes, Oracle 10G. To load data in tables we call sqlldr. Interestingly our .sh files are working fine but not .csh script. If we set SID manually .csh script runs correctly. How do i set SID for

  • Firefox 18.0 running on Mac 10.6.8: Error message "Well, this is embarrassing."

    My computer recently upgraded to Firefox 18.0, and since then Firefox has been usable. With every link, I get a revolving, multi-colored wheel and, eventually, the following error message: Well, this is embarrassing. Firefox is having trouble recover

  • Epub Fixed Layout

    I am using CC and I want to export my indesign project to a fixed layout epub. When I go to export I am only given the option to export to a regular epub and not a fixed layout epub. How will I be able to export this as a fixed layout?