You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by clinton lopez <sl...@yahoo.com> on 2004/10/07 10:44:07 UTC

Problem with Screen Classes in Subdirectories

In my case, it seems that the screen classes corresponding to the velocity templates are not being called when they are in subdirectories. They work fine when they are in their root directories.
 
For example:
 
in templates/.../screens/:
    index.vm
     admin/
           add.vm
 
in classes/.../screens/:
     index.java
     admin/
          add.java
 
index.java was executed before index.vm but add.java was not when add.vm was called (through $link.setPage("admin,add.vm"))
I assumed it should work this way. The layout and navigation parts worked fine.
 
Is there anything I missed?
 
Thanks!

		
---------------------------------
Do you Yahoo!?
vote.yahoo.com - Register online to vote today!

Re: Problem with Screen Classes in Subdirectories

Posted by Tony Oslund <ao...@bevcomm.net>.
There is no requirement that there be a matching screen class or action 
class to simply display a vm so it may not generate an error log entry.


Check to see if you have setup your packages.

For example if your class directory structure was 
WEB-INF/classes/com/mycompany/admin/screens, or 
WEB-INF/classes/com/mycompany/admin/actions then you might setup the 
following within TurbineResources.properties.

module.packages=com.mycompany.admin


If you have setup your packages then check to see if you have another 
add.java class for the same app within another sub-directory.  If you do it 
may be calling that one instead.

Even though it is looking for ./screens/admin/add.vm the class loader will 
use the first add.class that it comes across within the packages that you 
have setup.


Does add.java extend VelocityScreen?


----- Original Message ----- 
From: "Marty Phee" <mp...@jump-technologies.com>
To: "Turbine Users List" <tu...@jakarta.apache.org>
Sent: Thursday, October 07, 2004 7:30 AM
Subject: Re: Problem with Screen Classes in Subdirectories


> What was in the log file?  Did velocity say it couldn't find the screen or 
> was
> there an exception because it couldnt't find the class?
>
>
> On Thursday 07 October 2004 03:44 am, clinton lopez wrote:
>> In my case, it seems that the screen classes corresponding to the 
>> velocity
>> templates are not being called when they are in subdirectories. They work
>> fine when they are in their root directories.
>>
>> For example:
>>
>> in templates/.../screens/:
>>     index.vm
>>      admin/
>>            add.vm
>>
>> in classes/.../screens/:
>>      index.java
>>      admin/
>>           add.java
>>
>> index.java was executed before index.vm but add.java was not when add.vm
>> was called (through $link.setPage("admin,add.vm")) I assumed it should 
>> work
>> this way. The layout and navigation parts worked fine.
>>
>> Is there anything I missed?
>>
>> Thanks!
>>
>>
>> ---------------------------------
>> Do you Yahoo!?
>> vote.yahoo.com - Register online to vote today!
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: Problem with Screen Classes in Subdirectories

Posted by Marty Phee <mp...@jump-technologies.com>.
What was in the log file?  Did velocity say it couldn't find the screen or was 
there an exception because it couldnt't find the class?


On Thursday 07 October 2004 03:44 am, clinton lopez wrote:
> In my case, it seems that the screen classes corresponding to the velocity
> templates are not being called when they are in subdirectories. They work
> fine when they are in their root directories.
>
> For example:
>
> in templates/.../screens/:
>     index.vm
>      admin/
>            add.vm
>
> in classes/.../screens/:
>      index.java
>      admin/
>           add.java
>
> index.java was executed before index.vm but add.java was not when add.vm
> was called (through $link.setPage("admin,add.vm")) I assumed it should work
> this way. The layout and navigation parts worked fine.
>
> Is there anything I missed?
>
> Thanks!
>
>
> ---------------------------------
> Do you Yahoo!?
> vote.yahoo.com - Register online to vote today!

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


RE: Problem with Screen Classes in Subdirectories

Posted by clinton lopez <sl...@yahoo.com>.
it worked!!!!
I thought all along that the case of my class name was
correct because in the documentation at 

http://jakarta.apache.org/turbine/turbine-2.3/howto/velocity-site-howto.html


...
(under Screens)
NOTE: Turbine capitalizes the first letter in the
class file name before looking for the matching class
in the classpath. This allows you to follow (somewhat)
normal class naming guidelines. For example:

index.vm and Index.vm both map to Index.class 
roleeditor.vm maps to Roleeditor.class  role_editor.vm
maps to Role_editor.class
...


- I figured out just now that this rule works if the
class is not inside a sub-directory. I think this
should be mentioned in the documentation. 

