You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Navdeep Singh <ns...@hotmail.com> on 2002/08/20 06:50:49 UTC

How to change the package definition from org.apache.jsp to something else ?

Hi,
I have noticed that the default package structure in my servlet source files (compiled from JSPs) is org.apache.jsp. 
But the .java and .class files are generated in /work/localhost/_/ directory.  How can i 

1. Force my compiled .java and .class file to go in /work/org/apache/jsp ? 
or 
2. Make .java files to include the right package in .java files (which is /work/locahost/_/)?

thanks 
Rob



Re: How to change the package definition from org.apache.jsp to something else ?

Posted by Rodrigo Ruiz <rr...@gridsystems.com>.
What about using

 <%@ page extends="your.package" %>

at the beginning of your JSP?

Related to JBuilder:
1. which version of JBuilder are you using?
2. Are you doing remote debugging, or executing Tomcat from within JBuilder?


----- Original Message -----
From: "Eric Gilbertson" <er...@pervasivesec.com>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Tuesday, August 20, 2002 5:53 PM
Subject: Re: How to change the package definition from org.apache.jsp to
something else ?


> Rob,
>
> As noted in a previous response, the package name and location of the
> servlet class
> files is server specific and not directly controllable by the user. You
can
> work around
> this by statically compiling your servlets using jspc (use the -p switch
to
> control
> the package name that is used) and packing the resulting class files into
a
> .war file.
> This scheme is also server specific, so you want might to consider
> portability impacts
> before using it.
>
> HTH,
>
> Eric Gilbertson
>
> At 12:50 AM 8/20/2002 -0400, you wrote:
> >Hi,
> >I have noticed that the default package structure in my servlet source
> >files (compiled from JSPs) is org.apache.jsp.
> >But the .java and .class files are generated in /work/localhost/_/
> >directory.  How can i
> >
> >1. Force my compiled .java and .class file to go in /work/org/apache/jsp
?
> >or
> >2. Make .java files to include the right package in .java files (which is
> >/work/locahost/_/)?
> >
> >thanks
> >Rob
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: How to change the package definition from org.apache.jsp to something else ?

Posted by Eric Gilbertson <er...@pervasivesec.com>.
Rob,

As noted in a previous response, the package name and location of the 
servlet class
files is server specific and not directly controllable by the user. You can 
work around
this by statically compiling your servlets using jspc (use the -p switch to 
control
the package name that is used) and packing the resulting class files into a 
.war file.
This scheme is also server specific, so you want might to consider 
portability impacts
before using it.

HTH,

Eric Gilbertson

At 12:50 AM 8/20/2002 -0400, you wrote:
>Hi,
>I have noticed that the default package structure in my servlet source 
>files (compiled from JSPs) is org.apache.jsp.
>But the .java and .class files are generated in /work/localhost/_/ 
>directory.  How can i
>
>1. Force my compiled .java and .class file to go in /work/org/apache/jsp ?
>or
>2. Make .java files to include the right package in .java files (which is 
>/work/locahost/_/)?
>
>thanks
>Rob



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: How to change the package definition from org.apache.jsp to something else ?

Posted by Navdeep Singh <ns...@hotmail.com>.
Thanks Craing !

As I said, problem is that these .java and .class files land in
/work/localhost/_/ directory with package definition of org.apache.jsp. This
is logically not correct and I cannot use jbuilder to debug the JSP as it
requires the files to be at a correct place. Do we have a workaround to make
this work ?

thanks again,
navdeep
----- Original Message -----
From: "Craig R. McClanahan" <cr...@apache.org>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Tuesday, August 20, 2002 1:26 AM
Subject: Re: How to change the package definition from org.apache.jsp to
something else ?


>
>
> On Tue, 20 Aug 2002, Navdeep Singh wrote:
>
> > Date: Tue, 20 Aug 2002 00:50:49 -0400
> > From: Navdeep Singh <ns...@hotmail.com>
> > Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> > To: tomcat-user@jakarta.apache.org
> > Subject: How to change the package definition from org.apache.jsp to
> >     something else ?
> >
> > Hi,
> > I have noticed that the default package structure in my servlet source
files (compiled from JSPs) is org.apache.jsp.
> > But the .java and .class files are generated in /work/localhost/_/
directory.  How can i
> >
> > 1. Force my compiled .java and .class file to go in /work/org/apache/jsp
?
> > or
>
> You cannot do this.  The JSP specification specifically says that the page
> compiler can do whatever it wants in terms of package names, and there is
> no guarantee that the generated source file will be placed *anywhere*, let
> alone where you think it should be placed.
>
> > 2. Make .java files to include the right package in .java files (which
is /work/locahost/_/)?
>
> As long as the JSP page compiler can compile these sources (and Tomcat
> can), it should not matter to you where they are placed.
>
> >
> > thanks
> > Rob
> >
> >
> >
>
> Craig
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: How to change the package definition from org.apache.jsp to something else ?

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Tue, 20 Aug 2002, Navdeep Singh wrote:

> Date: Tue, 20 Aug 2002 00:50:49 -0400
> From: Navdeep Singh <ns...@hotmail.com>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: tomcat-user@jakarta.apache.org
> Subject: How to change the package definition from org.apache.jsp to
>     something else ?
>
> Hi,
> I have noticed that the default package structure in my servlet source files (compiled from JSPs) is org.apache.jsp.
> But the .java and .class files are generated in /work/localhost/_/ directory.  How can i
>
> 1. Force my compiled .java and .class file to go in /work/org/apache/jsp ?
> or

You cannot do this.  The JSP specification specifically says that the page
compiler can do whatever it wants in terms of package names, and there is
no guarantee that the generated source file will be placed *anywhere*, let
alone where you think it should be placed.

> 2. Make .java files to include the right package in .java files (which is /work/locahost/_/)?

As long as the JSP page compiler can compile these sources (and Tomcat
can), it should not matter to you where they are placed.

>
> thanks
> Rob
>
>
>

Craig



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>