JSP import self made Package that imports another self made package!

I also posted under JSP section.
I really need an answer please.
Quite new to JSP & java. Not sure about how to use import properly for my problem below:
Using Tomcat4.12 & jdsdk1.4 on WinXP
So I create a package - lets call it p1.
For all java files that belong to this packge I put on the top line of code:
package p1;
All files of package p1 are put in Tomcatdir\webapps\myapp\WEB-INF\classes\p1
everything complies & the packge runs fine - theres a servlet in it & I'm happy.
Now I create a new package to go with my webapp. Lets call this p2.
However there is a java file in p2 that uses a class from p1 package.
So in that file I put:
import p1.theclassname;
However this will not work because this line refers to:
Tomcatdir\webapps\myapp\WEB-INF\classes\p2\p1
so it will not find the class. Because its in:
Tomcatdir\webapps\myapp\WEB-INF\classes\p1
Anyway I can make it comple by moving files about & making a more complex dir structure & more complex package names - but this cant b the propler way to do it?????
Anyway with my quick fix to this problem I cause a new porblem - in my jsp files that use both packages I cant import the classes I needas the are all complied in packages that are now in the worng place on the hard drive!
I also tried doing this by just having p1 where it was to start with & then instead of making p2 - I'd just complie it in the classes folder & have it import p1. This works fine until I try to import the classes in JSP - I tried things like:
<%@ page import=".*" %>
but it doesnt work unless its in a packge like
<%@ page import="p2.*" %>
but if its in a package then the sturcture to the other packge is all wrong again!!!!!!!!
I hope someone knows what I'm going on about.
Please help me.

you are answer izzaman's problemYes
he has solve already,
right?Well, I wasn't sure if he really solved it, or just found an ugly workaround, so I wanted to make sure it wasn't the latter.
can you help me to clear me doubt also. I'm new
to Java. my problem has been posted earlier....I don't know specifically how to fix your problem. It's probably a classpath issue, though it may also be some simple oversight like a misspelling or something. It's hard to say without more details. If it is a classpath issue, then whatever izzaman did may also work for you. I haven't done much with servlets and JSP lately, and when I have, I've never had classpath problems, so I don't know what kinds of issues are common there.
I would suggest starting a new thread for your problem. That's generally what you should do anyway, and it will get more notice if it's in its own thread. Don't put it in Adanced Language Topics though. Put it in the JSP forum or Java Programming.
Good Luck!