Thank you very much!!!

--- David Demner <tu...@demner.com> wrote:

> Hi Clinton,
> 
> I'm pretty sure Henning is correct and the case of
> the class name is
> incorrect.  I think it needs to be the same case as
> your .vm file - in your
> case try add.java instead of Add.java
> 
> Good luck,
> 
> David
> 
> -----Original Message-----
> From: clinton lopez [mailto:slpy_hed@yahoo.com] 
> Sent: Thursday October 7, 2004 7:38 PM
> To: Turbine Users List
> Subject: Re: Problem with Screen Classes in
> Subdirectories
> 
> 
> Thanks to all who answered my question.
> 
> My Add.java extends VelocitySecureScreen
> 
> I can't find any information in the log file whether
> or not it was able to find the class. I assumed it
> didn't find it because the value of the variable
> specified in context.put("entry", "hello") was not
> reflected in velocity (just outputs '$entry').
> 
> the log file looked something like:
> 
> ...
> 2004-10-07 14:11:02,575 - ResourceManager : found
> screens/admin/add.vm with loader
>
org.apache.velocity.runtime.resource.loader.FileResourceLoader
> 2004-10-07 14:11:02,575 -
>
org.apache.velocity.runtime.exception.ReferenceException:
> reference : template = screens/admin/add.vm [line
> 19,column 4] : $entry is not a valid reference.
> ...
> 
> The index.vm, which was not under a sub-directory,
> was
> able to output the correct value of the variable. I
> tried to copy the same working Index.java to a
> sub-directory (I just changed the package to the
> correct directory) but it is still not working
> properly.
> 
> I'm using Turbine2.2. I can't find any version 2.3
> release and my cvs can't connect to the Turbine
> repository. I'm not sure if this is the problem.
> 
> Thanks!
> 
> 
> --- "Henning P. Schmiedehausen" <hp...@intermeta.de>
> wrote:
> 
> > clinton lopez <sl...@yahoo.com> writes:
> > 
> > Make sure that the case of the class name is
> > correct.
> > 
> > Also, the class should extends VelocityScreen or
> > VelocitySecureScreen.
> > 
> > 	Regards
> > 		Henning
> > 
> > 
> > 
> > >--0-1870538179-1097138647=:85986
> > >Content-Type: text/plain; charset=us-ascii
> > 
> > >In my case, it seems that the screen classes
> > corresponding to the velocity templates are not
> > being called when they are in subdirectories. They
> > work fine when they are in their root directories.
> > > 
> > >For example:
> > > 
> > >in templates/.../screens/:
> > >    index.vm
> > >     admin/
> > >           add.vm
> > > 
> > >in classes/.../screens/:
> > >     index.java
> > >     admin/
> > >          add.java
> > > 
> > >index.java was executed before index.vm but
> > add.java was not when add.vm was called (through
> > $link.setPage("admin,add.vm"))
> > >I assumed it should work this way. The layout and
> > navigation parts worked fine.
> > > 
> > >Is there anything I missed?
> > > 
> > >Thanks!
> > 
> > >		
> > >---------------------------------
> > >Do you Yahoo!?
> > >vote.yahoo.com - Register online to vote today!
> > >--0-1870538179-1097138647=:85986--
> > 
> > -- 
> > Dipl.-Inf. (Univ.) Henning P. Schmiedehausen      
>  
> >  INTERMETA GmbH
> > hps@intermeta.de        +49 9131 50 654 0  
> > http://www.intermeta.de/
> > 
> > RedHat Certified Engineer -- Jakarta Turbine
> > Development  -- hero for hire
> >    Linux, Java, perl, Solaris -- Consulting,
> > Training, Development
> > 
> > "Fighting for one's political stand is an
> honorable
> > action, but re-
> >  fusing to acknowledge that there might be
> > weaknesses in one's
> >  position - in order to identify them so that they
> > can be remedied -
> >  is a large enough problem with the Open Source
> > movement that it
> >  deserves to be on this list of the top five
> > problems."
> >                        -- Michelle Levesque,
> > "Fundamental Issues with
> >                                     Open Source
> > Software Development"
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > turbine-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> > turbine-user-help@jakarta.apache.org
> > 
> > 
> 
> 
> 		
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail - Helps protect you from nasty viruses.
> http://promotions.yahoo.com/new_mail
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> turbine-user-help@jakarta.apache.org
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> turbine-user-help@jakarta.apache.org
> 
> 


		
_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


RE: Problem with Screen Classes in Subdirectories

