Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Tomcat Users »

RE: trying to use the dates.jsp --- Fixed it !

Yansheng Lin

2004-04-27


Glad you fixed the problem:). Well, the default one has the corretly
context and relative path, and when you call the <jsp:useBean> action with
the path correctly defined in your class attribute, your jsp engine knows
where to look for it by default. When you change the path, you will have to
import the class file specifically. Otherwise what happen if there are two
classes called JspCalendar....

You can work around this by specifying a <base> element in your jsp. But
it's not as intuitive as an import in the beginning of the page.

Cheers:)

Yan Lin
Sun Certified J2EE Web Component Developer
http://j2e-translate.sourceforge.net


-----Original Message-----
From: Prashant Khanna [mailto:pkhann1@(protected)]
Sent: April 26, 2004 23:05
To: Tomcat Users List
Subject: trying to use the dates.jsp --- Fixed it !


Hi!

Thank u for helping me out. I fixed the problem. I did a page import in my
dates.jsp and BINGO! it worked. The following is what I added:

                           <%@(protected)
import="dates.JspCalendar" %>
But the dates.jsp under .../webapps/examples/jsp/dates runs fine without
including the above statement, it isn't so when i execute dates.jsp present
under .../webapps/users/pkhann1/jsp/dates, when i try to run dates.jsp
present under this directory, it gives me a classNotFounfException(as
mentioned in my previous mails).

If possible please do try to help me out with this.

Thanx in advance

Yansheng Lin <yansheng.lin@(protected):
Hi, can u post your request url? And your servlet-mapping in your web.xml,
if you have one. I got a feeling you are calling your jsp file directly
instead of through a servlet. i.e., http://localhost:8080/dates/dates.jsp
instead of http://localhost:8080/DateServlet. Both should work if the
default mapping was set up correctly.

Also just to make sure, delete your /work directory before any testing.

-Yan

-----Original Message-----
From: Prashant Khanna [mailto:pkhann1@(protected)]
Sent: April 26, 2004 12:40
To: Tomcat Users List
Subject: RE: trying to use the dates.jsp


I did as u said. I used javac -d to compile and put my class file under
.../classes/dates. But it sill didn't work. Same error (HTTP 500,
classnotfound exception).


Yansheng Lin wrote:
Hi, when you see something like package.className, first thing you want to
check is to see if the full path is correctly defined under your
WEB-INF/classes folder. In your output below, I don't see you have the
package name 'dates' under classes.

-Yan

-----Original Message-----
From: Prashant Khanna [mailto:pkhann1@(protected)]
Sent: April 26, 2004 10:56
To: Tomcat Users List
Subject: trying to use the dates.jsp


I am trying to use the dates.jsp file the comes along by default with the
tomcat server.


Edson Alves Pereira wrote:
Are you trying to use a JSP page or calling a servlet?

> ----------
> De: Prashant Khanna[SMTP:pkhann1@(protected)]
> Responder: Tomcat Users List
> Enviada: segunda-feira, 26 de abril de 2004 11:34
> Para: Tomcat Users List
> Assunto: Re: Unfixable tomcat error
>
> I have the JspCalendar.java file and also the JspCalendar.class file
> stored under the respective WEB-INF/dates folder.
>
> I am doing this whole setup so that users could use the tomcat server to
> execute their applications from their respective accounts.
>
> QM wrote:
> On Sun, Apr 25, 2004 at 09:21:46PM -0700, Prashant Khanna wrote:
> : <...>/webapps/users/pkhann1/WEB-INF/classes/JspCalendar.class
> : <...>/webapps/users/pkhann1/WEB-INF/classes/JspCalendar.java
> ^^^^^^^^^^^^^^^^^^^^
> : [snip]
> : org.apache.jasper.JasperException: dates.JspCalendar
> ^^^^^^^^^^^^^^^^^^^^
>
> You're missing a dir under WEB-INF/classes.
> Why build your code and copy it to your webapp?
> Use javac's "-d" switch to specify the target dir, so package structure
> remains intact.
>
> -QM
>
> --
>
> software -- http://www.brandxdev.net
> tech news -- http://www.RoarNetworX.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
> For additional commands, e-mail: tomcat-user-help@(protected)
>
>
> ---------------------------------
> Do you Yahoo!?
> Yahoo! Photos: High-quality 4x6 digital prints for 25¢
>


---------------------------------
Do you Yahoo!?
Yahoo! Photos: High-quality 4x6 digital prints for 25¢


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
For additional commands, e-mail: tomcat-user-help@(protected)


---------------------------------
Do you Yahoo!?
Yahoo! Photos: High-quality 4x6 digital prints for 25¢


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
For additional commands, e-mail: tomcat-user-help@(protected)

   
---------------------------------
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
For additional commands, e-mail: tomcat-user-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.