Similar Messages

  • Jsp import package error after upgrading to jdk1.4.2_08 and tomcat 5.0

    I am trying to upgrade the jdk and tomcat from 1.3/3.3 to 1.4/5.0.
    My jsp imports worked fine prior to the upgrade, but now I get the following:
    Jun 6, 2005 10:01:17 AM org.apache.jasper.compiler.Compiler generateClass
    SEVERE: Error compiling file: /C:/Tomcat/work/Catalina/localhost/Print//org/apac
    he/jsp\BillingPrompt_jsp.java [javac] Compiling 1 source file
    C:\Tomcat\work\Catalina\localhost\Print\org\apache\jsp\BillingPrompt_jsp.java:11
    : package com.adware.print.database.inquire does not exist
    import com.adware.print.database.inquire.*;
    ^
    1 error
    A fatal error has occured for user: Unable to compile class for JSP
    Generated servlet error:
    C:\Tomcat\work\Catalina\localhost\Print\org\apache\jsp\BillingPrompt_jsp.java:11
    : package com.adware.print.database.inquire does not exist
    import com.adware.print.database.inquire.*;
    The package in the import statement "import com.adware.print.database.inquire.*" actually has no classes in it. The classes are contained in "import com.adware.print.database.inquire.controller.*". If I change the import statement everything works. The problem is that I have 100s of jsps. If there is a work-around outside of changing the import statements, that would be best.
    Can anyone help? Thanks.

    do you know what url is being looked up? the message is complaining that the url is starting with the string "an]", which seems pretty bogus.

  • JSP import fails unless Jars are included in the PAR

    Hello,
    We have a simple EP6 iView for displaying the Universal Worklist entries (UWL) using a JSPDynPage.
    We import the UWL library symbols and compile/use them in the Java code without problems (e.g. import com.sap.netweaver.bc.uwl.Item; )
    The following entry is made in the portalapp.xml file to make sure the UWL symbols are found at runtime:
         <property name="ServicesReference" value="SAPJ2EE::library:tckmcbc.uwl~api"/>     
    The problem occurs when we try to import the UWL symbols into our JSP with this code:
         <%@ page import="com.sap.netweaver.bc.uwl.Item" %>
    The UWL symbols are just not found.  Here are the exception headers:
    #1#com.sapportals.portal.prt.component.PortalComponentException: Error in service call of Resource
    Component : pcd:portal_content/MikesFolder/com.lds.mlp.MikesTest1
    #1#com.sapportals.portal.prt.servlets_jsp.server.compiler.CompilingException: Error occurs during the rendering of jsp component
    Caused by: com.sapportals.portal.prt.servlets_jsp.server.compiler.CompilingException: D:/usr/sap/EP1/JC00/j2ee/cluster/server0/apps/sap.com/irj/servlet_jsp/irj/root/web-inf/portal/portalapps/mikestest1/work/pagelet/_sapportalsjsp_helloiviewpage.java:22: package com.sap.netweaver.bc.uwl does not exist
    import com.sap.netweaver.bc.uwl.Item;
                                    ^
    1 error
    Now if I add the bc.uwl.service.api_api.jar into PORTAL-INFlib everything is fine.  However this seems like such a 'hack'.  We really shouldn't be distributing a system file in our PAR.
    This person seems to have had the same problem with the system mail jars ( JSP MAIL ERROR ).
    Can anyone please shed some light on this problem?  Do we really have to distribute the system jars to make this JSP import work properly?
    Thanks & Cheers,
    Mike Pastor
    "always generous with points"

    Hi,
    This is exactly the portalapp.xml of the sap application com.sap.netweaver.bc.uwl.par
    check out the difference between this and yours?
    Dont miss out on anything important here. I think it should work.
    If you are still facing problem only while using in jsp I have a cure.
    Write a clean java class in your app which queries the apis in this jar.
    Also add sharing reference to this application in your portalapp.xml. Query your class in your jsp rather than the "standard jar"
    <?xml version="1.0" encoding="utf-8"?>
    <application>
      <registry>
        <entry path="/runtime/hooks/deployment/UniversalWorklistDeploymentHook" name="UniversalWorklistDeploymentHook" type="service"/>
      </registry>
      <application-config>
        <property name="startup" value="true"/>
        <property name="releasable" value="true"/>
        <property name="ServicesReference" value="SAPJ2EE::library:tckmcbc.uwl~api,SAPJ2EE::service:webdynpro,com.sap.portal.runtime.system.inqmy, com.sap.portal.ivs.connectorservice,com.sap.portal.ivs.systemlandscapeservice, urlgenerator, com.sap.portal.usermapping, usermanagement, com.sap.portal.runtime.application.rfcengine,com.sap.portal.runtime.config,knowledgemanagement"/>
        <property name="PreservedConfigPaths" value=""/>
        <property name="Vendor" value="sap.com"/>
        <property name="SecurityArea" value="NetWeaver.KMC"/>
      </application-config>
      <components/>
      <services>
        <service name="com.sap.netweaver.bc.uwl" alias="UniversalWorklistService">
          <service-config>
            <property name="className" value="com.sap.netweaver.bc.uwl.core.portal.UWLPortalService"/>
            <property name="classNameFactory" value=""/>
            <property name="classNameManager" value=""/>
            <property name="poolFactory" value="0"/>
            <property name="startup" value="true"/>
            <property name="SafetyLevel" value="low_safety"/>
          </service-config>
        </service>
        <service name="UniversalWorklistDeploymentHook">
          <service-config>
            <property name="className" value="com.sap.netweaver.bc.uwl.core.portal.UWLDeploymentHook"/>
            <property name="classNameFactory" value=""/>
            <property name="classNameManager" value=""/>
            <property name="poolFactory" value="0"/>
            <property name="startup" value="true"/>
            <property name="SafetyLevel" value="low_safety"/>
          </service-config>
        </service>
      </services>
    </application>

  • Xmltype.transform() with stylesheet that includes another stylesheet

    I' trying to use xmltype.transform() with a stylesheet that includes/imports another stylesheet. But this results in a 'ORA-03113: End of communication channel'. Is xsl:include or xsl:import supported?
    This is the first stylesheet:
    <?xml version="1.0"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
         <xsl:import href="company2.xsl"/>
         <xsl:template match="/">
              <xsl:apply-templates select="company"/>
         </xsl:template>
    </xsl:stylesheet>
    And this the second stylesheet:
    <?xml version="1.0"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
         <xsl:template match="company">
              Company: <xsl:value-of select="."/>
         </xsl:template>
    </xsl:stylesheet>
    Both stylesheets are stored in the Oracle XDB Repository in folder '/public/test'.
    The following script results in an error:
    declare
    l_xsl xmltype;
    l_xml xmltype;
    l_xml2 xmltype;
    begin
    l_xsl := xdburitype('/public/test/company.xsl').getxml();
    l_xml := xmltype('<company>Oracle</company>');
    l_xml2 := l_xml.transform(l_xsl);
    end;
    I tried the following values for the href attribute of xsl:include:
    company2.xsl
    /public/test/company2.xsl
    http://<host>:<port>/public/test/company2/xsl
    I also tried to use xsl:import instead of xsl:include with the above attribute values for href. In all cases I get the ORA-03113.
    Thanks for any help, hints or tips.
    Erwin Groenendal

    Did you look in the database alert log or in the database log area to see if any trace file was generated by your error? The listener.log may have more information too.
    Also, you can trace your session to see what is happening.
    alter session set sql_trace = true;
    run sql
    alter session set sql_trace = false;
    or
    alter session set events '10046 trace name context forever, level 12';
    or TURN on TRACING for any SESSION
    execute sys.dbms_system.set_sql_trace_in_session -
    (sid => &sid, serial# => &serial#, sql_trace => true);
    run sql
    execute sys.dbms_system.set_sql_trace_in_session -
    (sid => &sid, serial# => &serial#, sql_trace => false);
    HTH
    M.

  • Is possible to make webservice that call another webservice??

    i already make 1 webservices(a) project and also make a class file that invoke another webservice(b)... when i test with SOAPUI to invoke my webservice(a), it failed. but when i make a main class and run as an application (standalone), everything is going good.
    is possible to make a webservices n invoke another webservices??????? if yes, can u give me an example..???

    yes its possible. I have written a web service that is part of our system that calls a third party system and passing credentials across to amalgamate data from 2 distinctly separate systems. A call is made to my webservice and in the code for that service I invoke a method on a set of stubs built against a third party wsdl.
    Similarly for smart card authentication users first call my webservice, but as I am not responsible for the smartcard validation itself I call another departments webservice, this time its a message based service and not RPC but either way I still build a SOAP message and then send it to a service which then does the smartcard validation for me.
    They are both working examples of a web service calling another web service.

  • In a jsp page one name button that corresponding 5 TextField how to insert

    hi,
    In a jsp page one name button that corresponding 5 TextField how to insert values inthe database that 5 textfield values

    Hi use
    String s=request.getParameter("Text Filed Name");
    do this for all the Text Field..... Then use preparedSatatment for inserting that data inside the database.

  • Adding field in Old Jsp based self registration application

    Hi,
    I have a requirement of addition of some fields and link in Self registartion on the login page.
    As we could not add any link in the self registartion field so i have deactivated the Web dynpro application.Now the Login page displays the old jsp based self registration.I am working on EP 7.0.
    Now my problem is how can i add fields to the Old Jsp based application to display it during registration.
    I have added some fields using the Configtool in the UME but how to make it display in the Self Registration page.
    Thanks,
    Amarys.

    Hi,
    I have not tried this but you will have to try this following things.
    1.Don't add any entry in FormMetaData.xml.If the value is in jsp then it should add value in database.Try this one first.
    2.Have this UDF as hidden and add entry into FormMetaData.xml and also add the entry in jsp.I think this should work if first is not working.
    3.Even if 2nd is not working then you might need to modify self registration class and put the value there.
    I haven't tried above method so I am not 100% sure which will work.
    Regards
    Nitesh

  • I am running Windows XP, SP3. I have tried to run Firefox 4 several times but it doesn't work properly. The main page comes up showing the logo, below that is the search box, and below that is another box with nothing in it.

    I am running Windows XP, SP3. I have tried to run Firefox 4 several times but it doesn't work properly. The main page comes up showing the logo, below that is the search box, and below that is another box with nothing in it.

    The external DVD/CD Writer will Not appear on your desktop when you attach it to your iMac.  It will appear in "Finder", which is in your Dock.
    Hope this helps

  • Do we have to Bounce Apache evertime JSP changes are made ?

    Hi all
    Do we have to Bounce Apache evertime JSP changes are made ?
    I am making a change in my JSP change (changing a sql query and adding a display text which is static) but the changes are not getting reflected when I upload the page to my server. Do I have to bounce the server everytime I make a change to a JSP Page?
    Regards Ali

    Hi
    Wich version of Oracle Application Server are you?
    regards

  • HT201485 When I try to complete an in app purchase a message pops up saying: YOUR PURCHASE CANNOT BE COMPLETED.. I close that and another message pops up saying: CANNOT CONNECT TO THE ITUNES STORE... I am connected to the Internet, can anyone figure this

    When I try to complete an in app purchase a message pops up saying: YOUR PURCHASE CANNOT BE COMPLETED.. I close that and another message pops up saying: CANNOT CONNECT TO THE ITUNES STORE... I am connected to the Internet, can anyone figure this out?

    Hello,
    Brother please follow these steps
    1) SignOut from Your apple itunes account
    2) Again Sign In Your iTunes Account
    And  you can turn off your wifi/internet from your iphone and again turn it on
    Kind Regards
    AmirKhalid (AKQ)

  • HT1338 why did i get a window that says another device is accessing my ip adress?

    why did i get a window that says another device is accessing my ip address?

    It may be that you have security turned on to prohibit this. You can register your drive by going to the website through your browser more easily.

  • What is the floating circle on the screen that opens another screen in grayscale?

    What is the floating circle on the screen that opens another screen in grayscale? It's a white circle inside another circle border. and it moves with my touch.

    Dear Mr SJ0123
    You seem to have a clue about all the tricks. As many I have read on this communtiy site, my power button is unresponsive. I have dealt with the power on and off by setting the Auto-Lock function to 1 minute, which is truly not trouble. Since my warranty is past, in Switzerland we must cough up 260CHF (275$) for a replacement.
    I can manage..EXCEPT I MISS MY SCREEN SHOT!
    Any ideas about how to use this function w/out the power button? Is this Assistive Touch my answer? I read on your website and really didn't get the impression that it would work.
    Thanks for any hints.
    Dodri13

  • [svn] 863: Cleanup the jsp for some space issue that causes problem for proxy test on WAS .

    Revision: 863
    Author: [email protected]
    Date: 2008-03-19 11:39:05 -0700 (Wed, 19 Mar 2008)
    Log Message:
    Cleanup the jsp for some space issue that causes problem for proxy test on WAS. Update both trunk and 3.0.x branch.
    Modified Paths:
    blazeds/branches/3.0.x/qa/apps/qa-regress/remote/HttpXmlEchoService.jsp
    blazeds/trunk/qa/apps/qa-regress/remote/HttpXmlEchoService.jsp

    Revision: 863
    Author: [email protected]
    Date: 2008-03-19 11:39:05 -0700 (Wed, 19 Mar 2008)
    Log Message:
    Cleanup the jsp for some space issue that causes problem for proxy test on WAS. Update both trunk and 3.0.x branch.
    Modified Paths:
    blazeds/branches/3.0.x/qa/apps/qa-regress/remote/HttpXmlEchoService.jsp
    blazeds/trunk/qa/apps/qa-regress/remote/HttpXmlEchoService.jsp

  • Having Problem With Importing Another Package

    Hi, I work in a team. We have a division of labor arrangement. Under our project, each developer is assigned a sub-task. Each sub-task receives some input parameters from its upstream sub-task and generates some outputs for the downstream sub-task.
    All developers first work independently. Each of us has our own folder/pacakge in the Repository. Each of us makes an assumption on the values of the input parameters received. (We later on integrate all sub-tasks.)
    I generate my Java classes under a folder called "Orchestrator", and I access some classes under the folder/package called "common". Things go smoothly.
    Thereafter, I start accessing other folders/packages. I first retrieve other folders/packages from the Repository and then in the Eclipse Package Explorer View --> import --> Import Existing Maven Projects ... No problem. I have all other folders/packages in the Package Explorer View.
    However, when I start adding the import statements in my Java classes to access classes in other folder/package; for example,
    import company_name.overall_project_name.project_name.folder_name.subfolder_name.class_name;I have the compilation error: The import company_name.overall_project_name.project_name.folder_name cannot be resolvedFirst, I have no problem to access the "common" folder/package. The code I have below does not have compilation error and I am able to use the class that is imported:
    import company_name.overall_project_name.project_name.common.util.ParamsDictionary;Second, I have checked the consistency of path and folder name.
    Can anybody give me a clue? Thank you.

    user537770 wrote:
    Hi, I work in a team. We have a division of labor arrangement. Under our project, each developer is assigned a sub-task. Each sub-task receives some input parameters from its upstream sub-task and generates some outputs for the downstream sub-task.
    All developers first work independently. Each of us has our own folder/pacakge in the Repository. Each of us makes an assumption on the values of the input parameters received. (We later on integrate all sub-tasks.)
    I generate my Java classes under a folder called "Orchestrator", and I access some classes under the folder/package called "common". Things go smoothly.
    Thereafter, I start accessing other folders/packages. I first retrieve other folders/packages from the Repository and then in the Eclipse Package Explorer View --> import --> Import Existing Maven Projects ... No problem. I have all other folders/packages in the Package Explorer View.
    However, when I start adding the import statements in my Java classes to access classes in other folder/package; for example,
    import company_name.overall_project_name.project_name.folder_name.subfolder_name.class_name;I have the compilation error: The import company_name.overall_project_name.project_name.folder_name cannot be resolvedFirst, I have no problem to access the "common" folder/package. The code I have below does not have compilation error and I am able to use the class that is imported:
    import company_name.overall_project_name.project_name.common.util.ParamsDictionary;Second, I have checked the consistency of path and folder name.
    Can anybody give me a clue? Thank you.Well, seems like your classpath doesn't include those folders you are trying to access.

  • Importing another package

    Hello, the following file/class structrue causes problems:
    src/     CSoCM/          ContentMasked
    src/     CSoCM/          ContentMaskedRepresenter
    src/     MusicBlog/     Blog
    src/     MusicBlog/     Article
    Inside the classes, I have put them into package CSoCM and MusicBlog. Now I want to call ContentMasked inside the Blog-class. How do I have to reference this?
    Thank you

    what do you mean by, "Of course both classes cannot be imported"?
    the import path is relative to the main fla file and it doesn't matter what package the importing class is in.

Maybe you are looking for

  • How to upload datas in excel sheet through BDC

    Hi,     I know how to upload datas in Text format  through BDC...Suppose even when datas are in .xls format,I saved that file as Text(tab delimited) format...then file become text format and it can be easily uploaded....     So, I want to know How to

  • Help to reset monitor resolution?

    Greetings, I have a G5 Quad with an Ati x1900 graphics card running into a 52" Samsung LCD. This was working fine through a dvi-vga adaptor until I switched the monitor resolution from 1920X1080 to 1360X768 which is not supported by the monitor .....

  • Problem with EDI Partner

    Hi Guru, While creating a invoice I am getting error while triggering the EDI for output type ZINV. I am getting below error--'Maintain outgoing EDI -connection data for partner XIP-100. I checked that this partner exists. i observed that for the par

  • Can I use my iphone to broadcast wi-fi to my laptop

    Can I use my iphone to broadcast wi-fi to my laptop

  • Network location and apple script

    Hi, I have a strange problem... When I try to use this AppleScript to change network location in Leopard, nothing happens: tell application "System Events" tell network preferences get properties --> returns: {current location:location id "51BD3FB7-5