RE: jsp imports
-Original Message- From: Darek Czarkowski I am not sure if this is relevant but, is session data a full name of the package? I would expect to see something like com.packagename.sessionData As I've been told, I need to wrap it in a package... or in my case I'm going to re-write 3 jsp's in Java, its easier. regards DaveP - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: jsp imports
On Thu, 24 Mar 2005 08:58:48 -, Pawson, David [EMAIL PROTECTED] wrote: -Original Message- From: Darek Czarkowski I am not sure if this is relevant but, is session data a full name of the package? I would expect to see something like com.packagename.sessionData As I've been told, I need to wrap it in a package... or in my case I'm going to re-write 3 jsp's in Java, its easier. Just out of curiosity why is that easier? Adding a package statement to a Java class, changing your import statements and creating the package directory structure isn't exactly difficult and could probably be quite easily done by a search and replace of the source files, plus it would be more standards compliant and make it easier for someone else to maintain if they need to. -- Jason Bainbridge http://kde.org - [EMAIL PROTECTED] Personal Site - http://jasonbainbridge.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
jsp imports
Tomcat 5.0.28 In my index.jsp file I have %@ page import=sessionData% % sessionData s = new sessionData(); s.clrSession(session, index.jsp); % And I get the error, Cannot resolve symbol 'sessionData'. It is not in a package. What syntax must I use to locate the class please? Or is it required to be packaged? Regards DaveP. snip here *
Re: jsp imports
It must be in a package. -Tim Pawson, David wrote: Tomcat 5.0.28 In my index.jsp file I have %@ page import=sessionData% % sessionData s = new sessionData(); s.clrSession(session, index.jsp); % And I get the error, Cannot resolve symbol 'sessionData'. It is not in a package. What syntax must I use to locate the class please? Or is it required to be packaged? Regards DaveP. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: jsp imports
-Original Message- From: Tim Funk [mailto:[EMAIL PROTECTED] Sent: 23 March 2005 11:31 To: Tomcat Users List Subject: Re: jsp imports It must be in a package. thanks Tim. Is there any logic in that? If tomcat searches %servlet%/WEB-INF/classes/package/class why can't it search without the package layer? Ah well. regards DaveP - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: jsp imports
On Wed, Mar 23, 2005 at 11:49:38AM -, Pawson, David wrote: : Is there any logic in that? :If tomcat searches %servlet%/WEB-INF/classes/package/class :why can't it search without the package layer? It's got naught to do with a Tomcat failing; packageless classes are considered a poor programming practice. As such, they're not allowed under servlet spec 2.4. Is this question in the wiki/FAQ? (I can't check right now.) It seems to come up often enough. -QM -- software -- http://www.brandxdev.net/ tech news -- http://www.RoarNetworX.com/ code scan -- http://www.JxRef.org/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: jsp imports
The java file generated by the JSP is in a package. The java lanaguage disallows a packageless class if you are in a package. -Tim Pawson, David wrote: -Original Message- From: Tim Funk [mailto:[EMAIL PROTECTED] Sent: 23 March 2005 11:31 To: Tomcat Users List Subject: Re: jsp imports It must be in a package. thanks Tim. Is there any logic in that? If tomcat searches %servlet%/WEB-INF/classes/package/class why can't it search without the package layer? Ah well. regards DaveP - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: jsp imports
-Original Message- From: QM :If tomcat searches %servlet%/WEB-INF/classes/package/class :why can't it search without the package layer? It's got naught to do with a Tomcat failing; I'm not 'blaming' Tomcat, just saying its a mismatch with standard java. packageless classes are considered a poor programming practice. As such, they're not allowed under servlet spec 2.4. Sounds like a 'sound' committee decision :-) That's a view I don't share. I'd say its a judgement that Sun shouldn't have made IMHO. regards DaveP - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: jsp imports
-Original Message- From: Tim Funk The java file generated by the JSP is in a package. The java lanaguage disallows a packageless class if you are in a package. Makes more sense Tim. Thanks for that. Boring rewrites ahead, or convert the jsp to java. Probably the latter. regards DaveP - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: jsp imports
I am not sure if this is relevant but, is session data a full name of the package? I would expect to see something like com.packagename.sessionData DarekC On Wed, 2005-03-23 at 03:20, Pawson, David wrote: Tomcat 5.0.28 In my index.jsp file I have %@ page import=sessionData% % sessionData s = new sessionData(); s.clrSession(session, index.jsp); % And I get the error, Cannot resolve symbol 'sessionData'. It is not in a package. What syntax must I use to locate the class please? Or is it required to be packaged? Regards DaveP. snip here * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
load-on-startup in web.xml (was RE: JSP imports and CLASSPATH issues)
Thanks Greg, worked like a charm! Now for the next question regarding load-on-startup in my web.xml. Other than having an public void init method in my servlet, and a servlet definition on the web.xml with load-on-startup, is there anything else that needs to be done? The application is deploying fine, but is not running the init function (I am doing a System.out.println(Servlet Started) to test). Any thoughts would be appreciated, Darren -Original Message- From: Greg Trasuk [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 12, 2002 10:52 AM To: 'Tomcat Users List' Subject: RE: JSP imports and CLASSPATH issues Hi Darren: WEB-INF/lib is where you would put your '.jar' files. Un'jarred' classes should go in WEB-INF/classes with the usual package heirarchy under WEB-INF/classes. So your class file should be WEB-INF/classes/com/javaexchange/dbConnectionBroker/dbConectionBroker.cl ass Cheers, Greg Trasuk, President StratusCom Manufacturing Systems Inc. - We use information technology to solve business problems on your plant floor. http://stratuscom.ca -Original Message- From: Greer, Darren (MED) [mailto:[EMAIL PROTECTED]] Sent: February 12, 2002 10:58 To: '[EMAIL PROTECTED]' Subject: JSP imports and CLASSPATH issues Hello all. I am running Tomcat v4.0.1 with jdk1.3.1 on a Linux box. I have created a basic webapp that utilizes a single servlet which uses a dbConnectionBroker class. I have a JSP which is creating a new dbConnection and I need to import the dbConnectionBroker class. This class file is located in WEB-INF/lib/com/javaexchange/dbConnectionBroker/dbConectionBro ker.class. I am doing a: %@ page import=com.javaexchange.dbConnectionBroker.* % I get the following error: ### org.apache.jasper.JasperException: Unable to compile class for JSP /opt/java/jakarta/jakarta-tomcat-4.0.1/dist/work/localhost/nod /index$jsp .java:3: Package com.javaexchange.dbConnectionBroker not found in import. import com.javaexchange.dbConnectionBroker.*; ^ 1 error ### Is the WEB-INF/lib directory not in the CLASSPATH at runtime? Or am I doing something wrong? Thanks, Darren -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
JSP imports and CLASSPATH issues
Hello all. I am running Tomcat v4.0.1 with jdk1.3.1 on a Linux box. I have created a basic webapp that utilizes a single servlet which uses a dbConnectionBroker class. I have a JSP which is creating a new dbConnection and I need to import the dbConnectionBroker class. This class file is located in WEB-INF/lib/com/javaexchange/dbConnectionBroker/dbConectionBroker.class. I am doing a: %@ page import=com.javaexchange.dbConnectionBroker.* % I get the following error: ### org.apache.jasper.JasperException: Unable to compile class for JSP /opt/java/jakarta/jakarta-tomcat-4.0.1/dist/work/localhost/nod/index$jsp .java:3: Package com.javaexchange.dbConnectionBroker not found in import. import com.javaexchange.dbConnectionBroker.*; ^ 1 error ### Is the WEB-INF/lib directory not in the CLASSPATH at runtime? Or am I doing something wrong? Thanks, Darren
RE: JSP imports and CLASSPATH issues
Hi Darren: WEB-INF/lib is where you would put your '.jar' files. Un'jarred' classes should go in WEB-INF/classes with the usual package heirarchy under WEB-INF/classes. So your class file should be WEB-INF/classes/com/javaexchange/dbConnectionBroker/dbConectionBroker.class Cheers, Greg Trasuk, President StratusCom Manufacturing Systems Inc. - We use information technology to solve business problems on your plant floor. http://stratuscom.ca -Original Message- From: Greer, Darren (MED) [mailto:[EMAIL PROTECTED]] Sent: February 12, 2002 10:58 To: '[EMAIL PROTECTED]' Subject: JSP imports and CLASSPATH issues Hello all. I am running Tomcat v4.0.1 with jdk1.3.1 on a Linux box. I have created a basic webapp that utilizes a single servlet which uses a dbConnectionBroker class. I have a JSP which is creating a new dbConnection and I need to import the dbConnectionBroker class. This class file is located in WEB-INF/lib/com/javaexchange/dbConnectionBroker/dbConectionBro ker.class. I am doing a: %@ page import=com.javaexchange.dbConnectionBroker.* % I get the following error: ### org.apache.jasper.JasperException: Unable to compile class for JSP /opt/java/jakarta/jakarta-tomcat-4.0.1/dist/work/localhost/nod /index$jsp .java:3: Package com.javaexchange.dbConnectionBroker not found in import. import com.javaexchange.dbConnectionBroker.*; ^ 1 error ### Is the WEB-INF/lib directory not in the CLASSPATH at runtime? Or am I doing something wrong? Thanks, Darren -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]