Posted by David Demner <tu...@demner.com>.
Hi Clinton,

I'm pretty sure Henning is correct and the case of the class name is
incorrect.  I think it needs to be the same case as your .vm file - in your
case try add.java instead of Add.java

Good luck,

David

-----Original Message-----
From: clinton lopez [mailto:slpy_hed@yahoo.com] 
Sent: Thursday October 7, 2004 7:38 PM
To: Turbine Users List
Subject: Re: Problem with Screen Classes in Subdirectories


Thanks to all who answered my question.

My Add.java extends VelocitySecureScreen

I can't find any information in the log file whether
or not it was able to find the class. I assumed it
didn't find it because the value of the variable
specified in context.put("entry", "hello") was not
reflected in velocity (just outputs '$entry').

the log file looked something like:

...
2004-10-07 14:11:02,575 - ResourceManager : found
screens/admin/add.vm with loader
org.apache.velocity.runtime.resource.loader.FileResourceLoader
2004-10-07 14:11:02,575 -
org.apache.velocity.runtime.exception.ReferenceException:
reference : template = screens/admin/add.vm [line
19,column 4] : $entry is not a valid reference.
...

The index.vm, which was not under a sub-directory, was
able to output the correct value of the variable. I
tried to copy the same working Index.java to a
sub-directory (I just changed the package to the
correct directory) but it is still not working
properly.

I'm using Turbine2.2. I can't find any version 2.3
release and my cvs can't connect to the Turbine
repository. I'm not sure if this is the problem.

Thanks!


--- "Henning P. Schmiedehausen" <hp...@intermeta.de>
wrote:

> clinton lopez <sl...@yahoo.com> writes:
> 
> Make sure that the case of the class name is
> correct.
> 
> Also, the class should extends VelocityScreen or
> VelocitySecureScreen.
> 
> 	Regards
> 		Henning
> 
> 
> 
> >--0-1870538179-1097138647=:85986
> >Content-Type: text/plain; charset=us-ascii
> 
> >In my case, it seems that the screen classes
> corresponding to the velocity templates are not
> being called when they are in subdirectories. They
> work fine when they are in their root directories.
> > 
> >For example:
> > 
> >in templates/.../screens/:
> >    index.vm
> >     admin/
> >           add.vm
> > 
> >in classes/.../screens/:
> >     index.java
> >     admin/
> >          add.java
> > 
> >index.java was executed before index.vm but
> add.java was not when add.vm was called (through
> $link.setPage("admin,add.vm"))
> >I assumed it should work this way. The layout and
> navigation parts worked fine.
> > 
> >Is there anything I missed?
> > 
> >Thanks!
> 
> >		
> >---------------------------------
> >Do you Yahoo!?
> >vote.yahoo.com - Register online to vote today!
> >--0-1870538179-1097138647=:85986--
> 
> -- 
> Dipl.-Inf. (Univ.) Henning P. Schmiedehausen        
>  INTERMETA GmbH
> hps@intermeta.de        +49 9131 50 654 0  
> http://www.intermeta.de/
> 
> RedHat Certified Engineer -- Jakarta Turbine
> Development  -- hero for hire
>    Linux, Java, perl, Solaris -- Consulting,
> Training, Development
> 
> "Fighting for one's political stand is an honorable
> action, but re-
>  fusing to acknowledge that there might be
> weaknesses in one's
>  position - in order to identify them so that they
> can be remedied -
>  is a large enough problem with the Open Source
> movement that it
>  deserves to be on this list of the top five
> problems."
>                        -- Michelle Levesque,
> "Fundamental Issues with
>                                     Open Source
> Software Development"
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> turbine-user-help@jakarta.apache.org
> 
> 


		
__________________________________
Do you Yahoo!?
Yahoo! Mail - Helps protect you from nasty viruses.
http://promotions.yahoo.com/new_mail

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: Problem with Screen Classes in Subdirectories

Posted by clinton lopez <sl...@yahoo.com>.
Thanks to all who answered my question.

My Add.java extends VelocitySecureScreen

I can't find any information in the log file whether
or not it was able to find the class. I assumed it
didn't find it because the value of the variable
specified in context.put("entry", "hello") was not
reflected in velocity (just outputs '$entry').

the log file looked something like:

...
2004-10-07 14:11:02,575 - ResourceManager : found
screens/admin/add.vm with loader
org.apache.velocity.runtime.resource.loader.FileResourceLoader
2004-10-07 14:11:02,575 -
org.apache.velocity.runtime.exception.ReferenceException:
reference : template = screens/admin/add.vm [line
19,column 4] : $entry is not a valid reference.
...

The index.vm, which was not under a sub-directory, was
able to output the correct value of the variable. I
tried to copy the same working Index.java to a
sub-directory (I just changed the package to the
correct directory) but it is still not working
properly.

I'm using Turbine2.2. I can't find any version 2.3
release and my cvs can't connect to the Turbine
repository. I'm not sure if this is the problem.

Thanks!


--- "Henning P. Schmiedehausen" <hp...@intermeta.de>
wrote:

> clinton lopez <sl...@yahoo.com> writes:
> 
> Make sure that the case of the class name is
> correct.
> 
> Also, the class should extends VelocityScreen or
> VelocitySecureScreen.
> 
> 	Regards
> 		Henning
> 
> 
> 
> >--0-1870538179-1097138647=:85986
> >Content-Type: text/plain; charset=us-ascii
> 
> >In my case, it seems that the screen classes
> corresponding to the velocity templates are not
> being called when they are in subdirectories. They
> work fine when they are in their root directories.
> > 
> >For example:
> > 
> >in templates/.../screens/:
> >    index.vm
> >     admin/
> >           add.vm
> > 
> >in classes/.../screens/:
> >     index.java
> >     admin/
> >          add.java
> > 
> >index.java was executed before index.vm but
> add.java was not when add.vm was called (through
> $link.setPage("admin,add.vm"))
> >I assumed it should work this way. The layout and
> navigation parts worked fine.
> > 
> >Is there anything I missed?
> > 
> >Thanks!
> 
> >		
> >---------------------------------
> >Do you Yahoo!?
> >vote.yahoo.com - Register online to vote today!
> >--0-1870538179-1097138647=:85986--
> 
> -- 
> Dipl.-Inf. (Univ.) Henning P. Schmiedehausen        
>  INTERMETA GmbH
> hps@intermeta.de        +49 9131 50 654 0  
> http://www.intermeta.de/
> 
> RedHat Certified Engineer -- Jakarta Turbine
> Development  -- hero for hire
>    Linux, Java, perl, Solaris -- Consulting,
> Training, Development
> 
> "Fighting for one's political stand is an honorable
> action, but re-
>  fusing to acknowledge that there might be
> weaknesses in one's
>  position - in order to identify them so that they
> can be remedied -
>  is a large enough problem with the Open Source
> movement that it
>  deserves to be on this list of the top five
> problems."
>                        -- Michelle Levesque,
> "Fundamental Issues with
>                                     Open Source
> Software Development"
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> turbine-user-help@jakarta.apache.org
> 
> 


		
__________________________________
Do you Yahoo!?
Yahoo! Mail - Helps protect you from nasty viruses.
http://promotions.yahoo.com/new_mail

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org


Re: Problem with Screen Classes in Subdirectories

Posted by "Henning P. Schmiedehausen" <hp...@intermeta.de>.
clinton lopez <sl...@yahoo.com> writes:

Make sure that the case of the class name is correct.

Also, the class should extends VelocityScreen or VelocitySecureScreen.

	Regards
		Henning



>--0-1870538179-1097138647=:85986
>Content-Type: text/plain; charset=us-ascii

>In my case, it seems that the screen classes corresponding to the velocity templates are not being called when they are in subdirectories. They work fine when they are in their root directories.
> 
>For example:
> 
>in templates/.../screens/:
>    index.vm
>     admin/
>           add.vm
> 
>in classes/.../screens/:
>     index.java
>     admin/
>          add.java
> 
>index.java was executed before index.vm but add.java was not when add.vm was called (through $link.setPage("admin,add.vm"))
>I assumed it should work this way. The layout and navigation parts worked fine.
> 
>Is there anything I missed?
> 
>Thanks!

>		
>---------------------------------
>Do you Yahoo!?
>vote.yahoo.com - Register online to vote today!
>--0-1870538179-1097138647=:85986--

-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
hps@intermeta.de        +49 9131 50 654 0   http://www.intermeta.de/

RedHat Certified Engineer -- Jakarta Turbine Development  -- hero for hire
   Linux, Java, perl, Solaris -- Consulting, Training, Development

"Fighting for one's political stand is an honorable action, but re-
 fusing to acknowledge that there might be weaknesses in one's
 position - in order to identify them so that they can be remedied -
 is a large enough problem with the Open Source movement that it
 deserves to be on this list of the top five problems."
                       -- Michelle Levesque, "Fundamental Issues with
                                    Open Source Software Development"

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org